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.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/crates/ide/src/lib.rs b/crates/ide/src/lib.rs
index 431aa30e56..a2ac62341d 100644
--- a/crates/ide/src/lib.rs
+++ b/crates/ide/src/lib.rs
@@ -273,11 +273,18 @@ impl Analysis {
self.with_db(|db| status::status(db, file_id))
}
- pub fn source_root(&self, file_id: FileId) -> Cancellable<SourceRootId> {
+ pub fn source_root_id(&self, file_id: FileId) -> Cancellable<SourceRootId> {
self.with_db(|db| db.file_source_root(file_id))
}
- pub fn parallel_prime_caches<F>(&self, num_worker_threads: u8, cb: F) -> Cancellable<()>
+ pub fn is_local_source_root(&self, source_root_id: SourceRootId) -> Cancellable<bool> {
+ self.with_db(|db| {
+ let sr = db.source_root(source_root_id);
+ !sr.is_library
+ })
+ }
+
+ pub fn parallel_prime_caches<F>(&self, num_worker_threads: usize, cb: F) -> Cancellable<()>
where
F: Fn(ParallelPrimeCachesProgress) + Sync + std::panic::UnwindSafe,
{