For now, VSCode only will show the signature of the selected function. To see other function defines, we have to move cursor to make the selection. Is it possible to show all the function signatures like in GoLand?
This is now in VSCode:
And this is now in GoLand:
It will be a huge help if gopls could also support this kind of completion hints like GoLand. There might be a performance hit, but we could make it a optional.
Comment From: gabyhelp
Related Issues
- x/tools/gopls: move function signature into detail for completion #32414 (closed)
- x/tools/gopls: don't trigger signature help from completion #37966 (closed)
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Comment From: h9jiang
LSP 3.17 introduces the CompletionItemLabelDetails
inside of CompletionItem
interface, we can use this instead. I don't think gopls is currently using this field at all. Maybe worth doing the migration from detail to the label detail.
References: originial discussion: https://github.com/microsoft/vscode/issues/39441 spec: lsp spec in x/tools: code
Today, gopls report function signature for completion items using detail, but the detail can only be rendered in vscode if being selected. However, the vscode render CompletionItemLabelDetails
without being selected. I think it's a good place to hold the signature information.
{
"label": "Print",
"kind": 3,
"detail": "func(a ...any) (n int, err error)",
"documentation": {}
}