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: handle go.sum file changes like go.mod changes after -mod=readonly #42815

Closed
stamblerre opened this issue Nov 24, 2020 · 3 comments
Labels
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

stamblerre commented Nov 24, 2020

With -mod=readonly (https://golang.org/cl/268597), changes to go.sum files will affect the results of packages.Load. We should handle changes to go.sum files in (*snapshot).clone and invalidate metadata in the same way that we do for go.mod files.

/cc @heschik

@stamblerre stamblerre added this to the gopls/vscode-go milestone Nov 24, 2020
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Nov 24, 2020
@heschi
Copy link
Contributor

heschi commented Nov 25, 2020

I don't think the description is quite correct. Specifically, a change to go.sum can take a broken packages.Load and fix it; if the load succeeded, then go.sum changes cannot be relevant. (Technically, they could break it, but I don't think we care about that.) So it's less that we should invalidate, and more that we should try again to fix any invalid metadata.

@gopherbot
Copy link

Change https://golang.org/cl/279032 mentions this issue: gopls/internal/regtest: test that accepting fix removes diagnostics

gopherbot pushed a commit to golang/tools that referenced this issue Dec 17, 2020
This test currently fails, as we don't treat go.sum updates as
invalidation events.

Updates golang/go#42815

Change-Id: I01a94ac99293a425ff7cff5d5effab19d0fd2772
Reviewed-on: https://go-review.googlesource.com/c/tools/+/279032
Trust: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
@findleyr findleyr self-assigned this Dec 23, 2020
@gopherbot
Copy link

Change https://golang.org/cl/279720 mentions this issue: internal/lsp/cache: only reload the workspace on saved changes

vscode-go: gopls by default automation moved this from Critical to Done Dec 23, 2020
@golang golang locked and limited conversation to collaborators Dec 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
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
No open projects
Development

No branches or pull requests

4 participants