mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Simplify eager macro representation
This commit is contained in:
parent
c7196620ab
commit
ea8555b155
10 changed files with 166 additions and 278 deletions
|
@ -948,20 +948,17 @@ impl DefCollector<'_> {
|
|||
// incrementality).
|
||||
let err = self.db.macro_expand_error(macro_call_id);
|
||||
if let Some(err) = err {
|
||||
if let MacroCallId::LazyMacro(id) = macro_call_id {
|
||||
let loc: MacroCallLoc = self.db.lookup_intern_macro(id);
|
||||
let loc: MacroCallLoc = self.db.lookup_intern_macro(macro_call_id);
|
||||
|
||||
let diag = match err {
|
||||
hir_expand::ExpandError::UnresolvedProcMacro => {
|
||||
// Missing proc macros are non-fatal, so they are handled specially.
|
||||
DefDiagnostic::unresolved_proc_macro(module_id, loc.kind)
|
||||
}
|
||||
_ => DefDiagnostic::macro_error(module_id, loc.kind, err.to_string()),
|
||||
};
|
||||
let diag = match err {
|
||||
hir_expand::ExpandError::UnresolvedProcMacro => {
|
||||
// Missing proc macros are non-fatal, so they are handled specially.
|
||||
DefDiagnostic::unresolved_proc_macro(module_id, loc.kind)
|
||||
}
|
||||
_ => DefDiagnostic::macro_error(module_id, loc.kind, err.to_string()),
|
||||
};
|
||||
|
||||
self.def_map.diagnostics.push(diag);
|
||||
}
|
||||
// FIXME: Handle eager macros.
|
||||
self.def_map.diagnostics.push(diag);
|
||||
}
|
||||
|
||||
// Then, fetch and process the item tree. This will reuse the expansion result from above.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue