-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: go to definition within imported modules #66827
Comments
I wonder if this is related to #53004. |
cc: @findleyr |
Sorry, but this didn't reproduce for me, with either VS Code or coc.nvim. (EDIT: to be clear: both of my test clients behaved as expected, and I could navigate to Must, NewRandom, etc) Which LSP client are you using? Can you please also share the output of |
I have the latest gopls -v version
Apologies for the confusion, indeed the issue actually arises only after I add the Try these Steps to reproduce:
|
@findleyr LSP client is VSCode (v1.88.1) running on Ubuntu Linux 22.04 amd64. Again apologies for not mentioning it upfront. I think the issue is specific to VSCode and having go/pkg/mod mapped as a project in the current workspace. My current LSP session state looks like this: Session 1 From: Cache 1 Views ID: 1 Overlays file:///home/user/go/pkg/mod/github.com/google/uuid@v1.6.0/version4.go |
This issue is reproducible only when $HOME/go/pkg/mod/ is added to the workspace. |
Indeed, I'll check that we're handling this correctly. Since this is unlikely to affect a large number of users, I'll move this to a future release milestone. |
Consider a Go project with
main.go
looking like this:When I go to definition (F12) of
uuid.New()
I end up here:So far so good.
But when I try to navigate futher to
Must
orNewRandom
, I get a popup "No definition found...".Whereas if I navigate to
fmt.Println
, I can navigate further intoFprintln
,doPrintln
,writeByte
, etc.Why is this difference in behavior between Go SDK packages and imported modules?
Shouldn't I be able to navigate within modules the same way I do in my own code and the Go SDK?
gopls version: v0.15.2
go version: 1.22
The full test project can be found at https://github.com/rustyx/issue-66827
The text was updated successfully, but these errors were encountered: