We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
body.block_scopes
ChildBySource
1 parent 13f4356 commit c12f7beCopy full SHA for c12f7be
crates/hir_def/src/child_by_source.rs
@@ -160,6 +160,10 @@ impl ChildBySource for EnumId {
160
impl ChildBySource for DefWithBodyId {
161
fn child_by_source_to(&self, db: &dyn DefDatabase, res: &mut DynMap) {
162
let body = db.body(*self);
163
- body.item_scope.child_by_source_to(db, res);
+ for def_map in body.block_scopes.iter().filter_map(|block| db.block_def_map(*block)) {
164
+ // All block expressions are merged into the same map, because they logically all add
165
+ // inner items to the containing `DefWithBodyId`.
166
+ def_map[def_map.root()].scope.child_by_source_to(db, res);
167
+ }
168
}
169
0 commit comments