From 882a86240f42068038586431e7e5de5de247720c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 1 Jan 2019 18:12:31 +0300 Subject: rename --- crates/ra_analysis/src/db.rs | 8 ++++---- crates/ra_hir/src/db.rs | 8 ++++---- crates/ra_hir/src/lib.rs | 2 +- crates/ra_hir/src/macros.rs | 20 ++++++++++---------- 4 files changed, 19 insertions(+), 19 deletions(-) (limited to 'crates') 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 { #[derive(Default)] struct IdMaps { defs: LocationIntener, - macros: LocationIntener, + macros: LocationIntener, } impl fmt::Debug for IdMaps { @@ -65,8 +65,8 @@ impl AsRef> for RootDatabase { } } -impl AsRef> for RootDatabase { - fn as_ref(&self) -> &LocationIntener { +impl AsRef> for RootDatabase { + fn as_ref(&self) -> &LocationIntener { &self.id_maps.macros } } @@ -91,7 +91,7 @@ salsa::database_storage! { fn library_symbols() for symbol_index::LibrarySymbolsQuery; } impl hir::db::HirDatabase { - fn expand_macro_invocation() for hir::db::ExpandMacroInvocationQuery; + fn expand_macro_invocation() for hir::db::ExpandMacroCallQuery; fn module_tree() for hir::db::ModuleTreeQuery; fn fn_scopes() for hir::db::FnScopesQuery; 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::{ SourceFileItems, SourceItemId, query_definitions, FnScopes, - macros::{MacroInvocationLoc, MacroInvocationId, MacroInput, MacroDef, MacroExpansion}, + macros::{MacroCallLoc, MacroCallId, MacroInput, MacroDef, MacroExpansion}, module::{ModuleId, ModuleTree, ModuleSource, nameres::{ItemMap, InputModuleItems}}, ty::{InferenceResult, Ty}, @@ -19,10 +19,10 @@ salsa::query_group! { pub trait HirDatabase: SyntaxDatabase + AsRef> - + AsRef> + + AsRef> { - fn expand_macro_invocation(invoc: MacroInvocationId) -> Option> { - type ExpandMacroInvocationQuery; + fn expand_macro_invocation(invoc: MacroCallId) -> Option> { + type ExpandMacroCallQuery; use fn crate::macros::expand_macro_invocation; } 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::{ path::{Path, PathKind}, name::Name, krate::Crate, - macros::{MacroDef, MacroInput, MacroExpansion, MacroInvocationId, MacroInvocationLoc}, + macros::{MacroDef, MacroInput, MacroExpansion, MacroCallId, MacroCallLoc}, module::{Module, ModuleId, Problem, nameres::{ItemMap, PerNs, Namespace}, ModuleScope, Resolution}, function::{Function, FnScopes}, 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}; /// Def's are a core concept of hir. A `Def` is an Item (function, module, etc) /// in a specific module. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub struct MacroInvocationId(u32); -ra_db::impl_numeric_id!(MacroInvocationId); +pub struct MacroCallId(u32); +ra_db::impl_numeric_id!(MacroCallId); #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -pub struct MacroInvocationLoc { +pub struct MacroCallLoc { source_root_id: SourceRootId, module_id: ModuleId, source_item_id: SourceItemId, } -impl MacroInvocationId { +impl MacroCallId { pub(crate) fn loc( self, - db: &impl AsRef>, - ) -> MacroInvocationLoc { + db: &impl AsRef>, + ) -> MacroCallLoc { db.as_ref().id2loc(self) } } -impl MacroInvocationLoc { +impl MacroCallLoc { #[allow(unused)] pub(crate) fn id( &self, - db: &impl AsRef>, - ) -> MacroInvocationId { + db: &impl AsRef>, + ) -> MacroCallId { db.as_ref().loc2id(&self) } } @@ -150,7 +150,7 @@ impl MacroExpansion { pub(crate) fn expand_macro_invocation( db: &impl HirDatabase, - invoc: MacroInvocationId, + invoc: MacroCallId, ) -> Option> { let loc = invoc.loc(db); let syntax = db.file_item(loc.source_item_id); -- cgit v1.2.3