@@ -804,9 +804,9 @@ impl GlobalState {
804804 fn handle_flycheck_msg ( & mut self , message : flycheck:: Message ) {
805805 match message {
806806 flycheck:: Message :: AddDiagnostic { id, workspace_root, diagnostic } => {
807- if !self . diagnostics_received {
807+ if !self . diagnostics_received . get ( & id ) . copied ( ) . unwrap_or_default ( ) {
808808 self . diagnostics . clear_check ( id) ;
809- self . diagnostics_received = true ;
809+ self . diagnostics_received . insert ( id , true ) ;
810810 }
811811 let snap = self . snapshot ( ) ;
812812 let diagnostics = crate :: diagnostics:: to_proto:: map_rust_diagnostic_to_lsp (
@@ -836,7 +836,7 @@ impl GlobalState {
836836 flycheck:: Message :: Progress { id, progress } => {
837837 let ( state, message) = match progress {
838838 flycheck:: Progress :: DidStart => {
839- self . diagnostics_received = false ;
839+ self . diagnostics_received . insert ( id , false ) ;
840840 ( Progress :: Begin , None )
841841 }
842842 flycheck:: Progress :: DidCheckCrate ( target) => ( Progress :: Report , Some ( target) ) ,
@@ -852,7 +852,7 @@ impl GlobalState {
852852 flycheck:: Progress :: DidFinish ( result) => {
853853 self . last_flycheck_error =
854854 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 ( ) {
856856 self . diagnostics . clear_check ( id) ;
857857 }
858858 ( Progress :: End , None )
0 commit comments