aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDJMcNab <[email protected]>2019-01-26 20:43:51 +0000
committerDJMcNab <[email protected]>2019-01-26 20:43:51 +0000
commitd9456c3989bf1988e266b22e76a995b20eae7ae4 (patch)
tree4fd99b0007474bb34471aab97cf125a20691db65
parent632b0f290232913ef9950ee46917d5c195193102 (diff)
Return an lsp error
-rw-r--r--crates/ra_lsp_server/src/main_loop/handlers.rs13
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 {