From a300fb68e25ea0cbf2cfba38968a40674cd4c805 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 20 Nov 2018 17:16:33 +0300 Subject: Make most of modules impl private --- crates/ra_analysis/src/descriptors/module/mod.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'crates/ra_analysis/src/descriptors/module/mod.rs') diff --git a/crates/ra_analysis/src/descriptors/module/mod.rs b/crates/ra_analysis/src/descriptors/module/mod.rs index a894025ed..ff7afe16e 100644 --- a/crates/ra_analysis/src/descriptors/module/mod.rs +++ b/crates/ra_analysis/src/descriptors/module/mod.rs @@ -8,7 +8,7 @@ use ra_editor::find_node_at_offset; use ra_syntax::{ algo::generate, ast::{self, AstNode, NameOwner}, - SmolStr, SyntaxNode, SyntaxNodeRef, + SmolStr, SyntaxNode, }; use relative_path::RelativePathBuf; @@ -62,7 +62,7 @@ impl ModuleDescriptor { module_source: ModuleSource, ) -> Cancelable> { let source_root_id = db.file_source_root(file_id); - let module_tree = db.module_tree(source_root_id)?; + let module_tree = db._module_tree(source_root_id)?; let res = match module_tree.any_module_for_source(module_source) { None => None, @@ -124,7 +124,11 @@ impl ModuleDescriptor { /// Returns a `ModuleScope`: a set of items, visible in this module. pub fn scope(&self, db: &impl DescriptorDatabase) -> Cancelable> { - db.module_scope(self.source_root_id, self.module_id) + db._module_scope(self.source_root_id, self.module_id) + } + + pub fn problems(&self, db: &impl DescriptorDatabase) -> Vec<(SyntaxNode, Problem)> { + self.module_id.problems(&self.tree, db) } } @@ -209,7 +213,7 @@ impl ModuleId { .find(|it| it.name == name)?; Some(*link.points_to.first()?) } - pub(crate) fn problems( + fn problems( self, tree: &ModuleTree, db: &impl SyntaxDatabase, -- cgit v1.2.3