diff options
Diffstat (limited to 'crates/ra_ide_api/src/symbol_index.rs')
-rw-r--r-- | crates/ra_ide_api/src/symbol_index.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/crates/ra_ide_api/src/symbol_index.rs b/crates/ra_ide_api/src/symbol_index.rs index e073a349e..230ff410e 100644 --- a/crates/ra_ide_api/src/symbol_index.rs +++ b/crates/ra_ide_api/src/symbol_index.rs | |||
@@ -34,7 +34,7 @@ use ra_syntax::{ | |||
34 | ast::{self, NameOwner}, | 34 | ast::{self, NameOwner}, |
35 | }; | 35 | }; |
36 | use ra_db::{ | 36 | use ra_db::{ |
37 | SourceRootId, FilesDatabase, | 37 | SourceRootId, SourceDatabase, |
38 | salsa::{self, ParallelDatabase}, | 38 | salsa::{self, ParallelDatabase}, |
39 | }; | 39 | }; |
40 | use rayon::prelude::*; | 40 | use rayon::prelude::*; |
@@ -49,6 +49,14 @@ pub(crate) trait SymbolsDatabase: hir::db::HirDatabase { | |||
49 | fn file_symbols(&self, file_id: FileId) -> Arc<SymbolIndex>; | 49 | fn file_symbols(&self, file_id: FileId) -> Arc<SymbolIndex>; |
50 | #[salsa::input] | 50 | #[salsa::input] |
51 | fn library_symbols(&self, id: SourceRootId) -> Arc<SymbolIndex>; | 51 | fn library_symbols(&self, id: SourceRootId) -> Arc<SymbolIndex>; |
52 | /// The set of "local" (that is, from the current workspace) roots. | ||
53 | /// Files in local roots are assumed to change frequently. | ||
54 | #[salsa::input] | ||
55 | fn local_roots(&self) -> Arc<Vec<SourceRootId>>; | ||
56 | /// The set of roots for crates.io libraries. | ||
57 | /// Files in libraries are assumed to never change. | ||
58 | #[salsa::input] | ||
59 | fn library_roots(&self) -> Arc<Vec<SourceRootId>>; | ||
52 | } | 60 | } |
53 | 61 | ||
54 | fn file_symbols(db: &impl SymbolsDatabase, file_id: FileId) -> Arc<SymbolIndex> { | 62 | fn file_symbols(db: &impl SymbolsDatabase, file_id: FileId) -> Arc<SymbolIndex> { |