aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api')
-rw-r--r--crates/ra_ide_api/src/folding_ranges.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/crates/ra_ide_api/src/folding_ranges.rs b/crates/ra_ide_api/src/folding_ranges.rs
index 3ab6c195e..79fadcc5d 100644
--- a/crates/ra_ide_api/src/folding_ranges.rs
+++ b/crates/ra_ide_api/src/folding_ranges.rs
@@ -87,6 +87,7 @@ fn fold_kind(kind: SyntaxKind) -> Option<FoldKind> {
87 | EXTERN_ITEM_LIST 87 | EXTERN_ITEM_LIST
88 | USE_TREE_LIST 88 | USE_TREE_LIST
89 | BLOCK 89 | BLOCK
90 | MATCH_ARM_LIST
90 | ENUM_VARIANT_LIST 91 | ENUM_VARIANT_LIST
91 | TOKEN_TREE => Some(FoldKind::Block), 92 | TOKEN_TREE => Some(FoldKind::Block),
92 _ => None, 93 _ => None,
@@ -358,4 +359,18 @@ macro_rules! foo <fold>{
358 let folds = &[FoldKind::Block]; 359 let folds = &[FoldKind::Block];
359 do_check(text, folds); 360 do_check(text, folds);
360 } 361 }
362
363 #[test]
364 fn test_fold_match_arms() {
365 let text = r#"
366fn main() <fold>{
367 match 0 <fold>{
368 0 => 0,
369 _ => 1,
370 }</fold>
371}</fold>"#;
372
373 let folds = &[FoldKind::Block, FoldKind::Block];
374 do_check(text, folds);
375 }
361} 376}