aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-01-22 13:26:32 +0000
committerAleksey Kladov <[email protected]>2019-01-22 13:26:32 +0000
commitcd67fb3ac17aef65a73cd670ee4c8087515b99c3 (patch)
treef717eeb5a329768423bbfb843b283422e19e5c21 /crates
parentb59334e67a3c76c91ccd7bc1212a485ab0ac4065 (diff)
fold macros
Diffstat (limited to 'crates')
-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}