Fix documentLink/resolve by introducing a data field#336
Merged
Conversation
The current definition of a DocumentLink makes resolving a link with documentLink/resolve essentially impossible. Having only a range field filled out is not enough information for a language server to deduce what content or file the link is about. To correct this, a new data field has been introduced to DocumentLink that servers can fill in with some data on the initial fulfillment of a textDocument/documentLink request so that subsequent documentLink/resolve requests will have some contextual information available to resolve the link. Signed-off-by: Remy Suen <[email protected]>
Member
|
@rcjsuen can you please update the spec. E.g. have /**
* A data entry field that is preserved on a document link between a
* DocumentLinkRequest and a DocumentLinkResolveRequest.
*/
data?: anyin there as well. |
Contributor
Author
|
Thank you for merging in the PR, Dirk. I've opened microsoft/language-server-protocol#464 to add the |
Member
|
@rcjsuen thanks |
This file contains hidden or 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
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.
The current definition of a
DocumentLinkmakes resolving a link withdocumentLink/resolveessentially impossible. With only arangefield available, it is not possible for the server to deduce what the originating content is as it does not have any information as to which text document the link is for.To correct this, a new
datafield has been introduced toDocumentLinkthat servers can fill in with some whatever it needs when initially fulfilling thetextDocument/documentLinkrequest. This way, a subsequentdocumentLink/resolverequest will have the necessary contextual information available to resolve the link and return back a URI to use in thetargetfield.