@@ -804,9 +804,9 @@ impl GlobalState {
804
804
fn handle_flycheck_msg ( & mut self , message : flycheck:: Message ) {
805
805
match message {
806
806
flycheck:: Message :: AddDiagnostic { id, workspace_root, diagnostic } => {
807
- if !self . diagnostics_received {
807
+ if !self . diagnostics_received . get ( & id ) . copied ( ) . unwrap_or_default ( ) {
808
808
self . diagnostics . clear_check ( id) ;
809
- self . diagnostics_received = true ;
809
+ self . diagnostics_received . insert ( id , true ) ;
810
810
}
811
811
let snap = self . snapshot ( ) ;
812
812
let diagnostics = crate :: diagnostics:: to_proto:: map_rust_diagnostic_to_lsp (
@@ -836,7 +836,7 @@ impl GlobalState {
836
836
flycheck:: Message :: Progress { id, progress } => {
837
837
let ( state, message) = match progress {
838
838
flycheck:: Progress :: DidStart => {
839
- self . diagnostics_received = false ;
839
+ self . diagnostics_received . insert ( id , false ) ;
840
840
( Progress :: Begin , None )
841
841
}
842
842
flycheck:: Progress :: DidCheckCrate ( target) => ( Progress :: Report , Some ( target) ) ,
@@ -852,7 +852,7 @@ impl GlobalState {
852
852
flycheck:: Progress :: DidFinish ( result) => {
853
853
self . last_flycheck_error =
854
854
result. err ( ) . map ( |err| format ! ( "cargo check failed to start: {err}" ) ) ;
855
- if !self . diagnostics_received {
855
+ if !self . diagnostics_received . get ( & id ) . copied ( ) . unwrap_or_default ( ) {
856
856
self . diagnostics . clear_check ( id) ;
857
857
}
858
858
( Progress :: End , None )
0 commit comments