Maintain language servers TOML array order in doc.language_servers
This commit is contained in:
parent
ff26208427
commit
073000e54d
1 changed files with 10 additions and 6 deletions
|
@ -1429,14 +1429,18 @@ 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)
|
||||
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
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
pub fn remove_language_server_by_name(&mut self, name: &str) -> Option<Arc<Client>> {
|
||||
|
|
Loading…
Add table
Reference in a new issue