mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-25 02:46:17 +04:00
Maintain language servers TOML array order in doc.language_servers
This commit is contained in:
parent
ff26208427
commit
073000e54d
@ -1429,13 +1429,17 @@ pub fn version(&self) -> i32 {
|
|||||||
self.version
|
self.version
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// maintains the order as configured in the language_servers TOML array
|
||||||
pub fn language_servers(&self) -> impl Iterator<Item = &helix_lsp::Client> {
|
pub fn language_servers(&self) -> impl Iterator<Item = &helix_lsp::Client> {
|
||||||
self.language_servers.values().filter_map(|l| {
|
self.language_config().into_iter().flat_map(move |config| {
|
||||||
if l.is_initialized() {
|
config.language_servers.iter().filter_map(move |features| {
|
||||||
Some(&**l)
|
let ls = &**self.language_servers.get(&features.name)?;
|
||||||
} else {
|
if ls.is_initialized() {
|
||||||
None
|
Some(ls)
|
||||||
}
|
} else {
|
||||||
|
None
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user