Unnamed repository; edit this file 'description' to name the repository.
Merge pull request #18663 from Veykril/push-syoklzkntykn
fix: Swallow rustfmt parsing panics
Lukas Wirth 2024-12-11
parent b248e53 · parent 8963e97 · commit e7a4c99
-rw-r--r--crates/rust-analyzer/src/handlers/request.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/rust-analyzer/src/handlers/request.rs b/crates/rust-analyzer/src/handlers/request.rs
index e51b14f611..fa78be5cb6 100644
--- a/crates/rust-analyzer/src/handlers/request.rs
+++ b/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(