mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Remove MacroCallKind::DeriveAttr
This commit is contained in:
parent
c376addfcc
commit
262e06f1ef
6 changed files with 34 additions and 79 deletions
|
@ -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,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue