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
Assignees
Milestone

Comments

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Oct 30, 2019

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

@jpvillaseca

This comment has been minimized.

Copy link

@jpvillaseca jpvillaseca commented Nov 12, 2019

Could it also be related to #35526?

@stamblerre

This comment has been minimized.

Copy link
Contributor Author

@stamblerre stamblerre commented Nov 12, 2019

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

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Nov 13, 2019

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

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Nov 13, 2019

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.