aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-01-26 08:20:53 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-01-26 08:20:53 +0000
commitac757e114e9dcbc70600803dd4adc4f99ecde78e (patch)
tree7aae7fff41fcc67523f1f0b7a0fc06a174d00394 /crates/ra_hir/src
parent2f270a51d266f30c03549ce85876c164e0203cd1 (diff)
parent4711cbcace33e34d43f880d30c2778c843240f27 (diff)
Merge #664
664: rename FilesDatabase -> SourceDatabase r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r--crates/ra_hir/src/db.rs4
-rw-r--r--crates/ra_hir/src/mock.rs12
-rw-r--r--crates/ra_hir/src/nameres/tests.rs2
-rw-r--r--crates/ra_hir/src/ty/tests.rs2
4 files changed, 7 insertions, 13 deletions
diff --git a/crates/ra_hir/src/db.rs b/crates/ra_hir/src/db.rs
index dfbf41bd6..9b5b79d38 100644
--- a/crates/ra_hir/src/db.rs
+++ b/crates/ra_hir/src/db.rs
@@ -1,7 +1,7 @@
1use std::sync::Arc; 1use std::sync::Arc;
2 2
3use ra_syntax::{SyntaxNode, TreeArc, SourceFile}; 3use ra_syntax::{SyntaxNode, TreeArc, SourceFile};
4use ra_db::{SyntaxDatabase, CrateId, salsa}; 4use ra_db::{SourceDatabase, CrateId, salsa};
5 5
6use crate::{ 6use crate::{
7 MacroCallId, HirFileId, 7 MacroCallId, HirFileId,
@@ -19,7 +19,7 @@ use crate::{
19}; 19};
20 20
21#[salsa::query_group(HirDatabaseStorage)] 21#[salsa::query_group(HirDatabaseStorage)]
22pub trait HirDatabase: SyntaxDatabase + AsRef<HirInterner> { 22pub trait HirDatabase: SourceDatabase + 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>;
25 25
diff --git a/crates/ra_hir/src/mock.rs b/crates/ra_hir/src/mock.rs
index 2dc252b1e..7da15eca0 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, salsa, 5 CheckCanceled, FilePosition, FileId, CrateGraph, SourceRoot, SourceRootId, SourceDatabase, 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,11 +11,7 @@ use crate::{db, HirInterner};
11 11
12pub const WORKSPACE: SourceRootId = SourceRootId(0); 12pub const WORKSPACE: SourceRootId = SourceRootId(0);
13 13
14#[salsa::database( 14#[salsa::database(ra_db::SourceDatabaseStorage, db::HirDatabaseStorage)]
15 ra_db::FilesDatabaseStorage,
16 ra_db::SyntaxDatabaseStorage,
17 db::HirDatabaseStorage
18)]
19#[derive(Debug)] 15#[derive(Debug)]
20pub(crate) struct MockDatabase { 16pub(crate) struct MockDatabase {
21 events: Mutex<Option<Vec<salsa::Event<MockDatabase>>>>, 17 events: Mutex<Option<Vec<salsa::Event<MockDatabase>>>>,
@@ -144,8 +140,6 @@ impl Default for MockDatabase {
144 file_counter: 0, 140 file_counter: 0,
145 }; 141 };
146 db.set_crate_graph(Default::default()); 142 db.set_crate_graph(Default::default());
147 db.set_local_roots(Default::default());
148 db.set_library_roots(Default::default());
149 db 143 db
150 } 144 }
151} 145}
@@ -161,7 +155,7 @@ impl salsa::ParallelDatabase for MockDatabase {
161 } 155 }
162} 156}
163 157
164impl BaseDatabase for MockDatabase {} 158impl CheckCanceled for MockDatabase {}
165 159
166impl AsRef<HirInterner> for MockDatabase { 160impl AsRef<HirInterner> for MockDatabase {
167 fn as_ref(&self) -> &HirInterner { 161 fn as_ref(&self) -> &HirInterner {
diff --git a/crates/ra_hir/src/nameres/tests.rs b/crates/ra_hir/src/nameres/tests.rs
index 24936976c..e72781f51 100644
--- a/crates/ra_hir/src/nameres/tests.rs
+++ b/crates/ra_hir/src/nameres/tests.rs
@@ -1,6 +1,6 @@
1use std::sync::Arc; 1use std::sync::Arc;
2 2
3use ra_db::{CrateGraph, SourceRootId, FilesDatabase}; 3use ra_db::{CrateGraph, SourceRootId, SourceDatabase};
4use relative_path::RelativePath; 4use relative_path::RelativePath;
5use test_utils::{assert_eq_text, covers}; 5use test_utils::{assert_eq_text, covers};
6 6
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs
index 389bdaf23..0eb4da06e 100644
--- a/crates/ra_hir/src/ty/tests.rs
+++ b/crates/ra_hir/src/ty/tests.rs
@@ -1,7 +1,7 @@
1use std::sync::Arc; 1use std::sync::Arc;
2use std::fmt::Write; 2use std::fmt::Write;
3 3
4use ra_db::{SyntaxDatabase, salsa::Database}; 4use ra_db::{SourceDatabase, salsa::Database};
5use ra_syntax::ast::{self, AstNode}; 5use ra_syntax::ast::{self, AstNode};
6 6
7use crate::{ 7use crate::{