aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src
diff options
context:
space:
mode:
authorPhilipp Mildenberger2023-03-20 17:04:02 +0000
committerPhilipp Mildenberger2023-05-18 19:58:17 +0000
commit073000e54d862ef542387868c897d4f847fbe18a (patch)
treedf6e70d984d89022a114504b7f6d5af8195fbc6b /helix-view/src
parentff262084271492bba239dbc2e5788be3c4d5a4e5 (diff)
Maintain language servers TOML array order in `doc.language_servers`
Diffstat (limited to 'helix-view/src')
-rw-r--r--helix-view/src/document.rs16
1 files changed, 10 insertions, 6 deletions
diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs
index f2f373aa..bd3c465d 100644
--- a/helix-view/src/document.rs
+++ b/helix-view/src/document.rs
@@ -1429,13 +1429,17 @@ impl Document {
self.version
}
+ /// maintains the order as configured in the language_servers TOML array
pub fn language_servers(&self) -> impl Iterator<Item = &helix_lsp::Client> {
- self.language_servers.values().filter_map(|l| {
- if l.is_initialized() {
- Some(&**l)
- } else {
- None
- }
+ self.language_config().into_iter().flat_map(move |config| {
+ config.language_servers.iter().filter_map(move |features| {
+ let ls = &**self.language_servers.get(&features.name)?;
+ if ls.is_initialized() {
+ Some(ls)
+ } else {
+ None
+ }
+ })
})
}