diff options
author | Aleksey Kladov <[email protected]> | 2018-09-15 21:19:41 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-09-15 22:00:05 +0100 |
commit | e69ff21207d83864e13f6c8631733f4f0c32ba0d (patch) | |
tree | 4c8b33bd7e8c873ad8963eeab0185e8d62e74b78 /crates/libanalysis/src/descriptors.rs | |
parent | 3ebeb0db8de65434db79c86aeed5473bfb21334f (diff) |
kill old module_map
Diffstat (limited to 'crates/libanalysis/src/descriptors.rs')
-rw-r--r-- | crates/libanalysis/src/descriptors.rs | 5 |
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) |