Skip to content

Commit

Permalink
[lsp-restart]: call the force_shutdown method for the old_client (#3972)
Browse files Browse the repository at this point in the history
* [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 Oct 3, 2022
1 parent c144cc0 commit b9ff5d0
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 b9ff5d0

Please sign in to comment.