diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-07-01 12:05:59 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-01 12:05:59 +0100 |
commit | f372b13a858a6d037e38ab13ec7ae0286be5a001 (patch) | |
tree | 85a29c48079b56b17ead09bf255b73037543cb4c /crates | |
parent | 7d82152b21579df144b4a5272e699e24cafb5b97 (diff) | |
parent | 44b8737cedc437ec4981e73c1543b04f723656fa (diff) |
Merge #5164
5164: Dont show empty progress for empty workspaces 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 | 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 { |