Skip to content

Commit d3b804d

Browse files
Error when rustfmt component is unavailable
1 parent d3dfa18 commit d3b804d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

crates/rust-analyzer/src/handlers.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,10 @@ pub(crate) fn handle_formatting(
928928

929929
if !output.status.success() {
930930
match output.status.code() {
931-
Some(1) if !captured_stderr.contains("not installed") => {
931+
Some(1)
932+
if !captured_stderr.contains("not installed")
933+
&& !captured_stderr.contains("not available") =>
934+
{
932935
// While `rustfmt` doesn't have a specific exit code for parse errors this is the
933936
// likely cause exiting with 1. Most Language Servers swallow parse errors on
934937
// formatting because otherwise an error is surfaced to the user on top of the

0 commit comments

Comments
 (0)