Skip to content

Commit 9559bce

Browse files
Rename parse_macro to parse_macro_expansion
This does not parse macros, it expands a macro and parses the *result*
1 parent f9d0d51 commit 9559bce

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

crates/hir/src/db.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub use hir_def::db::{
1111
};
1212
pub use hir_expand::db::{
1313
AstDatabase, AstDatabaseStorage, AstIdMapQuery, InternEagerExpansionQuery, InternMacroQuery,
14-
MacroArgTextQuery, MacroDefQuery, MacroExpandQuery, ParseMacroQuery,
14+
MacroArgTextQuery, MacroDefQuery, MacroExpandQuery, ParseMacroExpansionQuery,
1515
};
1616
pub use hir_ty::db::*;
1717

crates/hir_expand/src/db.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ pub trait AstDatabase: SourceDatabase {
8888
#[salsa::transparent]
8989
fn macro_arg(&self, id: MacroCallId) -> Option<Arc<(tt::Subtree, mbe::TokenMap)>>;
9090
fn macro_def(&self, id: MacroDefId) -> Option<Arc<(TokenExpander, mbe::TokenMap)>>;
91-
fn parse_macro(
91+
fn parse_macro_expansion(
9292
&self,
9393
macro_file: MacroFile,
9494
) -> MacroResult<(Parse<SyntaxNode>, Arc<mbe::TokenMap>)>;
@@ -283,12 +283,12 @@ fn parse_or_expand(db: &dyn AstDatabase, file_id: HirFileId) -> Option<SyntaxNod
283283
match file_id.0 {
284284
HirFileIdRepr::FileId(file_id) => Some(db.parse(file_id).tree().syntax().clone()),
285285
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
287287
}
288288
}
289289
}
290290

291-
fn parse_macro(
291+
fn parse_macro_expansion(
292292
db: &dyn AstDatabase,
293293
macro_file: MacroFile,
294294
) -> MacroResult<(Parse<SyntaxNode>, Arc<mbe::TokenMap>)> {

crates/hir_expand/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ impl HirFileId {
144144
let def_tt = loc.def.ast_id?.to_node(db).token_tree()?;
145145

146146
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?;
148148
let macro_arg = db.macro_arg(macro_file.macro_call_id)?;
149149

150150
Some(ExpansionInfo {

crates/ide/src/status.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fn syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats {
1919
ide_db::base_db::ParseQuery.in_db(db).entries::<SyntaxTreeStats>()
2020
}
2121
fn macro_syntax_tree_stats(db: &RootDatabase) -> SyntaxTreeStats {
22-
hir::db::ParseMacroQuery.in_db(db).entries::<SyntaxTreeStats>()
22+
hir::db::ParseMacroExpansionQuery.in_db(db).entries::<SyntaxTreeStats>()
2323
}
2424

2525
// Feature: Status

crates/ide_db/src/apply_change.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl RootDatabase {
7676
let sweep = SweepStrategy::default().discard_values().sweep_all_revisions();
7777

7878
base_db::ParseQuery.in_db(self).sweep(sweep);
79-
hir::db::ParseMacroQuery.in_db(self).sweep(sweep);
79+
hir::db::ParseMacroExpansionQuery.in_db(self).sweep(sweep);
8080

8181
// Macros do take significant space, but less then the syntax trees
8282
// self.query(hir::db::MacroDefQuery).sweep(sweep);
@@ -143,7 +143,7 @@ impl RootDatabase {
143143
hir::db::AstIdMapQuery
144144
hir::db::MacroArgTextQuery
145145
hir::db::MacroDefQuery
146-
hir::db::ParseMacroQuery
146+
hir::db::ParseMacroExpansionQuery
147147
hir::db::MacroExpandQuery
148148

149149
// DefDatabase

crates/ide_db/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl RootDatabase {
113113
pub fn update_lru_capacity(&mut self, lru_capacity: Option<usize>) {
114114
let lru_capacity = lru_capacity.unwrap_or(base_db::DEFAULT_LRU_CAP);
115115
base_db::ParseQuery.in_db_mut(self).set_lru_capacity(lru_capacity);
116-
hir::db::ParseMacroQuery.in_db_mut(self).set_lru_capacity(lru_capacity);
116+
hir::db::ParseMacroExpansionQuery.in_db_mut(self).set_lru_capacity(lru_capacity);
117117
hir::db::MacroExpandQuery.in_db_mut(self).set_lru_capacity(lru_capacity);
118118
}
119119
}

0 commit comments

Comments
 (0)