diff options
-rw-r--r-- | crates/rust-analyzer/src/main_loop.rs | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs index f6d8daeed..ac95e428e 100644 --- a/crates/rust-analyzer/src/main_loop.rs +++ b/crates/rust-analyzer/src/main_loop.rs | |||
@@ -97,22 +97,6 @@ impl fmt::Debug for Event { | |||
97 | } | 97 | } |
98 | 98 | ||
99 | impl GlobalState { | 99 | impl GlobalState { |
100 | fn next_event(&self, inbox: &Receiver<lsp_server::Message>) -> Option<Event> { | ||
101 | select! { | ||
102 | recv(inbox) -> msg => | ||
103 | msg.ok().map(Event::Lsp), | ||
104 | |||
105 | recv(self.task_pool.receiver) -> task => | ||
106 | Some(Event::Task(task.unwrap())), | ||
107 | |||
108 | recv(self.loader.receiver) -> task => | ||
109 | Some(Event::Vfs(task.unwrap())), | ||
110 | |||
111 | recv(self.flycheck_receiver) -> task => | ||
112 | Some(Event::Flycheck(task.unwrap())), | ||
113 | } | ||
114 | } | ||
115 | |||
116 | fn run(mut self, inbox: Receiver<lsp_server::Message>) -> Result<()> { | 100 | fn run(mut self, inbox: Receiver<lsp_server::Message>) -> Result<()> { |
117 | if self.config.linked_projects.is_empty() && self.config.notifications.cargo_toml_not_found | 101 | if self.config.linked_projects.is_empty() && self.config.notifications.cargo_toml_not_found |
118 | { | 102 | { |
@@ -169,6 +153,22 @@ impl GlobalState { | |||
169 | Err("client exited without proper shutdown sequence")? | 153 | Err("client exited without proper shutdown sequence")? |
170 | } | 154 | } |
171 | 155 | ||
156 | fn next_event(&self, inbox: &Receiver<lsp_server::Message>) -> Option<Event> { | ||
157 | select! { | ||
158 | recv(inbox) -> msg => | ||
159 | msg.ok().map(Event::Lsp), | ||
160 | |||
161 | recv(self.task_pool.receiver) -> task => | ||
162 | Some(Event::Task(task.unwrap())), | ||
163 | |||
164 | recv(self.loader.receiver) -> task => | ||
165 | Some(Event::Vfs(task.unwrap())), | ||
166 | |||
167 | recv(self.flycheck_receiver) -> task => | ||
168 | Some(Event::Flycheck(task.unwrap())), | ||
169 | } | ||
170 | } | ||
171 | |||
172 | fn handle_event(&mut self, event: Event) -> Result<()> { | 172 | fn handle_event(&mut self, event: Event) -> Result<()> { |
173 | let loop_start = Instant::now(); | 173 | let loop_start = Instant::now(); |
174 | // NOTE: don't count blocking select! call as a loop-turn time | 174 | // NOTE: don't count blocking select! call as a loop-turn time |