ATTENTION: Please answer these questions BEFORE submitting your issue. Thanks!
I am not sure if this is a gopls issue of vs-code go extension issue ... or both...
What did you do?
Enabled
"gopls": {
"ui.documentation.linksInHover": "gopls"
},
```
Clicked on a doc link in the hover popup for grpc.DialContext and it took me to...
`http://127.0.0.1:53693/gopls/exMLWbr5ON4/pkg/google.golang.org/grpc@v1.62.1?view=1#DialContext`
And that returned `package not found`

Right clicked -> Source Action -> Browse documentation for func grpc.DialContext -> which opened `http://127.0.0.1:53693/gopls/exMLWbr5ON4/pkg/google.golang.org/grpc?view=1#DialContext` (**note** the difference in the urls)
<img width="1020" alt="Screenshot 2024-06-21 at 3 55 44 PM" src="https://github.com/golang/go/assets/103/d5cb6428-17c5-4e6b-ba5a-6c6f5ea0f4da">
<br/>
<br/>
I tried this in multiple projects and different symbols with the same results (hover popup doc link returns package not found / Source Action works)
#### What did you expect to see?
The documentation for grpc.DialContext from gopls
#### What did you see instead?
package not found
#### Build info
golang.org/x/tools/gopls v0.16.0 golang.org/x/tools/gopls@v0.16.0 h1:JOYR1NabC699+pLFI02CxlD9xaPXdaVmPp7f01k0/hE= github.com/BurntSushi/toml@v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= github.com/google/go-cmp@v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= golang.org/x/exp/typeparams@v0.0.0-20221212164502-fae10dda9338 h1:2O2DON6y3XMJiQRAS1UWU+54aec2uopH3x7MAiqGW6Y= golang.org/x/mod@v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= golang.org/x/sync@v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= golang.org/x/telemetry@v0.0.0-20240607193123-221703e18637 h1:3Wt8mZlbFwG8llny+t18kh7AXxyWePFycXMuVdHxnyM= golang.org/x/text@v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= golang.org/x/tools@v0.22.1-0.20240620150659-cb3016b76f3e h1:Cht5EwNRmW9EgQ7ihPmgIswaQW4jR1cPbmzGCNl2++8= golang.org/x/vuln@v1.0.4 h1:SP0mPeg2PmGCu03V+61EcQiOjmpri2XijexKdzv8Z1I= honnef.co/go/tools@v0.4.7 h1:9MDAWxMoSnB6QoSqiVr7P5mtkT9pOc1kSxchzPCnqJs= mvdan.cc/gofumpt@v0.6.0 h1:G3QvahNDmpD+Aek/bNOLrFR2XC6ZAdo62dZu65gmwGo= mvdan.cc/xurls/v2@v2.5.0 h1:lyBNOm8Wo71UknhUs4QTFUNNMyxy2JEIaKKo0RWOh+8= go: go1.22.2 ```
Comment From: gabyhelp
Similar Issues
- x/tools/gopls: space in package path leads to invalid hover markdown #68026
- x/tools/gopls: add method documentation \& jump to page source to hovered type. #66721
- x/tools/gopls: symbol definitions not found after latest vscode/gopls upgrade #66677
- x/tools/gopls: fails to load package for test file #41081
- x/tools/gopls: cannot go to definition when `"ui.navigation.importShortcut": "Link"` #45987
- x/tools/gopls: go to definition doesn't work in VSCode #32608
- x/tools/gopls: missing function name in signature when hovering over built-in function #51811
- x/tools/gopls: gopls returns "getting file for Highlight: no PackageHandles" errors #39624
- x/tools/gopls: go to definition breaks gopls #38503
- x/tools/gopls: not working #37119
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Comment From: freeformz
Another engineer at $WORK was able to reproduce, although not consistently.
Comment From: findleyr
CC @adonovan
Comment From: adonovan
I can reproduce this in gopls' own main.go file on the telemetry.Start symbol. Wow, I can't believe I missed a bug this shallow during all the testing. Thanks for reporting.
Comment From: gopherbot
Change https://go.dev/cl/594556 mentions this issue: gopls/internal/golang: strip @v1.2.3 suffix from pkgdoc URLs
Comment From: freeformz
I installed from master and am having a similar problem.
From doc link in the hover popup: (URL: http://127.0.0.1:63774/gopls/on0HKAhym30/pkg/github.com/google/flatbuffers?view=1#Builder)
From the Source Action: (URL: http://127.0.0.1:63774/gopls/on0HKAhym30/pkg/github.com/google/flatbuffers/go?view=1#Builder
Note the difference in the URLS....
http://127.0.0.1:63774/gopls/on0HKAhym30/pkg/github.com/google/flatbuffers?view=1#Builder http://127.0.0.1:63774/gopls/on0HKAhym30/pkg/github.com/google/flatbuffers/go?view=1#Builder
The first one doesn't work, the second one does.
Comment From: gopherbot
Change https://go.dev/cl/595563 mentions this issue: [gopls-release-branch.0.16] gopls/internal/golang: strip @v1.2.3 suffix from pkgdoc URLs