Open phil-nelson opened 6 years ago
I was informed that jedi-vim integrates signature help with completion menu. Haven't got time to look into it and don't know how much work it would require.
Actually I made similar stuff at https://github.com/autozimu/LanguageClient-neovim/commits/infobuf.
Another thing is that, the work might be out of scope of this project. IMO, it would be better fitted into completion plugins, like deoplete and NCM.
What jedi-vim does:
I would love to see something like that, currently signature help is too often overshadowed by other messages.
@autozimu jedi-vim change the context of last line。 and use conceal syntax highlight.
you can check out SpaceVim's implement of signature API.
it will use conceal cchat instead of change the content of buffer. I think it is better.
BTW Vim has a bug about cchar.
for more info, please read
and I also think this featureshould be added in complete plugin. languageclient-neovim could provide information for the signature help.
cquery supports the command line option `--enable-comments' now (experimental and subject to change).
textDocument/hover
seems fine in VSCode because they use a popup window. But for Emacs and Neovim, one-line signature displaying on the status bar looks better. I still wonder how language servers should support multi-line hover information with comments
//! foo
//! bar
int a;
I think that using floating window to show the documentation under cursor would be best experience, it would not change layout as preview window. But it's not merged https://github.com/neovim/neovim/pull/6619 yet.
This patch works well enough for my use case, it mimics deoplete-jedi's behavior of putting the signature in the description, this way deoplete will show it in the preview window.
--- a/src/languageclient.rs
+++ b/src/languageclient.rs
@@ -1969,11 +1969,18 @@ impl State {
snippet = String::default();
};
- let info;
+ let mut info = String::new();
+ if lspitem.kind == Some(lsp::CompletionItemKind::Function) {
+ if let Some(ref sig) = lspitem.detail {
+ info.push_str(sig.as_str());
+ }
+ }
if let Some(ref doc) = lspitem.documentation {
- info = doc.to_string();
- } else {
- info = "".to_string();
+ if !info.is_empty() {
+ info.push('\n');
+ info.push('\n');
+ }
+ info.push_str(doc.to_string().as_str());
}
VimCompleteItem {
Is there a way of using NeoVim Virtual Text to help with this similar to #664? Maybe full signature arguments or just info for current argument?
Love the way diagnostics popup inline now, it'd be nice to get the signature help going as seamless
I believe echodoc already supports the signature thing. I used that myself and am quite happy.
Floating window is supposed to be merged soon (tomorrow or next week) https://github.com/neovim/neovim/pull/6619, would be nice to have support for preview with it.
The floating window feature is merged :fireworks:
Related tweet: https://twitter.com/Neovim/status/1101879098044043264
any updates on this?
echodoc supports floating window.
echodoc
works fine in many cases. However, if you have an overloaded function, and you go to correct an already written function, it might show you the wrong overload.
Here it shows the help for foo
with 3 parameters, but the code calls foo
with 1 parameter.
Is it possible to give echodoc
information about the overload through LanguageClient#textDocument_signatureHelp
?
signatureHelp
in clangd
isn't perfect either, but somewhat better.
I am trying to work out a good way to display signature help. This includes documentation.
It would be great to display popup information but I can't see any way to do this, probably requires quite some work.
Next best I've come up with is displaying information in the preview window, like what YCM does. I've done a quick hacky implementation of this and it looks okay:
Any other ideas?