diff options
| author | Lukas Wirth <lukastw97@gmail.com> | 2024-12-11 10:30:01 +0100 |
|---|---|---|
| committer | Lukas Wirth <lukastw97@gmail.com> | 2024-12-11 10:52:04 +0100 |
| commit | e6fbb5c8e6fe33d9922d7b80bf07a0ff7f0d3f89 (patch) | |
| tree | f7c78ac461ce87cb13d22c93be617cc914523a32 | |
| parent | 536eea39e8a495be83efd76129b3ce4e79da70ef (diff) | |
| download | rust-e6fbb5c8e6fe33d9922d7b80bf07a0ff7f0d3f89.tar.gz rust-e6fbb5c8e6fe33d9922d7b80bf07a0ff7f0d3f89.zip | |
fix: Swallow rustfmt parsing panics
| -rw-r--r-- | src/tools/rust-analyzer/crates/rust-analyzer/src/handlers/request.rs | 4 |
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( |
