diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs index f2f373aac..bd3c465d4 100644 --- a/helix-view/src/document.rs +++ b/helix-view/src/document.rs @@ -1429,13 +1429,17 @@ pub fn version(&self) -> i32 { self.version } + /// maintains the order as configured in the language_servers TOML array pub fn language_servers(&self) -> impl Iterator { - 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 + } + }) }) }