-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Closed
Copy link
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.FrozenDueToAgeToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.
Milestone
Description
Currently gopls decorates each import statement with a link to the package doc
in pkg.go.dev
(or a custom doc site if users configured a different linkTarget) unconditionally.
However, I found the current choice is not optimal because
- the link to the standard library package always points to the latest stable version of go's. That maybe not be correct.
- the link to the third-party library package points to the right versioned doc, but that may not exist in pkg.go.dev.
- the link to the private packages points to the public pkg.go.dev by default, that's not appropriate.
- the link for the replaced dependencies or
go.work
-adjusted dependencies can't be right. - redirecting users to the external website is distracting, and often surprising.
- asking users to click an external link without presenting the full URLs can be problematic - imagine a repo has .vscode/settings.json with malicious linkTarget configured.
I propose we change this part of UX/UI.
- render proper package doc (or at least the snippet - the very first line) as a hover.
- add the link to one of the package file, maybe the one provided the package doc. (note: currently VS Code and LSP lack handling of folder-type links - Ability to expand a selected folder in the file explorer microsoft/vscode#141564)
- add the link to the pkg.go.dev as a link in the hover message (like other hovers for symbols) so users know where the clicking action takes them.
I also propose a similar change for the links used in go.mod files.
For document links, maybe we can consider the go.mod file of the module stored in the module cache.
Metadata
Metadata
Assignees
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.FrozenDueToAgeToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.