mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Derive block attributes from block item tree
This commit is contained in:
parent
05b0612051
commit
e5b23e3bc1
8 changed files with 41 additions and 27 deletions
|
@ -431,12 +431,10 @@ impl AttrsWithOwner {
|
|||
.item_tree(db)
|
||||
.raw_attrs(AttrOwner::ModItem(definition_tree_id.value.into()))
|
||||
.clone(),
|
||||
ModuleOrigin::BlockExpr { block } => RawAttrs::from_attrs_owner(
|
||||
db.upcast(),
|
||||
InFile::new(block.file_id, block.to_node(db.upcast()))
|
||||
.as_ref()
|
||||
.map(|it| it as &dyn ast::HasAttrs),
|
||||
),
|
||||
ModuleOrigin::BlockExpr { id, block } => {
|
||||
let tree = db.block_item_tree_query(id);
|
||||
tree.raw_attrs(AttrOwner::TopLevel).clone()
|
||||
}
|
||||
}
|
||||
}
|
||||
AttrDefId::FieldId(it) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue