From 832bae8e28768759ba3dc75cf6a10fb333741d8e Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 1 Jan 2019 18:19:15 +0300 Subject: fix tests --- crates/ra_hir/src/db.rs | 2 +- crates/ra_hir/src/mock.rs | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'crates/ra_hir/src') diff --git a/crates/ra_hir/src/db.rs b/crates/ra_hir/src/db.rs index 95d8da200..289bec507 100644 --- a/crates/ra_hir/src/db.rs +++ b/crates/ra_hir/src/db.rs @@ -8,7 +8,7 @@ use crate::{ SourceFileItems, SourceItemId, query_definitions, FnScopes, - macros::{MacroCallLoc, MacroCallId, MacroInput, MacroDef, MacroExpansion}, + macros::{MacroCallLoc, MacroCallId, MacroExpansion}, module::{ModuleId, ModuleTree, ModuleSource, nameres::{ItemMap, InputModuleItems}}, ty::{InferenceResult, Ty}, 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 use relative_path::RelativePathBuf; use test_utils::{parse_fixture, CURSOR_MARKER, extract_offset}; -use crate::{db, DefId, DefLoc}; +use crate::{db, DefId, DefLoc, MacroCallId, MacroCallLoc}; pub const WORKSPACE: SourceRootId = SourceRootId(0); @@ -95,6 +95,7 @@ impl MockDatabase { #[derive(Debug, Default)] struct IdMaps { defs: LocationIntener, + macros: LocationIntener, } impl salsa::Database for MockDatabase { @@ -144,6 +145,11 @@ impl AsRef> for MockDatabase { &self.id_maps.defs } } +impl AsRef> for MockDatabase { + fn as_ref(&self) -> &LocationIntener { + &self.id_maps.macros + } +} impl MockDatabase { pub(crate) fn log(&self, f: impl FnOnce()) -> Vec> { @@ -183,6 +189,7 @@ salsa::database_storage! { fn file_lines() for ra_db::FileLinesQuery; } impl db::HirDatabase { + fn expand_macro_invocation() for db::ExpandMacroCallQuery; fn module_tree() for db::ModuleTreeQuery; fn fn_scopes() for db::FnScopesQuery; fn file_items() for db::SourceFileItemsQuery; -- cgit v1.2.3