aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/ra_lsp_server/src/main_loop.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs
index 16c05e4c3..d406faf6c 100644
--- a/crates/ra_lsp_server/src/main_loop.rs
+++ b/crates/ra_lsp_server/src/main_loop.rs
@@ -171,7 +171,6 @@ fn main_loop_inner(
171 let (libdata_sender, libdata_receiver) = unbounded(); 171 let (libdata_sender, libdata_receiver) = unbounded();
172 loop { 172 loop {
173 let _p = profile("loop_turn"); 173 let _p = profile("loop_turn");
174 state.maybe_collect_garbage();
175 174
176 log::trace!("selecting"); 175 log::trace!("selecting");
177 let event = select! { 176 let event = select! {
@@ -193,13 +192,17 @@ fn main_loop_inner(
193 } 192 }
194 let mut state_changed = false; 193 let mut state_changed = false;
195 match event { 194 match event {
196 Event::Task(task) => on_task(task, msg_sender, pending_requests), 195 Event::Task(task) => {
196 on_task(task, msg_sender, pending_requests);
197 state.maybe_collect_garbage();
198 }
197 Event::Vfs(task) => { 199 Event::Vfs(task) => {
198 state.vfs.write().handle_task(task); 200 state.vfs.write().handle_task(task);
199 state_changed = true; 201 state_changed = true;
200 } 202 }
201 Event::Lib(lib) => { 203 Event::Lib(lib) => {
202 state.add_lib(lib); 204 state.add_lib(lib);
205 state.maybe_collect_garbage();
203 in_flight_libraries -= 1; 206 in_flight_libraries -= 1;
204 } 207 }
205 Event::Msg(msg) => match msg { 208 Event::Msg(msg) => match msg {