diff options
author | Davide Galassi | 2023-03-08 00:34:31 +0000 |
---|---|---|
committer | GitHub | 2023-03-08 00:34:31 +0000 |
commit | f976c004e2efa4cb583b06827b44fef84bf925f5 (patch) | |
tree | 1e2b15c6562556648b4e860d0fc8de135c0b3b61 /helix-lsp | |
parent | 0e5a4e55a497c58f68859edb48fd85854403b866 (diff) |
Allow LSP server to be stopped (#5964)
Diffstat (limited to 'helix-lsp')
-rw-r--r-- | helix-lsp/src/lib.rs | 10 |
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, |