mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Show proc-macro loading errors in unresolved-proc-macro diagnostics
This commit is contained in:
parent
15c63c4119
commit
7d51fc4640
14 changed files with 149 additions and 114 deletions
|
@ -627,7 +627,7 @@ fn emit_def_diagnostic(db: &dyn HirDatabase, acc: &mut Vec<AnyDiagnostic>, diag:
|
|||
);
|
||||
}
|
||||
|
||||
DefDiagnosticKind::UnresolvedProcMacro { ast } => {
|
||||
DefDiagnosticKind::UnresolvedProcMacro { ast, proc_macro_err } => {
|
||||
let (node, precise_location, macro_name, kind) = match ast {
|
||||
MacroCallKind::FnLike { ast_id, .. } => {
|
||||
let node = ast_id.to_node(db.upcast());
|
||||
|
@ -689,7 +689,16 @@ fn emit_def_diagnostic(db: &dyn HirDatabase, acc: &mut Vec<AnyDiagnostic>, diag:
|
|||
)
|
||||
}
|
||||
};
|
||||
acc.push(UnresolvedProcMacro { node, precise_location, macro_name, kind }.into());
|
||||
acc.push(
|
||||
UnresolvedProcMacro {
|
||||
node,
|
||||
precise_location,
|
||||
macro_name,
|
||||
kind,
|
||||
proc_macro_err: proc_macro_err.clone(),
|
||||
}
|
||||
.into(),
|
||||
);
|
||||
}
|
||||
|
||||
DefDiagnosticKind::UnresolvedMacroCall { ast, path } => {
|
||||
|
@ -1163,6 +1172,7 @@ impl DefWithBody {
|
|||
precise_location: None,
|
||||
macro_name: None,
|
||||
kind: MacroKind::ProcMacro,
|
||||
proc_macro_err: None,
|
||||
}
|
||||
.into(),
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue