aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/symbol_index.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src/symbol_index.rs')
-rw-r--r--crates/ra_ide_api/src/symbol_index.rs21
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};
35use ra_db::{SourceRootId, FilesDatabase, LocalSyntaxPtr}; 35use ra_db::{
36use salsa::ParallelDatabase; 36 SourceRootId, FilesDatabase, LocalSyntaxPtr,
37 salsa::{self, ParallelDatabase},
38};
37use rayon::prelude::*; 39use rayon::prelude::*;
38 40
39use crate::{ 41use crate::{
@@ -41,16 +43,11 @@ use crate::{
41 db::RootDatabase, 43 db::RootDatabase,
42}; 44};
43 45
44salsa::query_group! { 46#[salsa::query_group]
45 pub(crate) trait SymbolsDatabase: hir::db::HirDatabase { 47pub(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
56fn file_symbols(db: &impl SymbolsDatabase, file_id: FileId) -> Arc<SymbolIndex> { 53fn file_symbols(db: &impl SymbolsDatabase, file_id: FileId) -> Arc<SymbolIndex> {