add gc request
This commit is contained in:
@@ -72,13 +72,14 @@ impl db::RootDatabase {
|
||||
self.set_source_root(root_id, Arc::new(source_root));
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
/// Ideally, we should call this function from time to time to collect heavy
|
||||
/// syntax trees. However, if we actually do that, everything is recomputed
|
||||
/// for some reason. Needs investigation.
|
||||
fn gc_syntax_trees(&mut self) {
|
||||
pub(crate) fn collect_garbage(&mut self) {
|
||||
self.query(ra_db::SourceFileQuery)
|
||||
.sweep(salsa::SweepStrategy::default().discard_values());
|
||||
self.query(hir::db::HirSourceFileQuery)
|
||||
.sweep(salsa::SweepStrategy::default().discard_values());
|
||||
self.query(hir::db::FileItemsQuery)
|
||||
.sweep(salsa::SweepStrategy::default().discard_values());
|
||||
self.query(hir::db::FileItemQuery)
|
||||
|
||||
@@ -285,6 +285,10 @@ impl AnalysisHost {
|
||||
pub fn apply_change(&mut self, change: AnalysisChange) {
|
||||
self.db.apply_change(change)
|
||||
}
|
||||
|
||||
pub fn collect_garbage(&mut self) {
|
||||
self.db.collect_garbage();
|
||||
}
|
||||
}
|
||||
|
||||
/// Analysis is a snapshot of a world state at a moment in time. It is the main
|
||||
|
||||
Reference in New Issue
Block a user