File tree Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -939,10 +939,12 @@ impl<'a> CompletionContext<'a> {
939939 ast:: Meta ( meta) => make_path_kind_attr( meta) ?,
940940 ast:: Visibility ( it) => PathKind :: Vis { has_in_token: it. in_token( ) . is_some( ) } ,
941941 ast:: UseTree ( _) => PathKind :: Use ,
942+ ast:: RecordExpr ( it) => make_path_kind_expr( it. into( ) ) ,
942943 _ => return None ,
943944 }
944945 }
945946 } ,
947+ ast:: RecordExpr ( it) => make_path_kind_expr( it. into( ) ) ,
946948 _ => return None ,
947949 }
948950 } ;
Original file line number Diff line number Diff line change @@ -651,3 +651,22 @@ fn main() {
651651 " ] ] ,
652652 ) ;
653653}
654+
655+ #[ test]
656+ fn complete_record_expr_path ( ) {
657+ check (
658+ r#"
659+ struct Zulu;
660+ impl Zulu {
661+ fn test() -> Self { }
662+ }
663+ fn boi(val: Zulu) { }
664+ fn main() {
665+ boi(Zulu:: $0 {});
666+ }
667+ "# ,
668+ expect ! [ [ r#"
669+ fn test() fn() -> Zulu
670+ "# ] ] ,
671+ ) ;
672+ }
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ fn path_for_qualifier(
5454 mut qual : CompletedMarker ,
5555) -> CompletedMarker {
5656 loop {
57- let use_tree = matches ! ( p. nth( 2 ) , T ![ * ] | T ![ '{' ] ) ;
57+ let use_tree = mode == Mode :: Use && matches ! ( p. nth( 2 ) , T ![ * ] | T ![ '{' ] ) ;
5858 if p. at ( T ! [ :: ] ) && !use_tree {
5959 let path = qual. precede ( p) ;
6060 p. bump ( T ! [ :: ] ) ;
You can’t perform that action at this time.
0 commit comments