completion-nvim icon indicating copy to clipboard operation
completion-nvim copied to clipboard

completion-nvim works poorly with rust_analyzer because complete suggestions is missing ()

Open JonasRSV opened this issue 5 years ago • 2 comments

The problem is that onHover documentation is not working great using completion-nvim for rust-analyzer

fn main() {
    println!("Hello, world!");

    let a : Result<String, String> = Ok(String::from("hi"));
    a.
}

a. will suggest completions such as

a.unwrap
a.ok
a.eq

But it should suggest

a.unwrap(..)
a.ok(..)
a.eq(..)

The problem is that when it does the first suggestion nvim-lsp incorrectly fetched the documentation so that the on-hover information becomes wrong.

Using completion-nvim the onhover documentation is just an empty "()" while using coc-nvim you get

img

So I believe if completion-nvim also suggested the actual calls then the preview information would be correct. This feature would let me make the switch from CoC.

While if I add the () manually then the nvim builtin lsp returns the correct information when doing onHover. It would be nice if this information was showing when tabbing between completions :)

JonasRSV avatar Dec 14 '20 12:12 JonasRSV

Have you tried to add snippet support ? You can try to add textDocument.completion.completionItem.snippetSupport = true to your LSP capabilities config. It's still a bit buggy though, sometimes it works and sometimes it doesn't

etrnal70 avatar Dec 14 '20 23:12 etrnal70

This is not snippets tho 🤔 I have the same issue here, it just doesn't show the hover popup while completing, ever. Would be great if this could be fixed

elkowar avatar Apr 18 '21 10:04 elkowar