Skip to content

Doc package links should be clickable #3374

Closed
@tylerbrandt

Description

@tylerbrandt

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions