Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LSP: Forcefully shutdown uninitialized servers (helix-editor#7449)
The LSP spec has this to say about initialize: > Until the server has responded to the `initialize` request with an > `InitializeResult`, the client must not send any additional requests > or notifications to the server. (https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initialize) The spec is not really explicit about how to handle this scenario. Before a client sends the 'initialize' request we are allowed to send an 'exit' notification, but after 'initialize' we can't send any requests (like shutdown) or notifications (like exit). So my intepretation is that we should forcefully close the server in this state. This matches the behavior of Neovim's built-in LSP client: https://github.com/neovim/neovim/blob/5ceb2238d3685255cd517ca87fd7edae9ed88811/runtime/lua/vim/lsp.lua#L1610-L1628
- Loading branch information