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

No autocomplete

Open Tylerwbrown opened this issue 1 year ago • 2 comments

I'm not getting any autocomplete when I use this plugin, but everything else seems to work (code actions, inline errors, etc.)

vscode has the same functionality but also have autocompletion working.

I see textDocument/completion responses coming through in my log when I type in nvim, so the LSP seems to be receiving requests and responding properly, they're just not showing up in neovim.

Running 0.8.3 nvim

Tylerwbrown avatar Mar 27 '23 02:03 Tylerwbrown

Auto completion should work out-of-the-box with any code-completion engine, refer to https://github.com/neovim/nvim-lspconfig/wiki/Autocompletion

ShinKage avatar Mar 27 '23 08:03 ShinKage

I think this is caused by Idris-LSP's requirement for the buffer to be saved to disk, not idris2-nvim.

It's not that auto-complete isn't working, it's that the LSP reads the data from the file, rather than the buffer, so it doesn't actually have access to what you are typing, and therefor can not suggest anything.

This can be seen with a fairly minimal file

createEmpties : {n : _} -> Vect n (Vect 0 elem_0)
createEmpties = 

if you start typing replicate, it will not give completion suggestions. However, if you type repli, write to disk (:w) and then continue typing, it will give the suggestion.

image image

Being able to handle files not on disk is planned for Idris2-LSP, but not currently present.

SlayerOfTheBad avatar Sep 15 '23 23:09 SlayerOfTheBad