From b9ff5d0e0a8a0cc17082dede2f662eb35c7a5815 Mon Sep 17 00:00:00 2001 From: Alexis Kalabura <55039048+axdank@users.noreply.github.com> Date: Mon, 3 Oct 2022 11:54:46 -0300 Subject: [PATCH] [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 --- helix-lsp/src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)) }