Skip to content
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

x/tools/gopls: use VersionedTextDocumentIdentifier in TextEdits #35243

Closed
stamblerre opened this issue Oct 30, 2019 · 4 comments
Closed

x/tools/gopls: use VersionedTextDocumentIdentifier in TextEdits #35243

stamblerre opened this issue Oct 30, 2019 · 4 comments
Labels
Documentation FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@stamblerre
Copy link
Contributor

See https://microsoft.github.io/language-server-protocol/specifications/specification-3-15/#versionedTextDocumentIdentifier for details.

We currently do not cache the file's version, which means that we return un-versioned TextEdits. If the state of gopls cache has not synced up with the client, we may edit the wrong code.

Possibly related: #34955

@gopherbot gopherbot added this to the Unreleased milestone Oct 30, 2019
@gopherbot gopherbot added Documentation Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Oct 30, 2019
@stamblerre stamblerre self-assigned this Nov 7, 2019
@jpvillaseca
Copy link

Could it also be related to #35526?

@stamblerre
Copy link
Contributor Author

I'm not sure, but #35526 seems like a different issue to me. It will be easier to tell with logs.

@gopherbot
Copy link

Change https://golang.org/cl/206882 mentions this issue: internal/lsp: use versioned URIs in rename and code actions

@gopherbot
Copy link

Change https://golang.org/cl/205863 mentions this issue: internal/lsp: use the versions provided by the client

gopherbot pushed a commit to golang/tools that referenced this issue Nov 13, 2019
This change adds support for returning versions along with file URIs, so
that the client can know when to apply changes. The version is not yet
propagated along to the internal/lsp/cache package, so this change will
have no effect (VS Code ignores a version of 0 and still applies the
changes).

A few minor changes made in the rename code (to remove the view
parameter). Some minor staticcheck fixes.

Updates golang/go#35243

Change-Id: Icc26bd9d9e5703c699f555424b94034c97b01d6f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/206882
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
@golang golang locked and limited conversation to collaborators Nov 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants