This repository was archived by the owner on Dec 29, 2022. It is now read-only.
File tree 2 files changed +14
-3
lines changed
2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -366,6 +366,7 @@ impl Executor for RlsExecutor {
366
366
let cargo_args = cargo_cmd. get_args ( ) ;
367
367
let crate_name =
368
368
parse_arg ( cargo_args, "--crate-name" ) . expect ( "no crate-name in rustc command line" ) ;
369
+ let cfg_test = cargo_args. iter ( ) . any ( |arg| arg == "--test" ) ;
369
370
trace ! ( "exec: {} {:?}" , crate_name, cargo_cmd) ;
370
371
371
372
// Send off a window/progress notification for this compile target.
@@ -374,8 +375,11 @@ impl Executor for RlsExecutor {
374
375
{
375
376
let progress_sender = self . progress_sender . lock ( ) . unwrap ( ) ;
376
377
progress_sender
377
- . send ( ProgressUpdate :: Message ( crate_name. clone ( ) ) )
378
- . expect ( "Failed to send progress update" ) ;
378
+ . send ( ProgressUpdate :: Message ( if cfg_test {
379
+ format ! ( "{} cfg(test)" , crate_name)
380
+ } else {
381
+ crate_name. clone ( )
382
+ } ) ) . expect ( "Failed to send progress update" ) ;
379
383
}
380
384
381
385
let out_dir = parse_arg ( cargo_args, "--out-dir" ) . expect ( "no out-dir in rustc command line" ) ;
Original file line number Diff line number Diff line change @@ -578,7 +578,14 @@ impl JobQueue {
578
578
{
579
579
let crate_name = proc_argument_value ( & job, "--crate-name" ) . and_then ( |x| x. to_str ( ) ) ;
580
580
let update = match crate_name {
581
- Some ( name) => ProgressUpdate :: Message ( name. to_owned ( ) ) ,
581
+ Some ( name) => {
582
+ let cfg_test = job. get_args ( ) . iter ( ) . any ( |arg| arg == "--test" ) ;
583
+ ProgressUpdate :: Message ( if cfg_test {
584
+ format ! ( "{} cfg(test)" , name)
585
+ } else {
586
+ name. to_owned ( )
587
+ } )
588
+ }
582
589
None => {
583
590
// divide by zero is avoided by earlier assert!
584
591
let percentage = compiler_messages. len ( ) as f64 / self . 0 . len ( ) as f64 ;
You can’t perform that action at this time.
0 commit comments