diff options
author | Aleksey Kladov <[email protected]> | 2019-01-01 15:12:31 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-01 19:15:35 +0000 |
commit | 882a86240f42068038586431e7e5de5de247720c (patch) | |
tree | eb7fc927ce33ba3ee60add688e42b49f664db8e2 /crates/ra_hir | |
parent | b2fec18098b6a99613012d185801fed72e424997 (diff) |
rename
Diffstat (limited to 'crates/ra_hir')
-rw-r--r-- | crates/ra_hir/src/db.rs | 8 | ||||
-rw-r--r-- | crates/ra_hir/src/lib.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir/src/macros.rs | 20 |
3 files changed, 15 insertions, 15 deletions
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 | ||
20 | pub trait HirDatabase: SyntaxDatabase | 20 | pub 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)] |
14 | pub struct MacroInvocationId(u32); | 14 | pub struct MacroCallId(u32); |
15 | ra_db::impl_numeric_id!(MacroInvocationId); | 15 | ra_db::impl_numeric_id!(MacroCallId); |
16 | 16 | ||
17 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 17 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |
18 | pub struct MacroInvocationLoc { | 18 | pub 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 | ||
24 | impl MacroInvocationId { | 24 | impl 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 | ||
33 | impl MacroInvocationLoc { | 33 | impl 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 | ||
151 | pub(crate) fn expand_macro_invocation( | 151 | pub(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); |