From 9027a21f9a1c7fcee0a59a1e28928fed29781dd8 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 28 Nov 2018 01:53:54 +0300 Subject: Introduce SourceItemId --- crates/ra_analysis/src/hir/query_definitions.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'crates/ra_analysis/src/hir/query_definitions.rs') diff --git a/crates/ra_analysis/src/hir/query_definitions.rs b/crates/ra_analysis/src/hir/query_definitions.rs index 53926cf16..ae292e964 100644 --- a/crates/ra_analysis/src/hir/query_definitions.rs +++ b/crates/ra_analysis/src/hir/query_definitions.rs @@ -12,7 +12,7 @@ use ra_syntax::{ use crate::{ FileId, Cancelable, hir::{ - SourceFileItems, SourceFileItemId, + SourceFileItems, SourceItemId, db::HirDatabase, function::{FnId, FnScopes}, module::{ @@ -52,12 +52,8 @@ pub(super) fn file_items(db: &impl HirDatabase, file_id: FileId) -> Arc SyntaxNode { - db.file_items(file_id)[file_item_id].clone() +pub(super) fn file_item(db: &impl HirDatabase, source_item_id: SourceItemId) -> SyntaxNode { + db.file_items(source_item_id.file_id)[source_item_id.item_id].clone() } pub(crate) fn submodules( -- cgit v1.2.3