From 9f9575d100416710e0988f46c8117faf3537f0b7 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Fri, 7 Nov 2025 19:43:43 +0100 Subject: [PATCH] Silence rust-analyzer startup errors (#42222) When rust-analyzer is still loading the cargo project it tends to error out on most lsp requests with `content modified`. This pollutes our logs. Release Notes: - N/A *or* Added/Fixed/Improved ... --- crates/project/src/lsp_store.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/project/src/lsp_store.rs b/crates/project/src/lsp_store.rs index a6d267b0f9f3dc7c3f22f5466ac19fea98cd0bdd..379fafd211d69f5c925f37f0b30f2edff682cdc0 100644 --- a/crates/project/src/lsp_store.rs +++ b/crates/project/src/lsp_store.rs @@ -2035,7 +2035,7 @@ impl LocalLspStore { cx: &mut AsyncApp, ) -> Result, Arc)>> { let logger = zlog::scoped!("lsp_format"); - zlog::info!(logger => "Formatting via LSP"); + zlog::debug!(logger => "Formatting via LSP"); let uri = file_path_to_lsp_url(abs_path)?; let text_document = lsp::TextDocumentIdentifier::new(uri); @@ -8432,6 +8432,8 @@ impl LspStore { while let Some((server_id, response_result)) = response_results.next().await { match response_result { Ok(response) => responses.push((server_id, response)), + // rust-analyzer likes to error with this when its still loading up + Err(e) if e.to_string().ends_with("content modified") => (), Err(e) => log::error!("Error handling response for request {request:?}: {e:#}"), } } @@ -12425,6 +12427,8 @@ impl LspStore { let mut responses = Vec::new(); match server_task.await { Ok(response) => responses.push((server_id, response)), + // rust-analyzer likes to error with this when its still loading up + Err(e) if e.to_string().ends_with("content modified") => (), Err(e) => log::error!( "Error handling response for request {request:?}: {e:#}" ),