aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_expand
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2020-11-24 20:57:51 +0000
committerJonas Schievink <[email protected]>2020-11-24 20:57:51 +0000
commit9559bce311c3b6b7009b9cd09e52c75497c87035 (patch)
treef28435190d7f830acb6335da5eeaa83a458b5e2a /crates/hir_expand
parentf9d0d511011b7071c621ac3f7c64c4aaec7f2dfb (diff)
Rename `parse_macro` to `parse_macro_expansion`
This does not parse macros, it expands a macro and parses the *result*
Diffstat (limited to 'crates/hir_expand')
-rw-r--r--crates/hir_expand/src/db.rs6
-rw-r--r--crates/hir_expand/src/lib.rs2
2 files changed, 4 insertions, 4 deletions
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 {
88 #[salsa::transparent] 88 #[salsa::transparent]
89 fn macro_arg(&self, id: MacroCallId) -> Option<Arc<(tt::Subtree, mbe::TokenMap)>>; 89 fn macro_arg(&self, id: MacroCallId) -> Option<Arc<(tt::Subtree, mbe::TokenMap)>>;
90 fn macro_def(&self, id: MacroDefId) -> Option<Arc<(TokenExpander, mbe::TokenMap)>>; 90 fn macro_def(&self, id: MacroDefId) -> Option<Arc<(TokenExpander, mbe::TokenMap)>>;
91 fn parse_macro( 91 fn parse_macro_expansion(
92 &self, 92 &self,
93 macro_file: MacroFile, 93 macro_file: MacroFile,
94 ) -> MacroResult<(Parse<SyntaxNode>, Arc<mbe::TokenMap>)>; 94 ) -> MacroResult<(Parse<SyntaxNode>, Arc<mbe::TokenMap>)>;
@@ -283,12 +283,12 @@ fn parse_or_expand(db: &dyn AstDatabase, file_id: HirFileId) -> Option<SyntaxNod
283 match file_id.0 { 283 match file_id.0 {
284 HirFileIdRepr::FileId(file_id) => Some(db.parse(file_id).tree().syntax().clone()), 284 HirFileIdRepr::FileId(file_id) => Some(db.parse(file_id).tree().syntax().clone()),
285 HirFileIdRepr::MacroFile(macro_file) => { 285 HirFileIdRepr::MacroFile(macro_file) => {
286 db.parse_macro(macro_file).map(|(it, _)| it.syntax_node()).value 286 db.parse_macro_expansion(macro_file).map(|(it, _)| it.syntax_node()).value
287 } 287 }
288 } 288 }
289} 289}
290 290
291fn parse_macro( 291fn parse_macro_expansion(
292 db: &dyn AstDatabase, 292 db: &dyn AstDatabase,
293 macro_file: MacroFile, 293 macro_file: MacroFile,
294) -> MacroResult<(Parse<SyntaxNode>, Arc<mbe::TokenMap>)> { 294) -> MacroResult<(Parse<SyntaxNode>, Arc<mbe::TokenMap>)> {
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 {
144 let def_tt = loc.def.ast_id?.to_node(db).token_tree()?; 144 let def_tt = loc.def.ast_id?.to_node(db).token_tree()?;
145 145
146 let macro_def = db.macro_def(loc.def)?; 146 let macro_def = db.macro_def(loc.def)?;
147 let (parse, exp_map) = db.parse_macro(macro_file).value?; 147 let (parse, exp_map) = db.parse_macro_expansion(macro_file).value?;
148 let macro_arg = db.macro_arg(macro_file.macro_call_id)?; 148 let macro_arg = db.macro_arg(macro_file.macro_call_id)?;
149 149
150 Some(ExpansionInfo { 150 Some(ExpansionInfo {