aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src/descriptors/module/mod.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-11-20 18:50:22 +0000
committerAleksey Kladov <[email protected]>2018-11-20 18:50:22 +0000
commitcc8163439f65138c0945c37d6bddc64ced2d2143 (patch)
tree232f888acb84723ea89fdf8decd866a042df5d6b /crates/ra_analysis/src/descriptors/module/mod.rs
parent1cf92c3e286232be7e0d1370b88547ca0cb6f636 (diff)
populate modules
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