aboutsummaryrefslogtreecommitdiff
path: root/crates/libanalysis/src/descriptors.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/libanalysis/src/descriptors.rs')
-rw-r--r--crates/libanalysis/src/descriptors.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/libanalysis/src/descriptors.rs b/crates/libanalysis/src/descriptors.rs
index 200f21576..93a4158e4 100644
--- a/crates/libanalysis/src/descriptors.rs
+++ b/crates/libanalysis/src/descriptors.rs
@@ -140,7 +140,7 @@ impl ModuleTreeDescriptor {
140 .links 140 .links
141 .iter() 141 .iter()
142 .filter(|it| it.name(self) == name) 142 .filter(|it| it.name(self) == name)
143 .map(|link| link.owner(self)) 143 .flat_map(|link| link.points_to(self).iter().map(|&node| self.node(node).file_id))
144 .collect() 144 .collect()
145 } 145 }
146 pub(crate) fn problems<'a, 'b>(&'b self, file_id: FileId, root: ast::Root<'a>) -> Vec<(ast::Name<'a>, &'b Problem)> { 146 pub(crate) fn problems<'a, 'b>(&'b self, file_id: FileId, root: ast::Root<'a>) -> Vec<(ast::Name<'a>, &'b Problem)> {
@@ -172,6 +172,9 @@ impl Link {
172 let owner = tree.link(self).owner; 172 let owner = tree.link(self).owner;
173 tree.node(owner).file_id 173 tree.node(owner).file_id
174 } 174 }
175 fn points_to(self, tree: &ModuleTreeDescriptor) -> &[Node] {
176 &tree.link(self).points_to
177 }
175 pub(crate) fn bind_source<'a>(self, tree: &ModuleTreeDescriptor, root: ast::Root<'a>) -> ast::Module<'a> { 178 pub(crate) fn bind_source<'a>(self, tree: &ModuleTreeDescriptor, root: ast::Root<'a>) -> ast::Module<'a> {
176 modules(root) 179 modules(root)
177 .filter(|(name, _)| name == &tree.link(self).name) 180 .filter(|(name, _)| name == &tree.link(self).name)