@hyangah makes four suggestions for ergonomic improvements to the new package documentation viewer: 1. Change the command title to "View documentation for package p", including the name of the current package. 2. When hovering over an import declaration, or an imported package name, offer the command "View documentation for package q" where q is the name of the referenced package. This would be in addition to the existing command. 3. When hovering over an imported symbol, offer the command "View documentation for symbol s", which adds the correct URL fragment. 4. Add a setting to enable Hover links to go, not to pkg.go.dev, but to the built-in pkg doc viewer; see sketch in https://go.dev/cl/572037.

One UX question: - should we offer "View...package" for both the current package and the selected imported package, or is that too much?

Comment From: gabyhelp

Similar Issues

  • https://github.com/golang/go/issues/51848

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

Comment From: adonovan

@findleyr and I decided: - All our browser-based code actions should use the verb "Browse...". - We should offer exactly one "Browse documentation" action, the most specific available for the context (imported symbol > imported package > current package) - The Code Action title should include the leaf name of the package.

Comment From: gopherbot

Change https://go.dev/cl/592496 mentions this issue: gopls/internal/golang: s/View/Browse/ for browser-based features

Comment From: gopherbot

Change https://go.dev/cl/592577 mentions this issue: gopls/internal/golang: improve ergonomics of "Browse documentation"

Comment From: gopherbot

Change https://go.dev/cl/572037 mentions this issue: gopls/internal/golang: support LinkTarget = "gopls" in Hover