diff options
author | Lukas Wirth <[email protected]> | 2021-01-31 18:53:01 +0000 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2021-01-31 18:53:01 +0000 |
commit | 999e020da2f08460ab0683409227ddd88097b336 (patch) | |
tree | f3ed7fcf81e6747a90b205f9197ca8ed091e0e10 /crates/hir_def | |
parent | 286d90de2d213b467a092e702edf8b0706c7c1b2 (diff) |
Return inner attributes of outline mod declarations in `attrs_query`
Diffstat (limited to 'crates/hir_def')
-rw-r--r-- | crates/hir_def/src/attr.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/crates/hir_def/src/attr.rs b/crates/hir_def/src/attr.rs index 6513daec8..fe4c3fa28 100644 --- a/crates/hir_def/src/attr.rs +++ b/crates/hir_def/src/attr.rs | |||
@@ -200,7 +200,15 @@ impl Attrs { | |||
200 | let mod_data = &def_map[module.local_id]; | 200 | let mod_data = &def_map[module.local_id]; |
201 | match mod_data.declaration_source(db) { | 201 | match mod_data.declaration_source(db) { |
202 | Some(it) => { | 202 | Some(it) => { |
203 | RawAttrs::from_attrs_owner(db, it.as_ref().map(|it| it as &dyn AttrsOwner)) | 203 | let raw_attrs = RawAttrs::from_attrs_owner( |
204 | db, | ||
205 | it.as_ref().map(|it| it as &dyn AttrsOwner), | ||
206 | ); | ||
207 | match mod_data.definition_source(db) { | ||
208 | InFile { file_id, value: ModuleSource::SourceFile(file) } => raw_attrs | ||
209 | .merge(RawAttrs::from_attrs_owner(db, InFile::new(file_id, &file))), | ||
210 | _ => raw_attrs, | ||
211 | } | ||
204 | } | 212 | } |
205 | None => RawAttrs::from_attrs_owner( | 213 | None => RawAttrs::from_attrs_owner( |
206 | db, | 214 | db, |