@@ -345,6 +345,7 @@ impl FlycheckActor {
345
345
) ;
346
346
}
347
347
if self . package_status . is_empty ( ) {
348
+ tracing:: trace!( flycheck_id = self . id, "clearing diagnostics" ) ;
348
349
// We finished without receiving any diagnostics.
349
350
// That means all of them are stale.
350
351
self . send ( FlycheckMessage :: ClearDiagnostics {
@@ -354,6 +355,11 @@ impl FlycheckActor {
354
355
} else {
355
356
for ( package_id, status) in mem:: take ( & mut self . package_status ) {
356
357
if let DiagnosticReceived :: No = status {
358
+ tracing:: trace!(
359
+ flycheck_id = self . id,
360
+ package_id = package_id. repr,
361
+ "clearing diagnostics"
362
+ ) ;
357
363
self . send ( FlycheckMessage :: ClearDiagnostics {
358
364
id : self . id ,
359
365
package_id : Some ( package_id) ,
@@ -385,9 +391,15 @@ impl FlycheckActor {
385
391
"diagnostic received"
386
392
) ;
387
393
if let Some ( package_id) = & package_id {
388
- if !self . package_status . contains_key ( package_id) {
389
- self . package_status
390
- . insert ( package_id. clone ( ) , DiagnosticReceived :: Yes ) ;
394
+ if let None | Some ( DiagnosticReceived :: No ) = self
395
+ . package_status
396
+ . insert ( package_id. clone ( ) , DiagnosticReceived :: Yes )
397
+ {
398
+ tracing:: trace!(
399
+ flycheck_id = self . id,
400
+ package_id = package_id. repr,
401
+ "clearing diagnostics"
402
+ ) ;
391
403
self . send ( FlycheckMessage :: ClearDiagnostics {
392
404
id : self . id ,
393
405
package_id : Some ( package_id. clone ( ) ) ,
0 commit comments