mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Return an lsp error
This commit is contained in:
parent
632b0f2902
commit
d9456c3989
1 changed files with 8 additions and 5 deletions
|
@ -537,13 +537,16 @@ pub fn handle_formatting(
|
||||||
let output = rustfmt.wait_with_output()?;
|
let output = rustfmt.wait_with_output()?;
|
||||||
let captured_stdout = String::from_utf8(output.stdout)?;
|
let captured_stdout = String::from_utf8(output.stdout)?;
|
||||||
if !output.status.success() {
|
if !output.status.success() {
|
||||||
failure::bail!(
|
return Err(LspError::new(
|
||||||
|
gen_lsp_server::ErrorCode::ParseError as i32,
|
||||||
|
format!(
|
||||||
r#"rustfmt exited with:
|
r#"rustfmt exited with:
|
||||||
Status: {}
|
Status: {}
|
||||||
stdout: {}"#,
|
stdout: {}"#,
|
||||||
output.status,
|
output.status, captured_stdout,
|
||||||
captured_stdout,
|
),
|
||||||
);
|
)
|
||||||
|
.into());
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(Some(vec![TextEdit {
|
Ok(Some(vec![TextEdit {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue