vscode-go
vscode-go copied to clipboard
Add menu item for "Browse gopls feature documentation"
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.
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
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:
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
cc @findleyr @adonovan
@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
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.
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.