mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
ad status command
This commit is contained in:
parent
e08df3219d
commit
0ba7e2eaeb
10 changed files with 68 additions and 0 deletions
|
@ -264,4 +264,19 @@ impl ServerWorld {
|
|||
.map_err(|_| format_err!("can't convert path to url: {}", path.display()))?;
|
||||
Ok(url)
|
||||
}
|
||||
|
||||
pub fn status(&self) -> String {
|
||||
let mut res = String::new();
|
||||
if self.workspaces.is_empty() {
|
||||
res.push_str("no workspaces\n")
|
||||
} else {
|
||||
res.push_str("workspaces:\n");
|
||||
for w in self.workspaces.iter() {
|
||||
res += &format!("{} packages loaded\n", w.cargo.packages().count());
|
||||
}
|
||||
}
|
||||
res.push_str("\nanalysis:\n");
|
||||
res.push_str(&self.analysis.status());
|
||||
res
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue