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: reloading metadata for test packages fails (internal/lsp/cmd) #36556

Closed
stamblerre opened this issue Jan 14, 2020 · 3 comments
Closed
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

https://golang.org/cl/214717 should not be necessary. It seems that there are go/packages errors (likely related to overlays), that are preventing metadata from being reloaded per-package.

This could also be tied to the fact that we are using a real module in go/packages/packagestest, because there were a number of errors that looked like:

[-: module golang.org/x/tools@latest found (v0.0.0-20200114052453-d31a08c2edf2), but does not contain package golang.org/x/tools/internal/lsp/noparse_format golang.org/x/tools/internal/lsp/folding]

@stamblerre stamblerre added this to the gopls v1.0 milestone Jan 14, 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 Jan 14, 2020
@stamblerre
Copy link
Contributor Author

Filed #36558 to address the confusing nature of the error message. This will be fixed in CL 214717, but I'm going to use this bug to understand why metadata is being reloaded in the cmd tests at all.

@stamblerre
Copy link
Contributor Author

It looks like we invalidate metadata because the initial workspace diagnostics have not completed before the snapshot is cloned, so none of the files have "known" file handles. Therefore, all of the tests effectively run from scratch. The real fix here would be to make sure at least the package handles are created before the initial workspace load is considered complete. I wonder if that will have a noticeable effect in the editor.

@gopherbot
Copy link

Change https://golang.org/cl/214799 mentions this issue: internal/lsp/cache: construct package handles as part of IWL

@stamblerre stamblerre modified the milestones: gopls v1.0, gopls/v0.3.0 Jan 15, 2020
@golang golang locked and limited conversation to collaborators Jan 14, 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
None yet
Development

No branches or pull requests

2 participants