-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Allow language specific handlers to use their own types for serialization #72230
Conversation
0edf3bc
to
6df7f0a
Compare
...es/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/AbstractLanguageServer.cs
Outdated
Show resolved
Hide resolved
request, | ||
lspServices, | ||
_logger, | ||
cancellationToken); | ||
} | ||
|
||
protected virtual string GetLanguageForRequest<TRequest>(string methodName, TRequest request) | ||
=> LanguageServerConstants.DefaultLanguageName; | ||
//protected virtual string GetLanguageForRequest<TRequest>(string methodName, TRequest request) |
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.
Seems to be no longer used anywhere
src/VisualStudio/Xaml/Impl/Implementation/LanguageServer/XamlRequestExecutionQueue.cs
Outdated
Show resolved
Hide resolved
042a611
to
cd4619b
Compare
cd4619b
to
9a326ca
Compare
9a326ca
to
eabfc37
Compare
Originally I was planning on pushing the deserialization down deeper into the queue (instead of before we enqueue it). However, I encountered a couple issues
Additionally, I am hopeful that in the future we may be able to provide a protocol types library that can handle all of the non-breaking JSON protocol changes without binary breaking changes (generally these occur because of union type additions). This is a requirement for Razor cohosting as well. If we're able to convert XAML to using those types as well, we would no longer need to support different type definitions for the same LSP method. |
8dbf2bf
to
222317c
Compare
222317c
to
5f16564
Compare
...es/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/AbstractLanguageServer.cs
Outdated
Show resolved
Hide resolved
...es/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/AbstractLanguageServer.cs
Outdated
Show resolved
Hide resolved
...es/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/AbstractLanguageServer.cs
Show resolved
Hide resolved
...es/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/AbstractLanguageServer.cs
Outdated
Show resolved
Hide resolved
...es/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/AbstractLanguageServer.cs
Outdated
Show resolved
Hide resolved
...es/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/AbstractLanguageServer.cs
Outdated
Show resolved
Hide resolved
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.
Update - the PR val cloudbuild failed due to a warning triggering in the source file includes. Running a new one now, should have results soon. |
This moves the deserialization and serialization support out of StreamJsonRpc, and directly into roslyn. Before we deserialize, we figure out what language a particular handler is for (based on the text document in the parameters). If none is found we use the default language handler.
This is done by manually looking at the JToken for the uri in the expected location (LSP requests are generally uniform in where they put the URI).
This will allow XAML to use different instances of LSP serialization types as compared to Roslyn.