From 43ed3d1196164c96d025745c42f261930b832911 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 19 Dec 2019 16:57:22 +0100 Subject: Handle start imports in import groups --- crates/ra_hir_def/src/path/lower/lower_use.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'crates/ra_hir_def/src/path/lower/lower_use.rs') diff --git a/crates/ra_hir_def/src/path/lower/lower_use.rs b/crates/ra_hir_def/src/path/lower/lower_use.rs index 062c02063..3218eaf0a 100644 --- a/crates/ra_hir_def/src/path/lower/lower_use.rs +++ b/crates/ra_hir_def/src/path/lower/lower_use.rs @@ -9,6 +9,7 @@ use hir_expand::{ name::{AsName, Name}, }; use ra_syntax::ast::{self, NameOwner}; +use test_utils::tested_by; use crate::path::{ModPath, PathKind}; @@ -34,6 +35,7 @@ pub(crate) fn lower_use_tree( } } else { let alias = tree.alias().and_then(|a| a.name()).map(|a| a.as_name()); + let is_glob = tree.has_star(); if let Some(ast_path) = tree.path() { // Handle self in a path. // E.g. `use something::{self, <...>}` @@ -48,11 +50,15 @@ pub(crate) fn lower_use_tree( } } if let Some(path) = convert_path(prefix, ast_path, hygiene) { - let is_glob = tree.has_star(); cb(path, &tree, is_glob, alias) } - // FIXME: report errors somewhere - // We get here if we do + // FIXME: report errors somewhere + // We get here if we do + } else if is_glob { + tested_by!(glob_enum_group); + if let Some(prefix) = prefix { + cb(prefix, &tree, is_glob, None) + } } } } -- cgit v1.2.3