From cd67fb3ac17aef65a73cd670ee4c8087515b99c3 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 22 Jan 2019 16:26:32 +0300 Subject: fold macros --- crates/ra_ide_api_light/src/folding_ranges.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'crates') 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 { COMMENT => Some(FoldKind::Comment), USE_ITEM => Some(FoldKind::Imports), NAMED_FIELD_DEF_LIST | FIELD_PAT_LIST | ITEM_LIST | EXTERN_ITEM_LIST | USE_TREE_LIST - | BLOCK | ENUM_VARIANT_LIST => Some(FoldKind::Block), + | BLOCK | ENUM_VARIANT_LIST | TOKEN_TREE => Some(FoldKind::Block), _ => None, } } @@ -294,4 +294,15 @@ fn main() { do_check(text, folds); } + #[test] + fn test_folds_macros() { + let text = r#" +macro_rules! foo { + ($($tt:tt)*) => { $($tt)* } +} +"#; + + let folds = &[FoldKind::Block]; + do_check(text, folds); + } } -- cgit v1.2.3