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
Milestone

Comments

@stamblerre
Copy link
Contributor

@stamblerre stamblerre commented Jan 14, 2020

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
@stamblerre

This comment has been minimized.

Copy link
Contributor Author

@stamblerre stamblerre commented Jan 14, 2020

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

This comment has been minimized.

Copy link
Contributor Author

@stamblerre stamblerre commented Jan 14, 2020

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

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jan 14, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.