From 552020dc62f3eb8308d12ddb6b052fa7e543b254 Mon Sep 17 00:00:00 2001 From: yukang Date: Mon, 14 Apr 2025 09:33:38 +0800 Subject: Ignore errors from rustfmt which may trigger error notification --- .../rust-analyzer/crates/rust-analyzer/src/handlers/request.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/tools/rust-analyzer') diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/handlers/request.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/handlers/request.rs index 27114fef87e..dd41991a913 100644 --- a/src/tools/rust-analyzer/crates/rust-analyzer/src/handlers/request.rs +++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/handlers/request.rs @@ -2418,7 +2418,11 @@ fn run_rustfmt( Ok(None) } // rustfmt panicked at lexing/parsing the file - Some(101) if !rustfmt_not_installed && captured_stderr.starts_with("error[") => { + Some(101) + if !rustfmt_not_installed + && (captured_stderr.starts_with("error[") + || captured_stderr.starts_with("error:")) => + { Ok(None) } _ => { -- cgit 1.4.1-3-g733a5