autozimu / LanguageClient-neovim

Language Server Protocol (LSP) support for vim and neovim.
MIT License
3.55k stars 273 forks source link

`Error detected while processing - not an open channel` if server dies #1239

Open OJFord opened 2 years ago

OJFord commented 2 years ago

Describe the bug

Any LanguageClient command (including LanguageClientStop & LanguageClientStart) fails with an error like:

Error detected while processing function LanguageClient#startServer[6]..LanguageClient#Call[22]..LanguageClient#Write: line 11: E906: Not an open channel

If the (STDIO only?) langauge server exits outside of it's control.

Environment

To Reproduce

Current behavior

Error detected while processing function LanguageClient#startServer[6]..LanguageClient#Call[22]..LanguageClient#Write: line 11: E906: Not an open channel

Expected behavior

Good: LanguageClientStop shouldn't care IMO, should just close down itself & if server already down that's no problem; LanguageClientStart should start it again if not already running.

Better: Automatically restart on any command; only error if it fails to start up again?

Screenshots

Additional context

I've perhaps most often hit this with VLS (Vue) spinning it's wheels and making vim hang entirely; short of killing the vim instance all I can do is kill the language server and live with the broken languageclient. (Because it's unresponsive, so I can't LanguageClientStop.) Though it has also happened where the server has just died for whatever other reason that wasn't me killing it.