diff options
Diffstat (limited to 'crates/ra_hir/src/query_definitions.rs')
-rw-r--r-- | crates/ra_hir/src/query_definitions.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/crates/ra_hir/src/query_definitions.rs b/crates/ra_hir/src/query_definitions.rs index cf8c7e435..61c93a964 100644 --- a/crates/ra_hir/src/query_definitions.rs +++ b/crates/ra_hir/src/query_definitions.rs | |||
@@ -23,7 +23,7 @@ pub(super) fn fn_scopes(db: &impl HirDatabase, func: Function) -> Arc<FnScopes> | |||
23 | } | 23 | } |
24 | 24 | ||
25 | pub(super) fn file_items(db: &impl HirDatabase, file_id: HirFileId) -> Arc<SourceFileItems> { | 25 | pub(super) fn file_items(db: &impl HirDatabase, file_id: HirFileId) -> Arc<SourceFileItems> { |
26 | let source_file = db.hir_source_file(file_id); | 26 | let source_file = db.hir_parse(file_id); |
27 | let res = SourceFileItems::new(file_id, &source_file); | 27 | let res = SourceFileItems::new(file_id, &source_file); |
28 | Arc::new(res) | 28 | Arc::new(res) |
29 | } | 29 | } |
@@ -34,10 +34,7 @@ pub(super) fn file_item( | |||
34 | ) -> TreeArc<SyntaxNode> { | 34 | ) -> TreeArc<SyntaxNode> { |
35 | match source_item_id.item_id { | 35 | match source_item_id.item_id { |
36 | Some(id) => db.file_items(source_item_id.file_id)[id].to_owned(), | 36 | Some(id) => db.file_items(source_item_id.file_id)[id].to_owned(), |
37 | None => db | 37 | None => db.hir_parse(source_item_id.file_id).syntax().to_owned(), |
38 | .hir_source_file(source_item_id.file_id) | ||
39 | .syntax() | ||
40 | .to_owned(), | ||
41 | } | 38 | } |
42 | } | 39 | } |
43 | 40 | ||