ray-x / lsp_signature.nvim

LSP signature hint as you type
Apache License 2.0
2.02k stars 57 forks source link

[Feature] Option to show return type in virtual text #219

Open ofirgall opened 1 year ago

ofirgall commented 1 year ago

Hey, I'm using the plugin only with virtual text to achieve a minimal view of the current argument like so: Screenshot from 2022-09-17 11-45-33

I would like to be able to configure the plugin to add a virtual text for the return type too, is it possible?

Btw this my cfg:

local lsp_signature_cfg = {
    bind = true,
    use_lspsaga = false,
    doc_lines = 0,
    floating_window = false,
    hint_scheme = 'LspSignatureHintVirtualText',
    hint_prefix = ' ',
}
ray-x commented 1 year ago

The Lsp does not specify the return type in its response. So it is possible but requires some efforts. Also, it may differ from language to language.

ofirgall commented 1 year ago

Doesn't the floating window shows the return type?

ray-x commented 1 year ago

The floating shows the function definition. So it requires a parser to get the return type.