findAllReferences: Share code between populateSearchSymbolSet and getRelatedSymbol#23028
Merged
2 commits merged intoApr 5, 2018
Merged
findAllReferences: Share code between populateSearchSymbolSet and getRelatedSymbol#230282 commits merged into
2 commits merged into
Conversation
34c5fac to
a7cfd8e
Compare
a7cfd8e to
ad533fe
Compare
Author
|
@sheetalkamat @armanio123 Could someone review? |
sheetalkamat
reviewed
Apr 5, 2018
| function addRootSymbols(sym: Symbol): void { | ||
| // If this is a union property, add all the symbols from all its source symbols in all unioned types. | ||
| // If the symbol is an instantiation from a another symbol (e.g. widened symbol) , add the root the list | ||
| for (const rootSymbol of checker.getRootSymbols(sym)) { |
Member
There was a problem hiding this comment.
Can you please move this comment may be at fromRoot(symbol) so we know we are iterating over symbols for unioned types? Thanks
Author
There was a problem hiding this comment.
Moved comment to fromRoot and elaborated (since behavior is different in the two cases)
sheetalkamat
approved these changes
Apr 5, 2018
89463cc to
ed3f110
Compare
ed3f110 to
48c846d
Compare
This was referenced Apr 6, 2018
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These functions iterate over nearly the same set of symbols; the difference is that
populateSearchSymbolSetadds them to an array, whilegetRelatedSymbolsearches for one contained in that array. There are also a few differences related to handling of parameter properties and root symbols, but those can be solved by giving those their own callbacks. There's also theincludeShorthandDestructuringparameter which I'm not sure should be different in each case, but it would change a bunch of baselines to make it consistent, so that's something for another day.