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.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/ra_analysis/src/descriptors/module/mod.rs b/crates/ra_analysis/src/descriptors/module/mod.rs
index 958487541..f49e7f909 100644
--- a/crates/ra_analysis/src/descriptors/module/mod.rs
+++ b/crates/ra_analysis/src/descriptors/module/mod.rs
@@ -214,6 +214,13 @@ impl ModuleId {
214 .find(|it| it.name == name)?; 214 .find(|it| it.name == name)?;
215 Some(*link.points_to.first()?) 215 Some(*link.points_to.first()?)
216 } 216 }
217 fn children<'a>(self, tree: &'a ModuleTree) -> impl Iterator<Item = (SmolStr, ModuleId)> + 'a {
218 tree.module(self).children.iter().filter_map(move |&it| {
219 let link = tree.link(it);
220 let module = *link.points_to.first()?;
221 Some((link.name.clone(), module))
222 })
223 }
217 fn problems(self, tree: &ModuleTree, db: &impl SyntaxDatabase) -> Vec<(SyntaxNode, Problem)> { 224 fn problems(self, tree: &ModuleTree, db: &impl SyntaxDatabase) -> Vec<(SyntaxNode, Problem)> {
218 tree.module(self) 225 tree.module(self)
219 .children 226 .children