mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-14 22:35:11 +00:00
Make replace_derive_with_manual_impl work again
This commit is contained in:
parent
be3168dabe
commit
f13c98034b
9 changed files with 118 additions and 130 deletions
|
@ -386,6 +386,17 @@ impl MacroCallKind {
|
|||
MacroCallKind::Derive { ast_id, .. } => {
|
||||
ast_id.with_value(ast_id.to_node(db).syntax().clone())
|
||||
}
|
||||
MacroCallKind::Attr { ast_id, is_derive: true, invoc_attr_index, .. } => {
|
||||
ast_id.with_value(ast_id.to_node(db)).map(|it| {
|
||||
it.doc_comments_and_attrs()
|
||||
.nth(*invoc_attr_index as usize)
|
||||
.and_then(|it| match it {
|
||||
Either::Left(attr) => Some(attr.syntax().clone()),
|
||||
Either::Right(_) => None,
|
||||
})
|
||||
.unwrap_or_else(|| it.syntax().clone())
|
||||
})
|
||||
}
|
||||
MacroCallKind::Attr { ast_id, .. } => {
|
||||
ast_id.with_value(ast_id.to_node(db).syntax().clone())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue