diff options
Diffstat (limited to 'crates/ra_assists/src/lib.rs')
-rw-r--r-- | crates/ra_assists/src/lib.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/ra_assists/src/lib.rs b/crates/ra_assists/src/lib.rs index 724bce191..625ebc4a2 100644 --- a/crates/ra_assists/src/lib.rs +++ b/crates/ra_assists/src/lib.rs | |||
@@ -234,6 +234,7 @@ mod helpers { | |||
234 | use crate::{test_db::TestDB, Assist, AssistCtx, ImportsLocator}; | 234 | use crate::{test_db::TestDB, Assist, AssistCtx, ImportsLocator}; |
235 | use std::sync::Arc; | 235 | use std::sync::Arc; |
236 | 236 | ||
237 | // FIXME remove the `ModuleDefId` reexport from `ra_hir` when this gets removed. | ||
237 | pub(crate) struct TestImportsLocator { | 238 | pub(crate) struct TestImportsLocator { |
238 | db: Arc<TestDB>, | 239 | db: Arc<TestDB>, |
239 | test_file_id: FileId, | 240 | test_file_id: FileId, |
@@ -248,13 +249,13 @@ mod helpers { | |||
248 | impl ImportsLocator for TestImportsLocator { | 249 | impl ImportsLocator for TestImportsLocator { |
249 | fn find_imports(&mut self, name_to_import: &str) -> Vec<hir::ModuleDef> { | 250 | fn find_imports(&mut self, name_to_import: &str) -> Vec<hir::ModuleDef> { |
250 | let crate_def_map = self.db.crate_def_map(self.db.test_crate()); | 251 | let crate_def_map = self.db.crate_def_map(self.db.test_crate()); |
251 | let mut findings = vec![]; | 252 | let mut findings = Vec::new(); |
252 | 253 | ||
253 | let mut module_ids_to_process = | 254 | let mut module_ids_to_process = |
254 | crate_def_map.modules_for_file(self.test_file_id).collect::<Vec<_>>(); | 255 | crate_def_map.modules_for_file(self.test_file_id).collect::<Vec<_>>(); |
255 | 256 | ||
256 | while !module_ids_to_process.is_empty() { | 257 | while !module_ids_to_process.is_empty() { |
257 | let mut more_ids_to_process = vec![]; | 258 | let mut more_ids_to_process = Vec::new(); |
258 | for local_module_id in module_ids_to_process.drain(..) { | 259 | for local_module_id in module_ids_to_process.drain(..) { |
259 | for (name, namespace_data) in | 260 | for (name, namespace_data) in |
260 | crate_def_map[local_module_id].scope.entries_without_primitives() | 261 | crate_def_map[local_module_id].scope.entries_without_primitives() |