Autocomplete only works after a file save
haringsrob opened this issue · 9 comments
Please not that this is specific to using neovim. For what it looks like I can only get autocomplete results after saving.
I have attached a small video to illustratie the behaviour:
neovim:
https://user-images.githubusercontent.com/866743/188264566-6aac848a-600a-4d4d-bb3d-70e2134a85f0.mov
vscode:
https://user-images.githubusercontent.com/866743/188264603-d3a1b5f4-ac68-4036-9903-b7724b2910c4.mov
as mentioned, this might be a client issue. However, with other lsp's I do not have that issue.
I will investigate a bit more with another editor to see if I can reproduce on or the other's behaviour in order to pinpoint the issue.
Tried this as well with https://github.com/neoclide/coc.nvim which seems to work fine. So this will be something with nvim's built-in language server client.
This could just be a flaw in the rpc implementation in neovim itself at this point as it is "bleeding edge", we can leave this open to retest it once there is stdio.
If you encounter that some feature works only after save, that means the server side document content is out of sync. Save fixes the problem as the server drops caches and rereads the file from disk.
There could be two reason for that:
- Not all
didChange
notifications arrive to the server. That's most likely the client's fault. - An unhandled exception occurred during
didChange
processing. The IDEA log should show some traces in this case.
Did the log have anything useful?
Hey @serganch,
Have had a few full time working days with this now and mostly everything works flawless.
Since I moved no nvim-coc I have not had issue with missing autocompletes. It seems that the rpc implementation in nvim is not finished yet. I look forward to trying it out with stdio as I know that implementation is stable.
I did find some other issues:
- it seems that
$
is somehow being left out on performing autocomplete inserts. This might be an escaping issue? - Sometimes the autocomplete insert of existing text, seems to malform the document slightly.
Overall, great experience for me as I can finally have my "own" editor, with the power of jetbrains editors.
Hi @haringsrob,
Thank you for the good news.
I'm working on stdio right now. I hope it will be ready on the next week.
As for the issues, we didn't have them on our side. Are they stable? Could you please provide the steps to reproduce
Hey @serganch,
Nice! I will retest it with stdio and make video's if then still reproducable.
@haringsrob hi again.
I've added the STDIO mode and updated the docs. It seems to work fine with VSCode. Please check it out.
Hey @serganch,
gave it a try, but I am getting [coc.nvim]: Uncaught exception: Header must provide a Content-Length property.
If I use another lsp client (the native one) it has the same behavior of not showing autocomplete until it saves.
Tcp one still works fine with coc.nvim.
Hey @serganch after tinkering a lot with settings I think it all works (over stdio) with core neovim.
There are still some oddities that I cannot figure out yet, but I will investigate more.
Thanks a lot, stdio is great as I do not have to remember to open the lsp server first.