Skip to content

Commit

Permalink
[lsp-restart]: call the force_shutdown method for the old_client (hel…
Browse files Browse the repository at this point in the history
…ix-editor#3972)

* [lsp-restart]: call the shutdown_and_exit method for the old_client

* change shutdown_and_exit to force_shutdown

* remove extra log
  • Loading branch information
axdank authored and Shekhinah Memmel committed Dec 11, 2022
1 parent 2c19076 commit da6959a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion helix-lsp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down

0 comments on commit da6959a

Please sign in to comment.