Remove MacroCallKind::DeriveAttr

This commit is contained in:
Wyatt Herkamp 2024-03-21 12:50:58 -04:00
parent c376addfcc
commit 262e06f1ef
6 changed files with 34 additions and 79 deletions

View file

@ -1022,26 +1022,6 @@ fn precise_macro_call_location(
MacroKind::Attr,
)
}
MacroCallKind::DeriveAttr { ast_id, invoc_attr_index } => {
let node = ast_id.to_node(db.upcast());
let attr = collect_attrs(&node)
.nth(invoc_attr_index.ast_index())
.and_then(|x| Either::left(x.1))
.unwrap_or_else(|| {
panic!("cannot find attribute #{}", invoc_attr_index.ast_index())
});
(
ast_id.with_value(SyntaxNodePtr::from(AstPtr::new(&attr))),
Some(attr.syntax().text_range()),
attr.path()
.and_then(|path| path.segment())
.and_then(|seg| seg.name_ref())
.as_ref()
.map(ToString::to_string),
MacroKind::Attr,
)
}
}
}