diff options
Diffstat (limited to 'crates/ra_lsp_server/src/server_world.rs')
-rw-r--r-- | crates/ra_lsp_server/src/server_world.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/crates/ra_lsp_server/src/server_world.rs b/crates/ra_lsp_server/src/server_world.rs index c24ded9f9..5cb97b29b 100644 --- a/crates/ra_lsp_server/src/server_world.rs +++ b/crates/ra_lsp_server/src/server_world.rs | |||
@@ -264,4 +264,19 @@ impl ServerWorld { | |||
264 | .map_err(|_| format_err!("can't convert path to url: {}", path.display()))?; | 264 | .map_err(|_| format_err!("can't convert path to url: {}", path.display()))?; |
265 | Ok(url) | 265 | Ok(url) |
266 | } | 266 | } |
267 | |||
268 | pub fn status(&self) -> String { | ||
269 | let mut res = String::new(); | ||
270 | if self.workspaces.is_empty() { | ||
271 | res.push_str("no workspaces\n") | ||
272 | } else { | ||
273 | res.push_str("workspaces:\n"); | ||
274 | for w in self.workspaces.iter() { | ||
275 | res += &format!("{} packages loaded\n", w.cargo.packages().count()); | ||
276 | } | ||
277 | } | ||
278 | res.push_str("\nanalysis:\n"); | ||
279 | res.push_str(&self.analysis.status()); | ||
280 | res | ||
281 | } | ||
267 | } | 282 | } |