diff options
-rw-r--r-- | crates/rust-analyzer/src/main_loop.rs | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs index 9fd16ef3b..2ce1441b6 100644 --- a/crates/rust-analyzer/src/main_loop.rs +++ b/crates/rust-analyzer/src/main_loop.rs | |||
@@ -168,22 +168,24 @@ impl GlobalState { | |||
168 | } | 168 | } |
169 | } | 169 | } |
170 | vfs::loader::Message::Progress { n_total, n_done } => { | 170 | vfs::loader::Message::Progress { n_total, n_done } => { |
171 | let state = if n_done == 0 { | 171 | if n_total > 0 { |
172 | Progress::Begin | 172 | let state = if n_done == 0 { |
173 | } else if n_done < n_total { | 173 | Progress::Begin |
174 | Progress::Report | 174 | } else if n_done < n_total { |
175 | } else { | 175 | Progress::Report |
176 | assert_eq!(n_done, n_total); | 176 | } else { |
177 | self.status = Status::Ready; | 177 | assert_eq!(n_done, n_total); |
178 | became_ready = true; | 178 | self.status = Status::Ready; |
179 | Progress::End | 179 | became_ready = true; |
180 | }; | 180 | Progress::End |
181 | self.report_progress( | 181 | }; |
182 | "roots scanned", | 182 | self.report_progress( |
183 | state, | 183 | "roots scanned", |
184 | Some(format!("{}/{}", n_done, n_total)), | 184 | state, |
185 | Some(Progress::percentage(n_done, n_total)), | 185 | Some(format!("{}/{}", n_done, n_total)), |
186 | ) | 186 | Some(Progress::percentage(n_done, n_total)), |
187 | ) | ||
188 | } | ||
187 | } | 189 | } |
188 | }, | 190 | }, |
189 | Event::Flycheck(task) => match task { | 191 | Event::Flycheck(task) => match task { |