diff --git a/crates/hir/src/db.rs b/crates/hir/src/db.rs index 07333c453f..8c767b249d 100644 --- a/crates/hir/src/db.rs +++ b/crates/hir/src/db.rs @@ -11,7 +11,7 @@ pub use hir_def::db::{ }; pub use hir_expand::db::{ AstDatabase, AstDatabaseStorage, AstIdMapQuery, InternEagerExpansionQuery, InternMacroQuery, - MacroArgTextQuery, MacroDefQuery, MacroExpandQuery, ParseMacroQuery, + MacroArgTextQuery, MacroDefQuery, MacroExpandQuery, ParseMacroExpansionQuery, }; pub use hir_ty::db::*; diff --git a/crates/hir_expand/src/db.rs b/crates/hir_expand/src/db.rs index 36d3307a1f..a9099eb22a 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 9fc697d6fa..83e09738b1 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 { diff --git a/crates/ide/src/status.rs b/crates/ide/src/status.rs index 8b4a1652e4..b75f88ed99 100644 --- a/crates/ide/src/status.rs +++ b/crates/ide/src/status.rs @@ -19,7 +19,7 @@ fn syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats { ide_db::base_db::ParseQuery.in_db(db).entries::() } fn macro_syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats { - hir::db::ParseMacroQuery.in_db(db).entries::() + hir::db::ParseMacroExpansionQuery.in_db(db).entries::() } // Feature: Status diff --git a/crates/ide_db/src/apply_change.rs b/crates/ide_db/src/apply_change.rs index da16fa21dc..987191fe32 100644 --- a/crates/ide_db/src/apply_change.rs +++ b/crates/ide_db/src/apply_change.rs @@ -76,7 +76,7 @@ impl RootDatabase { let sweep = SweepStrategy::default().discard_values().sweep_all_revisions(); base_db::ParseQuery.in_db(self).sweep(sweep); - hir::db::ParseMacroQuery.in_db(self).sweep(sweep); + hir::db::ParseMacroExpansionQuery.in_db(self).sweep(sweep); // Macros do take significant space, but less then the syntax trees // self.query(hir::db::MacroDefQuery).sweep(sweep); @@ -143,7 +143,7 @@ impl RootDatabase { hir::db::AstIdMapQuery hir::db::MacroArgTextQuery hir::db::MacroDefQuery - hir::db::ParseMacroQuery + hir::db::ParseMacroExpansionQuery hir::db::MacroExpandQuery // DefDatabase diff --git a/crates/ide_db/src/lib.rs b/crates/ide_db/src/lib.rs index 38ebdbf791..05139a6515 100644 --- a/crates/ide_db/src/lib.rs +++ b/crates/ide_db/src/lib.rs @@ -113,7 +113,7 @@ impl RootDatabase { pub fn update_lru_capacity(&mut self, lru_capacity: Option) { let lru_capacity = lru_capacity.unwrap_or(base_db::DEFAULT_LRU_CAP); base_db::ParseQuery.in_db_mut(self).set_lru_capacity(lru_capacity); - hir::db::ParseMacroQuery.in_db_mut(self).set_lru_capacity(lru_capacity); + hir::db::ParseMacroExpansionQuery.in_db_mut(self).set_lru_capacity(lru_capacity); hir::db::MacroExpandQuery.in_db_mut(self).set_lru_capacity(lru_capacity); } }