aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/mock.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/mock.rs')
-rw-r--r--crates/ra_hir/src/mock.rs12
1 files changed, 3 insertions, 9 deletions
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 {