From 76ff4679651d3190f1df1e9510befb0b0f4805fd Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Wed, 24 Apr 2024 11:22:42 -0400 Subject: [PATCH] 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 --- crates/project/src/project.rs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/crates/project/src/project.rs b/crates/project/src/project.rs index 019fca5ca2..9bbcce6f6f 100644 --- a/crates/project/src/project.rs +++ b/crates/project/src/project.rs @@ -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::>(); - 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); } }