diff options
author | Aleksey Kladov <[email protected]> | 2020-07-07 09:14:48 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-07-07 09:14:48 +0100 |
commit | 4bbc385277bcab509c321b1374f72f1ef19d7750 (patch) | |
tree | 74488258fb566dc4344165ade6067d8f2ce7298f /crates/ra_ide_db/src/symbol_index.rs | |
parent | d4bc2f25de6297c75f7b7f029df224b650ef3143 (diff) |
Switch to fully dynamically dispatched salsa
This improves compile times quite a bit
Diffstat (limited to 'crates/ra_ide_db/src/symbol_index.rs')
-rw-r--r-- | crates/ra_ide_db/src/symbol_index.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/crates/ra_ide_db/src/symbol_index.rs b/crates/ra_ide_db/src/symbol_index.rs index 5a09e7d1d..131e2a128 100644 --- a/crates/ra_ide_db/src/symbol_index.rs +++ b/crates/ra_ide_db/src/symbol_index.rs | |||
@@ -87,7 +87,7 @@ impl Query { | |||
87 | } | 87 | } |
88 | 88 | ||
89 | #[salsa::query_group(SymbolsDatabaseStorage)] | 89 | #[salsa::query_group(SymbolsDatabaseStorage)] |
90 | pub trait SymbolsDatabase: hir::db::HirDatabase + SourceDatabaseExt + ParallelDatabase { | 90 | pub trait SymbolsDatabase: hir::db::HirDatabase + SourceDatabaseExt { |
91 | fn file_symbols(&self, file_id: FileId) -> Arc<SymbolIndex>; | 91 | fn file_symbols(&self, file_id: FileId) -> Arc<SymbolIndex>; |
92 | fn library_symbols(&self) -> Arc<FxHashMap<SourceRootId, SymbolIndex>>; | 92 | fn library_symbols(&self) -> Arc<FxHashMap<SourceRootId, SymbolIndex>>; |
93 | /// The set of "local" (that is, from the current workspace) roots. | 93 | /// The set of "local" (that is, from the current workspace) roots. |
@@ -100,9 +100,7 @@ pub trait SymbolsDatabase: hir::db::HirDatabase + SourceDatabaseExt + ParallelDa | |||
100 | fn library_roots(&self) -> Arc<FxHashSet<SourceRootId>>; | 100 | fn library_roots(&self) -> Arc<FxHashSet<SourceRootId>>; |
101 | } | 101 | } |
102 | 102 | ||
103 | fn library_symbols( | 103 | fn library_symbols(db: &dyn SymbolsDatabase) -> Arc<FxHashMap<SourceRootId, SymbolIndex>> { |
104 | db: &(impl SymbolsDatabase + ParallelDatabase), | ||
105 | ) -> Arc<FxHashMap<SourceRootId, SymbolIndex>> { | ||
106 | let _p = profile("library_symbols"); | 104 | let _p = profile("library_symbols"); |
107 | 105 | ||
108 | let roots = db.library_roots(); | 106 | let roots = db.library_roots(); |
@@ -123,7 +121,7 @@ fn library_symbols( | |||
123 | Arc::new(res) | 121 | Arc::new(res) |
124 | } | 122 | } |
125 | 123 | ||
126 | fn file_symbols(db: &impl SymbolsDatabase, file_id: FileId) -> Arc<SymbolIndex> { | 124 | fn file_symbols(db: &dyn SymbolsDatabase, file_id: FileId) -> Arc<SymbolIndex> { |
127 | db.check_canceled(); | 125 | db.check_canceled(); |
128 | let parse = db.parse(file_id); | 126 | let parse = db.parse(file_id); |
129 | 127 | ||