mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-02 19:53:46 +00:00
Return an lsp error
This commit is contained in:
parent
632b0f2902
commit
d9456c3989
@ -537,13 +537,16 @@ pub fn handle_formatting(
|
||||
let output = rustfmt.wait_with_output()?;
|
||||
let captured_stdout = String::from_utf8(output.stdout)?;
|
||||
if !output.status.success() {
|
||||
failure::bail!(
|
||||
r#"rustfmt exited with:
|
||||
return Err(LspError::new(
|
||||
gen_lsp_server::ErrorCode::ParseError as i32,
|
||||
format!(
|
||||
r#"rustfmt exited with:
|
||||
Status: {}
|
||||
stdout: {}"#,
|
||||
output.status,
|
||||
captured_stdout,
|
||||
);
|
||||
output.status, captured_stdout,
|
||||
),
|
||||
)
|
||||
.into());
|
||||
}
|
||||
|
||||
Ok(Some(vec![TextEdit {
|
||||
|
Loading…
Reference in New Issue
Block a user