aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/mock.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-01-26 08:09:39 +0000
committerAleksey Kladov <[email protected]>2019-01-26 08:09:39 +0000
commitbe1a005ebd02298feb8d272278354411d16acdee (patch)
treeadfa44d2e47ca780a6125981055c5b47ab202977 /crates/ra_hir/src/mock.rs
parent2f270a51d266f30c03549ce85876c164e0203cd1 (diff)
fold syntax database into files database
Diffstat (limited to 'crates/ra_hir/src/mock.rs')
-rw-r--r--crates/ra_hir/src/mock.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/crates/ra_hir/src/mock.rs b/crates/ra_hir/src/mock.rs
index 2dc252b1e..4af4dd096 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, 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,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::FilesDatabaseStorage, 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>>>>,
@@ -161,7 +157,7 @@ impl salsa::ParallelDatabase for MockDatabase {
161 } 157 }
162} 158}
163 159
164impl BaseDatabase for MockDatabase {} 160impl CheckCanceled for MockDatabase {}
165 161
166impl AsRef<HirInterner> for MockDatabase { 162impl AsRef<HirInterner> for MockDatabase {
167 fn as_ref(&self) -> &HirInterner { 163 fn as_ref(&self) -> &HirInterner {