mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
internal: Record unresolved derive invocations in hir
This commit is contained in:
parent
0e5d8883cc
commit
44d61766b5
7 changed files with 55 additions and 28 deletions
|
@ -6,7 +6,6 @@
|
|||
|
||||
use either::Either;
|
||||
use hir_expand::HirFileId;
|
||||
use itertools::Itertools;
|
||||
use syntax::ast::HasAttrs;
|
||||
|
||||
use crate::{
|
||||
|
@ -123,8 +122,7 @@ impl ChildBySource for ItemScope {
|
|||
});
|
||||
self.derive_macro_invocs().for_each(|(ast_id, calls)| {
|
||||
let item = ast_id.to_node(db.upcast());
|
||||
let grouped = calls.iter().copied().into_group_map();
|
||||
for (attr_id, calls) in grouped {
|
||||
for (attr_id, calls) in calls {
|
||||
if let Some(attr) = item.attrs().nth(attr_id.ast_index as usize) {
|
||||
res[keys::DERIVE_MACRO].insert(ast_id.with_value(attr), calls.into());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue