aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/src/main_loop.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_lsp_server/src/main_loop.rs')
-rw-r--r--crates/ra_lsp_server/src/main_loop.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs
index 81fd08c91..dda318e43 100644
--- a/crates/ra_lsp_server/src/main_loop.rs
+++ b/crates/ra_lsp_server/src/main_loop.rs
@@ -305,7 +305,6 @@ fn loop_turn(
305 log::info!("queued count = {}", queue_count); 305 log::info!("queued count = {}", queue_count);
306 } 306 }
307 307
308 let mut state_changed = false;
309 match event { 308 match event {
310 Event::Task(task) => { 309 Event::Task(task) => {
311 on_task(task, &connection.sender, &mut loop_state.pending_requests, world_state); 310 on_task(task, &connection.sender, &mut loop_state.pending_requests, world_state);
@@ -313,7 +312,6 @@ fn loop_turn(
313 } 312 }
314 Event::Vfs(task) => { 313 Event::Vfs(task) => {
315 world_state.vfs.write().handle_task(task); 314 world_state.vfs.write().handle_task(task);
316 state_changed = true;
317 } 315 }
318 Event::Lib(lib) => { 316 Event::Lib(lib) => {
319 world_state.add_lib(lib); 317 world_state.add_lib(lib);
@@ -338,7 +336,6 @@ fn loop_turn(
338 &mut loop_state.subscriptions, 336 &mut loop_state.subscriptions,
339 not, 337 not,
340 )?; 338 )?;
341 state_changed = true;
342 } 339 }
343 Message::Response(resp) => { 340 Message::Response(resp) => {
344 let removed = loop_state.pending_responses.remove(&resp.id); 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 while loop_state.in_flight_libraries < MAX_IN_FLIGHT_LIBS 355 while loop_state.in_flight_libraries < MAX_IN_FLIGHT_LIBS
354 && !loop_state.pending_libraries.is_empty() 356 && !loop_state.pending_libraries.is_empty()
355 { 357 {