diff options
Diffstat (limited to 'crates/ra_hir/src/nameres/collector.rs')
-rw-r--r-- | crates/ra_hir/src/nameres/collector.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/crates/ra_hir/src/nameres/collector.rs b/crates/ra_hir/src/nameres/collector.rs index 7da2dcdff..26158b5c3 100644 --- a/crates/ra_hir/src/nameres/collector.rs +++ b/crates/ra_hir/src/nameres/collector.rs | |||
@@ -295,6 +295,23 @@ where | |||
295 | } | 295 | } |
296 | } | 296 | } |
297 | 297 | ||
298 | // `#[macro_use] extern crate` glob import macros | ||
299 | if import.is_extern_crate && import.is_macro_use { | ||
300 | if let Some(ModuleDef::Module(m)) = | ||
301 | def.a().and_then(|item| item.take_types()) | ||
302 | { | ||
303 | let item_map = self.db.crate_def_map(m.krate); | ||
304 | let scope = &item_map[m.module_id].scope; | ||
305 | let macros = scope | ||
306 | .macros | ||
307 | .iter() | ||
308 | .map(|(name, res)| (name.clone(), Either::B(*res))) | ||
309 | .collect::<Vec<_>>(); | ||
310 | |||
311 | self.update(module_id, Some(import_id), ¯os); | ||
312 | } | ||
313 | } | ||
314 | |||
298 | let resolution = match def { | 315 | let resolution = match def { |
299 | Either::A(item) => { | 316 | Either::A(item) => { |
300 | Either::A(Resolution { def: item, import: Some(import_id) }) | 317 | Either::A(Resolution { def: item, import: Some(import_id) }) |