diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-07-23 09:27:20 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-23 09:27:20 +0100 |
commit | 085891d8855bb905c2ba12c1618bace410253926 (patch) | |
tree | a7a09d0a42f51903b3adf6cde77843a606350467 /crates | |
parent | 56ff9ef0262f5bad7fa1d0ac3b76974d88671afd (diff) | |
parent | c2d8829d567a6ea19361b27a8711231e6af89844 (diff) |
Merge #5501
5501: minor r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates')
-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 |