This repository has been archived by the owner on Oct 12, 2022. It is now read-only.
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.
This change only affects the buildserver, which is only used by Sourcegraph. There is no change to editor users.
Motivation
I'm working on integrating lsp-client into the Go extension, which has surfaced a non-spec-compliant characteristic of go-langserver:
originalRootUri
must be specified in theInitializeParams
Instead of adding workarounds in lsp-client, I'm adding support in go-langserver for putting the value of
originalRootUri
in therootUri
field and omittingoriginalRootUri
.Backwards compatibility
During a migration period in which customers bump their go-langserver versions, there will be some customers running the old version and some running the new version.
My current plan is to only merge lsp-client into the Go extension when customers have bumped their versions. This means that in the meantime, go-langserver must remain compatible with the current Go extension (i.e. it must still support
originalRootUri
). That's why you'll see the flagclientUsesFileSchemeWithinWorkspace
and someif
-statements in this PR.Details
In the
rootUri
in theInitializeParams
of theinitialize
request, clients can send either:file://
URI, which indicates that:file://
URIsgit://
URIsoriginalRootUri
is presentgit://
URI, which indicates that:file://
URIsoriginalRootUri
is absent androotUri
contains the original root URIThis subsumes the other approach #369