mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Report syntax errors from item level macro expansions
This commit is contained in:
parent
71b50f9f09
commit
d1632c2727
11 changed files with 147 additions and 76 deletions
|
@ -265,6 +265,19 @@ pub fn diagnostics(
|
|||
AnyDiagnostic::InvalidDeriveTarget(d) => handlers::invalid_derive_target::invalid_derive_target(&ctx, &d),
|
||||
AnyDiagnostic::MacroDefError(d) => handlers::macro_error::macro_def_error(&ctx, &d),
|
||||
AnyDiagnostic::MacroError(d) => handlers::macro_error::macro_error(&ctx, &d),
|
||||
AnyDiagnostic::MacroExpansionParseError(d) => {
|
||||
res.extend(d.errors.iter().take(32).map(|err| {
|
||||
{
|
||||
Diagnostic::new(
|
||||
"syntax-error",
|
||||
format!("Syntax Error in Expansion: {err}"),
|
||||
ctx.resolve_precise_location(&d.node.clone(), d.precise_location),
|
||||
)
|
||||
}
|
||||
.experimental()
|
||||
}));
|
||||
continue;
|
||||
},
|
||||
AnyDiagnostic::MalformedDerive(d) => handlers::malformed_derive::malformed_derive(&ctx, &d),
|
||||
AnyDiagnostic::MismatchedArgCount(d) => handlers::mismatched_arg_count::mismatched_arg_count(&ctx, &d),
|
||||
AnyDiagnostic::MissingFields(d) => handlers::missing_fields::missing_fields(&ctx, &d),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue