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: duplicate reload after workspace re-initialization #54473

Closed
findleyr opened this issue Aug 16, 2022 · 2 comments
Closed

x/tools/gopls: duplicate reload after workspace re-initialization #54473

findleyr opened this issue Aug 16, 2022 · 2 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

@findleyr
Copy link
Contributor

Noticed this while debugging regression tests.

As a result of CL 417576, when we re-initialize a workspace we also do a follow-up load of all packages. Note that we must reload some packages for correctness (because they may have disappeared), but not all. We must prune our shouldLoad map during reinitialization.

@findleyr findleyr added this to the gopls/v0.10.0 milestone Aug 16, 2022
@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 Aug 16, 2022
@gopherbot
Copy link

Change https://go.dev/cl/424074 mentions this issue: internal/lsp/cache: clear shouldLoad IDs on load

@gopherbot
Copy link

Change https://go.dev/cl/428596 mentions this issue: [gopls-release-branch.0.9] internal/lsp/cache: clear shouldLoad IDs on load

gopherbot pushed a commit to golang/tools that referenced this issue Sep 6, 2022
…n load

CL 417576 externalized shouldLoad tracking into a map, which was used to
trigger a reload and cleared once reload completes. Unfortunately, it
overlooked the fact that we may also reload the entire workspace (via
reinitialization). In this case, we should clear newly loaded IDs from
the shouldLoad map, so that they are not subsequently loaded again.

For golang/go#54842
Updates golang/go#54473

Change-Id: I26f49552cae502644142dc4a4e946294db37f6f7
Reviewed-on: https://go-review.googlesource.com/c/tools/+/424074
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
(cherry picked from commit e55fb40)
Reviewed-on: https://go-review.googlesource.com/c/tools/+/428596
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Sep 11, 2022
This release updates the gopls vulncheck command (which backs the
preview of vulncheck integration in VS Code) with the latest schema
of the Go vulnerability database. See the Vulnerability Management
for Go blog post for more context.

Additionally, this release includes a bugfix for redundant reloads
following go.mod changes (golang/go#54473).
@golang golang locked and limited conversation to collaborators Sep 6, 2023
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
None yet
Development

No branches or pull requests

2 participants