about summary refs log tree commit diff
path: root/src/tools/rust-analyzer
diff options
context:
space:
mode:
authorLukas Wirth <lukastw97@gmail.com>2024-12-11 10:06:28 +0000
committerGitHub <noreply@github.com>2024-12-11 10:06:28 +0000
commita18e38e6e23255e095dd3be763e7fa29bc5d4cbe (patch)
tree77070deba41bd94def05b508025790e0b25b4fe7 /src/tools/rust-analyzer
parent81720881ae5a859b61f3801b7d6cb6fd196df9b2 (diff)
parente6fbb5c8e6fe33d9922d7b80bf07a0ff7f0d3f89 (diff)
downloadrust-a18e38e6e23255e095dd3be763e7fa29bc5d4cbe.tar.gz
rust-a18e38e6e23255e095dd3be763e7fa29bc5d4cbe.zip
Merge pull request #18663 from Veykril/push-syoklzkntykn
fix: Swallow rustfmt parsing panics
Diffstat (limited to 'src/tools/rust-analyzer')
-rw-r--r--src/tools/rust-analyzer/crates/rust-analyzer/src/handlers/request.rs4
1 files changed, 4 insertions, 0 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 e51b14f6118..fa78be5cb60 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
@@ -2352,6 +2352,10 @@ fn run_rustfmt(
                 );
                 Ok(None)
             }
+            // rustfmt panicked at lexing/parsing the file
+            Some(101) if !rustfmt_not_installed && captured_stderr.starts_with("error[") => {
+                Ok(None)
+            }
             _ => {
                 // Something else happened - e.g. `rustfmt` is missing or caught a signal
                 Err(LspError::new(