1
Fork 0

fix: Swallow rustfmt parsing panics

This commit is contained in:
Lukas Wirth 2024-12-11 10:30:01 +01:00
parent 536eea39e8
commit e6fbb5c8e6

View file

@ -2352,6 +2352,10 @@ fn run_rustfmt(
); );
Ok(None) 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 // Something else happened - e.g. `rustfmt` is missing or caught a signal
Err(LspError::new( Err(LspError::new(