Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir/src/lib.rs')
-rw-r--r--crates/hir/src/lib.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
index 382d1f9a54..2d73168727 100644
--- a/crates/hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -701,8 +701,9 @@ fn emit_def_diagnostic(db: &dyn HirDatabase, acc: &mut Vec<AnyDiagnostic>, diag:
let node = ast.to_node(db.upcast());
acc.push(
UnresolvedMacroCall {
- macro_call: InFile::new(ast.file_id, AstPtr::new(&node)),
+ macro_call: InFile::new(node.file_id, SyntaxNodePtr::new(&node.value)),
path: path.clone(),
+ is_bang: matches!(ast, MacroCallKind::FnLike { .. }),
}
.into(),
);
@@ -1170,7 +1171,12 @@ impl DefWithBody {
.into(),
),
BodyDiagnostic::UnresolvedMacroCall { node, path } => acc.push(
- UnresolvedMacroCall { macro_call: node.clone(), path: path.clone() }.into(),
+ UnresolvedMacroCall {
+ macro_call: node.clone().map(|ast_ptr| ast_ptr.into()),
+ path: path.clone(),
+ is_bang: true,
+ }
+ .into(),
),
}
}