aboutsummaryrefslogtreecommitdiff
path: root/helix-lsp/src
diff options
context:
space:
mode:
authorDavide Galassi2023-03-08 00:34:31 +0000
committerGitHub2023-03-08 00:34:31 +0000
commitf976c004e2efa4cb583b06827b44fef84bf925f5 (patch)
tree1e2b15c6562556648b4e860d0fc8de135c0b3b61 /helix-lsp/src
parent0e5a4e55a497c58f68859edb48fd85854403b866 (diff)
Allow LSP server to be stopped (#5964)
Diffstat (limited to 'helix-lsp/src')
-rw-r--r--helix-lsp/src/lib.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/helix-lsp/src/lib.rs b/helix-lsp/src/lib.rs
index 341d4a54..ca9d17ac 100644
--- a/helix-lsp/src/lib.rs
+++ b/helix-lsp/src/lib.rs
@@ -476,6 +476,16 @@ impl Registry {
}
}
+ pub fn stop(&mut self, language_config: &LanguageConfiguration) {
+ let scope = language_config.scope.clone();
+
+ if let Some((_, client)) = self.inner.remove(&scope) {
+ tokio::spawn(async move {
+ let _ = client.force_shutdown().await;
+ });
+ }
+ }
+
pub fn get(
&mut self,
language_config: &LanguageConfiguration,