aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-07-09 17:49:44 +0100
committerGitHub <[email protected]>2020-07-09 17:49:44 +0100
commit1fb92d791e44d3b225f73d9160de173f255ab881 (patch)
treed5ccfc20ff7d0260543c97d3cd30c9531e44200a /crates/ra_ide
parent7f991d80699844cdc38f61970cbbd73044506676 (diff)
parentca8969a1044bb4a0c990efdf6ae90740ce085930 (diff)
Merge #5284
5284: Fold struct literals r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide')
-rw-r--r--crates/ra_ide/src/folding_ranges.rs17
1 files 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<FoldKind> {
87 ARG_LIST => Some(FoldKind::ArgList), 87 ARG_LIST => Some(FoldKind::ArgList),
88 RECORD_FIELD_DEF_LIST 88 RECORD_FIELD_DEF_LIST
89 | RECORD_FIELD_PAT_LIST 89 | RECORD_FIELD_PAT_LIST
90 | RECORD_FIELD_LIST
90 | ITEM_LIST 91 | ITEM_LIST
91 | EXTERN_ITEM_LIST 92 | EXTERN_ITEM_LIST
92 | USE_TREE_LIST 93 | USE_TREE_LIST
@@ -355,7 +356,8 @@ fn main() <fold block>{
355 0 => 0, 356 0 => 0,
356 _ => 1, 357 _ => 1,
357 }</fold> 358 }</fold>
358}</fold>"#, 359}</fold>
360"#,
359 ); 361 );
360 } 362 }
361 363
@@ -370,7 +372,18 @@ fn main() <fold block>{
370 3, 372 3,
371 )</fold> 373 )</fold>
372}</fold> 374}</fold>
373 "#, 375"#,
376 )
377 }
378
379 #[test]
380 fn fold_record_literals() {
381 check(
382 r#"
383const _: S = S <fold block>{
384
385}</fold>;
386"#,
374 ) 387 )
375 } 388 }
376} 389}