@@ -16,28 +16,26 @@ pub(crate) fn complete_vis_path(acc: &mut Completions, ctx: &CompletionContext)
1616 } ;
1717
1818 match qualified {
19- Qualified :: With { resolution, is_super_chain, .. } => {
19+ Qualified :: With {
20+ resolution : Some ( hir:: PathResolution :: Def ( hir:: ModuleDef :: Module ( module) ) ) ,
21+ is_super_chain,
22+ ..
23+ } => {
2024 // Try completing next child module of the path that is still a parent of the current module
21- if let Some ( hir:: PathResolution :: Def ( hir:: ModuleDef :: Module ( module) ) ) = resolution {
22- let next_towards_current = ctx
23- . module
24- . path_to_root ( ctx. db )
25- . into_iter ( )
26- . take_while ( |it| it != module)
27- . last ( ) ;
28- if let Some ( next) = next_towards_current {
29- if let Some ( name) = next. name ( ctx. db ) {
30- cov_mark:: hit!( visibility_qualified) ;
31- acc. add_resolution ( ctx, name, ScopeDef :: ModuleDef ( next. into ( ) ) ) ;
32- }
25+ let next_towards_current =
26+ ctx. module . path_to_root ( ctx. db ) . into_iter ( ) . take_while ( |it| it != module) . last ( ) ;
27+ if let Some ( next) = next_towards_current {
28+ if let Some ( name) = next. name ( ctx. db ) {
29+ cov_mark:: hit!( visibility_qualified) ;
30+ acc. add_resolution ( ctx, name, ScopeDef :: ModuleDef ( next. into ( ) ) ) ;
3331 }
3432 }
3533
3634 if * is_super_chain {
3735 acc. add_keyword ( ctx, "super::" ) ;
3836 }
3937 }
40- Qualified :: Absolute | Qualified :: Infer => { }
38+ Qualified :: Absolute | Qualified :: Infer | Qualified :: With { .. } => { }
4139 Qualified :: No => {
4240 if !has_in_token {
4341 cov_mark:: hit!( kw_completion_in) ;
0 commit comments