about summary refs log tree commit diff
path: root/src/tools/rust-analyzer
diff options
context:
space:
mode:
authoryukang <moorekang@gmail.com>2025-04-14 09:33:38 +0800
committeryukang <moorekang@gmail.com>2025-04-14 09:33:38 +0800
commit552020dc62f3eb8308d12ddb6b052fa7e543b254 (patch)
treec0a3f7f3fcfc4fe44bf9cfa423950d4716e2cba6 /src/tools/rust-analyzer
parent121a12edc699b5f50a5ab4924f8db3ab1ce96b75 (diff)
downloadrust-552020dc62f3eb8308d12ddb6b052fa7e543b254.tar.gz
rust-552020dc62f3eb8308d12ddb6b052fa7e543b254.zip
Ignore errors from rustfmt which may trigger error notification
Diffstat (limited to 'src/tools/rust-analyzer')
-rw-r--r--src/tools/rust-analyzer/crates/rust-analyzer/src/handlers/request.rs6
1 files changed, 5 insertions, 1 deletions
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)
             }
             _ => {