vscode-go icon indicating copy to clipboard operation
vscode-go copied to clipboard

Add menu item for "Browse gopls feature documentation"

Open adonovan opened this issue 1 year ago • 4 comments

The gopls.doc.features code action (requires gopls at tip) opens the gopls manual in a browser. However, this code action appears only when the "command-." key is pressed to open a menu of miscellaneous code actions. It should be a more prominent command in the UI: directly available in the command palette and the toplevel context menu.

xtools$ gopls codeaction ./gopls/main.go 
command	"Browse gopls feature documentation" [gopls.doc.features]
command	"Browse documentation for package main" [source.doc]
xtools$ gopls codeaction -exec -kind=gopls ./gopls/main.go 
(opens browser)

Also: we observed that this code action didn't appear at all for one user (@hyangah). We should investigate.

adonovan avatar Aug 20 '24 20:08 adonovan

Quite opposite request from me - is there currently a way to disable "gopls.doc.features" action from code actions menu at all? I find it quite disruptive to my workflow. I couldn't find anything in any docs I could find (https://github.com/golang/tools/blob/master/gopls/doc/settings.md and https://github.com/golang/vscode-go/wiki/settings#settings-for-gopls), but after taking glance at code in golang/tools/gopls it definitely feels like it could be disabled

rszyma avatar Dec 26 '24 14:12 rszyma

Quite opposite request from me - is there currently a way to disable "gopls.doc.features" action from code actions menu at all?

Any updates?

This recent change is extremely annoying.

I don't understand why the option has the higher priority than organize imports:

Image

your-diary avatar Jan 24 '25 15:01 your-diary

I don't understand why the option has the higher priority than organize imports:

Hi your-diary@, are you using vscode-go or vim-go. If you are using vscode-go, I think there should be something I can do to re-arrange the code actions returned from gopls. If this is vim-go, I suggest you create a feature request/bug report to golang/go under gopls and ask for re-arranging or disable code actions.

I think in VSCode-GO, gopls.add_import is put under quick fix and the gopls.doc.features is under more actions

Image

cc @findleyr @adonovan

h9jiang avatar Mar 05 '25 15:03 h9jiang

@h9jiang Hi. Thank you for your reply.

Because I'm using Vim, I opened an issue in golang/go, following your suggestion:

  • golang/go#72742

your-diary avatar Mar 08 '25 05:03 your-diary

My understanding is this action is available in every place where you could invoke code action in go files, am I right? IMO, it's not a very good way to promote documentation use. What if every extension would add a similar action? Additionally, it adds a lot of informational noise. Please reconsider your decision, or at least provide an option to turn it off. There're actions which might go below it, and I have to press the down arrow one more time to reach them, which is suboptimal.

P.S. If you want to promote features, consider adding a link in hovers, just near a link to the gopkg docs.

solomatov avatar Jun 23 '25 12:06 solomatov

Hi solomatov@, thank you for sharing your opinion.

My understanding is this action is available in every place where you could invoke code action in go files, am I right?

Yes

Let me mark this as needs investigation. We can explore other options in vscode API to see how we can surface this feature doc. If we could find a better place, we can do some client side filtering so the gopls.doc.feature code action can be excluded from the response and instead show it somewhere else.

h9jiang avatar Jun 23 '25 14:06 h9jiang