Skip to content

Commit 45be9c2

Browse files
authored
Merge pull request rust-lang#19576 from chenyukang/yukang-fix-rustfmt-error
Ignore errors from rustfmt which may trigger error notification
2 parents 121a12e + 552020d commit 45be9c2

File tree

1 file changed

+5
-1
lines changed
  • src/tools/rust-analyzer/crates/rust-analyzer/src/handlers

1 file changed

+5
-1
lines changed

src/tools/rust-analyzer/crates/rust-analyzer/src/handlers/request.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2418,7 +2418,11 @@ fn run_rustfmt(
24182418
Ok(None)
24192419
}
24202420
// rustfmt panicked at lexing/parsing the file
2421-
Some(101) if !rustfmt_not_installed && captured_stderr.starts_with("error[") => {
2421+
Some(101)
2422+
if !rustfmt_not_installed
2423+
&& (captured_stderr.starts_with("error[")
2424+
|| captured_stderr.starts_with("error:")) =>
2425+
{
24222426
Ok(None)
24232427
}
24242428
_ => {

0 commit comments

Comments
 (0)