Allow clients to pass experimental capabilities they want to enable as a dictionary #2204
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.
The motivation for this is that I noticed that the
workspace/peekDocuments
request only allows the specification of a document to peek but not the location to peek within it. The fix is to change thelocation
parameter fromDocumentUri
toLocation
, but this is a protocol-breaking change, so the client needs to communicate that it can support locations in theworkspace/peekDocuments
request.The client currently communicates that it supports peeking documents by passing
workspace/peekDocuments: true
in the experimental client capabilities. We could just add another option to the experimental client capabilities likeworkspace/peekDocuments.supportsLocations
but this seems a little hacky. Instead, what I propose is that we"<capability name>": { "supported": true }
"workspace/peekDocuments": { "supported" true, "supportsLocation": true }
to communicate that location-based peeking is supportedThis pattern will also support experimental capability changes like this in the future.
Use cases that might lack because of this are: