Skip to content

Commit a18e38e

Browse files
authored
Merge pull request #18663 from Veykril/push-syoklzkntykn
fix: Swallow rustfmt parsing panics
2 parents 8172088 + e6fbb5c commit a18e38e

File tree

1 file changed

+4
-0
lines changed
  • src/tools/rust-analyzer/crates/rust-analyzer/src/handlers

1 file changed

+4
-0
lines changed

Diff for: src/tools/rust-analyzer/crates/rust-analyzer/src/handlers/request.rs

+4
Original file line numberDiff line numberDiff line change
@@ -2352,6 +2352,10 @@ fn run_rustfmt(
23522352
);
23532353
Ok(None)
23542354
}
2355+
// rustfmt panicked at lexing/parsing the file
2356+
Some(101) if !rustfmt_not_installed && captured_stderr.starts_with("error[") => {
2357+
Ok(None)
2358+
}
23552359
_ => {
23562360
// Something else happened - e.g. `rustfmt` is missing or caught a signal
23572361
Err(LspError::new(

0 commit comments

Comments
 (0)