@@ -136,7 +136,7 @@ impl GlobalState {
136136 log:: info!( "queued count = {}" , queue_count) ;
137137 }
138138
139- let mut became_ready = false ;
139+ let prev_status = self . status ;
140140 match event {
141141 Event :: Lsp ( msg) => match msg {
142142 lsp_server:: Message :: Request ( req) => self . on_request ( loop_start, req) ?,
@@ -168,15 +168,17 @@ impl GlobalState {
168168 }
169169 }
170170 vfs:: loader:: Message :: Progress { n_total, n_done } => {
171- if n_total > 0 {
171+ if n_total == 0 {
172+ self . status = Status :: Ready ;
173+ } else {
172174 let state = if n_done == 0 {
175+ self . status = Status :: Loading ;
173176 Progress :: Begin
174177 } else if n_done < n_total {
175178 Progress :: Report
176179 } else {
177180 assert_eq ! ( n_done, n_total) ;
178181 self . status = Status :: Ready ;
179- became_ready = true ;
180182 Progress :: End
181183 } ;
182184 self . report_progress (
@@ -233,13 +235,13 @@ impl GlobalState {
233235 }
234236
235237 let state_changed = self . process_changes ( ) ;
236- if became_ready {
238+ if prev_status == Status :: Loading && self . status == Status :: Ready {
237239 if let Some ( flycheck) = & self . flycheck {
238240 flycheck. handle . update ( ) ;
239241 }
240242 }
241243
242- if self . status == Status :: Ready && ( state_changed || became_ready ) {
244+ if self . status == Status :: Ready && ( state_changed || prev_status == Status :: Loading ) {
243245 let subscriptions = self
244246 . mem_docs
245247 . iter ( )
0 commit comments