From ca8969a1044bb4a0c990efdf6ae90740ce085930 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 9 Jul 2020 18:49:17 +0200 Subject: Fold struct literals --- crates/ra_ide/src/folding_ranges.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/crates/ra_ide/src/folding_ranges.rs b/crates/ra_ide/src/folding_ranges.rs index 5cec689f8..e7ec9953f 100644 --- a/crates/ra_ide/src/folding_ranges.rs +++ b/crates/ra_ide/src/folding_ranges.rs @@ -87,6 +87,7 @@ fn fold_kind(kind: SyntaxKind) -> Option { ARG_LIST => Some(FoldKind::ArgList), RECORD_FIELD_DEF_LIST | RECORD_FIELD_PAT_LIST + | RECORD_FIELD_LIST | ITEM_LIST | EXTERN_ITEM_LIST | USE_TREE_LIST @@ -355,7 +356,8 @@ fn main() { 0 => 0, _ => 1, } -}"#, +} +"#, ); } @@ -370,7 +372,18 @@ fn main() { 3, ) } - "#, +"#, + ) + } + + #[test] + fn fold_record_literals() { + check( + r#" +const _: S = S { + +}; +"#, ) } } -- cgit v1.2.3