From 3922503205e2798e21273a22112f584951f25623 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 28 Nov 2018 02:09:09 +0300 Subject: ItemId based module source --- crates/ra_analysis/src/hir/query_definitions.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 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 ae292e964..cdd986ce4 100644 --- a/crates/ra_analysis/src/hir/query_definitions.rs +++ b/crates/ra_analysis/src/hir/query_definitions.rs @@ -63,16 +63,17 @@ pub(crate) fn submodules( db.check_canceled()?; let file_id = source.file_id(); let submodules = match source.resolve(db) { - ModuleSourceNode::SourceFile(it) => collect_submodules(file_id, it.borrowed()), + ModuleSourceNode::SourceFile(it) => collect_submodules(db, file_id, it.borrowed()), ModuleSourceNode::Module(it) => it .borrowed() .item_list() - .map(|it| collect_submodules(file_id, it)) + .map(|it| collect_submodules(db, file_id, it)) .unwrap_or_else(Vec::new), }; return Ok(Arc::new(submodules)); fn collect_submodules<'a>( + db: &impl HirDatabase, file_id: FileId, root: impl ast::ModuleItemOwner<'a>, ) -> Vec { @@ -81,7 +82,7 @@ pub(crate) fn submodules( if m.has_semi() { Submodule::Declaration(name) } else { - let src = ModuleSource::new_inline(file_id, m); + let src = ModuleSource::new_inline(db, file_id, m); Submodule::Definition(name, src) } }) -- cgit v1.2.3