Skip to content

Commit 33e53d4

Browse files
bors[bot]lnicola
andauthored
Merge #5653
5653: Fold trait declarations r=SomeoneToIgnore a=lnicola Fixes #5652 Co-authored-by: Laurențiu Nicola <[email protected]>
2 parents f17d2d1 + f1bbc77 commit 33e53d4

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

crates/ra_ide/src/folding_ranges.rs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ fn fold_kind(kind: SyntaxKind) -> Option<FoldKind> {
8585
COMMENT => Some(FoldKind::Comment),
8686
USE => Some(FoldKind::Imports),
8787
ARG_LIST | PARAM_LIST => Some(FoldKind::ArgList),
88-
RECORD_FIELD_LIST
88+
ASSOC_ITEM_LIST
89+
| RECORD_FIELD_LIST
8990
| RECORD_PAT_FIELD_LIST
9091
| RECORD_EXPR_FIELD_LIST
9192
| ITEM_LIST
@@ -336,6 +337,26 @@ fn main() <fold block>{
336337
);
337338
}
338339

340+
#[test]
341+
fn test_folds_structs() {
342+
check(
343+
r#"
344+
struct Foo <fold block>{
345+
}</fold>
346+
"#,
347+
);
348+
}
349+
350+
#[test]
351+
fn test_folds_traits() {
352+
check(
353+
r#"
354+
trait Foo <fold block>{
355+
}</fold>
356+
"#,
357+
);
358+
}
359+
339360
#[test]
340361
fn test_folds_macros() {
341362
check(

0 commit comments

Comments
 (0)