mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Fix expand macro
This commit is contained in:
parent
b568bcfe6d
commit
0a9c80053f
3 changed files with 16 additions and 9 deletions
|
@ -405,9 +405,16 @@ impl SourceAnalyzer {
|
|||
implements_trait(&canonical_ty, db, &self.resolver, krate, std_future_trait)
|
||||
}
|
||||
|
||||
pub fn expand(&self, db: &impl HirDatabase, macro_call: &ast::MacroCall) -> Option<Expansion> {
|
||||
let def = self.resolve_macro_call(db, macro_call)?.id;
|
||||
let ast_id = AstId::new(self.file_id, db.ast_id_map(self.file_id).ast_id(macro_call));
|
||||
pub fn expand(
|
||||
&self,
|
||||
db: &impl HirDatabase,
|
||||
macro_call: Source<&ast::MacroCall>,
|
||||
) -> Option<Expansion> {
|
||||
let def = self.resolve_macro_call(db, macro_call.value)?.id;
|
||||
let ast_id = AstId::new(
|
||||
macro_call.file_id,
|
||||
db.ast_id_map(macro_call.file_id).ast_id(macro_call.value),
|
||||
);
|
||||
let macro_call_loc = MacroCallLoc { def, ast_id };
|
||||
Some(Expansion { macro_call_id: db.intern_macro(macro_call_loc) })
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue