aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-10-20 16:43:02 +0100
committerAleksey Kladov <[email protected]>2018-10-20 16:43:02 +0100
commit73dd870da2dcc991b0fdcdde8bee91f05cb9e182 (patch)
tree611f4bb8433c733a3e6c3c74779d79366a2ccc81 /crates
parent2ded93a78a108c1f7e0dd0a9036c88c786f21dce (diff)
update salsa
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_analysis/Cargo.toml2
-rw-r--r--crates/ra_analysis/src/db.rs6
-rw-r--r--crates/ra_analysis/src/module_map.rs6
-rw-r--r--crates/ra_analysis/src/roots.rs8
4 files changed, 11 insertions, 11 deletions
diff --git a/crates/ra_analysis/Cargo.toml b/crates/ra_analysis/Cargo.toml
index 17b04182f..dd4ec8375 100644
--- a/crates/ra_analysis/Cargo.toml
+++ b/crates/ra_analysis/Cargo.toml
@@ -15,7 +15,7 @@ fst = "0.3.1"
15im = "12.0.0" 15im = "12.0.0"
16ra_syntax = { path = "../ra_syntax" } 16ra_syntax = { path = "../ra_syntax" }
17ra_editor = { path = "../ra_editor" } 17ra_editor = { path = "../ra_editor" }
18salsa = "0.5.0" 18salsa = "0.6.0"
19rustc-hash = "1.0" 19rustc-hash = "1.0"
20 20
21[dev-dependencies] 21[dev-dependencies]
diff --git a/crates/ra_analysis/src/db.rs b/crates/ra_analysis/src/db.rs
index 042dde1ac..cce959669 100644
--- a/crates/ra_analysis/src/db.rs
+++ b/crates/ra_analysis/src/db.rs
@@ -16,7 +16,7 @@ use std::{
16 16
17#[derive(Default)] 17#[derive(Default)]
18pub(crate) struct RootDatabase { 18pub(crate) struct RootDatabase {
19 runtime: salsa::runtime::Runtime<RootDatabase>, 19 runtime: salsa::Runtime<RootDatabase>,
20} 20}
21 21
22impl fmt::Debug for RootDatabase { 22impl fmt::Debug for RootDatabase {
@@ -26,7 +26,7 @@ impl fmt::Debug for RootDatabase {
26} 26}
27 27
28impl salsa::Database for RootDatabase { 28impl salsa::Database for RootDatabase {
29 fn salsa_runtime(&self) -> &salsa::runtime::Runtime<RootDatabase> { 29 fn salsa_runtime(&self) -> &salsa::Runtime<RootDatabase> {
30 &self.runtime 30 &self.runtime
31 } 31 }
32} 32}
@@ -69,7 +69,7 @@ salsa::query_group! {
69 type FileTextQuery; 69 type FileTextQuery;
70 storage input; 70 storage input;
71 } 71 }
72 fn file_set(key: ()) -> Arc<FileSet> { 72 fn file_set() -> Arc<FileSet> {
73 type FileSetQuery; 73 type FileSetQuery;
74 storage input; 74 storage input;
75 } 75 }
diff --git a/crates/ra_analysis/src/module_map.rs b/crates/ra_analysis/src/module_map.rs
index ff0ec3cc7..b15432498 100644
--- a/crates/ra_analysis/src/module_map.rs
+++ b/crates/ra_analysis/src/module_map.rs
@@ -8,7 +8,7 @@ use std::sync::Arc;
8 8
9salsa::query_group! { 9salsa::query_group! {
10 pub(crate) trait ModulesDatabase: SyntaxDatabase { 10 pub(crate) trait ModulesDatabase: SyntaxDatabase {
11 fn module_tree(key: ()) -> Arc<ModuleTreeDescriptor> { 11 fn module_tree() -> Arc<ModuleTreeDescriptor> {
12 type ModuleTreeQuery; 12 type ModuleTreeQuery;
13 } 13 }
14 fn module_descriptor(file_id: FileId) -> Arc<ModuleDescriptor> { 14 fn module_descriptor(file_id: FileId) -> Arc<ModuleDescriptor> {
@@ -22,8 +22,8 @@ fn module_descriptor(db: &impl ModulesDatabase, file_id: FileId) -> Arc<ModuleDe
22 Arc::new(ModuleDescriptor::new(file.ast())) 22 Arc::new(ModuleDescriptor::new(file.ast()))
23} 23}
24 24
25fn module_tree(db: &impl ModulesDatabase, (): ()) -> Arc<ModuleTreeDescriptor> { 25fn module_tree(db: &impl ModulesDatabase) -> Arc<ModuleTreeDescriptor> {
26 let file_set = db.file_set(()); 26 let file_set = db.file_set();
27 let mut files = Vec::new(); 27 let mut files = Vec::new();
28 for &file_id in file_set.files.iter() { 28 for &file_id in file_set.files.iter() {
29 let module_descr = db.module_descriptor(file_id); 29 let module_descr = db.module_descriptor(file_id);
diff --git a/crates/ra_analysis/src/roots.rs b/crates/ra_analysis/src/roots.rs
index 1f2b21b27..19c84df65 100644
--- a/crates/ra_analysis/src/roots.rs
+++ b/crates/ra_analysis/src/roots.rs
@@ -50,7 +50,7 @@ impl WritableSourceRoot {
50 } 50 }
51 } 51 }
52 } 52 }
53 let file_set = self.db.file_set(()); 53 let file_set = self.db.file_set();
54 let mut files: FxHashSet<FileId> = file_set.files.clone(); 54 let mut files: FxHashSet<FileId> = file_set.files.clone();
55 for file_id in removed { 55 for file_id in removed {
56 files.remove(&file_id); 56 files.remove(&file_id);
@@ -65,10 +65,10 @@ impl WritableSourceRoot {
65 65
66impl SourceRoot for WritableSourceRoot { 66impl SourceRoot for WritableSourceRoot {
67 fn module_tree(&self) -> Arc<ModuleTreeDescriptor> { 67 fn module_tree(&self) -> Arc<ModuleTreeDescriptor> {
68 self.db.module_tree(()) 68 self.db.module_tree()
69 } 69 }
70 fn contains(&self, file_id: FileId) -> bool { 70 fn contains(&self, file_id: FileId) -> bool {
71 self.db.file_set(()).files.contains(&file_id) 71 self.db.file_set().files.contains(&file_id)
72 } 72 }
73 fn lines(&self, file_id: FileId) -> Arc<LineIndex> { 73 fn lines(&self, file_id: FileId) -> Arc<LineIndex> {
74 self.db.file_lines(file_id) 74 self.db.file_lines(file_id)
@@ -78,7 +78,7 @@ impl SourceRoot for WritableSourceRoot {
78 } 78 }
79 fn symbols<'a>(&'a self, acc: &mut Vec<Arc<SymbolIndex>>) { 79 fn symbols<'a>(&'a self, acc: &mut Vec<Arc<SymbolIndex>>) {
80 let db = &self.db; 80 let db = &self.db;
81 let symbols = db.file_set(()); 81 let symbols = db.file_set();
82 let symbols = symbols 82 let symbols = symbols
83 .files 83 .files
84 .iter() 84 .iter()