@@ -52,7 +52,7 @@ pub(crate) fn expand_glob_import(acc: &mut Assists, ctx: &AssistContext) -> Opti
52
52
let current_scope = ctx. sema . scope ( & star. parent ( ) ?) ?;
53
53
let current_module = current_scope. module ( ) ;
54
54
55
- let refs_in_target = find_refs_in_mod ( ctx, target_module, Some ( current_module) ) ?;
55
+ let refs_in_target = find_refs_in_mod ( ctx, target_module, current_module) ?;
56
56
let imported_defs = find_imported_defs ( ctx, star) ?;
57
57
58
58
let target = parent. either ( |n| n. syntax ( ) . clone ( ) , |n| n. syntax ( ) . clone ( ) ) ;
@@ -168,18 +168,12 @@ impl Refs {
168
168
}
169
169
}
170
170
171
- fn find_refs_in_mod (
172
- ctx : & AssistContext ,
173
- module : Module ,
174
- visible_from : Option < Module > ,
175
- ) -> Option < Refs > {
176
- if let Some ( from) = visible_from {
177
- if !is_mod_visible_from ( ctx, module, from) {
178
- return None ;
179
- }
171
+ fn find_refs_in_mod ( ctx : & AssistContext , module : Module , visible_from : Module ) -> Option < Refs > {
172
+ if !is_mod_visible_from ( ctx, module, visible_from) {
173
+ return None ;
180
174
}
181
175
182
- let module_scope = module. scope ( ctx. db ( ) , visible_from) ;
176
+ let module_scope = module. scope ( ctx. db ( ) , Some ( visible_from) ) ;
183
177
let refs = module_scope. into_iter ( ) . filter_map ( |( n, d) | Ref :: from_scope_def ( n, d) ) . collect ( ) ;
184
178
Some ( Refs ( refs) )
185
179
}
0 commit comments