Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/lib.rs')
-rw-r--r--crates/ide/src/lib.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/crates/ide/src/lib.rs b/crates/ide/src/lib.rs
index dded01520f..c4a3ec1e8e 100644
--- a/crates/ide/src/lib.rs
+++ b/crates/ide/src/lib.rs
@@ -333,11 +333,21 @@ impl Analysis {
})
}
- pub fn parallel_prime_caches<F>(&self, num_worker_threads: usize, cb: F) -> Cancellable<()>
+ /// Warm caches for the given `scope`. `scope` must be closed under
+ /// transitive dependencies; callers that want to prime everything pass
+ /// `&base_db::all_crates(db)`.
+ pub fn parallel_prime_caches<F>(
+ &self,
+ scope: &[Crate],
+ num_worker_threads: usize,
+ cb: F,
+ ) -> Cancellable<()>
where
F: Fn(ParallelPrimeCachesProgress) + Sync + std::panic::UnwindSafe,
{
- self.with_db(move |db| prime_caches::parallel_prime_caches(db, num_worker_threads, &cb))
+ self.with_db(move |db| {
+ prime_caches::parallel_prime_caches(db, scope, num_worker_threads, &cb)
+ })
}
/// Gets the text of the source file.