@@ -230,7 +230,7 @@ pub(crate) enum Progress {
230
230
DidFailToRestart ( String ) ,
231
231
}
232
232
233
- #[ derive( Debug ) ]
233
+ #[ derive( Debug , Clone ) ]
234
234
enum PackageToRestart {
235
235
All ,
236
236
// Either a cargo package or a $label in rust-project.check.overrideCommand
@@ -247,7 +247,7 @@ enum FlycheckCommandOrigin {
247
247
ProjectJsonRunnable ,
248
248
}
249
249
250
- #[ derive( Debug ) ]
250
+ #[ derive( Debug , Clone ) ]
251
251
pub ( crate ) enum PackageSpecifier {
252
252
Cargo {
253
253
/// The one in Cargo.toml, assumed to work with `cargo check -p {}` etc
@@ -412,8 +412,9 @@ impl FlycheckActor {
412
412
}
413
413
414
414
let Some ( ( command, origin) ) =
415
- self . check_command ( package, saved_file. as_deref ( ) , target)
415
+ self . check_command ( package. clone ( ) , saved_file. as_deref ( ) , target)
416
416
else {
417
+ tracing:: debug!( ?package, "failed to build flycheck command" ) ;
417
418
continue ;
418
419
} ;
419
420
@@ -428,19 +429,19 @@ impl FlycheckActor {
428
429
) ,
429
430
} ;
430
431
431
- tracing:: debug!( ?command, "will restart flycheck" ) ;
432
+ tracing:: debug!( ?origin , ? command, "will restart flycheck" ) ;
432
433
let ( sender, receiver) = unbounded ( ) ;
433
434
match CommandHandle :: spawn ( command, sender) {
434
435
Ok ( command_handle) => {
435
- tracing:: debug!( command = debug_command, "did restart flycheck" ) ;
436
+ tracing:: debug!( ?origin , command = % debug_command, "did restart flycheck" ) ;
436
437
self . command_handle = Some ( command_handle) ;
437
438
self . command_receiver = Some ( receiver) ;
438
439
self . report_progress ( Progress :: DidStart { user_facing_command } ) ;
439
440
self . status = FlycheckStatus :: Started ;
440
441
}
441
442
Err ( error) => {
442
443
self . report_progress ( Progress :: DidFailToRestart ( format ! (
443
- "Failed to run the following command: {debug_command} error={error}"
444
+ "Failed to run the following command: {debug_command} origin={origin:?} error={error}"
444
445
) ) ) ;
445
446
self . status = FlycheckStatus :: Finished ;
446
447
}
0 commit comments