From 37e80c529772aec176d93a33ee5a2fec3ab8e45d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 1 Jun 2019 22:11:38 +0300 Subject: show macro expanded trees in the stats as well --- crates/ra_ide_api/src/status.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'crates/ra_ide_api/src') diff --git a/crates/ra_ide_api/src/status.rs b/crates/ra_ide_api/src/status.rs index 821106fea..822279812 100644 --- a/crates/ra_ide_api/src/status.rs +++ b/crates/ra_ide_api/src/status.rs @@ -4,11 +4,12 @@ use std::{ 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 @@ use crate::{ }; 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 @@ impl fmt::Display for SyntaxTreeStats { } } -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 -- cgit v1.2.3 From d7a2a9171ecc36ec47ba23020c7d7392da537d2e Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 1 Jun 2019 22:14:42 +0300 Subject: don't cache ast_id_to_node --- crates/ra_ide_api/src/change.rs | 1 - 1 file changed, 1 deletion(-) (limited to 'crates/ra_ide_api/src') diff --git a/crates/ra_ide_api/src/change.rs b/crates/ra_ide_api/src/change.rs index 4b597afc0..4196a3853 100644 --- a/crates/ra_ide_api/src/change.rs +++ b/crates/ra_ide_api/src/change.rs @@ -228,7 +228,6 @@ impl RootDatabase { self.query(hir::db::ParseOrExpandQuery).sweep(sweep); self.query(hir::db::AstIdMapQuery).sweep(sweep); - self.query(hir::db::AstIdToNodeQuery).sweep(sweep); self.query(hir::db::RawItemsWithSourceMapQuery).sweep(sweep); self.query(hir::db::BodyWithSourceMapQuery).sweep(sweep); -- cgit v1.2.3 From f7d3a873050fb8360b663ca281a805de8cf7f30d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 1 Jun 2019 22:31:22 +0300 Subject: collect impl source maps --- crates/ra_ide_api/src/change.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'crates/ra_ide_api/src') diff --git a/crates/ra_ide_api/src/change.rs b/crates/ra_ide_api/src/change.rs index 4196a3853..445a94aa8 100644 --- a/crates/ra_ide_api/src/change.rs +++ b/crates/ra_ide_api/src/change.rs @@ -230,6 +230,7 @@ impl RootDatabase { self.query(hir::db::AstIdMapQuery).sweep(sweep); self.query(hir::db::RawItemsWithSourceMapQuery).sweep(sweep); + self.query(hir::db::ImplsInModuleWithSourceMapQuery).sweep(sweep); self.query(hir::db::BodyWithSourceMapQuery).sweep(sweep); } } -- cgit v1.2.3