aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock14
-rw-r--r--crates/ra_db/Cargo.toml3
-rw-r--r--crates/ra_db/src/lib.rs4
-rw-r--r--crates/ra_hir/Cargo.toml1
-rw-r--r--crates/ra_hir/src/db.rs2
-rw-r--r--crates/ra_hir/src/mock.rs8
-rw-r--r--crates/ra_ide_api/Cargo.toml1
-rw-r--r--crates/ra_ide_api/src/db.rs12
-rw-r--r--crates/ra_ide_api/src/imp.rs10
-rw-r--r--crates/ra_ide_api/src/symbol_index.rs2
10 files changed, 29 insertions, 28 deletions
diff --git a/Cargo.lock b/Cargo.lock
index a8113a87d..473a74a32 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -726,7 +726,7 @@ dependencies = [
726 "ra_syntax 0.1.0", 726 "ra_syntax 0.1.0",
727 "relative-path 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 727 "relative-path 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
728 "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 728 "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
729 "salsa 0.10.0-alpha3 (registry+https://github.com/rust-lang/crates.io-index)", 729 "salsa 0.10.0-alpha4 (registry+https://github.com/rust-lang/crates.io-index)",
730 "test_utils 0.1.0", 730 "test_utils 0.1.0",
731] 731]
732 732
@@ -746,7 +746,6 @@ dependencies = [
746 "ra_syntax 0.1.0", 746 "ra_syntax 0.1.0",
747 "relative-path 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 747 "relative-path 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
748 "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 748 "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
749 "salsa 0.10.0-alpha3 (registry+https://github.com/rust-lang/crates.io-index)",
750 "test_utils 0.1.0", 749 "test_utils 0.1.0",
751] 750]
752 751
@@ -768,7 +767,6 @@ dependencies = [
768 "rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", 767 "rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
769 "relative-path 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", 768 "relative-path 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
770 "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 769 "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
771 "salsa 0.10.0-alpha3 (registry+https://github.com/rust-lang/crates.io-index)",
772 "test_utils 0.1.0", 770 "test_utils 0.1.0",
773 "unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 771 "unicase 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
774] 772]
@@ -1091,7 +1089,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1091 1089
1092[[package]] 1090[[package]]
1093name = "salsa" 1091name = "salsa"
1094version = "0.10.0-alpha3" 1092version = "0.10.0-alpha4"
1095source = "registry+https://github.com/rust-lang/crates.io-index" 1093source = "registry+https://github.com/rust-lang/crates.io-index"
1096dependencies = [ 1094dependencies = [
1097 "derive-new 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", 1095 "derive-new 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1100,13 +1098,13 @@ dependencies = [
1100 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", 1098 "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
1101 "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", 1099 "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
1102 "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 1100 "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
1103 "salsa-macros 0.10.0-alpha3 (registry+https://github.com/rust-lang/crates.io-index)", 1101 "salsa-macros 0.10.0-alpha4 (registry+https://github.com/rust-lang/crates.io-index)",
1104 "smallvec 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", 1102 "smallvec 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
1105] 1103]
1106 1104
1107[[package]] 1105[[package]]
1108name = "salsa-macros" 1106name = "salsa-macros"
1109version = "0.10.0-alpha3" 1107version = "0.10.0-alpha4"
1110source = "registry+https://github.com/rust-lang/crates.io-index" 1108source = "registry+https://github.com/rust-lang/crates.io-index"
1111dependencies = [ 1109dependencies = [
1112 "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", 1110 "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1697,8 +1695,8 @@ dependencies = [
1697"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" 1695"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
1698"checksum rusty-fork 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9591f190d2852720b679c21f66ad929f9f1d7bb09d1193c26167586029d8489c" 1696"checksum rusty-fork 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9591f190d2852720b679c21f66ad929f9f1d7bb09d1193c26167586029d8489c"
1699"checksum ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "eb9e9b8cde282a9fe6a42dd4681319bfb63f121b8a8ee9439c6f4107e58a46f7" 1697"checksum ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "eb9e9b8cde282a9fe6a42dd4681319bfb63f121b8a8ee9439c6f4107e58a46f7"
1700"checksum salsa 0.10.0-alpha3 (registry+https://github.com/rust-lang/crates.io-index)" = "135c0977b23f8a9dc16744dd5495989110e3763ba5ea41e386741c7f8901e285" 1698"checksum salsa 0.10.0-alpha4 (registry+https://github.com/rust-lang/crates.io-index)" = "3f442595eae948da8fbb2aa1e13940d9d2d70031753a27a5d1434f91b706ff12"
1701"checksum salsa-macros 0.10.0-alpha3 (registry+https://github.com/rust-lang/crates.io-index)" = "c9c93b5efed7281334c4bed8470b278076d1ccd6a60da59a15cd0d57792afff8" 1699"checksum salsa-macros 0.10.0-alpha4 (registry+https://github.com/rust-lang/crates.io-index)" = "2e6c1a1bee4eb44881438e80c1a26db1c3b957b6cc51765615d429019babdec2"
1702"checksum same-file 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8f20c4be53a8a1ff4c1f1b2bd14570d2f634628709752f0702ecdd2b3f9a5267" 1700"checksum same-file 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8f20c4be53a8a1ff4c1f1b2bd14570d2f634628709752f0702ecdd2b3f9a5267"
1703"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" 1701"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27"
1704"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" 1702"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 3568da905..9aa77f72e 100644
--- a/crates/ra_db/Cargo.toml
+++ b/crates/ra_db/Cargo.toml
@@ -6,9 +6,10 @@ authors = ["Aleksey Kladov <[email protected]>"]
6 6
7[dependencies] 7[dependencies]
8relative-path = "0.4.0" 8relative-path = "0.4.0"
9salsa = "0.10.0-alpha3" 9salsa = "0.10.0-alpha4"
10rustc-hash = "1.0" 10rustc-hash = "1.0"
11parking_lot = "0.7.0" 11parking_lot = "0.7.0"
12
12ra_arena = { path = "../ra_arena" } 13ra_arena = { path = "../ra_arena" }
13ra_syntax = { path = "../ra_syntax" } 14ra_syntax = { path = "../ra_syntax" }
14test_utils = { path = "../test_utils" } 15test_utils = { path = "../test_utils" }
diff --git a/crates/ra_db/src/lib.rs b/crates/ra_db/src/lib.rs
index 7e13f70bc..3a0aa7d24 100644
--- a/crates/ra_db/src/lib.rs
+++ b/crates/ra_db/src/lib.rs
@@ -63,7 +63,7 @@ pub struct FileRange {
63 pub range: TextRange, 63 pub range: TextRange,
64} 64}
65 65
66#[salsa::query_group] 66#[salsa::query_group(FilesDatabaseStorage)]
67pub trait FilesDatabase: salsa::Database { 67pub trait FilesDatabase: salsa::Database {
68 /// Text of the file. 68 /// Text of the file.
69 #[salsa::input] 69 #[salsa::input]
@@ -102,7 +102,7 @@ fn source_root_crates(db: &impl FilesDatabase, id: SourceRootId) -> Arc<Vec<Crat
102 Arc::new(res) 102 Arc::new(res)
103} 103}
104 104
105#[salsa::query_group] 105#[salsa::query_group(SyntaxDatabaseStorage)]
106pub trait SyntaxDatabase: FilesDatabase + BaseDatabase { 106pub trait SyntaxDatabase: FilesDatabase + BaseDatabase {
107 fn source_file(&self, file_id: FileId) -> TreeArc<SourceFile>; 107 fn source_file(&self, file_id: FileId) -> TreeArc<SourceFile>;
108} 108}
diff --git a/crates/ra_hir/Cargo.toml b/crates/ra_hir/Cargo.toml
index 3d802ade4..57a4b155b 100644
--- a/crates/ra_hir/Cargo.toml
+++ b/crates/ra_hir/Cargo.toml
@@ -12,7 +12,6 @@ rustc-hash = "1.0"
12parking_lot = "0.7.0" 12parking_lot = "0.7.0"
13ena = "0.11" 13ena = "0.11"
14join_to_string = "0.1.3" 14join_to_string = "0.1.3"
15salsa = "0.10.0-alpha3"
16 15
17ra_syntax = { path = "../ra_syntax" } 16ra_syntax = { path = "../ra_syntax" }
18ra_arena = { path = "../ra_arena" } 17ra_arena = { path = "../ra_arena" }
diff --git a/crates/ra_hir/src/db.rs b/crates/ra_hir/src/db.rs
index 3c82262a2..dfbf41bd6 100644
--- a/crates/ra_hir/src/db.rs
+++ b/crates/ra_hir/src/db.rs
@@ -18,7 +18,7 @@ use crate::{
18 generics::{GenericParams, GenericDef}, 18 generics::{GenericParams, GenericDef},
19}; 19};
20 20
21#[salsa::query_group] 21#[salsa::query_group(HirDatabaseStorage)]
22pub trait HirDatabase: SyntaxDatabase + AsRef<HirInterner> { 22pub trait HirDatabase: SyntaxDatabase + AsRef<HirInterner> {
23 #[salsa::invoke(HirFileId::hir_source_file)] 23 #[salsa::invoke(HirFileId::hir_source_file)]
24 fn hir_source_file(&self, file_id: HirFileId) -> TreeArc<SourceFile>; 24 fn hir_source_file(&self, file_id: HirFileId) -> TreeArc<SourceFile>;
diff --git a/crates/ra_hir/src/mock.rs b/crates/ra_hir/src/mock.rs
index 36b174cd6..2dc252b1e 100644
--- a/crates/ra_hir/src/mock.rs
+++ b/crates/ra_hir/src/mock.rs
@@ -2,7 +2,7 @@ use std::{sync::Arc, panic};
2 2
3use parking_lot::Mutex; 3use parking_lot::Mutex;
4use ra_db::{ 4use ra_db::{
5 BaseDatabase, FilePosition, FileId, CrateGraph, SourceRoot, SourceRootId, FilesDatabase, 5 BaseDatabase, FilePosition, FileId, CrateGraph, SourceRoot, SourceRootId, FilesDatabase, salsa,
6}; 6};
7use relative_path::RelativePathBuf; 7use relative_path::RelativePathBuf;
8use test_utils::{parse_fixture, CURSOR_MARKER, extract_offset}; 8use test_utils::{parse_fixture, CURSOR_MARKER, extract_offset};
@@ -11,7 +11,11 @@ use crate::{db, HirInterner};
11 11
12pub const WORKSPACE: SourceRootId = SourceRootId(0); 12pub const WORKSPACE: SourceRootId = SourceRootId(0);
13 13
14#[salsa::database(ra_db::FilesDatabase, ra_db::SyntaxDatabase, db::HirDatabase)] 14#[salsa::database(
15 ra_db::FilesDatabaseStorage,
16 ra_db::SyntaxDatabaseStorage,
17 db::HirDatabaseStorage
18)]
15#[derive(Debug)] 19#[derive(Debug)]
16pub(crate) struct MockDatabase { 20pub(crate) struct MockDatabase {
17 events: Mutex<Option<Vec<salsa::Event<MockDatabase>>>>, 21 events: Mutex<Option<Vec<salsa::Event<MockDatabase>>>>,
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"
14rustc-hash = "1.0" 14rustc-hash = "1.0"
15parking_lot = "0.7.0" 15parking_lot = "0.7.0"
16unicase = "2.2.0" 16unicase = "2.2.0"
17salsa = "0.10.0-alpha3"
18 17
19ra_syntax = { path = "../ra_syntax" } 18ra_syntax = { path = "../ra_syntax" }
20ra_ide_api_light = { path = "../ra_ide_api_light" } 19ra_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::{
8use crate::{symbol_index, LineIndex}; 8use crate::{symbol_index, LineIndex};
9 9
10#[salsa::database( 10#[salsa::database(
11 ra_db::FilesDatabase, 11 ra_db::FilesDatabaseStorage,
12 ra_db::SyntaxDatabase, 12 ra_db::SyntaxDatabaseStorage,
13 LineIndexDatabase, 13 LineIndexDatabaseStorage,
14 symbol_index::SymbolsDatabase, 14 symbol_index::SymbolsDatabaseStorage,
15 hir::db::HirDatabase 15 hir::db::HirDatabaseStorage
16)] 16)]
17#[derive(Debug)] 17#[derive(Debug)]
18pub(crate) struct RootDatabase { 18pub(crate) struct RootDatabase {
@@ -62,7 +62,7 @@ impl AsRef<hir::HirInterner> for RootDatabase {
62 } 62 }
63} 63}
64 64
65#[salsa::query_group] 65#[salsa::query_group(LineIndexDatabaseStorage)]
66pub(crate) trait LineIndexDatabase: ra_db::FilesDatabase + BaseDatabase { 66pub(crate) trait LineIndexDatabase: ra_db::FilesDatabase + BaseDatabase {
67 fn line_index(&self, file_id: FileId) -> Arc<LineIndex>; 67 fn line_index(&self, file_id: FileId) -> Arc<LineIndex>;
68} 68}
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::{
5}; 5};
6use ra_db::{ 6use ra_db::{
7 FilesDatabase, SourceRoot, SourceRootId, SyntaxDatabase, 7 FilesDatabase, SourceRoot, SourceRootId, SyntaxDatabase,
8 salsa::Database, 8 salsa::{Database, SweepStrategy},
9}; 9};
10use ra_ide_api_light::{self, assists, LocalEdit, Severity}; 10use ra_ide_api_light::{self, assists, LocalEdit, Severity};
11use ra_syntax::{ 11use ra_syntax::{
@@ -77,13 +77,13 @@ impl db::RootDatabase {
77 /// for some reason. Needs investigation. 77 /// for some reason. Needs investigation.
78 pub(crate) fn collect_garbage(&mut self) { 78 pub(crate) fn collect_garbage(&mut self) {
79 self.query(ra_db::SourceFileQuery) 79 self.query(ra_db::SourceFileQuery)
80 .sweep(salsa::SweepStrategy::default().discard_values()); 80 .sweep(SweepStrategy::default().discard_values());
81 self.query(hir::db::HirSourceFileQuery) 81 self.query(hir::db::HirSourceFileQuery)
82 .sweep(salsa::SweepStrategy::default().discard_values()); 82 .sweep(SweepStrategy::default().discard_values());
83 self.query(hir::db::FileItemsQuery) 83 self.query(hir::db::FileItemsQuery)
84 .sweep(salsa::SweepStrategy::default().discard_values()); 84 .sweep(SweepStrategy::default().discard_values());
85 self.query(hir::db::FileItemQuery) 85 self.query(hir::db::FileItemQuery)
86 .sweep(salsa::SweepStrategy::default().discard_values()); 86 .sweep(SweepStrategy::default().discard_values());
87 } 87 }
88} 88}
89 89
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::{
44 db::RootDatabase, 44 db::RootDatabase,
45}; 45};
46 46
47#[salsa::query_group] 47#[salsa::query_group(SymbolsDatabaseStorage)]
48pub(crate) trait SymbolsDatabase: hir::db::HirDatabase { 48pub(crate) trait SymbolsDatabase: hir::db::HirDatabase {
49 fn file_symbols(&self, file_id: FileId) -> Arc<SymbolIndex>; 49 fn file_symbols(&self, file_id: FileId) -> Arc<SymbolIndex>;
50 #[salsa::input] 50 #[salsa::input]