File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -305,15 +305,13 @@ fn loop_turn(
305
305
log:: info!( "queued count = {}" , queue_count) ;
306
306
}
307
307
308
- let mut state_changed = false ;
309
308
match event {
310
309
Event :: Task ( task) => {
311
310
on_task ( task, & connection. sender , & mut loop_state. pending_requests , world_state) ;
312
311
world_state. maybe_collect_garbage ( ) ;
313
312
}
314
313
Event :: Vfs ( task) => {
315
314
world_state. vfs . write ( ) . handle_task ( task) ;
316
- state_changed = true ;
317
315
}
318
316
Event :: Lib ( lib) => {
319
317
world_state. add_lib ( lib) ;
@@ -338,7 +336,6 @@ fn loop_turn(
338
336
& mut loop_state. subscriptions ,
339
337
not,
340
338
) ?;
341
- state_changed = true ;
342
339
}
343
340
Message :: Response ( resp) => {
344
341
let removed = loop_state. pending_responses . remove ( & resp. id ) ;
@@ -349,7 +346,12 @@ fn loop_turn(
349
346
} ,
350
347
} ;
351
348
352
- loop_state. pending_libraries . extend ( world_state. process_changes ( ) ) ;
349
+ let mut state_changed = false ;
350
+ if let Some ( changes) = world_state. process_changes ( ) {
351
+ state_changed = true ;
352
+ loop_state. pending_libraries . extend ( changes) ;
353
+ }
354
+
353
355
while loop_state. in_flight_libraries < MAX_IN_FLIGHT_LIBS
354
356
&& !loop_state. pending_libraries . is_empty ( )
355
357
{
Original file line number Diff line number Diff line change @@ -145,10 +145,10 @@ impl WorldState {
145
145
/// FIXME: better API here
146
146
pub fn process_changes (
147
147
& mut self ,
148
- ) -> Vec < ( SourceRootId , Vec < ( FileId , RelativePathBuf , Arc < String > ) > ) > {
148
+ ) -> Option < Vec < ( SourceRootId , Vec < ( FileId , RelativePathBuf , Arc < String > ) > ) > > {
149
149
let changes = self . vfs . write ( ) . commit_changes ( ) ;
150
150
if changes. is_empty ( ) {
151
- return Vec :: new ( ) ;
151
+ return None ;
152
152
}
153
153
let mut libs = Vec :: new ( ) ;
154
154
let mut change = AnalysisChange :: new ( ) ;
@@ -182,7 +182,7 @@ impl WorldState {
182
182
}
183
183
}
184
184
self . analysis_host . apply_change ( change) ;
185
- libs
185
+ Some ( libs)
186
186
}
187
187
188
188
pub fn add_lib ( & mut self , data : LibraryData ) {
You can’t perform that action at this time.
0 commit comments