diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index 3f58e3c93..4fc15c796 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs | |||
@@ -537,13 +537,16 @@ pub fn handle_formatting( | |||
537 | let output = rustfmt.wait_with_output()?; | 537 | let output = rustfmt.wait_with_output()?; |
538 | let captured_stdout = String::from_utf8(output.stdout)?; | 538 | let captured_stdout = String::from_utf8(output.stdout)?; |
539 | if !output.status.success() { | 539 | if !output.status.success() { |
540 | failure::bail!( | 540 | return Err(LspError::new( |
541 | r#"rustfmt exited with: | 541 | gen_lsp_server::ErrorCode::ParseError as i32, |
542 | format!( | ||
543 | r#"rustfmt exited with: | ||
542 | Status: {} | 544 | Status: {} |
543 | stdout: {}"#, | 545 | stdout: {}"#, |
544 | output.status, | 546 | output.status, captured_stdout, |
545 | captured_stdout, | 547 | ), |
546 | ); | 548 | ) |
549 | .into()); | ||
547 | } | 550 | } |
548 | 551 | ||
549 | Ok(Some(vec![TextEdit { | 552 | Ok(Some(vec![TextEdit { |