diff --git a/crates/ra_ide_api/src/status.rs b/crates/ra_ide_api/src/status.rs index 821106fea1f..822279812c0 100644 --- a/crates/ra_ide_api/src/status.rs +++ b/crates/ra_ide_api/src/status.rs @@ -4,11 +4,12 @@ sync::Arc, }; -use ra_syntax::{AstNode, Parse}; +use ra_syntax::{TreeArc, SyntaxNode}; use ra_db::{ - ParseQuery, FileTextQuery, SourceRootId, + FileTextQuery, SourceRootId, salsa::{Database, debug::{DebugQueryTable, TableEntry}}, }; +use hir::HirFileId; use crate::{ FileId, db::RootDatabase, @@ -16,7 +17,7 @@ }; pub(crate) fn syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats { - db.query(ParseQuery).entries::() + db.query(hir::db::ParseOrExpandQuery).entries::() } pub(crate) fn status(db: &RootDatabase) -> String { @@ -72,17 +73,17 @@ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { } } -impl FromIterator> for SyntaxTreeStats { +impl FromIterator>>> for SyntaxTreeStats { fn from_iter(iter: T) -> SyntaxTreeStats where - T: IntoIterator>, + T: IntoIterator>>>, { let mut res = SyntaxTreeStats::default(); for entry in iter { res.total += 1; - if let Some(value) = entry.value { + if let Some(tree) = entry.value.and_then(|it| it) { res.retained += 1; - res.retained_size += value.tree.syntax().memory_size_of_subtree(); + res.retained_size += tree.memory_size_of_subtree(); } } res