aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_db/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide_db/src/lib.rs')
-rw-r--r--crates/ide_db/src/lib.rs20
1 files changed, 3 insertions, 17 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
20use base_db::{ 20use 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};
25use hir::db::{AstDatabase, DefDatabase, HirDatabase}; 24use hir::db::{AstDatabase, DefDatabase, HirDatabase};
26use rustc_hash::FxHashSet; 25use rustc_hash::FxHashSet;
@@ -80,20 +79,7 @@ impl FileLoader for RootDatabase {
80 } 79 }
81} 80}
82 81
83impl salsa::Database for RootDatabase { 82impl 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
98impl Default for RootDatabase { 84impl 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)]
129pub trait LineIndexDatabase: base_db::SourceDatabase + CheckCanceled { 115pub 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