diff options
author | Jonas Schievink <[email protected]> | 2021-05-17 18:07:10 +0100 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2021-05-27 14:05:41 +0100 |
commit | 33debc40654be9e9061c53784f6c762b2fd21eba (patch) | |
tree | def63d3cc42fe48b1dfdf716c2e8e56de5324dab /crates/ide_db | |
parent | d0a4ba294ccf0c925a5ff1115c19a60c6a24b734 (diff) |
Update salsa
Diffstat (limited to 'crates/ide_db')
-rw-r--r-- | crates/ide_db/src/lib.rs | 20 | ||||
-rw-r--r-- | crates/ide_db/src/symbol_index.rs | 2 |
2 files changed, 4 insertions, 18 deletions
diff --git a/crates/ide_db/src/lib.rs b/crates/ide_db/src/lib.rs index 88ee4a87d..1f900aef4 100644 --- a/crates/ide_db/src/lib.rs +++ b/crates/ide_db/src/lib.rs | |||
@@ -19,8 +19,7 @@ use std::{fmt, sync::Arc}; | |||
19 | 19 | ||
20 | use base_db::{ | 20 | use base_db::{ |
21 | salsa::{self, Durability}, | 21 | salsa::{self, Durability}, |
22 | AnchoredPath, Canceled, CheckCanceled, CrateId, FileId, FileLoader, FileLoaderDelegate, | 22 | AnchoredPath, CrateId, FileId, FileLoader, FileLoaderDelegate, SourceDatabase, Upcast, |
23 | SourceDatabase, Upcast, | ||
24 | }; | 23 | }; |
25 | use hir::db::{AstDatabase, DefDatabase, HirDatabase}; | 24 | use hir::db::{AstDatabase, DefDatabase, HirDatabase}; |
26 | use rustc_hash::FxHashSet; | 25 | use rustc_hash::FxHashSet; |
@@ -80,20 +79,7 @@ impl FileLoader for RootDatabase { | |||
80 | } | 79 | } |
81 | } | 80 | } |
82 | 81 | ||
83 | impl salsa::Database for RootDatabase { | 82 | impl salsa::Database for RootDatabase {} |
84 | fn on_propagated_panic(&self) -> ! { | ||
85 | Canceled::throw() | ||
86 | } | ||
87 | fn salsa_event(&self, event: salsa::Event) { | ||
88 | match event.kind { | ||
89 | salsa::EventKind::DidValidateMemoizedValue { .. } | ||
90 | | salsa::EventKind::WillExecute { .. } => { | ||
91 | self.check_canceled(); | ||
92 | } | ||
93 | _ => (), | ||
94 | } | ||
95 | } | ||
96 | } | ||
97 | 83 | ||
98 | impl Default for RootDatabase { | 84 | impl Default for RootDatabase { |
99 | fn default() -> RootDatabase { | 85 | fn default() -> RootDatabase { |
@@ -126,7 +112,7 @@ impl salsa::ParallelDatabase for RootDatabase { | |||
126 | } | 112 | } |
127 | 113 | ||
128 | #[salsa::query_group(LineIndexDatabaseStorage)] | 114 | #[salsa::query_group(LineIndexDatabaseStorage)] |
129 | pub trait LineIndexDatabase: base_db::SourceDatabase + CheckCanceled { | 115 | pub trait LineIndexDatabase: base_db::SourceDatabase { |
130 | fn line_index(&self, file_id: FileId) -> Arc<LineIndex>; | 116 | fn line_index(&self, file_id: FileId) -> Arc<LineIndex>; |
131 | } | 117 | } |
132 | 118 | ||
diff --git a/crates/ide_db/src/symbol_index.rs b/crates/ide_db/src/symbol_index.rs index 0f5c4abc4..5c372a7e5 100644 --- a/crates/ide_db/src/symbol_index.rs +++ b/crates/ide_db/src/symbol_index.rs | |||
@@ -127,7 +127,7 @@ fn library_symbols(db: &dyn SymbolsDatabase) -> Arc<FxHashMap<SourceRootId, Symb | |||
127 | } | 127 | } |
128 | 128 | ||
129 | fn file_symbols(db: &dyn SymbolsDatabase, file_id: FileId) -> Arc<SymbolIndex> { | 129 | fn file_symbols(db: &dyn SymbolsDatabase, file_id: FileId) -> Arc<SymbolIndex> { |
130 | db.check_canceled(); | 130 | db.unwind_if_cancelled(); |
131 | let parse = db.parse(file_id); | 131 | let parse = db.parse(file_id); |
132 | 132 | ||
133 | let symbols = source_file_to_file_symbols(&parse.tree(), file_id); | 133 | let symbols = source_file_to_file_symbols(&parse.tree(), file_id); |