-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: gopls doc viewer failed with "package not found" error #70453
Comments
It's possible that #68223 can be the same issue. |
Thanks, I can reproduce the problem. The URL is lacking the final /github segment of the package path. If you instead use Source Action > Browse Documentation, it computes the correct URL. Will investigate. |
Ah, the logic in golang.formatLink is to blame: if pkgURL != nil { // LinksInHover == "gopls"
path, _, _ := strings.Cut(h.LinkPath, "@") // remove optional module version suffix
url = pkgURL(PackagePath(path), h.LinkAnchor) LinkPath is It should probably use something like https://pkg.go.dev/golang.org/x/mod/module#SplitPathVersion to parse the path. |
Seems like an easy fix, thanks Alan for investigating. I'll put this in the v0.17.0 milestone, but we can of course fix it later. |
Change https://go.dev/cl/630077 mentions this issue: |
gopls version
Build info
golang.org/x/tools/gopls v0.17.0-pre.2
golang.org/x/tools/[email protected] h1:y6wuA4lucYh1D/La5Rs6/aaR1YDLuT1UPygLfmKyBuI=
github.com/BurntSushi/[email protected] h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs=
github.com/google/[email protected] h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
golang.org/x/exp/[email protected] h1:1P7xPZEwZMoBoz0Yze5Nx2/4pxj6nw9ZqHWXqP0iRgQ=
golang.org/x/[email protected] h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=
golang.org/x/[email protected] h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=
golang.org/x/[email protected] h1:TCDqnvbBsFapViksHcHySl/sW4+rTGNIAoJJesHRuMM=
golang.org/x/[email protected] h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug=
golang.org/x/[email protected] h1:3ufSKdb6bs9yNyF0YIdrRQjzlObIct/11gv96ANGmZA=
golang.org/x/[email protected] h1:SP0mPeg2PmGCu03V+61EcQiOjmpri2XijexKdzv8Z1I=
honnef.co/go/[email protected] h1:4bH5o3b5ZULQ4UrBmP+63W9r7qIkqJClEA9ko5YKx+I=
mvdan.cc/[email protected] h1:bg91ttqXmi9y2xawvkuMXyvAA/1ZGJqYAEGjXuP0JXU=
mvdan.cc/xurls/[email protected] h1:lyBNOm8Wo71UknhUs4QTFUNNMyxy2JEIaKKo0RWOh+8=
go: go1.23.3
go env
What did you do?
maintner/github.go
, and hover over*github.Label
in line 418.What did you see happen?
"package not found" on browser
What did you expect to see?
Package doc
Editor and settings
VS Code
Logs
No response
The text was updated successfully, but these errors were encountered: