diff options
author | Aleksey Kladov <[email protected]> | 2019-01-01 15:19:15 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-01 19:15:35 +0000 |
commit | 832bae8e28768759ba3dc75cf6a10fb333741d8e (patch) | |
tree | 36c86a339d500c4e4c2e43d9c737813a182168d0 /crates/ra_hir/src/mock.rs | |
parent | 882a86240f42068038586431e7e5de5de247720c (diff) |
fix tests
Diffstat (limited to 'crates/ra_hir/src/mock.rs')
-rw-r--r-- | crates/ra_hir/src/mock.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/crates/ra_hir/src/mock.rs b/crates/ra_hir/src/mock.rs index a2507c9b5..78f638ce4 100644 --- a/crates/ra_hir/src/mock.rs +++ b/crates/ra_hir/src/mock.rs | |||
@@ -6,7 +6,7 @@ use ra_db::{LocationIntener, BaseDatabase, FilePosition, FileId, CrateGraph, Sou | |||
6 | use relative_path::RelativePathBuf; | 6 | use relative_path::RelativePathBuf; |
7 | use test_utils::{parse_fixture, CURSOR_MARKER, extract_offset}; | 7 | use test_utils::{parse_fixture, CURSOR_MARKER, extract_offset}; |
8 | 8 | ||
9 | use crate::{db, DefId, DefLoc}; | 9 | use crate::{db, DefId, DefLoc, MacroCallId, MacroCallLoc}; |
10 | 10 | ||
11 | pub const WORKSPACE: SourceRootId = SourceRootId(0); | 11 | pub const WORKSPACE: SourceRootId = SourceRootId(0); |
12 | 12 | ||
@@ -95,6 +95,7 @@ impl MockDatabase { | |||
95 | #[derive(Debug, Default)] | 95 | #[derive(Debug, Default)] |
96 | struct IdMaps { | 96 | struct IdMaps { |
97 | defs: LocationIntener<DefLoc, DefId>, | 97 | defs: LocationIntener<DefLoc, DefId>, |
98 | macros: LocationIntener<MacroCallLoc, MacroCallId>, | ||
98 | } | 99 | } |
99 | 100 | ||
100 | impl salsa::Database for MockDatabase { | 101 | impl salsa::Database for MockDatabase { |
@@ -144,6 +145,11 @@ impl AsRef<LocationIntener<DefLoc, DefId>> for MockDatabase { | |||
144 | &self.id_maps.defs | 145 | &self.id_maps.defs |
145 | } | 146 | } |
146 | } | 147 | } |
148 | impl AsRef<LocationIntener<MacroCallLoc, MacroCallId>> for MockDatabase { | ||
149 | fn as_ref(&self) -> &LocationIntener<MacroCallLoc, MacroCallId> { | ||
150 | &self.id_maps.macros | ||
151 | } | ||
152 | } | ||
147 | 153 | ||
148 | impl MockDatabase { | 154 | impl MockDatabase { |
149 | pub(crate) fn log(&self, f: impl FnOnce()) -> Vec<salsa::Event<MockDatabase>> { | 155 | pub(crate) fn log(&self, f: impl FnOnce()) -> Vec<salsa::Event<MockDatabase>> { |
@@ -183,6 +189,7 @@ salsa::database_storage! { | |||
183 | fn file_lines() for ra_db::FileLinesQuery; | 189 | fn file_lines() for ra_db::FileLinesQuery; |
184 | } | 190 | } |
185 | impl db::HirDatabase { | 191 | impl db::HirDatabase { |
192 | fn expand_macro_invocation() for db::ExpandMacroCallQuery; | ||
186 | fn module_tree() for db::ModuleTreeQuery; | 193 | fn module_tree() for db::ModuleTreeQuery; |
187 | fn fn_scopes() for db::FnScopesQuery; | 194 | fn fn_scopes() for db::FnScopesQuery; |
188 | fn file_items() for db::SourceFileItemsQuery; | 195 | fn file_items() for db::SourceFileItemsQuery; |