aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src')
-rw-r--r--crates/ra_ide_api/src/change.rs9
-rw-r--r--crates/ra_ide_api/src/db.rs5
-rw-r--r--crates/ra_ide_api/src/status.rs15
3 files changed, 19 insertions, 10 deletions
diff --git a/crates/ra_ide_api/src/change.rs b/crates/ra_ide_api/src/change.rs
index 4b597afc0..02814ce56 100644
--- a/crates/ra_ide_api/src/change.rs
+++ b/crates/ra_ide_api/src/change.rs
@@ -227,10 +227,17 @@ impl RootDatabase {
227 self.query(ra_db::ParseQuery).sweep(sweep); 227 self.query(ra_db::ParseQuery).sweep(sweep);
228 228
229 self.query(hir::db::ParseOrExpandQuery).sweep(sweep); 229 self.query(hir::db::ParseOrExpandQuery).sweep(sweep);
230 self.query(hir::db::MacroDefQuery).sweep(sweep);
231 self.query(hir::db::MacroArgQuery).sweep(sweep);
232 self.query(hir::db::MacroExpandQuery).sweep(sweep);
230 self.query(hir::db::AstIdMapQuery).sweep(sweep); 233 self.query(hir::db::AstIdMapQuery).sweep(sweep);
231 self.query(hir::db::AstIdToNodeQuery).sweep(sweep);
232 234
233 self.query(hir::db::RawItemsWithSourceMapQuery).sweep(sweep); 235 self.query(hir::db::RawItemsWithSourceMapQuery).sweep(sweep);
236 self.query(hir::db::ImplsInModuleWithSourceMapQuery).sweep(sweep);
234 self.query(hir::db::BodyWithSourceMapQuery).sweep(sweep); 237 self.query(hir::db::BodyWithSourceMapQuery).sweep(sweep);
238
239 self.query(hir::db::ExprScopesQuery).sweep(sweep);
240 self.query(hir::db::InferQuery).sweep(sweep);
241 self.query(hir::db::BodyHirQuery).sweep(sweep);
235 } 242 }
236} 243}
diff --git a/crates/ra_ide_api/src/db.rs b/crates/ra_ide_api/src/db.rs
index d84a0e7be..d1a452ecb 100644
--- a/crates/ra_ide_api/src/db.rs
+++ b/crates/ra_ide_api/src/db.rs
@@ -14,8 +14,9 @@ use crate::{LineIndex, symbol_index::{self, SymbolsDatabase}};
14 ra_db::SourceDatabaseStorage, 14 ra_db::SourceDatabaseStorage,
15 LineIndexDatabaseStorage, 15 LineIndexDatabaseStorage,
16 symbol_index::SymbolsDatabaseStorage, 16 symbol_index::SymbolsDatabaseStorage,
17 hir::db::HirDatabaseStorage, 17 hir::db::AstDatabaseStorage,
18 hir::db::DefDatabaseStorage 18 hir::db::DefDatabaseStorage,
19 hir::db::HirDatabaseStorage
19)] 20)]
20#[derive(Debug)] 21#[derive(Debug)]
21pub(crate) struct RootDatabase { 22pub(crate) struct RootDatabase {
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::{
4 sync::Arc, 4 sync::Arc,
5}; 5};
6 6
7use ra_syntax::{AstNode, Parse}; 7use ra_syntax::{TreeArc, SyntaxNode};
8use ra_db::{ 8use ra_db::{
9 ParseQuery, FileTextQuery, SourceRootId, 9 FileTextQuery, SourceRootId,
10 salsa::{Database, debug::{DebugQueryTable, TableEntry}}, 10 salsa::{Database, debug::{DebugQueryTable, TableEntry}},
11}; 11};
12use hir::HirFileId;
12 13
13use crate::{ 14use crate::{
14 FileId, db::RootDatabase, 15 FileId, db::RootDatabase,
@@ -16,7 +17,7 @@ use crate::{
16}; 17};
17 18
18pub(crate) fn syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats { 19pub(crate) fn syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats {
19 db.query(ParseQuery).entries::<SyntaxTreeStats>() 20 db.query(hir::db::ParseOrExpandQuery).entries::<SyntaxTreeStats>()
20} 21}
21 22
22pub(crate) fn status(db: &RootDatabase) -> String { 23pub(crate) fn status(db: &RootDatabase) -> String {
@@ -72,17 +73,17 @@ impl fmt::Display for SyntaxTreeStats {
72 } 73 }
73} 74}
74 75
75impl FromIterator<TableEntry<FileId, Parse>> for SyntaxTreeStats { 76impl FromIterator<TableEntry<HirFileId, Option<TreeArc<SyntaxNode>>>> for SyntaxTreeStats {
76 fn from_iter<T>(iter: T) -> SyntaxTreeStats 77 fn from_iter<T>(iter: T) -> SyntaxTreeStats
77 where 78 where
78 T: IntoIterator<Item = TableEntry<FileId, Parse>>, 79 T: IntoIterator<Item = TableEntry<HirFileId, Option<TreeArc<SyntaxNode>>>>,
79 { 80 {
80 let mut res = SyntaxTreeStats::default(); 81 let mut res = SyntaxTreeStats::default();
81 for entry in iter { 82 for entry in iter {
82 res.total += 1; 83 res.total += 1;
83 if let Some(value) = entry.value { 84 if let Some(tree) = entry.value.and_then(|it| it) {
84 res.retained += 1; 85 res.retained += 1;
85 res.retained_size += value.tree.syntax().memory_size_of_subtree(); 86 res.retained_size += tree.memory_size_of_subtree();
86 } 87 }
87 } 88 }
88 res 89 res