golang / vscode-go

Go extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=golang.Go
Other
3.78k stars 727 forks source link

Doc package links should be clickable #3374

Closed tylerbrandt closed 1 month ago

tylerbrandt commented 1 month ago

Is your feature request related to a problem? Please describe.

It is a bit frustrating that when I format links in a doc comment like [package.Symbol], [github.com/fully-qualified/package], or [symbol], which are all formats that pkgsite supports (https://tip.golang.org/doc/comment#doclinks), vscode-go doesn't do anything with those. If they happen to be links that VS Code recognizes (like fully-qualified GitHub links) it'll open those in the browser, but this isn't what I want either (it should go to the pkg.go.dev page for that package).

Describe the solution you'd like The link should act like a Go type mention (hover over shows preview of docs, command-click goes to definition). Ideally also it would change the syntax highlighting to indicate that this is a "valid" link (which is a productivity boon when authoring such comments, particularly since typos are common and sometimes there's weird gotchas with the formatting). Goland has a really nice implementation of this with both features:

Screenshot 2024-05-02 at 10 52 01 AM

Describe alternatives you've considered I have resorted to running a live-updating entr -r pkgsite command in the console and using the browser. But it would be nice if I didn't have to leave my editor for that!

Additional context

Demo app which has these kinds of links in it: https://github.com/tylerbrandt/godoc-example

suzmue commented 1 month ago

I believe this is the same feature request as this upstream feature request in golang/go#61677. Please feel free to add your support to that request by reacting or commenting on that issue!

I am going to close this issue as a duplicate of golang/go#61677, but if you believe this is an error, feel free to reopen.

tylerbrandt commented 1 month ago

Ok, I didn’t know this was the language server responsibility but 👍🏻