project: Reorder LSP Adapters within LanguageRegistry (#23528)

Closes #ISSUE

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-01-23 13:03:37 +01:00 committed by GitHub
parent 11bb906520
commit 828b5ab975
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -286,6 +286,20 @@ impl LanguageServerTree {
))
})
.collect::<IndexMap<_, _>>();
// After starting all the language servers, reorder them to reflect the desired order
// based on the settings.
//
// This is done, in part, to ensure that language servers loaded at different points
// (e.g., native vs extension) still end up in the right order at the end, rather than
// it being based on which language server happened to be loaded in first.
self.languages.reorder_language_servers(
&language_name,
adapters_with_settings
.keys()
.map(|wrapper| wrapper.0.clone())
.collect(),
);
adapters_with_settings
}