sync::Arc,
};
-use languageserver_types::Url;
+use lsp_types::Url;
use ra_ide_api::{
Analysis, AnalysisChange, AnalysisHost, CrateGraph, FileId, LibraryData,
SourceRootId
vfs: Arc::clone(&self.vfs),
}
}
+
+ pub fn maybe_collect_garbage(&mut self) {
+ self.analysis_host.maybe_collect_garbage()
+ }
+
+ pub fn collect_garbage(&mut self) {
+ self.analysis_host.collect_garbage()
+ }
}
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
+ }
}