Recreate PR.
This commit is contained in:
parent
0657812bc2
commit
7d502c7f08
1
.gitignore
vendored
1
.gitignore
vendored
@ -11,3 +11,4 @@ generated_assists.adoc
|
||||
generated_features.adoc
|
||||
generated_diagnostic.adoc
|
||||
.DS_Store
|
||||
.glitterrc
|
||||
|
@ -34,15 +34,24 @@ fn macro_syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats {
|
||||
// image::https://user-images.githubusercontent.com/48062697/113065584-05f34500-91b1-11eb-98cc-5c196f76be7f.gif[]
|
||||
pub(crate) fn status(db: &RootDatabase, file_id: Option<FileId>) -> String {
|
||||
let mut buf = String::new();
|
||||
let count = profile::countme::get_all();
|
||||
format_to!(buf, "{}\n", FileTextQuery.in_db(db).entries::<FilesStats>());
|
||||
format_to!(buf, "{}\n", LibrarySymbolsQuery.in_db(db).entries::<LibrarySymbolsStats>());
|
||||
format_to!(buf, "{}\n", syntax_tree_stats(db));
|
||||
format_to!(buf, "{} (macros)\n", macro_syntax_tree_stats(db));
|
||||
format_to!(buf, "{} total\n", memory_usage());
|
||||
format_to!(buf, "\ncounts:\n{}", profile::countme::get_all());
|
||||
format_to!(buf, "{} (Macros)\n", macro_syntax_tree_stats(db));
|
||||
format_to!(buf, "{} Total\n", memory_usage());
|
||||
format_to!(
|
||||
buf,
|
||||
"\nCounts:\n{}",
|
||||
if count.to_string().contains("all counts are zero") {
|
||||
String::from("All counts are zero\n")
|
||||
} else {
|
||||
count.to_string()
|
||||
}
|
||||
);
|
||||
|
||||
if let Some(file_id) = file_id {
|
||||
format_to!(buf, "\nfile info:\n");
|
||||
format_to!(buf, "\nFile info:\n");
|
||||
let krate = crate::parent_module::crate_for(db, file_id).pop();
|
||||
match krate {
|
||||
Some(krate) => {
|
||||
|
@ -60,21 +60,27 @@ 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");
|
||||
buf.push_str("Workspaces:\n");
|
||||
for w in snap.workspaces.iter() {
|
||||
format_to!(buf, "{} packages loaded\n", w.n_packages());
|
||||
format_to!(
|
||||
buf,
|
||||
"Loaded {} packages across {} workspace{}.\n",
|
||||
w.n_packages(),
|
||||
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 { " " };
|
||||
|
Loading…
x
Reference in New Issue
Block a user