Skip to content

Commit 40cd0b8

Browse files
committed
add formatting tests for multi-line object destructuring
with insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces === false
1 parent 0fd0903 commit 40cd0b8

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/// <reference path='fourslash.ts'/>
2+
3+
/////*1*/const {
4+
/////*2*/ a,
5+
/////*3*/ b,
6+
/////*4*/} = { a: 1, b: 2 };
7+
8+
format.document();
9+
10+
goTo.marker("1");
11+
verify.currentLineContentIs("const {");
12+
goTo.marker("2");
13+
verify.currentLineContentIs(" a,");
14+
goTo.marker("3");
15+
verify.currentLineContentIs(" b,");
16+
goTo.marker("4");
17+
verify.currentLineContentIs("} = { a: 1, b: 2 };");
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/// <reference path='fourslash.ts'/>
2+
3+
/////*1*/const {
4+
/////*2*/ a,
5+
/////*3*/ b,
6+
/////*4*/} = { a: 1, b: 2 };
7+
8+
format.setOption('InsertSpaceAfterOpeningAndBeforeClosingNonemptyBraces', false);
9+
10+
format.document();
11+
12+
goTo.marker("1");
13+
verify.currentLineContentIs("const {");
14+
goTo.marker("2");
15+
verify.currentLineContentIs(" a,");
16+
goTo.marker("3");
17+
verify.currentLineContentIs(" b,");
18+
goTo.marker("4");
19+
verify.currentLineContentIs("} = {a: 1, b: 2};");

0 commit comments

Comments
 (0)