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: filter intermediate test variants when resolving package for file #57795

Open
findleyr opened this issue Jan 13, 2023 · 1 comment
Assignees
Labels
gopls Issues related to the Go language server, gopls. NeedsFix The path to resolution is known, but the work has not been done. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@findleyr
Copy link
Contributor

https://go.dev/cl/455615 simplified our package APIs, but dropped the explicit filtering of intermediate test variants from snapshot.PackageForFile.

I believe as a result of this change, we may get an intermediate test variant at the call sites where we previously would not. This can cause needless type-checking.

Not yet released, but we must address this before v0.12.0

CC @adonovan

@findleyr findleyr added the NeedsFix The path to resolution is known, but the work has not been done. label Jan 13, 2023
@findleyr findleyr added this to the gopls/v0.12.0 milestone Jan 13, 2023
@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 13, 2023
@gopherbot
Copy link

Change https://go.dev/cl/462497 mentions this issue: gopls/internal/lsp/source: include ITVs in global references

gopherbot pushed a commit to golang/tools that referenced this issue Jan 18, 2023
The global search for references should include intermediate
test variants (ITVs), because the rdeps of every variant are disjoint.
The existing comment was mistaken.

The local search does not need them for the valid reason given in
the existing comment.

The previous call to RemoveIntermediateTestVariants had not
quite the intended effect because we forgot to use its result. (D'oh.)
The effect of the change in the test was to expose the bug
by creating an ordinary test variant.

Updates golang/go#57795

Change-Id: I1852aebf81ae0d169191834eb9a880d0ba90bc6e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/462497
Reviewed-by: Robert Findley <rfindley@google.com>
Run-TryBot: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls Issues related to the Go language server, gopls. NeedsFix The path to resolution is known, but the work has not been done. 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