mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
ide: parallel prime caches
This commit is contained in:
parent
b4c31481a5
commit
3168148cc6
6 changed files with 275 additions and 26 deletions
|
@ -87,7 +87,7 @@ pub use crate::{
|
|||
moniker::{MonikerKind, MonikerResult, PackageInformation},
|
||||
move_item::Direction,
|
||||
navigation_target::NavigationTarget,
|
||||
prime_caches::PrimeCachesProgress,
|
||||
prime_caches::{ParallelPrimeCachesProgress, PrimeCachesProgress},
|
||||
references::ReferenceSearchResult,
|
||||
rename::RenameError,
|
||||
runnables::{Runnable, RunnableKind, TestId},
|
||||
|
@ -251,6 +251,13 @@ impl Analysis {
|
|||
self.with_db(move |db| prime_caches::prime_caches(db, &cb))
|
||||
}
|
||||
|
||||
pub fn parallel_prime_caches<F>(&self, num_worker_threads: u8, 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))
|
||||
}
|
||||
|
||||
/// Gets the text of the source file.
|
||||
pub fn file_text(&self, file_id: FileId) -> Cancellable<Arc<String>> {
|
||||
self.with_db(|db| db.file_text(file_id))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue