Skip to content

Commit 0ec5ae9

Browse files
committed
Adding test case for when case block starts on new line
1 parent 6e4b81f commit 0ec5ae9

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed

tests/baselines/Issue294.baseline.txt

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
original file
2+
-----------------------------------
3+
switch (0) {
4+
case 0: {
5+
const zero = 0;
6+
return zero;
7+
}
8+
}
9+
-----------------------------------
10+
11+
Grammar: TypeScript.tmLanguage
12+
-----------------------------------
13+
>switch (0) {
14+
^^^^^^
15+
source.ts switch-statement.expr.ts switch-expression.expr.ts keyword.control.switch.ts
16+
^
17+
source.ts switch-statement.expr.ts switch-expression.expr.ts
18+
^
19+
source.ts switch-statement.expr.ts switch-expression.expr.ts meta.brace.round.ts
20+
^
21+
source.ts switch-statement.expr.ts switch-expression.expr.ts constant.numeric.decimal.ts
22+
^
23+
source.ts switch-statement.expr.ts switch-expression.expr.ts meta.brace.round.ts
24+
^
25+
source.ts switch-statement.expr.ts
26+
^
27+
source.ts switch-statement.expr.ts switch-block.expr.ts punctuation.definition.block.ts
28+
^^
29+
source.ts switch-statement.expr.ts switch-block.expr.ts
30+
> case 0: {
31+
^^^^
32+
source.ts switch-statement.expr.ts switch-block.expr.ts
33+
^^^^
34+
source.ts switch-statement.expr.ts switch-block.expr.ts case-clause.expr.ts keyword.control.switch.ts
35+
^
36+
source.ts switch-statement.expr.ts switch-block.expr.ts case-clause.expr.ts
37+
^
38+
source.ts switch-statement.expr.ts switch-block.expr.ts case-clause.expr.ts constant.numeric.decimal.ts
39+
^
40+
source.ts switch-statement.expr.ts switch-block.expr.ts case-clause.expr.ts
41+
^
42+
source.ts switch-statement.expr.ts switch-block.expr.ts meta.object-literal.ts
43+
^
44+
source.ts switch-statement.expr.ts switch-block.expr.ts meta.object-literal.ts punctuation.definition.block.ts
45+
^^
46+
source.ts switch-statement.expr.ts switch-block.expr.ts meta.object-literal.ts
47+
> const zero = 0;
48+
^^^^^^^^^^^^^^^^^^^^^^^^^
49+
source.ts switch-statement.expr.ts switch-block.expr.ts meta.object-literal.ts
50+
> return zero;
51+
^^^^^^^^^^^^^^^^^^^^^^
52+
source.ts switch-statement.expr.ts switch-block.expr.ts meta.object-literal.ts
53+
> }
54+
^^^^
55+
source.ts switch-statement.expr.ts switch-block.expr.ts meta.object-literal.ts
56+
^
57+
source.ts switch-statement.expr.ts switch-block.expr.ts meta.object-literal.ts punctuation.definition.block.ts
58+
^^
59+
source.ts switch-statement.expr.ts switch-block.expr.ts
60+
>}
61+
^
62+
source.ts switch-statement.expr.ts punctuation.definition.block.ts

tests/cases/Issue294.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
switch (0) {
2+
case 0: {
3+
const zero = 0;
4+
return zero;
5+
}
6+
}

0 commit comments

Comments
 (0)