diff --git a/Cargo.lock b/Cargo.lock index a8113a87db..473a74a323 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -726,7 +726,7 @@ dependencies = [ "ra_syntax 0.1.0", "relative-path 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "salsa 0.10.0-alpha3 (registry+https://github.com/rust-lang/crates.io-index)", + "salsa 0.10.0-alpha4 (registry+https://github.com/rust-lang/crates.io-index)", "test_utils 0.1.0", ] @@ -746,7 +746,6 @@ dependencies = [ "ra_syntax 0.1.0", "relative-path 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "salsa 0.10.0-alpha3 (registry+https://github.com/rust-lang/crates.io-index)", "test_utils 0.1.0", ] @@ -768,7 +767,6 @@ dependencies = [ "rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "relative-path 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "salsa 0.10.0-alpha3 (registry+https://github.com/rust-lang/crates.io-index)", "test_utils 0.1.0", "unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1091,7 +1089,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "salsa" -version = "0.10.0-alpha3" +version = "0.10.0-alpha4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "derive-new 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1100,13 +1098,13 @@ dependencies = [ "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "salsa-macros 0.10.0-alpha3 (registry+https://github.com/rust-lang/crates.io-index)", + "salsa-macros 0.10.0-alpha4 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "salsa-macros" -version = "0.10.0-alpha3" +version = "0.10.0-alpha4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1697,8 +1695,8 @@ dependencies = [ "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum rusty-fork 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9591f190d2852720b679c21f66ad929f9f1d7bb09d1193c26167586029d8489c" "checksum ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "eb9e9b8cde282a9fe6a42dd4681319bfb63f121b8a8ee9439c6f4107e58a46f7" -"checksum salsa 0.10.0-alpha3 (registry+https://github.com/rust-lang/crates.io-index)" = "135c0977b23f8a9dc16744dd5495989110e3763ba5ea41e386741c7f8901e285" -"checksum salsa-macros 0.10.0-alpha3 (registry+https://github.com/rust-lang/crates.io-index)" = "c9c93b5efed7281334c4bed8470b278076d1ccd6a60da59a15cd0d57792afff8" +"checksum salsa 0.10.0-alpha4 (registry+https://github.com/rust-lang/crates.io-index)" = "3f442595eae948da8fbb2aa1e13940d9d2d70031753a27a5d1434f91b706ff12" +"checksum salsa-macros 0.10.0-alpha4 (registry+https://github.com/rust-lang/crates.io-index)" = "2e6c1a1bee4eb44881438e80c1a26db1c3b957b6cc51765615d429019babdec2" "checksum same-file 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8f20c4be53a8a1ff4c1f1b2bd14570d2f634628709752f0702ecdd2b3f9a5267" "checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" diff --git a/crates/ra_db/Cargo.toml b/crates/ra_db/Cargo.toml index 3568da905a..9aa77f72e0 100644 --- a/crates/ra_db/Cargo.toml +++ b/crates/ra_db/Cargo.toml @@ -6,9 +6,10 @@ authors = ["Aleksey Kladov "] [dependencies] relative-path = "0.4.0" -salsa = "0.10.0-alpha3" +salsa = "0.10.0-alpha4" rustc-hash = "1.0" parking_lot = "0.7.0" + ra_arena = { path = "../ra_arena" } ra_syntax = { path = "../ra_syntax" } test_utils = { path = "../test_utils" } diff --git a/crates/ra_db/src/lib.rs b/crates/ra_db/src/lib.rs index 7e13f70bc0..3a0aa7d246 100644 --- a/crates/ra_db/src/lib.rs +++ b/crates/ra_db/src/lib.rs @@ -63,7 +63,7 @@ pub struct FileRange { pub range: TextRange, } -#[salsa::query_group] +#[salsa::query_group(FilesDatabaseStorage)] pub trait FilesDatabase: salsa::Database { /// Text of the file. #[salsa::input] @@ -102,7 +102,7 @@ fn source_root_crates(db: &impl FilesDatabase, id: SourceRootId) -> Arc TreeArc; } diff --git a/crates/ra_hir/Cargo.toml b/crates/ra_hir/Cargo.toml index 3d802ade4f..57a4b155bb 100644 --- a/crates/ra_hir/Cargo.toml +++ b/crates/ra_hir/Cargo.toml @@ -12,7 +12,6 @@ rustc-hash = "1.0" parking_lot = "0.7.0" ena = "0.11" join_to_string = "0.1.3" -salsa = "0.10.0-alpha3" ra_syntax = { path = "../ra_syntax" } ra_arena = { path = "../ra_arena" } diff --git a/crates/ra_hir/src/db.rs b/crates/ra_hir/src/db.rs index 3c82262a28..dfbf41bd66 100644 --- a/crates/ra_hir/src/db.rs +++ b/crates/ra_hir/src/db.rs @@ -18,7 +18,7 @@ use crate::{ generics::{GenericParams, GenericDef}, }; -#[salsa::query_group] +#[salsa::query_group(HirDatabaseStorage)] pub trait HirDatabase: SyntaxDatabase + AsRef { #[salsa::invoke(HirFileId::hir_source_file)] fn hir_source_file(&self, file_id: HirFileId) -> TreeArc; diff --git a/crates/ra_hir/src/mock.rs b/crates/ra_hir/src/mock.rs index 36b174cd61..2dc252b1ee 100644 --- a/crates/ra_hir/src/mock.rs +++ b/crates/ra_hir/src/mock.rs @@ -2,7 +2,7 @@ use std::{sync::Arc, panic}; use parking_lot::Mutex; use ra_db::{ - BaseDatabase, FilePosition, FileId, CrateGraph, SourceRoot, SourceRootId, FilesDatabase, + BaseDatabase, FilePosition, FileId, CrateGraph, SourceRoot, SourceRootId, FilesDatabase, salsa, }; use relative_path::RelativePathBuf; use test_utils::{parse_fixture, CURSOR_MARKER, extract_offset}; @@ -11,7 +11,11 @@ use crate::{db, HirInterner}; pub const WORKSPACE: SourceRootId = SourceRootId(0); -#[salsa::database(ra_db::FilesDatabase, ra_db::SyntaxDatabase, db::HirDatabase)] +#[salsa::database( + ra_db::FilesDatabaseStorage, + ra_db::SyntaxDatabaseStorage, + db::HirDatabaseStorage +)] #[derive(Debug)] pub(crate) struct MockDatabase { events: Mutex>>>, diff --git a/crates/ra_ide_api/Cargo.toml b/crates/ra_ide_api/Cargo.toml index dfdddea501..79e473463f 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 f0190ae514..30891aed49 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 961f7b230d..bd9e3f1e3c 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 6184ad3ec3..e073a349ef 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]