include file itself in SourceFileItems

This commit is contained in:
Aleksey Kladov 2018-12-04 21:21:39 +03:00
parent 244f9a142f
commit a9e4142f43

View file

@ -36,9 +36,10 @@ pub(super) fn fn_scopes(db: &impl HirDatabase, fn_id: FnId) -> Arc<FnScopes> {
}
pub(super) fn file_items(db: &impl HirDatabase, file_id: FileId) -> Arc<SourceFileItems> {
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()