From 049f8df93cca05af395ce873738dc85d5a25f3fc Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 21 Nov 2018 12:57:05 +0300 Subject: switch completion to new scope --- crates/ra_analysis/src/descriptors/module/imp.rs | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'crates/ra_analysis/src/descriptors/module/imp.rs') diff --git a/crates/ra_analysis/src/descriptors/module/imp.rs b/crates/ra_analysis/src/descriptors/module/imp.rs index defe87216..d4dce861f 100644 --- a/crates/ra_analysis/src/descriptors/module/imp.rs +++ b/crates/ra_analysis/src/descriptors/module/imp.rs @@ -1,7 +1,7 @@ use std::sync::Arc; use ra_syntax::{ - ast::{self, ModuleItemOwner, NameOwner}, + ast::{self, NameOwner}, SmolStr, }; use relative_path::RelativePathBuf; @@ -15,7 +15,7 @@ use crate::{ }; use super::{ - LinkData, LinkId, ModuleData, ModuleId, ModuleScope, ModuleSource, ModuleSourceNode, + LinkData, LinkId, ModuleData, ModuleId, ModuleSource, ModuleSourceNode, ModuleTree, Problem, }; @@ -81,23 +81,6 @@ pub(crate) fn modules<'a>( }) } -pub(crate) fn module_scope( - db: &impl DescriptorDatabase, - source_root_id: SourceRootId, - module_id: ModuleId, -) -> Cancelable> { - let tree = db._module_tree(source_root_id)?; - let source = module_id.source(&tree).resolve(db); - let res = match source { - ModuleSourceNode::SourceFile(it) => ModuleScope::new(it.borrowed().items()), - ModuleSourceNode::Module(it) => match it.borrowed().item_list() { - Some(items) => ModuleScope::new(items.items()), - None => ModuleScope::new(std::iter::empty()), - }, - }; - Ok(Arc::new(res)) -} - pub(crate) fn module_tree( db: &impl DescriptorDatabase, source_root: SourceRootId, -- cgit v1.2.3