File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ pub enum FoldKind {
19
19
Statics ,
20
20
Array ,
21
21
WhereClause ,
22
+ ReturnType ,
22
23
}
23
24
24
25
#[ derive( Debug ) ]
@@ -131,6 +132,7 @@ fn fold_kind(kind: SyntaxKind) -> Option<FoldKind> {
131
132
COMMENT => Some ( FoldKind :: Comment ) ,
132
133
ARG_LIST | PARAM_LIST => Some ( FoldKind :: ArgList ) ,
133
134
ARRAY_EXPR => Some ( FoldKind :: Array ) ,
135
+ RET_TYPE => Some ( FoldKind :: ReturnType ) ,
134
136
ASSOC_ITEM_LIST
135
137
| RECORD_FIELD_LIST
136
138
| RECORD_PAT_FIELD_LIST
@@ -300,6 +302,7 @@ mod tests {
300
302
FoldKind :: Statics => "statics" ,
301
303
FoldKind :: Array => "array" ,
302
304
FoldKind :: WhereClause => "whereclause" ,
305
+ FoldKind :: ReturnType => "returntype" ,
303
306
} ;
304
307
assert_eq ! ( kind, & attr. unwrap( ) ) ;
305
308
}
@@ -560,4 +563,18 @@ where
560
563
"# ,
561
564
)
562
565
}
566
+
567
+ #[ test]
568
+ fn fold_return_type ( ) {
569
+ check (
570
+ r#"
571
+ fn foo()<fold returntype>-> (
572
+ bool,
573
+ bool,
574
+ )</fold> { (true, true) }
575
+
576
+ fn bar() -> (bool, bool) { (true, true) }
577
+ "# ,
578
+ )
579
+ }
563
580
}
Original file line number Diff line number Diff line change @@ -534,6 +534,7 @@ pub(crate) fn folding_range(
534
534
| FoldKind :: Consts
535
535
| FoldKind :: Statics
536
536
| FoldKind :: WhereClause
537
+ | FoldKind :: ReturnType
537
538
| FoldKind :: Array => None ,
538
539
} ;
539
540
You can’t perform that action at this time.
0 commit comments