autozimu / LanguageClient-neovim

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

exit() triggers resumeOnCrash #1206

Closed ryan0270 closed 3 years ago

ryan0270 commented 3 years ago

Describe the bug

When I explicitly call LanguageClient#exit() with a file open, there's a message saying [LC] Server crashed, restarting client. If I set let g:LanguageClient_restartOnCrash = 0 this no longer happens.

Environment

To Reproduce

Steps to reproduce the behavior:

Current behavior

Message appears saying LC has crashed and is being restarted.

Expected behavior

Explicitly choosing to exit LC should not trigger a restart.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

martskins commented 3 years ago

That is expected, an exit call without a previous shutdown call will exit with code 1, as per the specification:

A notification to ask the server to exit its process. The server should exit with success code 0 if the shutdown request has been received before; otherwise with error code 1.

If you want to stop the server gracefully you can run the command :LanguageClientStop, which will call LanguageClient#shutdown() and will not trigger the restart.

martskins commented 3 years ago

Closing this for lack of response, but feel free to re-open if you think this doesn't solve your issue.