aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src/descriptors/module/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_analysis/src/descriptors/module/mod.rs')
-rw-r--r--crates/ra_analysis/src/descriptors/module/mod.rs12
1 files changed, 8 insertions, 4 deletions
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;
8use ra_syntax::{ 8use ra_syntax::{
9 algo::generate, 9 algo::generate,
10 ast::{self, AstNode, NameOwner}, 10 ast::{self, AstNode, NameOwner},
11 SmolStr, SyntaxNode, SyntaxNodeRef, 11 SmolStr, SyntaxNode,
12}; 12};
13use relative_path::RelativePathBuf; 13use relative_path::RelativePathBuf;
14 14
@@ -62,7 +62,7 @@ impl ModuleDescriptor {
62 module_source: ModuleSource, 62 module_source: ModuleSource,
63 ) -> Cancelable<Option<ModuleDescriptor>> { 63 ) -> Cancelable<Option<ModuleDescriptor>> {
64 let source_root_id = db.file_source_root(file_id); 64 let source_root_id = db.file_source_root(file_id);
65 let module_tree = db.module_tree(source_root_id)?; 65 let module_tree = db._module_tree(source_root_id)?;
66 66
67 let res = match module_tree.any_module_for_source(module_source) { 67 let res = match module_tree.any_module_for_source(module_source) {
68 None => None, 68 None => None,
@@ -124,7 +124,11 @@ impl ModuleDescriptor {
124 124
125 /// Returns a `ModuleScope`: a set of items, visible in this module. 125 /// Returns a `ModuleScope`: a set of items, visible in this module.
126 pub fn scope(&self, db: &impl DescriptorDatabase) -> Cancelable<Arc<ModuleScope>> { 126 pub fn scope(&self, db: &impl DescriptorDatabase) -> Cancelable<Arc<ModuleScope>> {
127 db.module_scope(self.source_root_id, self.module_id) 127 db._module_scope(self.source_root_id, self.module_id)
128 }
129
130 pub fn problems(&self, db: &impl DescriptorDatabase) -> Vec<(SyntaxNode, Problem)> {
131 self.module_id.problems(&self.tree, db)
128 } 132 }
129} 133}
130 134
@@ -209,7 +213,7 @@ impl ModuleId {
209 .find(|it| it.name == name)?; 213 .find(|it| it.name == name)?;
210 Some(*link.points_to.first()?) 214 Some(*link.points_to.first()?)
211 } 215 }
212 pub(crate) fn problems( 216 fn problems(
213 self, 217 self,
214 tree: &ModuleTree, 218 tree: &ModuleTree,
215 db: &impl SyntaxDatabase, 219 db: &impl SyntaxDatabase,