mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Diagnose unresolved derive macros
This commit is contained in:
parent
1ad500beb6
commit
fa42888e27
6 changed files with 44 additions and 19 deletions
|
@ -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(),
|
||||
),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue