aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/ra_analysis/src/db.rs8
-rw-r--r--crates/ra_hir/src/db.rs8
-rw-r--r--crates/ra_hir/src/lib.rs2
-rw-r--r--crates/ra_hir/src/macros.rs20
4 files changed, 19 insertions, 19 deletions
diff --git a/crates/ra_analysis/src/db.rs b/crates/ra_analysis/src/db.rs
index 2a71cc2b6..86c15f4ee 100644
--- a/crates/ra_analysis/src/db.rs
+++ b/crates/ra_analysis/src/db.rs
@@ -15,7 +15,7 @@ pub(crate) struct RootDatabase {
15#[derive(Default)] 15#[derive(Default)]
16struct IdMaps { 16struct IdMaps {
17 defs: LocationIntener<hir::DefLoc, hir::DefId>, 17 defs: LocationIntener<hir::DefLoc, hir::DefId>,
18 macros: LocationIntener<hir::MacroInvocationLoc, hir::MacroInvocationId>, 18 macros: LocationIntener<hir::MacroCallLoc, hir::MacroCallId>,
19} 19}
20 20
21impl fmt::Debug for IdMaps { 21impl fmt::Debug for IdMaps {
@@ -65,8 +65,8 @@ impl AsRef<LocationIntener<hir::DefLoc, hir::DefId>> for RootDatabase {
65 } 65 }
66} 66}
67 67
68impl AsRef<LocationIntener<hir::MacroInvocationLoc, hir::MacroInvocationId>> for RootDatabase { 68impl AsRef<LocationIntener<hir::MacroCallLoc, hir::MacroCallId>> for RootDatabase {
69 fn as_ref(&self) -> &LocationIntener<hir::MacroInvocationLoc, hir::MacroInvocationId> { 69 fn as_ref(&self) -> &LocationIntener<hir::MacroCallLoc, hir::MacroCallId> {
70 &self.id_maps.macros 70 &self.id_maps.macros
71 } 71 }
72} 72}
@@ -91,7 +91,7 @@ salsa::database_storage! {
91 fn library_symbols() for symbol_index::LibrarySymbolsQuery; 91 fn library_symbols() for symbol_index::LibrarySymbolsQuery;
92 } 92 }
93 impl hir::db::HirDatabase { 93 impl hir::db::HirDatabase {
94 fn expand_macro_invocation() for hir::db::ExpandMacroInvocationQuery; 94 fn expand_macro_invocation() for hir::db::ExpandMacroCallQuery;
95 fn module_tree() for hir::db::ModuleTreeQuery; 95 fn module_tree() for hir::db::ModuleTreeQuery;
96 fn fn_scopes() for hir::db::FnScopesQuery; 96 fn fn_scopes() for hir::db::FnScopesQuery;
97 fn file_items() for hir::db::SourceFileItemsQuery; 97 fn file_items() for hir::db::SourceFileItemsQuery;
diff --git a/crates/ra_hir/src/db.rs b/crates/ra_hir/src/db.rs
index 242d0549d..95d8da200 100644
--- a/crates/ra_hir/src/db.rs
+++ b/crates/ra_hir/src/db.rs
@@ -8,7 +8,7 @@ use crate::{
8 SourceFileItems, SourceItemId, 8 SourceFileItems, SourceItemId,
9 query_definitions, 9 query_definitions,
10 FnScopes, 10 FnScopes,
11 macros::{MacroInvocationLoc, MacroInvocationId, MacroInput, MacroDef, MacroExpansion}, 11 macros::{MacroCallLoc, MacroCallId, MacroInput, MacroDef, MacroExpansion},
12 module::{ModuleId, ModuleTree, ModuleSource, 12 module::{ModuleId, ModuleTree, ModuleSource,
13 nameres::{ItemMap, InputModuleItems}}, 13 nameres::{ItemMap, InputModuleItems}},
14 ty::{InferenceResult, Ty}, 14 ty::{InferenceResult, Ty},
@@ -19,10 +19,10 @@ salsa::query_group! {
19 19
20pub trait HirDatabase: SyntaxDatabase 20pub trait HirDatabase: SyntaxDatabase
21 + AsRef<LocationIntener<DefLoc, DefId>> 21 + AsRef<LocationIntener<DefLoc, DefId>>
22 + AsRef<LocationIntener<MacroInvocationLoc, MacroInvocationId>> 22 + AsRef<LocationIntener<MacroCallLoc, MacroCallId>>
23{ 23{
24 fn expand_macro_invocation(invoc: MacroInvocationId) -> Option<Arc<MacroExpansion>> { 24 fn expand_macro_invocation(invoc: MacroCallId) -> Option<Arc<MacroExpansion>> {
25 type ExpandMacroInvocationQuery; 25 type ExpandMacroCallQuery;
26 use fn crate::macros::expand_macro_invocation; 26 use fn crate::macros::expand_macro_invocation;
27 } 27 }
28 28
diff --git a/crates/ra_hir/src/lib.rs b/crates/ra_hir/src/lib.rs
index 1bafb1c4d..4422ac45b 100644
--- a/crates/ra_hir/src/lib.rs
+++ b/crates/ra_hir/src/lib.rs
@@ -46,7 +46,7 @@ pub use self::{
46 path::{Path, PathKind}, 46 path::{Path, PathKind},
47 name::Name, 47 name::Name,
48 krate::Crate, 48 krate::Crate,
49 macros::{MacroDef, MacroInput, MacroExpansion, MacroInvocationId, MacroInvocationLoc}, 49 macros::{MacroDef, MacroInput, MacroExpansion, MacroCallId, MacroCallLoc},
50 module::{Module, ModuleId, Problem, nameres::{ItemMap, PerNs, Namespace}, ModuleScope, Resolution}, 50 module::{Module, ModuleId, Problem, nameres::{ItemMap, PerNs, Namespace}, ModuleScope, Resolution},
51 function::{Function, FnScopes}, 51 function::{Function, FnScopes},
52 adt::{Struct, Enum}, 52 adt::{Struct, Enum},
diff --git a/crates/ra_hir/src/macros.rs b/crates/ra_hir/src/macros.rs
index f0b99cc1a..d9de2d8bd 100644
--- a/crates/ra_hir/src/macros.rs
+++ b/crates/ra_hir/src/macros.rs
@@ -11,31 +11,31 @@ use crate::{SourceRootId, module::ModuleId, SourceItemId, HirDatabase};
11/// Def's are a core concept of hir. A `Def` is an Item (function, module, etc) 11/// Def's are a core concept of hir. A `Def` is an Item (function, module, etc)
12/// in a specific module. 12/// in a specific module.
13#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] 13#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
14pub struct MacroInvocationId(u32); 14pub struct MacroCallId(u32);
15ra_db::impl_numeric_id!(MacroInvocationId); 15ra_db::impl_numeric_id!(MacroCallId);
16 16
17#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] 17#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
18pub struct MacroInvocationLoc { 18pub struct MacroCallLoc {
19 source_root_id: SourceRootId, 19 source_root_id: SourceRootId,
20 module_id: ModuleId, 20 module_id: ModuleId,
21 source_item_id: SourceItemId, 21 source_item_id: SourceItemId,
22} 22}
23 23
24impl MacroInvocationId { 24impl MacroCallId {
25 pub(crate) fn loc( 25 pub(crate) fn loc(
26 self, 26 self,
27 db: &impl AsRef<LocationIntener<MacroInvocationLoc, MacroInvocationId>>, 27 db: &impl AsRef<LocationIntener<MacroCallLoc, MacroCallId>>,
28 ) -> MacroInvocationLoc { 28 ) -> MacroCallLoc {
29 db.as_ref().id2loc(self) 29 db.as_ref().id2loc(self)
30 } 30 }
31} 31}
32 32
33impl MacroInvocationLoc { 33impl MacroCallLoc {
34 #[allow(unused)] 34 #[allow(unused)]
35 pub(crate) fn id( 35 pub(crate) fn id(
36 &self, 36 &self,
37 db: &impl AsRef<LocationIntener<MacroInvocationLoc, MacroInvocationId>>, 37 db: &impl AsRef<LocationIntener<MacroCallLoc, MacroCallId>>,
38 ) -> MacroInvocationId { 38 ) -> MacroCallId {
39 db.as_ref().loc2id(&self) 39 db.as_ref().loc2id(&self)
40 } 40 }
41} 41}
@@ -150,7 +150,7 @@ impl MacroExpansion {
150 150
151pub(crate) fn expand_macro_invocation( 151pub(crate) fn expand_macro_invocation(
152 db: &impl HirDatabase, 152 db: &impl HirDatabase,
153 invoc: MacroInvocationId, 153 invoc: MacroCallId,
154) -> Option<Arc<MacroExpansion>> { 154) -> Option<Arc<MacroExpansion>> {
155 let loc = invoc.loc(db); 155 let loc = invoc.loc(db);
156 let syntax = db.file_item(loc.source_item_id); 156 let syntax = db.file_item(loc.source_item_id);