-
Notifications
You must be signed in to change notification settings - Fork 18k
x/tools/gopls: gopls implementation result does not include all types in vendor directory #56169
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
Can you try with the
And restart the gopls (Go: Restart Language Server) or reload the vscode window. I could reproduce the issue with the released version of gopls. But I see the |
I've just tried, but see no difference. It can't find that particular implementation in the
Is there a way to make a |
To check the detailed version of gopls -
The gopls your extension is using is printed in the |
The trace: https://gist.github.com/x-yuri/985f8289b15e07fe1038c1eafe679b0b
Now that I think about it, maybe I should uninstall |
But
All in all looks like a |
Thanks for capturing the log. I also verified this is reproducible - sorry that I was confused by "Find all references" reporting the interface definition correctly. From your original report, I see that you are reporting that the "Find all implementations" (or Implementations) result is missing a type in the In the example you shared, p.repo.Blobs implements a method of the interface I think this happens because the implementation type ( I verified gopls returns the implementation type if I rename I will transfer this to gopls issue tracker, but I am afraid this is subtle and may not be fixable easily. |
Oh, I just noticed that one of the links in my report is wrong (the second one):
And that's probably what you meant here:
So to make sure we're on the same page... I know that In the same vein |
Change https://go.dev/cl/454637 mentions this issue: |
I am afraid this isn't fixed. I still don't see the implementation in |
Reopen for continued investigation & fix verification. cc @adonovan |
It looks like the issue may be related to file watching: gopls doesn't ask VS Code to watch the vendor directory. (I discovered this after implementing proper support for glob patterns in our fake LSP client). |
I cloned moby into
I confirm that with v0.11.0 only the first two were reported, so this issue appears to have been fixed. |
What version of Go, VS Code & VS Code Go extension are you using?
Version Information
go version
to get version of Go from the VS Code integrated terminal.gopls -v version
to get version of Gopls from the VS Code integrated terminal.code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.Go: Locate Configured Go Tools
command.Share the Go related settings you have added/edited
I didn't change any settings.
Describe the bug
I trying to examine the
moby
project, and the extension seems to ignore thevendor
dir. Possibly because there's nogo.mod
at the root of the repository. E.g. it can't find the implementation ofp.repo.Blobs
, that is located here. As long as I need to navigate within the main module it seems to work fine.Steps to reproduce the behavior:
~/go/src/github.com/docker/docker
.code
, thendistribution/pull_v2.go
(line 903).Blobs
, choose "Go to Implementations".You'll see only some mock implementations from
distribution/push_v2_test.go
.Screenshots or recordings
The text was updated successfully, but these errors were encountered: