From 9559bce311c3b6b7009b9cd09e52c75497c87035 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Tue, 24 Nov 2020 21:57:51 +0100 Subject: Rename `parse_macro` to `parse_macro_expansion` This does not parse macros, it expands a macro and parses the *result* --- crates/hir_expand/src/db.rs | 6 +++--- crates/hir_expand/src/lib.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/hir_expand') diff --git a/crates/hir_expand/src/db.rs b/crates/hir_expand/src/db.rs index 36d3307a1..a9099eb22 100644 --- a/crates/hir_expand/src/db.rs +++ b/crates/hir_expand/src/db.rs @@ -88,7 +88,7 @@ pub trait AstDatabase: SourceDatabase { #[salsa::transparent] fn macro_arg(&self, id: MacroCallId) -> Option>; fn macro_def(&self, id: MacroDefId) -> Option>; - fn parse_macro( + fn parse_macro_expansion( &self, macro_file: MacroFile, ) -> MacroResult<(Parse, Arc)>; @@ -283,12 +283,12 @@ fn parse_or_expand(db: &dyn AstDatabase, file_id: HirFileId) -> Option Some(db.parse(file_id).tree().syntax().clone()), HirFileIdRepr::MacroFile(macro_file) => { - db.parse_macro(macro_file).map(|(it, _)| it.syntax_node()).value + db.parse_macro_expansion(macro_file).map(|(it, _)| it.syntax_node()).value } } } -fn parse_macro( +fn parse_macro_expansion( db: &dyn AstDatabase, macro_file: MacroFile, ) -> MacroResult<(Parse, Arc)> { diff --git a/crates/hir_expand/src/lib.rs b/crates/hir_expand/src/lib.rs index 9fc697d6f..83e09738b 100644 --- a/crates/hir_expand/src/lib.rs +++ b/crates/hir_expand/src/lib.rs @@ -144,7 +144,7 @@ impl HirFileId { let def_tt = loc.def.ast_id?.to_node(db).token_tree()?; let macro_def = db.macro_def(loc.def)?; - let (parse, exp_map) = db.parse_macro(macro_file).value?; + let (parse, exp_map) = db.parse_macro_expansion(macro_file).value?; let macro_arg = db.macro_arg(macro_file.macro_call_id)?; Some(ExpansionInfo { -- cgit v1.2.3