From 33debc40654be9e9061c53784f6c762b2fd21eba Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Mon, 17 May 2021 19:07:10 +0200 Subject: Update salsa --- crates/ide_db/src/lib.rs | 20 +++----------------- crates/ide_db/src/symbol_index.rs | 2 +- 2 files changed, 4 insertions(+), 18 deletions(-) (limited to 'crates/ide_db') 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}; use base_db::{ salsa::{self, Durability}, - AnchoredPath, Canceled, CheckCanceled, CrateId, FileId, FileLoader, FileLoaderDelegate, - SourceDatabase, Upcast, + AnchoredPath, CrateId, FileId, FileLoader, FileLoaderDelegate, SourceDatabase, Upcast, }; use hir::db::{AstDatabase, DefDatabase, HirDatabase}; use rustc_hash::FxHashSet; @@ -80,20 +79,7 @@ impl FileLoader for RootDatabase { } } -impl salsa::Database for RootDatabase { - fn on_propagated_panic(&self) -> ! { - Canceled::throw() - } - fn salsa_event(&self, event: salsa::Event) { - match event.kind { - salsa::EventKind::DidValidateMemoizedValue { .. } - | salsa::EventKind::WillExecute { .. } => { - self.check_canceled(); - } - _ => (), - } - } -} +impl salsa::Database for RootDatabase {} impl Default for RootDatabase { fn default() -> RootDatabase { @@ -126,7 +112,7 @@ impl salsa::ParallelDatabase for RootDatabase { } #[salsa::query_group(LineIndexDatabaseStorage)] -pub trait LineIndexDatabase: base_db::SourceDatabase + CheckCanceled { +pub trait LineIndexDatabase: base_db::SourceDatabase { fn line_index(&self, file_id: FileId) -> Arc; } 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 Arc { - db.check_canceled(); + db.unwind_if_cancelled(); let parse = db.parse(file_id); let symbols = source_file_to_file_symbols(&parse.tree(), file_id); -- cgit v1.2.3