on master help sign in
[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

commitb9ff5d0e0a8a0cc17082dede2f662eb35c7a5815 authorAlexis Kalabura <55039048+axdank@users.noreply.github.com> dateMon 3 Oct 2022, 11:54 (4 years ago) parentc144cc0
1 file changed+5−1
helix-lsp/src/lib.rs+5−1
helix-lsp/src/lib.rs+5−1
@@ -370,7 +370,11 @@ impl Registry {
370370 let NewClientResult(client, incoming) = start_client(id, language_config, config)?;
371371 self.incoming.push(UnboundedReceiverStream::new(incoming));
372372
373− entry.insert((id, client.clone()));
373+ let (_, old_client) = entry.insert((id, client.clone()));
374+
375+ tokio::spawn(async move {
376+ let _ = old_client.force_shutdown().await;
377+ });
374378
375379 Ok(Some(client))
376380 }