diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-17 11:17:46 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-17 11:17:46 +0000 |
commit | 168c46ab777f6e3263bb2e58f0ce9b0b1619114e (patch) | |
tree | 0723f5b15899902811d027587a46698016d21d54 /crates/ra_ide_api/src/symbol_index.rs | |
parent | 454cc313589fb17de92d6f3dbf576a5ea5f4adf2 (diff) | |
parent | a2ca03d10b093ea20d7db8bfd78aa1e787482cc0 (diff) |
Merge #561
561: :arrow_up: salsa r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src/symbol_index.rs')
-rw-r--r-- | crates/ra_ide_api/src/symbol_index.rs | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/crates/ra_ide_api/src/symbol_index.rs b/crates/ra_ide_api/src/symbol_index.rs index 74165d68f..bfa2f3469 100644 --- a/crates/ra_ide_api/src/symbol_index.rs +++ b/crates/ra_ide_api/src/symbol_index.rs | |||
@@ -32,8 +32,10 @@ use ra_syntax::{ | |||
32 | SyntaxKind::{self, *}, | 32 | SyntaxKind::{self, *}, |
33 | ast::{self, NameOwner}, | 33 | ast::{self, NameOwner}, |
34 | }; | 34 | }; |
35 | use ra_db::{SourceRootId, FilesDatabase, LocalSyntaxPtr}; | 35 | use ra_db::{ |
36 | use salsa::ParallelDatabase; | 36 | SourceRootId, FilesDatabase, LocalSyntaxPtr, |
37 | salsa::{self, ParallelDatabase}, | ||
38 | }; | ||
37 | use rayon::prelude::*; | 39 | use rayon::prelude::*; |
38 | 40 | ||
39 | use crate::{ | 41 | use crate::{ |
@@ -41,16 +43,11 @@ use crate::{ | |||
41 | db::RootDatabase, | 43 | db::RootDatabase, |
42 | }; | 44 | }; |
43 | 45 | ||
44 | salsa::query_group! { | 46 | #[salsa::query_group] |
45 | pub(crate) trait SymbolsDatabase: hir::db::HirDatabase { | 47 | pub(crate) trait SymbolsDatabase: hir::db::HirDatabase { |
46 | fn file_symbols(file_id: FileId) -> Arc<SymbolIndex> { | 48 | fn file_symbols(&self, file_id: FileId) -> Arc<SymbolIndex>; |
47 | type FileSymbolsQuery; | 49 | #[salsa::input] |
48 | } | 50 | fn library_symbols(&self, id: SourceRootId) -> Arc<SymbolIndex>; |
49 | fn library_symbols(id: SourceRootId) -> Arc<SymbolIndex> { | ||
50 | type LibrarySymbolsQuery; | ||
51 | storage input; | ||
52 | } | ||
53 | } | ||
54 | } | 51 | } |
55 | 52 | ||
56 | fn file_symbols(db: &impl SymbolsDatabase, file_id: FileId) -> Arc<SymbolIndex> { | 53 | fn file_symbols(db: &impl SymbolsDatabase, file_id: FileId) -> Arc<SymbolIndex> { |