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> {
939
939
ast:: Meta ( meta) => make_path_kind_attr( meta) ?,
940
940
ast:: Visibility ( it) => PathKind :: Vis { has_in_token: it. in_token( ) . is_some( ) } ,
941
941
ast:: UseTree ( _) => PathKind :: Use ,
942
+ ast:: RecordExpr ( it) => make_path_kind_expr( it. into( ) ) ,
942
943
_ => return None ,
943
944
}
944
945
}
945
946
} ,
947
+ ast:: RecordExpr ( it) => make_path_kind_expr( it. into( ) ) ,
946
948
_ => return None ,
947
949
}
948
950
} ;
Original file line number Diff line number Diff line change @@ -651,3 +651,22 @@ fn main() {
651
651
" ] ] ,
652
652
) ;
653
653
}
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(
54
54
mut qual : CompletedMarker ,
55
55
) -> CompletedMarker {
56
56
loop {
57
- let use_tree = matches ! ( p. nth( 2 ) , T ![ * ] | T ![ '{' ] ) ;
57
+ let use_tree = mode == Mode :: Use && matches ! ( p. nth( 2 ) , T ![ * ] | T ![ '{' ] ) ;
58
58
if p. at ( T ! [ :: ] ) && !use_tree {
59
59
let path = qual. precede ( p) ;
60
60
p. bump ( T ! [ :: ] ) ;
You can’t perform that action at this time.
0 commit comments