-
Notifications
You must be signed in to change notification settings - Fork 18k
x/tools/gopls: missing metadata for import #40685
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
Comments
I've been noticing this again and actually saw it specifically when I manually added imports from a quickfix. |
Ok yep, this is easily reproducible by adding a symbol from an unimported package and accepting the quick fix. Will investigate. Edit: Less easily reproducible than I thought. I reproduced it by adding |
Change https://golang.org/cl/252681 mentions this issue: |
To clarify, while this is reproducible with a quick fix, I have also noticed it when running |
Just noticed that my repro case test failed for all but Go 1.14, so this may be a Go command bug, which would explain its recent appearance. Edit: Confirming that I cannot reproduce with Go 1.14. |
Looks like this is a consequence of #36857--an overlaid file in a package that has a test variant really needs to be added both to the original package and its test variant. We currently don't handle this, but I think the ordering of the pre-1.15 Now it's being added to the test variant, which results in incorrect |
Change https://golang.org/cl/253800 mentions this issue: |
…ated overlay bug Something about the ordering of `go list` results must have changed in Go 1.15, so overlays with test variants were failing to get the correct imports. Technically, the correct solution would have been to support overlays for a package *and* its test variant, but for the purposes of gopls, it's actually more important that the overlays apply to the package itself (rather than its test variant). Fixes golang/go#40685 Change-Id: I3282557502f7f30bf484e1e6c17b90db824bc7d0 Reviewed-on: https://go-review.googlesource.com/c/tools/+/253800 Run-TryBot: Rebecca Stambler <[email protected]> Reviewed-by: Michael Matloob <[email protected]> Reviewed-by: Heschi Kreinick <[email protected]>
I've noticed a few times that after adding and removing
log.Printf
s that I get an error saying that there is no metadata for the log package. This seems like something is going wrong with our metadata invalidation logic in (*snapshot).clone.The text was updated successfully, but these errors were encountered: