diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-08-11 10:15:46 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-11 10:15:46 +0000 |
| commit | 61ee051455fdfd64ceca21960c5480be3b97fbf0 (patch) | |
| tree | d71cafb9758e87c961ed0e4c78f7092bdd239e77 | |
| parent | c1a5257b6d0a0eacdf5822f65783fb6e1c54bbb1 (diff) | |
| parent | 4f386afb16297f588484ff24e2b4693218893a94 (diff) | |
| download | rust-61ee051455fdfd64ceca21960c5480be3b97fbf0.tar.gz rust-61ee051455fdfd64ceca21960c5480be3b97fbf0.zip | |
Merge #5705
5705: Log the command flycheck runs to debug misconfigurations r=jonas-schievink a=Veetaha Without this users have no clue why flycheck fails to run. This is what is printed to the output channel: ``` [ERROR rust_analyzer::main_loop] cargo check failed: Cargo watcher failed,the command produced no valid metadata (exit code: ExitStatus(ExitStatus(25856))) ``` I stumbled with this figuring out that rust-analyzer adds `--all-features` which is not intended for some crates in the workspace (i.e. they have mutually-exclusive features). Having the command rust-analyzer ran should help a lot Co-authored-by: Veetaha <veetaha2@gmail.com>
| -rw-r--r-- | crates/flycheck/src/lib.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/crates/flycheck/src/lib.rs b/crates/flycheck/src/lib.rs index 7c38f5ef9d5..31e14246de8 100644 --- a/crates/flycheck/src/lib.rs +++ b/crates/flycheck/src/lib.rs @@ -1,4 +1,4 @@ -//! cargo_check provides the functionality needed to run `cargo check` or +//! Flycheck provides the functionality needed to run `cargo check` or //! another compatible command (f.x. clippy) in a background thread and provide //! LSP diagnostics based on the output of the command. @@ -147,6 +147,12 @@ impl FlycheckActor { // avoid busy-waiting. let cargo_handle = self.cargo_handle.take().unwrap(); let res = cargo_handle.join(); + if res.is_err() { + log::error!( + "Flycheck failed to run the following command: {:?}", + self.check_command() + ) + } self.send(Message::Progress(Progress::DidFinish(res))); } Event::CheckEvent(Some(message)) => match message { @@ -253,7 +259,7 @@ impl CargoHandle { return Err(io::Error::new( io::ErrorKind::Other, format!( - "Cargo watcher failed,the command produced no valid metadata (exit code: {:?})", + "Cargo watcher failed, the command produced no valid metadata (exit code: {:?})", exit_status ), )); |
