@@ -13,8 +13,8 @@ use syntax::{
1313use crate :: context:: {
1414 CompletionContext , DotAccess , DotAccessKind , IdentContext , ItemListKind , LifetimeContext ,
1515 LifetimeKind , NameContext , NameKind , NameRefContext , NameRefKind , ParamKind , PathCompletionCtx ,
16- PathKind , PathQualifierCtx , PatternContext , PatternRefutability , Qualified , QualifierCtx ,
17- TypeAscriptionTarget , TypeLocation , COMPLETION_MARKER ,
16+ PathKind , PatternContext , PatternRefutability , Qualified , QualifierCtx , TypeAscriptionTarget ,
17+ TypeLocation , COMPLETION_MARKER ,
1818} ;
1919
2020impl < ' a > CompletionContext < ' a > {
@@ -589,6 +589,7 @@ impl<'a> CompletionContext<'a> {
589589 parent : path. parent_path ( ) ,
590590 kind : PathKind :: Item { kind : ItemListKind :: SourceFile } ,
591591 has_type_args : false ,
592+ use_tree_parent : false ,
592593 } ;
593594
594595 let is_in_block = |it : & SyntaxNode | {
@@ -853,6 +854,7 @@ impl<'a> CompletionContext<'a> {
853854
854855 // calculate the qualifier context
855856 if let Some ( ( path, use_tree_parent) ) = path_or_use_tree_qualifier ( & path) {
857+ path_ctx. use_tree_parent = use_tree_parent;
856858 if !use_tree_parent && segment. coloncolon_token ( ) . is_some ( ) {
857859 path_ctx. qualified = Qualified :: Absolute ;
858860 } else {
@@ -878,12 +880,7 @@ impl<'a> CompletionContext<'a> {
878880 let is_super_chain =
879881 iter:: successors ( Some ( path. clone ( ) ) , |p| p. qualifier ( ) )
880882 . all ( |p| p. segment ( ) . and_then ( |s| s. super_token ( ) ) . is_some ( ) ) ;
881- Qualified :: With ( PathQualifierCtx {
882- path,
883- resolution : res,
884- is_super_chain,
885- use_tree_parent,
886- } )
883+ Qualified :: With { path, resolution : res, is_super_chain }
887884 }
888885 } ;
889886 }
0 commit comments