diff options
| -rw-r--r-- | crates/ra_ide/src/folding_ranges.rs | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/crates/ra_ide/src/folding_ranges.rs b/crates/ra_ide/src/folding_ranges.rs index 903c3499643..0fbc9babd58 100644 --- a/crates/ra_ide/src/folding_ranges.rs +++ b/crates/ra_ide/src/folding_ranges.rs @@ -85,7 +85,8 @@ fn fold_kind(kind: SyntaxKind) -> Option<FoldKind> { COMMENT => Some(FoldKind::Comment), USE => Some(FoldKind::Imports), ARG_LIST | PARAM_LIST => Some(FoldKind::ArgList), - RECORD_FIELD_LIST + ASSOC_ITEM_LIST + | RECORD_FIELD_LIST | RECORD_PAT_FIELD_LIST | RECORD_EXPR_FIELD_LIST | ITEM_LIST @@ -337,6 +338,26 @@ fn main() <fold block>{ } #[test] + fn test_folds_structs() { + check( + r#" +struct Foo <fold block>{ +}</fold> +"#, + ); + } + + #[test] + fn test_folds_traits() { + check( + r#" +trait Foo <fold block>{ +}</fold> +"#, + ); + } + + #[test] fn test_folds_macros() { check( r#" |
