-
Notifications
You must be signed in to change notification settings - Fork 105
Breaking: Registration Options require Client Capability during creation #440
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
Conversation
…olete. * LSP Serializer renamed to LSPSerializer * Added serialization rules for client * Ensure code actions are provided properly. * Updated serialization rules for server
… base classes from a single params object
…f the bugs have been solved
…enerate 'AllowDerivedRequests'
Docs link for this PR: (The above description will be rolled into the release notes). |
Codecov Report
@@ Coverage Diff @@
## master #440 +/- ##
==========================================
- Coverage 78.17% 70.54% -7.63%
==========================================
Files 237 259 +22
Lines 8647 10916 +2269
Branches 634 772 +138
==========================================
+ Hits 6760 7701 +941
- Misses 1887 3215 +1328
Continue to review full report at Codecov.
|
b6ee7b1
to
2c2589b
Compare
… this but 3 second intellisense times are unbearable
2c2589b
to
dacd031
Compare
Registration Changes
The 3.16 specification defines the SemanticLegend in such a way that the client produces a list of supported tokens and the server must return the tokens it supports and the index order it will use.
Today we get the registration options at registration of a handler, but this is typically before we have started communicating with the server.
This change adds a new interface
IRegistrationOptions<TOptions, TCapability>
and all interfaces have been updated to implement this interface if they have both a client capability and a server registration option.Abstract Handlers Registration Options
The abstract base classes by the above change now have a new method that must be implemented.
protected internal abstract TRegistrationOptions CreateRegistrationOptions(TCapability capability);
The base handler then caches the resulting value so this method is only ever called once.
Existing implementations of
GetRegistrationOptions
can be replaced withCreateRegistrationOptions
.Abstract Handlers
All the abstract handler base classes have been renamed to have a Suffix of "Base" if there was not one there before.
The fix for this is simply to make sure the
Base
suffix has been applied.Feature Specific Files
This is not a breaking change, the goal was to make sure that namespaces did not change, if there is a miss let me know.
Any classes related to the Request, Response, Capability and Registration Options have been moved into a
XyzFeature.cs
file. This will help reduce the number of overall files in the repo, as well as hopefully with discoverabiliy. More importantly this make it easier to create new features, as all the components for a given feature will be in the same file.TextDocumentSyncRegistrationOptions Added
The IDidXyzTextDocument handlers have been updated to have specific named options, and a master options class
TextDocumentSyncRegistrationOptions
has been added. You provide theTextDocumentSyncRegistrationOptions
and all the other named options can be implicitly created from it.Source Generation
Source Generation has been refactored to be a little more flexible and better organized (it's not prefect but better).
Some documentation has been added to document the attributes and their usage. These should available to consumers to also use themselves, please let me know of any bugs you might encounter with them.