Navigation Menu

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: fails to load std and cmd workspace packages #46901

Closed
findleyr opened this issue Jun 24, 2021 · 4 comments
Closed

x/tools/gopls: fails to load std and cmd workspace packages #46901

findleyr opened this issue Jun 24, 2021 · 4 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

Gopls loads std and cmd with the go/packages queries "std/..." and "cmd/...", respectively, resulting in no workspace packages being loaded. As a result, the only packages considered part of the workspace are loaded via open files.

This seems to have been the case for a while, but may have become more noticeable with recent memory optimizations.

This is straightforward to fix, though it makes working in cmd and std a lot more resource intensive: 2.8G vs <1G for me, and find references on testing.T takes a good 5-10s. I'd still prefer to fix it. If anyone wants the old behavior they can opt in to the degraded memory mode.

CC @stamblerre @mdempsky

@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 Jun 24, 2021
@gopherbot gopherbot added this to the Unreleased milestone Jun 24, 2021
@mdempsky
Copy link
Member

How do you opt-in to the previous behavior?

@gopherbot
Copy link

Change https://golang.org/cl/330529 mentions this issue: internal/lsp/cache: fix loading of std and cmd

@findleyr
Copy link
Contributor Author

How do you opt-in to the previous behavior?

"memoryMode": "DegradeClosed"
should do it.

We should verify this and move this setting out of experimental before releasing the attached change to std/cmd loading.

@findleyr
Copy link
Contributor Author

Whelp, degraded memory mode doesn't seem to help much, actually. I'll file a separate issue for that.

@golang golang locked and limited conversation to collaborators Jun 24, 2022
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

3 participants