-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use precise ranges when requesting for semantic tokens with feature flags #9154
Conversation
…t the expense of sending more messages) The hope is that the LSP spec could be changed such that a single request could take multiple ranges.
- Using feature flags Contributes to #9092
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly looks really good, just lots of duplicated code that will be a maintenance headache, so we should unify.
...icrosoft.AspNetCore.Razor.LanguageServer/Semantic/Services/RazorSemanticTokensInfoService.cs
Outdated
Show resolved
Hide resolved
...icrosoft.AspNetCore.Razor.LanguageServer/Semantic/Services/RazorSemanticTokensInfoService.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.VisualStudio.LanguageServerClient.Razor/Endpoints/SemanticTokens.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.VisualStudio.LanguageServerClient.Razor/Endpoints/SemanticTokens.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.VisualStudio.LanguageServerClient.Razor/Endpoints/SemanticTokens.cs
Outdated
Show resolved
Hide resolved
src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/SemanticTokenTestBase.cs
Outdated
Show resolved
Hide resolved
src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/SemanticTokenTestBase.cs
Outdated
Show resolved
Hide resolved
...c/TestFiles/RazorSemanticTokenInfoServiceTest/GetSemanticTokens_CSharp_Explicit.semantic.txt
Outdated
Show resolved
Hide resolved
...icrosoft.AspNetCore.Razor.LanguageServer/Semantic/Services/RazorSemanticTokensInfoService.cs
Outdated
Show resolved
Hide resolved
Are there any semantic tests over a string with multiple C# segments that only requests a razor span containing one of them? The diff files for such a test would nicely encompass the difference between the behavior with and without the feature flag set. #Closed |
...rc/Microsoft.VisualStudio.RazorExtension/Microsoft.VisualStudio.RazorExtension.Custom.pkgdef
Outdated
Show resolved
Hide resolved
...rc/Microsoft.VisualStudio.RazorExtension/Microsoft.VisualStudio.RazorExtension.Custom.pkgdef
Outdated
Show resolved
Hide resolved
…ure-flag Conflicts: src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/DefaultLanguageServerFeatureOptions.cs src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/VisualStudioWindowsLanguageServerFeatureOptions.cs src/Razor/src/Microsoft.VisualStudio.RazorExtension/Microsoft.VisualStudio.RazorExtension.Custom.pkgdef src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/RazorSemanticTokenInfoServiceTest.cs src/Razor/test/Microsoft.VisualStudio.LanguageServerClient.Razor.Test/RazorCustomMessageTargetTest.cs
src/Razor/src/Microsoft.VisualStudio.LanguageServerClient.Razor/Endpoints/SemanticTokens.cs
Outdated
Show resolved
Hide resolved
...icrosoft.AspNetCore.Razor.LanguageServer/Semantic/Services/RazorSemanticTokensInfoService.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.VisualStudio.LanguageServerClient.Razor/Endpoints/SemanticTokens.cs
Outdated
Show resolved
Hide resolved
...osoft.VisualStudio.LanguageServices.Razor/VisualStudioWindowsLanguageServerFeatureOptions.cs
Outdated
Show resolved
Hide resolved
...t.AspNetCore.Razor.LanguageServer.Test/Microsoft.AspNetCore.Razor.LanguageServer.Test.csproj
Outdated
Show resolved
Hide resolved
...nticTokenInfoServiceTest/GetSemanticTokens_Razor_MultiLineCommentWithBlankLines.semantic.txt
Outdated
Show resolved
Hide resolved
...Files/RazorSemanticTokenInfoServiceTest/GetSemanticTokens_HTMLCommentWithCSharp.semantic.txt
Outdated
Show resolved
Hide resolved
...icrosoft.AspNetCore.Razor.LanguageServer/Semantic/Services/RazorSemanticTokensInfoService.cs
Outdated
Show resolved
Hide resolved
- Simplify ProvideSemanticTokensResponse - Apply nit feedback
src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/SemanticTokenTestBase.cs
Outdated
Show resolved
Hide resolved
Note for reviewers: The PR is ready for review. It also adds new tests comparing results between when feature flag is set vs. when not. Only one odd case of a test is currently failing"
Third index for some reason is off for that test case. I'm going to take a look at that. Thanks @davidwengier and @ToddGrun for the reviews so far! |
...Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/RazorSemanticTokenInfoServiceTest.cs
Outdated
Show resolved
Hide resolved
...Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/RazorSemanticTokenInfoServiceTest.cs
Outdated
Show resolved
Hide resolved
- make perRangeTokens required and not nullable - add workitem for failing test
...icrosoft.AspNetCore.Razor.LanguageServer/Semantic/Services/RazorSemanticTokensInfoService.cs
Outdated
Show resolved
Hide resolved
...icrosoft.AspNetCore.Razor.LanguageServer/Semantic/Services/RazorSemanticTokensInfoService.cs
Outdated
Show resolved
Hide resolved
...icrosoft.AspNetCore.Razor.LanguageServer/Semantic/Services/RazorSemanticTokensInfoService.cs
Outdated
Show resolved
Hide resolved
...icrosoft.AspNetCore.Razor.LanguageServer/Semantic/Services/RazorSemanticTokensInfoService.cs
Outdated
Show resolved
Hide resolved
...icrosoft.AspNetCore.Razor.LanguageServer/Semantic/Services/RazorSemanticTokensInfoService.cs
Show resolved
Hide resolved
...Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/RazorSemanticTokenInfoServiceTest.cs
Outdated
Show resolved
Hide resolved
...Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/RazorSemanticTokenInfoServiceTest.cs
Outdated
Show resolved
Hide resolved
src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/SemanticTokenTestBase.cs
Outdated
Show resolved
Hide resolved
src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/SemanticTokenTestBase.cs
Outdated
Show resolved
Hide resolved
src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Semantic/SemanticTokenTestBase.cs
Outdated
Show resolved
Hide resolved
- Switch feature flag default for VS Code to false
- (was missing `s` after the word token)
GetSemanticTokens_Razor_MultiLineCommentWithBlankLines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few very small nits, but otherwise well done getting this in. Thanks for putting up with all of the comments 😁
Summary of the changes
Contributes to #9092
TODO:
Benchmarks (Before & After)
BEFORE (RAN TWICE)
AFTER