Potentially fixed a bug regarding static items not bolding#44797
Merged
akhera99 merged 6 commits intodotnet:masterfrom Jun 5, 2020
Merged
Potentially fixed a bug regarding static items not bolding#44797akhera99 merged 6 commits intodotnet:masterfrom
akhera99 merged 6 commits intodotnet:masterfrom
Conversation
Contributor
|
Hi @akhera99 I'll take a look at thsi :) Thanks for the contribution. |
src/Workspaces/CSharp/Portable/Classification/SyntaxClassification/NameSyntaxClassifier.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/CSharp/Portable/Classification/SyntaxClassification/NameSyntaxClassifier.cs
Show resolved
Hide resolved
src/Workspaces/CSharp/Portable/Classification/SyntaxClassification/NameSyntaxClassifier.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/CSharp/Portable/Classification/SyntaxClassification/NameSyntaxClassifier.cs
Outdated
Show resolved
Hide resolved
...Workspaces/Core/Portable/Classification/SyntaxClassification/AbstractNameSyntaxClassifier.cs
Show resolved
Hide resolved
...Workspaces/Core/Portable/Classification/SyntaxClassification/AbstractNameSyntaxClassifier.cs
Show resolved
Hide resolved
Contributor
|
Done with pass. |
CyrusNajmabadi
approved these changes
Jun 4, 2020
jasonmalinowski
approved these changes
Jun 4, 2020
src/EditorFeatures/CSharpTest/Classification/SemanticClassifierTests.cs
Outdated
Show resolved
Hide resolved
…rTests.cs Co-authored-by: Jason Malinowski <jason@jason-m.com>
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.
Fixes #38781
Issue:
The issue here was that certain static defined items were not being bolded properly. This was due to the fact that we classified static methods only if there was a single symbol match. Since, in the example provided, nameof is ambiguous then we also need to classify static methods in that case.
Fix:
To fix this, I needed to modify the
TryClassifyAmbiguousSymbolmethod. I added a boolean flag to indicate if at least one of the references were static. Then, if they all resolved at the set remained at a size of 1, I checked to see if any of those references were static. If they were, I also added a static classification to the result. In the case of multiple overloaded methods with the same name, some being static and some not, we decided to resolve it to just be bolded.