Show which roots are being scanned in progress messages

See: #12613
This commit is contained in:
Rebecca Turner 2023-09-19 12:44:30 -07:00
parent 51ac6de6f3
commit 1ceb2ea414
No known key found for this signature in database
4 changed files with 54 additions and 7 deletions

View file

@ -586,7 +586,7 @@ impl GlobalState {
}
}
}
vfs::loader::Message::Progress { n_total, n_done, config_version } => {
vfs::loader::Message::Progress { n_total, n_done, file, config_version } => {
always!(config_version <= self.vfs_config_version);
self.vfs_progress_config_version = config_version;
@ -601,10 +601,23 @@ impl GlobalState {
assert_eq!(n_done, n_total);
Progress::End
};
let mut message = format!("{n_done}/{n_total}");
if let Some(file) = file {
message += &format!(
": {}",
match file.strip_prefix(&self.config.root_path()) {
Some(relative_path) => relative_path.as_ref(),
None => file.as_ref(),
}
.display()
);
}
self.report_progress(
"Roots Scanned",
state,
Some(format!("{n_done}/{n_total}")),
Some(message),
Some(Progress::fraction(n_done, n_total)),
None,
);