-
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
Adding client capabilities to OOP client initialization data #11129
Conversation
The service gets initialized once during initial connection / init and provides client capabilities to other remote services.
- Adding client capabilities to RemoteClientLSPInitializationOptions - Converting IRemoteClientIntializationService to be a JSON service for simplicity of data serialization - Converting client initialization code to use JSON client to call IRemoteClientIntializationService
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.
Thanks for submitting this! I'm really glad to see it happening. I have a few suggestions, but it looks like there are test failures. (Note that you can always check for test failures by running build.cmd -test
at the command-line before submitting.)
src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/Initialization/RemoteClientCapabilities.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Remote/RemoteServiceInvoker.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Remote/RemoteServiceInvoker.cs
Outdated
Show resolved
Hide resolved
...or/src/Microsoft.CodeAnalysis.Remote.Razor/Initialization/RemoteClientCapabilitiesService.cs
Outdated
Show resolved
Hide resolved
...Razor/src/Microsoft.CodeAnalysis.Remote.Razor/DocumentSymbols/RemoteDocumentSymbolService.cs
Outdated
Show resolved
Hide resolved
thanks, I ran and fixed cohosting tests, missed that one. just submitted a fix.
thanks, didn't know about that parameter |
Does that do something different to just running tests in Test Explorer?? |
src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Remote/RemoteServiceInvoker.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.VisualStudio.LanguageServices.Razor/Remote/RemoteServiceInvoker.cs
Outdated
Show resolved
Hide resolved
Only consumers that are initializing capabiilities service by calling SetCapabilities should be importing it via RemoteClientCapabilitiesService. All other consumers should be using IClientCapabilitiesService.
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.
Lovely! Just a few minor tweaks to make everything really nice and neat.
Also at some point we need to be a bit smarter about the LSP initialization, but I'll log a separate issue for it.
src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Protocol/ClientCapabilitiesServiceBase.cs
Outdated
Show resolved
Hide resolved
src/Razor/test/Microsoft.CodeAnalysis.Remote.Razor.Test/RazorServicesTest.cs
Outdated
Show resolved
Hide resolved
...zor/test/Microsoft.VisualStudio.LanguageServices.Razor.Test/Cohost/CohostEndpointTestBase.cs
Show resolved
Hide resolved
Technically, yes; practically, no. If something throws on a thread after a thread has finished running, it'll fail at the command-line, but Test Explorer will eat the exceptions. That's pretty uncommon though, so practically, there's no real difference. 😄 Personally, I like to run them at the command-line so they run just as they do in CI. That gives me some confidence that any test failures in CI for Window-Debug or Windows-Release aren't mine. Plus, I get to see if there any warnings (such as unused using) that would break the CI build before pushing. Also, I always trip over the fact that our integration tests our included in the Test Explorer. Too often when making a compiler change, I'll forget and Ctrl+A to select all tests and accidentally start integration tests running. |
...Razor/src/Microsoft.CodeAnalysis.Remote.Razor/DocumentSymbols/RemoteDocumentSymbolService.cs
Outdated
Show resolved
Hide resolved
May I recommend a "RazorToolingTests.playlist" playlist file, that includes everything but compiler and integration tests, so one click of the "Run All In View" button runs only the interesting things. |
I do know about that, but I did say "too often when making a compiler change." 😄 |
- Renaming a variable - Made UpdateClientLSPInitializationOptions mode complete (so it updates RemoteSemanticTokensLegendService now with initialization data) - Removed limitation of single update on RemoteSemanticTokensLegendService - Use UpdateClientLSPInitializationOptions in cohost semantic tokens test
Summary of the changes
Fixes: #11102