aboutsummaryrefslogtreecommitdiff
path: root/crates/rust-analyzer/src/handlers.rs
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2021-04-04 23:33:11 +0100
committerJonas Schievink <[email protected]>2021-04-04 23:33:11 +0100
commitd3b804d11d554e6d4e4ccbad92add86e093b4bdb (patch)
treeafb5fd141bf9525f029cacb99a9fbb7225921daf /crates/rust-analyzer/src/handlers.rs
parentd3dfa18071cdccd2757db7eeff2ffec21b25ffd4 (diff)
Error when `rustfmt` component is unavailable
Diffstat (limited to 'crates/rust-analyzer/src/handlers.rs')
-rw-r--r--crates/rust-analyzer/src/handlers.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/rust-analyzer/src/handlers.rs b/crates/rust-analyzer/src/handlers.rs
index 53d29ddfc..e8f9f2179 100644
--- a/crates/rust-analyzer/src/handlers.rs
+++ b/crates/rust-analyzer/src/handlers.rs
@@ -928,7 +928,10 @@ pub(crate) fn handle_formatting(
928 928
929 if !output.status.success() { 929 if !output.status.success() {
930 match output.status.code() { 930 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 {
932 // While `rustfmt` doesn't have a specific exit code for parse errors this is the 935 // While `rustfmt` doesn't have a specific exit code for parse errors this is the
933 // likely cause exiting with 1. Most Language Servers swallow parse errors on 936 // likely cause exiting with 1. Most Language Servers swallow parse errors on
934 // formatting because otherwise an error is surfaced to the user on top of the 937 // formatting because otherwise an error is surfaced to the user on top of the