eagarly clean astd maps

This commit is contained in:
Aleksey Kladov 2019-05-04 11:53:44 +03:00
parent 11cc8024a1
commit 6c63a59425
4 changed files with 9 additions and 3 deletions

View file

@ -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)
}
}