You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
helix/helix-lsp/src
Michael Davis e0bb032f0e
LSP: Forcefully shutdown uninitialized servers (#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:
5ceb2238d3/runtime/lua/vim/lsp.lua (L1610-L1628)
1 year ago
..
client.rs Reduce boilerplate by 'use lsp::*' in Client::supports_feature, and remove TODO comment 2 years ago
jsonrpc.rs LSP: Add request ID to request timeout message (#6010) 2 years ago
lib.rs map positions through changes in O(N) 1 year ago
snippet.rs Fix typos (#6643) 2 years ago
transport.rs LSP: Forcefully shutdown uninitialized servers (#7449) 1 year ago