Log which language servers will be started (#10936)

This PR adds a new log message indicating which language servers will be
started for a given language.

The aim is to make debugging the usage of the new `language_servers`
setting (#10911) easier.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-04-24 11:22:42 -04:00 committed by GitHub
parent e1791b7dd0
commit 76ff467965
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3068,12 +3068,21 @@ impl Project {
let enabled_language_servers =
settings.customized_language_servers(&available_language_servers);
let enabled_lsp_adapters = available_lsp_adapters
.into_iter()
.filter(|adapter| enabled_language_servers.contains(&adapter.name))
.collect::<Vec<_>>();
for adapter in available_lsp_adapters {
if !enabled_language_servers.contains(&adapter.name) {
continue;
}
log::info!(
"starting language servers for {language}: {adapters}",
language = language.name(),
adapters = enabled_lsp_adapters
.iter()
.map(|adapter| adapter.name.0.as_ref())
.join(", ")
);
for adapter in enabled_lsp_adapters {
self.start_language_server(worktree, adapter.clone(), language.clone(), cx);
}
}