diff options
Diffstat (limited to 'crates/ra_hir/src/mock.rs')
-rw-r--r-- | crates/ra_hir/src/mock.rs | 12 |
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 | ||
3 | use parking_lot::Mutex; | 3 | use parking_lot::Mutex; |
4 | use ra_db::{ | 4 | use ra_db::{ |
5 | BaseDatabase, FilePosition, FileId, CrateGraph, SourceRoot, SourceRootId, FilesDatabase, salsa, | 5 | CheckCanceled, FilePosition, FileId, CrateGraph, SourceRoot, SourceRootId, SourceDatabase, salsa, |
6 | }; | 6 | }; |
7 | use relative_path::RelativePathBuf; | 7 | use relative_path::RelativePathBuf; |
8 | use test_utils::{parse_fixture, CURSOR_MARKER, extract_offset}; | 8 | use test_utils::{parse_fixture, CURSOR_MARKER, extract_offset}; |
@@ -11,11 +11,7 @@ use crate::{db, HirInterner}; | |||
11 | 11 | ||
12 | pub const WORKSPACE: SourceRootId = SourceRootId(0); | 12 | pub 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)] |
20 | pub(crate) struct MockDatabase { | 16 | pub(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 | ||
164 | impl BaseDatabase for MockDatabase {} | 158 | impl CheckCanceled for MockDatabase {} |
165 | 159 | ||
166 | impl AsRef<HirInterner> for MockDatabase { | 160 | impl AsRef<HirInterner> for MockDatabase { |
167 | fn as_ref(&self) -> &HirInterner { | 161 | fn as_ref(&self) -> &HirInterner { |