Skip to content

Commit

Permalink
fix: Swallow rustfmt parsing panics
Browse files Browse the repository at this point in the history
  • Loading branch information
Veykril committed Dec 11, 2024
1 parent 41f3319 commit 8963e97
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/rust-analyzer/src/handlers/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 8963e97

Please sign in to comment.