9269: Recreate status page r=lnicola a=Milo123459

I'm working on redesigning the status page.

Co-authored-by: Milo <50248166+Milo123459@users.noreply.github.com>
This commit is contained in:
bors[bot] 2021-06-29 19:53:19 +00:00 committed by GitHub
commit 11b9233fc4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 19 deletions

View file

@ -38,7 +38,6 @@ tracing = "0.1"
tracing-subscriber = { version = "0.2", default-features = false, features = ["env-filter", "registry"] }
tracing-tree = { version = "0.1.4" }
always-assert = "0.1"
stdx = { path = "../stdx", version = "0.0.0" }
flycheck = { path = "../flycheck", version = "0.0.0" }
ide = { path = "../ide", version = "0.0.0" }

View file

@ -60,21 +60,25 @@ pub(crate) fn handle_analyzer_status(
}
if snap.workspaces.is_empty() {
buf.push_str("no workspaces\n")
buf.push_str("No workspaces\n")
} else {
buf.push_str("workspaces:\n");
for w in snap.workspaces.iter() {
format_to!(buf, "{} packages loaded\n", w.n_packages());
}
buf.push_str("Workspaces:\n");
format_to!(
buf,
"Loaded {:?} packages across {} workspace{}.\n",
snap.workspaces.iter().map(|w| w.n_packages()).sum::<usize>(),
snap.workspaces.len(),
if snap.workspaces.len() == 1 { "" } else { "s" }
);
}
buf.push_str("\nanalysis:\n");
buf.push_str("\nAnalysis:\n");
buf.push_str(
&snap
.analysis
.status(file_id)
.unwrap_or_else(|_| "Analysis retrieval was cancelled".to_owned()),
);
format_to!(buf, "\n\nrequests:\n");
format_to!(buf, "\n\nRequests:\n");
let requests = snap.latest_requests.read();
for (is_last, r) in requests.iter() {
let mark = if is_last { "*" } else { " " };