aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api_light/src
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-01-22 13:27:17 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-01-22 13:27:17 +0000
commite396cb3548c8a36ba505cc08248333c225e56d2a (patch)
treef717eeb5a329768423bbfb843b283422e19e5c21 /crates/ra_ide_api_light/src
parentb59334e67a3c76c91ccd7bc1212a485ab0ac4065 (diff)
parentcd67fb3ac17aef65a73cd670ee4c8087515b99c3 (diff)
Merge #594
594: fold macros r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide_api_light/src')
-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}