Skip to content

Commit

Permalink
Auto merge of #17033 - ShoyuVanilla:flyck-log, r=Veykril
Browse files Browse the repository at this point in the history
Log flycheck errors

Resolves #16969

The non-cargo messages are appended to the error strings here;

https://github.com/rust-lang/rust-analyzer/blob/7a8374c162c64c17e865b98aad282d16b16e96d6/crates/flycheck/src/lib.rs#L460-L482

that one is formatted into `Err` here;

https://github.com/rust-lang/rust-analyzer/blob/7a8374c162c64c17e865b98aad282d16b16e96d6/crates/flycheck/src/command.rs#L144-L155

and finally, this PR appends it at the end of existing Flycheck error message
  • Loading branch information
bors committed Apr 11, 2024
2 parents a5feb4f + f7a66fd commit 657b33b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions crates/flycheck/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ impl FlycheckActor {
tracing::debug!(?command, "will restart flycheck");
match CommandHandle::spawn(command) {
Ok(command_handle) => {
tracing::debug!(command = formatted_command, "did restart flycheck");
tracing::debug!(command = formatted_command, "did restart flycheck");
self.command_handle = Some(command_handle);
self.report_progress(Progress::DidStart);
}
Expand All @@ -306,10 +306,11 @@ impl FlycheckActor {
let formatted_handle = format!("{:?}", command_handle);

let res = command_handle.join();
if res.is_err() {
if let Err(error) = &res {
tracing::error!(
"Flycheck failed to run the following command: {}",
formatted_handle
"Flycheck failed to run the following command: {}, error={}",
formatted_handle,
error
);
}
self.report_progress(Progress::DidFinish(res));
Expand Down

0 comments on commit 657b33b

Please sign in to comment.