diff options
author | Philipp Mildenberger | 2023-04-02 18:05:26 +0000 |
---|---|---|
committer | Philipp Mildenberger | 2023-05-18 19:58:17 +0000 |
commit | 3e4bac1d964cc29939b396a7e1e9ebd7feda5e0a (patch) | |
tree | d3c244987de564ebe913891d9abfcbeceee21c07 /helix-lsp | |
parent | 2a21b939c432e4b5a186df780a1e97d20ff53120 (diff) |
Fix lsp_restart across multiple different document scopes (language servers weren't restarted, if not of the same scope id), and fix some smaller rebase issues
Diffstat (limited to 'helix-lsp')
-rw-r--r-- | helix-lsp/src/lib.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/helix-lsp/src/lib.rs b/helix-lsp/src/lib.rs index 6b4bb430..3fd9c2bf 100644 --- a/helix-lsp/src/lib.rs +++ b/helix-lsp/src/lib.rs @@ -691,7 +691,6 @@ impl Registry { .language_servers .iter() .filter_map(|LanguageServerFeatures { name, .. }| { - // #[allow(clippy::map_entry)] if self.inner.contains_key(name) { let client = match self.start_client( name.clone(), @@ -708,7 +707,7 @@ impl Registry { .insert(name.clone(), vec![client.clone()]) .unwrap(); - // TODO what if there are different language servers for different workspaces, + // TODO what if there are multiple instances for different workspaces? // I think the language servers will be stopped without being restarted, which is not intended for old_client in old_clients { tokio::spawn(async move { @@ -745,15 +744,12 @@ impl Registry { .language_servers .iter() .map(|LanguageServerFeatures { name, .. }| { - if let Some(clients) = self.inner.get_mut(name) { - // clients.find( - - if let Some((_, client)) = clients.iter_mut().enumerate().find(|(i, client)| { + if let Some(clients) = self.inner.get(name) { + if let Some((_, client)) = clients.iter().enumerate().find(|(i, client)| { client.try_add_doc(&language_config.roots, root_dirs, doc_path, *i == 0) }) { return Ok((name.to_owned(), client.clone())); } - // return Ok((name.clone(), clients.clone())); } let client = self.start_client( name.clone(), |