From 1f97445f39bc1fec4c6b38eb1a801da6871698b2 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Thu, 19 Sep 2019 17:22:08 +0200 Subject: `fold_kind`: `MATCH_ARM_LIST => FoldKind::Block` --- crates/ra_ide_api/src/folding_ranges.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'crates/ra_ide_api') diff --git a/crates/ra_ide_api/src/folding_ranges.rs b/crates/ra_ide_api/src/folding_ranges.rs index 3ab6c195e..fc18222f2 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 { | EXTERN_ITEM_LIST | USE_TREE_LIST | BLOCK + | MATCH_ARM_LIST | ENUM_VARIANT_LIST | TOKEN_TREE => Some(FoldKind::Block), _ => None, @@ -358,4 +359,21 @@ macro_rules! foo { let folds = &[FoldKind::Block]; do_check(text, folds); } + + #[test] + fn test_fold_match_arms() { + let text = r#" +fn main() { + match 0 { + 0 => 0, + _ => 1, + } +}"#; + + let folds = &[ + FoldKind::Block, + FoldKind::Block, + ]; + do_check(text, folds); + } } -- cgit v1.2.3