From 1fd18f020dcf01a441925ac0a368a31f3ddf4047 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 25 Jan 2019 23:27:16 +0300 Subject: :arrow_up: salsa --- crates/ra_ide_api/Cargo.toml | 1 - crates/ra_ide_api/src/db.rs | 12 ++++++------ crates/ra_ide_api/src/imp.rs | 10 +++++----- crates/ra_ide_api/src/symbol_index.rs | 2 +- 4 files changed, 12 insertions(+), 13 deletions(-) (limited to 'crates/ra_ide_api') diff --git a/crates/ra_ide_api/Cargo.toml b/crates/ra_ide_api/Cargo.toml index dfdddea50..79e473463 100644 --- a/crates/ra_ide_api/Cargo.toml +++ b/crates/ra_ide_api/Cargo.toml @@ -14,7 +14,6 @@ fst = "0.3.1" rustc-hash = "1.0" parking_lot = "0.7.0" unicase = "2.2.0" -salsa = "0.10.0-alpha3" ra_syntax = { path = "../ra_syntax" } ra_ide_api_light = { path = "../ra_ide_api_light" } diff --git a/crates/ra_ide_api/src/db.rs b/crates/ra_ide_api/src/db.rs index f0190ae51..30891aed4 100644 --- a/crates/ra_ide_api/src/db.rs +++ b/crates/ra_ide_api/src/db.rs @@ -8,11 +8,11 @@ use ra_db::{ use crate::{symbol_index, LineIndex}; #[salsa::database( - ra_db::FilesDatabase, - ra_db::SyntaxDatabase, - LineIndexDatabase, - symbol_index::SymbolsDatabase, - hir::db::HirDatabase + ra_db::FilesDatabaseStorage, + ra_db::SyntaxDatabaseStorage, + LineIndexDatabaseStorage, + symbol_index::SymbolsDatabaseStorage, + hir::db::HirDatabaseStorage )] #[derive(Debug)] pub(crate) struct RootDatabase { @@ -62,7 +62,7 @@ impl AsRef for RootDatabase { } } -#[salsa::query_group] +#[salsa::query_group(LineIndexDatabaseStorage)] pub(crate) trait LineIndexDatabase: ra_db::FilesDatabase + BaseDatabase { fn line_index(&self, file_id: FileId) -> Arc; } diff --git a/crates/ra_ide_api/src/imp.rs b/crates/ra_ide_api/src/imp.rs index 961f7b230..bd9e3f1e3 100644 --- a/crates/ra_ide_api/src/imp.rs +++ b/crates/ra_ide_api/src/imp.rs @@ -5,7 +5,7 @@ use hir::{ }; use ra_db::{ FilesDatabase, SourceRoot, SourceRootId, SyntaxDatabase, - salsa::Database, + salsa::{Database, SweepStrategy}, }; use ra_ide_api_light::{self, assists, LocalEdit, Severity}; use ra_syntax::{ @@ -77,13 +77,13 @@ impl db::RootDatabase { /// for some reason. Needs investigation. pub(crate) fn collect_garbage(&mut self) { self.query(ra_db::SourceFileQuery) - .sweep(salsa::SweepStrategy::default().discard_values()); + .sweep(SweepStrategy::default().discard_values()); self.query(hir::db::HirSourceFileQuery) - .sweep(salsa::SweepStrategy::default().discard_values()); + .sweep(SweepStrategy::default().discard_values()); self.query(hir::db::FileItemsQuery) - .sweep(salsa::SweepStrategy::default().discard_values()); + .sweep(SweepStrategy::default().discard_values()); self.query(hir::db::FileItemQuery) - .sweep(salsa::SweepStrategy::default().discard_values()); + .sweep(SweepStrategy::default().discard_values()); } } diff --git a/crates/ra_ide_api/src/symbol_index.rs b/crates/ra_ide_api/src/symbol_index.rs index 6184ad3ec..e073a349e 100644 --- a/crates/ra_ide_api/src/symbol_index.rs +++ b/crates/ra_ide_api/src/symbol_index.rs @@ -44,7 +44,7 @@ use crate::{ db::RootDatabase, }; -#[salsa::query_group] +#[salsa::query_group(SymbolsDatabaseStorage)] pub(crate) trait SymbolsDatabase: hir::db::HirDatabase { fn file_symbols(&self, file_id: FileId) -> Arc; #[salsa::input] -- cgit v1.2.3