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: package not found when "linksInHover": "gopls" #68116

Closed
freeformz opened this issue Jun 21, 2024 · 7 comments
Closed

x/tools/gopls: package not found when "linksInHover": "gopls" #68116

freeformz opened this issue Jun 21, 2024 · 7 comments
Assignees
Labels
gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@freeformz
Copy link

freeformz commented Jun 21, 2024

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/[email protected]?view=1#DialContext
And that returned package not found
Screenshot 2024-06-21 at 3 45 28 PM

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)

Screenshot 2024-06-21 at 3 55 44 PM

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/[email protected] h1:JOYR1NabC699+pLFI02CxlD9xaPXdaVmPp7f01k0/hE=
    github.com/BurntSushi/[email protected] h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak=
    github.com/google/[email protected] h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
    golang.org/x/exp/[email protected] h1:2O2DON6y3XMJiQRAS1UWU+54aec2uopH3x7MAiqGW6Y=
    golang.org/x/[email protected] h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0=
    golang.org/x/[email protected] h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
    golang.org/x/[email protected] h1:3Wt8mZlbFwG8llny+t18kh7AXxyWePFycXMuVdHxnyM=
    golang.org/x/[email protected] h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
    golang.org/x/[email protected] h1:Cht5EwNRmW9EgQ7ihPmgIswaQW4jR1cPbmzGCNl2++8=
    golang.org/x/[email protected] h1:SP0mPeg2PmGCu03V+61EcQiOjmpri2XijexKdzv8Z1I=
    honnef.co/go/[email protected] h1:9MDAWxMoSnB6QoSqiVr7P5mtkT9pOc1kSxchzPCnqJs=
    mvdan.cc/[email protected] h1:G3QvahNDmpD+Aek/bNOLrFR2XC6ZAdo62dZu65gmwGo=
    mvdan.cc/xurls/[email protected] h1:lyBNOm8Wo71UknhUs4QTFUNNMyxy2JEIaKKo0RWOh+8=
go: go1.22.2
@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 Jun 21, 2024
@gopherbot gopherbot added this to the Unreleased milestone Jun 21, 2024
@freeformz freeformz changed the title x/tools/gopls: <DESCRIBE THE PROBLEM> x/tools/gopls: package not found when linksInHover": "gopls" Jun 21, 2024
@freeformz freeformz changed the title x/tools/gopls: package not found when linksInHover": "gopls" x/tools/gopls: package not found when "linksInHover": "gopls" Jun 21, 2024
@ansaba ansaba added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 24, 2024
@freeformz
Copy link
Author

Another engineer at $WORK was able to reproduce, although not consistently.

@findleyr
Copy link
Contributor

CC @adonovan

@adonovan
Copy link
Member

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.

@findleyr findleyr modified the milestones: Unreleased, gopls/v0.16.1 Jun 24, 2024
@adonovan adonovan self-assigned this Jun 24, 2024
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/594556 mentions this issue: gopls/internal/golang: strip @v1.2.3 suffix from pkgdoc URLs

@freeformz
Copy link
Author

@gopherbot
Copy link
Contributor

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

gopherbot pushed a commit to golang/tools that referenced this issue Jun 28, 2024
…ix from pkgdoc URLs

The  package path in a /pkg URL does not want a module
version suffix: the view specifies the versions of all packages.
Remove them.

Fixes golang/go#68116

Change-Id: Icbe7a6e7346d12456724d005fe8f755872657055
Reviewed-on: https://go-review.googlesource.com/c/tools/+/594556
LUCI-TryBot-Result: Go LUCI <[email protected]>
Auto-Submit: Alan Donovan <[email protected]>
Reviewed-by: Robert Findley <[email protected]>
(cherry picked from commit 1e6c1e2)
Reviewed-on: https://go-review.googlesource.com/c/tools/+/595563
Auto-Submit: Robert Findley <[email protected]>
Reviewed-by: Alan Donovan <[email protected]>
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Jul 7, 2024
This release addresses the following gopls issues:

    golang/go#68116, broken links to dependencies in the new integrated doc viewer.
    golang/go#68169, a crash in package name completion.
    golang/go#68213, a crash when hovering over an interface with an empty type set.
    golang/go#68240, additional telemetry instrumentation to help inform decisions for [email protected]. (Note that this is local instrumentation only; a separate proposal will be filed to allow collection of this data from users who have opted in to sharing their telemetry data).
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. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

6 participants