internal: Record unresolved derive invocations in hir

This commit is contained in:
Lukas Wirth 2022-01-01 20:31:04 +01:00
parent 989c06b25d
commit 6b7b09d329
8 changed files with 87 additions and 52 deletions

View file

@ -17,7 +17,7 @@ use syntax::{
match_ast, AstToken, SyntaxKind, SyntaxNode, SyntaxToken,
};
use crate::{helpers::try_resolve_derive_input, RootDatabase};
use crate::RootDatabase;
// FIXME: a more precise name would probably be `Symbol`?
#[derive(Debug, PartialEq, Eq, Copy, Clone, Hash)]
@ -55,11 +55,8 @@ impl Definition {
let attr = ast::TokenTree::cast(parent.clone())
.and_then(|tt| tt.parent_meta())
.and_then(|meta| meta.parent_attr());
if let Some(attr) = attr {
return try_resolve_derive_input(&sema, &attr, &ident)
.map(Into::into)
.into_iter()
.collect();
if let Some(_) = attr {
return sema.resolve_derive_ident(&ident).map(Into::into).into_iter().collect();
}
}
Self::from_node(sema, &parent)