mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Publish diagnostics for macro expansion errors
This commit is contained in:
parent
1b26520971
commit
0432aa0ed7
8 changed files with 168 additions and 7 deletions
|
@ -142,6 +142,13 @@ pub(crate) fn diagnostics(
|
|||
.with_code(Some(d.code())),
|
||||
);
|
||||
})
|
||||
.on::<hir::diagnostics::UnresolvedProcMacro, _>(|d| {
|
||||
// FIXME: it would be nice to tell the user whether proc macros are currently disabled
|
||||
res.borrow_mut().push(
|
||||
Diagnostic::hint(sema.diagnostics_display_range(d).range, d.message())
|
||||
.with_code(Some(d.code())),
|
||||
);
|
||||
})
|
||||
// Only collect experimental diagnostics when they're enabled.
|
||||
.filter(|diag| !(diag.is_experimental() && config.disable_experimental))
|
||||
.filter(|diag| !config.disabled.contains(diag.code().as_str()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue