Fix the eager token maps by re-mapping the textranges between the input and input expansion

This commit is contained in:
Lukas Wirth 2023-07-13 09:17:07 +02:00
parent 2366c16bf9
commit 6a7b905c86
18 changed files with 434 additions and 157 deletions

View file

@ -698,7 +698,7 @@ impl Module {
fn emit_macro_def_diagnostics(db: &dyn HirDatabase, acc: &mut Vec<AnyDiagnostic>, m: Macro) {
let id = macro_id_to_def_id(db.upcast(), m.id);
if let hir_expand::db::TokenExpander::DeclarativeMacro(expander) = db.macro_def(id) {
if let hir_expand::db::TokenExpander::DeclarativeMacro(expander) = db.macro_expander(id) {
if let Some(e) = expander.mac.err() {
let Some(ast) = id.ast_id().left() else {
never!("declarative expander for non decl-macro: {:?}", e);