summaryrefslogtreecommitdiff
path: root/helix-view
diff options
context:
space:
mode:
authorPhilipp Mildenberger2023-03-19 18:26:39 +0000
committerPhilipp Mildenberger2023-05-18 19:48:32 +0000
commit58c913ce4567a95c52808d78245eb1dac806971c (patch)
tree17cd34fb69639a01337e800a1273db53bdcec717 /helix-view
parent7d20740b5b2e115e3075251204ee1ff1901166df (diff)
Simplify 'lsp_stop' command
Diffstat (limited to 'helix-view')
-rw-r--r--helix-view/src/document.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs
index 3fd271eb..49eb13a0 100644
--- a/helix-view/src/document.rs
+++ b/helix-view/src/document.rs
@@ -1442,6 +1442,13 @@ impl Document {
.filter_map(|l| if l.is_initialized() { Some(&**l) } else { None })
}
+ pub fn remove_language_server_by_name(&mut self, name: &str) -> Option<Arc<Client>> {
+ match self.language_servers.iter().position(|l| l.name() == name) {
+ Some(index) => Some(self.language_servers.remove(index)),
+ None => None,
+ }
+ }
+
// TODO filter also based on LSP capabilities?
pub fn language_servers_with_feature(
&self,