From 332799d914bdd35740c25c27f5bac7e4b3cba6c7 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Fri, 20 Mar 2020 22:09:23 +0200 Subject: Reload only the properties that do not affect vfs --- crates/ra_ide_db/src/lib.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'crates/ra_ide_db') diff --git a/crates/ra_ide_db/src/lib.rs b/crates/ra_ide_db/src/lib.rs index 4faeefa8d..e6f2d36e9 100644 --- a/crates/ra_ide_db/src/lib.rs +++ b/crates/ra_ide_db/src/lib.rs @@ -115,12 +115,16 @@ impl RootDatabase { db.set_crate_graph_with_durability(Default::default(), Durability::HIGH); db.set_local_roots_with_durability(Default::default(), Durability::HIGH); db.set_library_roots_with_durability(Default::default(), Durability::HIGH); - let lru_capacity = lru_capacity.unwrap_or(ra_db::DEFAULT_LRU_CAP); - db.query_mut(ra_db::ParseQuery).set_lru_capacity(lru_capacity); - db.query_mut(hir::db::ParseMacroQuery).set_lru_capacity(lru_capacity); - db.query_mut(hir::db::MacroExpandQuery).set_lru_capacity(lru_capacity); + db.update_lru_capacity(lru_capacity); db } + + pub fn update_lru_capacity(&mut self, lru_capacity: Option) { + let lru_capacity = lru_capacity.unwrap_or(ra_db::DEFAULT_LRU_CAP); + self.query_mut(ra_db::ParseQuery).set_lru_capacity(lru_capacity); + self.query_mut(hir::db::ParseMacroQuery).set_lru_capacity(lru_capacity); + self.query_mut(hir::db::MacroExpandQuery).set_lru_capacity(lru_capacity); + } } impl salsa::ParallelDatabase for RootDatabase { -- cgit v1.2.3