Unnamed repository; edit this file 'description' to name the repository.
[lsp-restart]: call the force_shutdown method for the old_client (#3972)
* [lsp-restart]: call the shutdown_and_exit method for the old_client * change shutdown_and_exit to force_shutdown * remove extra log
Alexis Kalabura 2022-10-03
parent c144cc0 · commit b9ff5d0
-rw-r--r--helix-lsp/src/lib.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/helix-lsp/src/lib.rs b/helix-lsp/src/lib.rs
index 0717fc04..98300a62 100644
--- a/helix-lsp/src/lib.rs
+++ b/helix-lsp/src/lib.rs
@@ -370,7 +370,11 @@ impl Registry {
let NewClientResult(client, incoming) = start_client(id, language_config, config)?;
self.incoming.push(UnboundedReceiverStream::new(incoming));
- entry.insert((id, client.clone()));
+ let (_, old_client) = entry.insert((id, client.clone()));
+
+ tokio::spawn(async move {
+ let _ = old_client.force_shutdown().await;
+ });
Ok(Some(client))
}