Skip to content

Commit f372b13

Browse files
bors[bot]matklad
andauthored
Merge #5164
5164: Dont show empty progress for empty workspaces r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
2 parents 7d82152 + 44b8737 commit f372b13

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

crates/rust-analyzer/src/main_loop.rs

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -168,22 +168,24 @@ impl GlobalState {
168168
}
169169
}
170170
vfs::loader::Message::Progress { n_total, n_done } => {
171-
let state = if n_done == 0 {
172-
Progress::Begin
173-
} else if n_done < n_total {
174-
Progress::Report
175-
} else {
176-
assert_eq!(n_done, n_total);
177-
self.status = Status::Ready;
178-
became_ready = true;
179-
Progress::End
180-
};
181-
self.report_progress(
182-
"roots scanned",
183-
state,
184-
Some(format!("{}/{}", n_done, n_total)),
185-
Some(Progress::percentage(n_done, n_total)),
186-
)
171+
if n_total > 0 {
172+
let state = if n_done == 0 {
173+
Progress::Begin
174+
} else if n_done < n_total {
175+
Progress::Report
176+
} else {
177+
assert_eq!(n_done, n_total);
178+
self.status = Status::Ready;
179+
became_ready = true;
180+
Progress::End
181+
};
182+
self.report_progress(
183+
"roots scanned",
184+
state,
185+
Some(format!("{}/{}", n_done, n_total)),
186+
Some(Progress::percentage(n_done, n_total)),
187+
)
188+
}
187189
}
188190
},
189191
Event::Flycheck(task) => match task {

0 commit comments

Comments
 (0)