File tree Expand file tree Collapse file tree 1 file changed +18
-14
lines changed
src/tools/rust-analyzer/crates/rust-analyzer/src Expand file tree Collapse file tree 1 file changed +18
-14
lines changed Original file line number Diff line number Diff line change @@ -353,19 +353,7 @@ impl FlycheckActor {
353353 package_id : None ,
354354 } ) ;
355355 } else {
356- for ( package_id, status) in mem:: take ( & mut self . package_status ) {
357- if let DiagnosticReceived :: No = status {
358- tracing:: trace!(
359- flycheck_id = self . id,
360- package_id = package_id. repr,
361- "clearing diagnostics"
362- ) ;
363- self . send ( FlycheckMessage :: ClearDiagnostics {
364- id : self . id ,
365- package_id : Some ( package_id) ,
366- } ) ;
367- }
368- }
356+ self . send_clear_diagnostics ( ) ;
369357 }
370358
371359 self . report_progress ( Progress :: DidFinish ( res) ) ;
@@ -429,7 +417,23 @@ impl FlycheckActor {
429417 command_handle. cancel ( ) ;
430418 self . command_receiver . take ( ) ;
431419 self . report_progress ( Progress :: DidCancel ) ;
432- self . package_status . clear ( ) ;
420+ self . send_clear_diagnostics ( ) ;
421+ }
422+ }
423+
424+ fn send_clear_diagnostics ( & mut self ) {
425+ for ( package_id, status) in mem:: take ( & mut self . package_status ) {
426+ if let DiagnosticReceived :: No = status {
427+ tracing:: trace!(
428+ flycheck_id = self . id,
429+ package_id = package_id. repr,
430+ "clearing diagnostics"
431+ ) ;
432+ self . send ( FlycheckMessage :: ClearDiagnostics {
433+ id : self . id ,
434+ package_id : Some ( package_id) ,
435+ } ) ;
436+ }
433437 }
434438 }
435439
You can’t perform that action at this time.
0 commit comments