diff options
Diffstat (limited to 'helix-lsp/src/transport.rs')
-rw-r--r-- | helix-lsp/src/transport.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/helix-lsp/src/transport.rs b/helix-lsp/src/transport.rs index 8aaeae3d..68b3d15e 100644 --- a/helix-lsp/src/transport.rs +++ b/helix-lsp/src/transport.rs @@ -250,6 +250,26 @@ impl Transport { } }; } + Err(Error::StreamClosed) => { + // Hack: inject a terminated notification so we trigger code that needs to happen after exit + use lsp_types::notification::Notification as _; + let notification = + ServerMessage::Call(jsonrpc::Call::Notification(jsonrpc::Notification { + jsonrpc: None, + method: lsp_types::notification::Exit::METHOD.to_string(), + params: jsonrpc::Params::None, + })); + match transport + .process_server_message(&client_tx, notification) + .await + { + Ok(_) => {} + Err(err) => { + error!("err: <- {:?}", err); + } + } + break; + } Err(err) => { error!("err: <- {:?}", err); break; |