aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api_light/src/folding_ranges.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api_light/src/folding_ranges.rs')
-rw-r--r--crates/ra_ide_api_light/src/folding_ranges.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/crates/ra_ide_api_light/src/folding_ranges.rs b/crates/ra_ide_api_light/src/folding_ranges.rs
index 6f3106889..288bba0ce 100644
--- a/crates/ra_ide_api_light/src/folding_ranges.rs
+++ b/crates/ra_ide_api_light/src/folding_ranges.rs
@@ -63,7 +63,7 @@ fn fold_kind(kind: SyntaxKind) -> Option<FoldKind> {
63 COMMENT => Some(FoldKind::Comment), 63 COMMENT => Some(FoldKind::Comment),
64 USE_ITEM => Some(FoldKind::Imports), 64 USE_ITEM => Some(FoldKind::Imports),
65 NAMED_FIELD_DEF_LIST | FIELD_PAT_LIST | ITEM_LIST | EXTERN_ITEM_LIST | USE_TREE_LIST 65 NAMED_FIELD_DEF_LIST | FIELD_PAT_LIST | ITEM_LIST | EXTERN_ITEM_LIST | USE_TREE_LIST
66 | BLOCK | ENUM_VARIANT_LIST => Some(FoldKind::Block), 66 | BLOCK | ENUM_VARIANT_LIST | TOKEN_TREE => Some(FoldKind::Block),
67 _ => None, 67 _ => None,
68 } 68 }
69} 69}
@@ -294,4 +294,15 @@ fn main() <fold>{
294 do_check(text, folds); 294 do_check(text, folds);
295 } 295 }
296 296
297 #[test]
298 fn test_folds_macros() {
299 let text = r#"
300macro_rules! foo <fold>{
301 ($($tt:tt)*) => { $($tt)* }
302}</fold>
303"#;
304
305 let folds = &[FoldKind::Block];
306 do_check(text, folds);
307 }
297} 308}