aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_ide_api/src/change.rs6
-rw-r--r--crates/ra_ide_api/src/status.rs4
2 files changed, 2 insertions, 8 deletions
diff --git a/crates/ra_ide_api/src/change.rs b/crates/ra_ide_api/src/change.rs
index b4ba3f3cd..981851829 100644
--- a/crates/ra_ide_api/src/change.rs
+++ b/crates/ra_ide_api/src/change.rs
@@ -13,7 +13,6 @@ use rustc_hash::FxHashMap;
13 13
14use crate::{ 14use crate::{
15 db::{DebugData, RootDatabase}, 15 db::{DebugData, RootDatabase},
16 status::syntax_tree_stats,
17 symbol_index::{SymbolIndex, SymbolsDatabase}, 16 symbol_index::{SymbolIndex, SymbolsDatabase},
18}; 17};
19 18
@@ -246,11 +245,6 @@ impl RootDatabase {
246 245
247 if self.last_gc_check.elapsed() > GC_COOLDOWN { 246 if self.last_gc_check.elapsed() > GC_COOLDOWN {
248 self.last_gc_check = crate::wasm_shims::Instant::now(); 247 self.last_gc_check = crate::wasm_shims::Instant::now();
249 let retained_trees = syntax_tree_stats(self).retained;
250 if retained_trees > 100 {
251 log::info!("automatic garbadge collection, {} retained trees", retained_trees);
252 self.collect_garbage();
253 }
254 } 248 }
255 } 249 }
256 250
diff --git a/crates/ra_ide_api/src/status.rs b/crates/ra_ide_api/src/status.rs
index c037e496d..dee2ea46a 100644
--- a/crates/ra_ide_api/src/status.rs
+++ b/crates/ra_ide_api/src/status.rs
@@ -17,10 +17,10 @@ use crate::{
17 FileId, 17 FileId,
18}; 18};
19 19
20pub(crate) fn syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats { 20fn syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats {
21 db.query(ra_db::ParseQuery).entries::<SyntaxTreeStats>() 21 db.query(ra_db::ParseQuery).entries::<SyntaxTreeStats>()
22} 22}
23pub(crate) fn macro_syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats { 23fn macro_syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats {
24 db.query(hir::db::ParseMacroQuery).entries::<SyntaxTreeStats>() 24 db.query(hir::db::ParseMacroQuery).entries::<SyntaxTreeStats>()
25} 25}
26 26