vscode-like suggestions in neovim

391 views Asked by At

I switched from vscode to neovim and am writing my own nvim config

Recently I realized that I'm missing suggestions in brackets looking like this:

enter image description here

I am using nvim-cmp and having troubles with looking the function's docsenter image description here

Could you help me please? Sorry for my poor english...

I want to see pop-up menu with arguments of function (or just documentation) while I am typing args

Now I configured nvim-cmp like this: enter image description here

2

There are 2 answers

0
Roy Crippen On

If I understand your problem correctly, you are able to see the documentation until you confirm a completion. After you confirm the completion your cursor looks like print(|) and the documentation popup goes away. Here's a link to the repo for a signature help source for nvim-cmp made by the developer of nvim-cmp. Add that plugin with your package manager of choice and add { name = 'nvim_lsp_signature_help' } to your list of sources in your nvim-cmp configuration:

require'cmp'.setup {
... other settings ...
  sources = {
    ... other sources ...
    { name = 'nvim_lsp_signature_help' },
  },
}
0
barrydevp On

I think you want something like lsp_signature.nvim or you could use my own signature parameter hints signature.lua. It's minimal and I try to mimic the behaviour of triggering as vscode does. https://asciinema.org/a/xmAxDSfIKSYJQ3hEISmScA4Ym