Simplify FAR impl wrt searching for global namespaces#61933
Merged
CyrusNajmabadi merged 5 commits intodotnet:mainfrom Jun 15, 2022
Merged
Simplify FAR impl wrt searching for global namespaces#61933CyrusNajmabadi merged 5 commits intodotnet:mainfrom
CyrusNajmabadi merged 5 commits intodotnet:mainfrom
Conversation
CyrusNajmabadi
commented
Jun 15, 2022
|
|
||
| static bool IsCandidate(SyntaxToken t, ISyntaxFactsService syntaxFacts, string text) | ||
| => syntaxFacts.IsGlobalNamespaceKeyword(t) || (syntaxFacts.IsIdentifier(t) && syntaxFacts.TextMatch(t.ValueText, text)); | ||
| => syntaxFacts.IsIdentifier(t) && syntaxFacts.TextMatch(t.ValueText, text); |
Contributor
Author
There was a problem hiding this comment.
ugly hack where we used the same path for identifier lookup to lookup the 'Global' keyword.
CyrusNajmabadi
commented
Jun 15, 2022
| containsGlobalKeyword = containsGlobalKeyword || syntaxFacts.IsGlobalNamespaceKeyword(token); | ||
|
|
||
| if (syntaxFacts.IsIdentifier(token) || | ||
| syntaxFacts.IsGlobalNamespaceKeyword(token)) |
Contributor
Author
There was a problem hiding this comment.
same ugly hack where when we encountered this specific keyword, we added it to the identifier set for the file. this was because we didn't use to store any other token information as a bit in the index. but we changed that up ages ago, and it's trivial to store this info.
CyrusNajmabadi
commented
Jun 15, 2022
| public bool ContainsTupleExpressionOrTupleType => _contextInfo.ContainsTupleExpressionOrTupleType; | ||
| public bool ContainsGlobalSuppressMessageAttribute => _contextInfo.ContainsGlobalSuppressMessageAttribute; | ||
| public bool ContainsConversion => _contextInfo.ContainsConversion; | ||
| public bool ContainsUsingStatement => _contextInfo.ContainsUsingStatement; |
Contributor
Author
There was a problem hiding this comment.
just sorted for my sanity. and public bool ContainsGlobalKeyword => _contextInfo.ContainsGlobalKeyword; was added.
dibarbet
approved these changes
Jun 15, 2022
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.