From 6c63a59425e256ce46d058807b64149297231982 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 4 May 2019 11:53:44 +0300 Subject: eagarly clean astd maps --- crates/ra_ide_api/src/change.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'crates/ra_ide_api') diff --git a/crates/ra_ide_api/src/change.rs b/crates/ra_ide_api/src/change.rs index 5bfdbe7e9..16b9ef3d5 100644 --- a/crates/ra_ide_api/src/change.rs +++ b/crates/ra_ide_api/src/change.rs @@ -186,6 +186,7 @@ impl RootDatabase { if let Some(crate_graph) = change.crate_graph { self.set_crate_graph(Arc::new(crate_graph)) } + self.collect_after_change() } fn apply_root_change(&mut self, root_id: SourceRootId, root_change: RootChange) { @@ -228,4 +229,9 @@ impl RootDatabase { self.query(hir::db::RawItemsWithSourceMapQuery).sweep(sweep); self.query(hir::db::BodyWithSourceMapQuery).sweep(sweep); } + + pub(crate) fn collect_after_change(&mut self) { + let sweep = SweepStrategy::default().discard_everything().sweep_all_revisions(); + self.query(hir::db::AstIdToNodeQuery).sweep(sweep) + } } -- cgit v1.2.3