-
Notifications
You must be signed in to change notification settings - Fork 196
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
Cohosting: Add semantic tokens support, via Roslyn OOP #10097
Merged
davidwengier
merged 23 commits into
dotnet:main
from
davidwengier:CohostSemanticTokensOOP
Mar 20, 2024
Merged
Cohosting: Add semantic tokens support, via Roslyn OOP #10097
davidwengier
merged 23 commits into
dotnet:main
from
davidwengier:CohostSemanticTokensOOP
Mar 20, 2024
Conversation
This file contains 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
This is temporary until we have a good way to get language server feature options across to OOP. Making this "real" via OOP is a challenge because FilePathService is in Workspaces, so adding it to the OOP MEF catalog is problematic.
This is a bit hacky, and will be cleaned up in a future PR, which will add an initialization service
Noticed this while debugging. We were using 2^n, which meant modifier values of 0, 1, 4. What we want is n^2, which is 1, 2, 4, and actually works. Of course the only modifier we produce is 4 in both situations, so it slipped through.
I was just using this to prove to myself that it was actually using OOP :)
DustinCampbell
approved these changes
Mar 14, 2024
src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/IRemoteSemanticTokensService.cs
Outdated
Show resolved
Hide resolved
.../src/Microsoft.CodeAnalysis.Remote.Razor/SemanticTokens/RemoteSemanticTokensLegendService.cs
Show resolved
Hide resolved
davidwengier
commented
Mar 15, 2024
...r/src/Microsoft.VisualStudio.LanguageServices.Razor/Remote/OutOfProcSemanticTokensService.cs
Outdated
Show resolved
Hide resolved
davidwengier
added a commit
that referenced
this pull request
Mar 15, 2024
Going to wait for the Roslyn change to be inserted into VS, just in case. |
DustinCampbell
approved these changes
Mar 18, 2024
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.
Part of #9519
This PR feels like the last month of my life, with most of that time simply fighting ServiceHub.
This adds a new endpoint for the cohosting server to support semantic tokens. It's the first endpoint in the server. (Almost) the only thing it does is immediately call our to the OOP process to do the actual work. Logic is mainly provided by the same service that the existing semantic tokens endpoint uses, but for a small piece of functionality that is plugged in, via MEF, to call Roslyn via a new C# API (dotnet/roslyn#72495) instead of via LSP. Currently the syntax tree is computed on the fly in OOP, and the document Roslyn is asked about is the one that the LSP server creates via IDynamicFile. In future this will change to get the real source generated document, and data from the source generator for the tree etc.
Reviewing commit-at-a-time is probably best. There are still a bunch of TODOs, some hard-coded bits, and some hacky bits, but I wanted to ensure this was actually reviewable and not too big.
Worth nothing this won't build until the Roslyn PR mentioned above is merged, and a new package is available to update to.