mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Made error output the contents of Cargo's stderr as well.
This commit is contained in:
parent
8e5c57f050
commit
ca9718aa42
1 changed files with 3 additions and 3 deletions
|
@ -2,7 +2,7 @@
|
||||||
//! another compatible command (f.x. clippy) in a background thread and provide
|
//! another compatible command (f.x. clippy) in a background thread and provide
|
||||||
//! LSP diagnostics based on the output of the command.
|
//! LSP diagnostics based on the output of the command.
|
||||||
|
|
||||||
use std::{fmt, io, process::Command, time::Duration};
|
use std::{fmt, io, process::Command, time::Duration, str::from_utf8};
|
||||||
|
|
||||||
use crossbeam_channel::{never, select, unbounded, Receiver, Sender};
|
use crossbeam_channel::{never, select, unbounded, Receiver, Sender};
|
||||||
use paths::AbsPathBuf;
|
use paths::AbsPathBuf;
|
||||||
|
@ -329,8 +329,8 @@ impl CargoActor {
|
||||||
Ok(output) if output.status.success() => Ok(()),
|
Ok(output) if output.status.success() => Ok(()),
|
||||||
Ok(output) => {
|
Ok(output) => {
|
||||||
Err(io::Error::new(io::ErrorKind::Other, format!(
|
Err(io::Error::new(io::ErrorKind::Other, format!(
|
||||||
"Cargo watcher failed, the command produced no valid metadata (exit code: {:?})\nMake sure you have `cargo clippy` installed and updated.",
|
"Cargo watcher failed, the command produced no valid metadata (exit code: {:?})\nCargo's stderr output:\n{}",
|
||||||
output.status
|
output.status, from_utf8(&output.stderr).unwrap_or("(Error: Could not fetch Cargo's stderr output)")
|
||||||
)))
|
)))
|
||||||
}
|
}
|
||||||
Err(e) => Err(io::Error::new(e.kind(), format!("{:?}: {}", e, error))),
|
Err(e) => Err(io::Error::new(e.kind(), format!("{:?}: {}", e, error))),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue