From a9e4142f434b1a2aa0729387534121fdf9c812a6 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 4 Dec 2018 21:21:39 +0300 Subject: [PATCH] include file itself in SourceFileItems --- crates/ra_hir/src/query_definitions.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/ra_hir/src/query_definitions.rs b/crates/ra_hir/src/query_definitions.rs index 6f602878c8..59318f307b 100644 --- a/crates/ra_hir/src/query_definitions.rs +++ b/crates/ra_hir/src/query_definitions.rs @@ -36,9 +36,10 @@ pub(super) fn fn_scopes(db: &impl HirDatabase, fn_id: FnId) -> Arc { } pub(super) fn file_items(db: &impl HirDatabase, file_id: FileId) -> Arc { - let source_file = db.source_file(file_id); - let source_file = source_file.borrowed(); let mut res = SourceFileItems::default(); + let source_file = db.source_file(file_id); + res.alloc(source_file.syntax().owned()); + let source_file = source_file.borrowed(); source_file .syntax() .descendants()