Add some more attribute ide tests

This commit is contained in:
Lukas Wirth 2021-09-14 03:00:53 +02:00
parent 6f9de71402
commit 538ac599d2
8 changed files with 156 additions and 9 deletions

View file

@ -31,6 +31,7 @@ pub(crate) fn expand_macro(db: &RootDatabase, position: FilePosition) -> Option<
SyntaxKind::IDENT => 1,
_ => 0,
})?;
let descended = sema.descend_into_macros(tok.clone());
if let Some(attr) = descended.ancestors().find_map(ast::Attr::cast) {
if let Some((path, tt)) = attr.as_simple_call() {
@ -45,6 +46,9 @@ pub(crate) fn expand_macro(db: &RootDatabase, position: FilePosition) -> Option<
}
}
}
// FIXME: Intermix attribute and bang! expansions
// currently we only recursively expand one of the two types
let mut expanded = None;
let mut name = None;
for node in tok.ancestors() {