Open mqudsi opened 3 years ago
Yep, I could reproduce. Just a minor correction though, the server is not crashing, it just isn't replying. If you wait long enough (60 seconds) the request will time out and it will recover. But indeed, the client is looping here https://github.com/autozimu/LanguageClient-neovim/blob/4037b1d872f3e65384ceb92c25bf19cac449b803/autoload/LanguageClient.vim#L1106.
I'm looking into this to see if we can get rid of that runSync call and invoke completion in a more async way
@mqudsi I think #1170 should do the trick, I'll give it a try in the next few days and if everything works as expected we can merge that into dev.
Thanks, removing that blocking call would indeed be a welcome change. I'll test that branch myself locally as well today, if I get the chance.
Just a note that I have never witnessed neovim return to a usable state after an LS hang, even after waiting well past the specified sixty seconds (which imho is already too generous).
:checkhealth LanguageClient
? yesDescribe the bug
Due to an upstream
rust-analyzer
bug, the language server was crashing in the middle of a call. Here is the LC log reporting the LSP output and confirming the abort:Of course, that isn't LanguageClient's problem at all. The problem is that this ultimately causes Neovim itself to hang, completely unresponsive (
killall -9 languageclient
does not help).I have LC installed and integrated into neovim via ncm2, and the completion was triggered by
<c-x><c-o>
. Attaching a debugger to neovim reveals that is hanging waiting on libuv to return from anepoll
call, after a call toLanguageClient_runSync(...)
:Environment
neovim/vim version (
nvim --version
orvim --version
): NVIM v0.5.0-dev+918-g4383c0f95This plugin version (
git rev-parse --short HEAD
): 4037b1d872f3e65384ceb92c25bf19cac449b803This plugin's binary version (
bin/languageclient --version
): 0.1.160Minimal vimrc content (A minimal vimrc is the smallest vimrc that could reproduce the issue. Refer to an example [here][min-vimrc.vim]): n/a, dependent on upstream bug
Language server link and version: rust-analyzer 277488b
To Reproduce
Try completing rust code that triggers a panic in rust-analyzer:
Current behavior
rust-analyzer crashes and neovim hangs.
Expected behavior
Neovim should not hang.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.