Skip to content

Commit 181e04b

Browse files
committed
Adds failing test
1 parent 171c664 commit 181e04b

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

tests/cases/fourslash/formatTemplateLiteral.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
////String.raw`foo`;/*6*/
1212
////String.raw `bar${3}`;/*7*/
1313
////`Write ${ JSON.stringify("") } and ${ (765) } and ${ 346 }`;/*spaceInside*/
14+
////`
15+
//// ${ JSON.stringify("") } and ${ (765) } and ${ 346 }`;/*spaceInsideNewline*/
1416
/////*formatEnd*/
1517

1618

@@ -37,4 +39,17 @@ goTo.marker("7");
3739
verify.currentLineContentIs("String.raw`bar${3}`;");
3840

3941
goTo.marker("spaceInside");
40-
verify.currentLineContentIs('`Write ${JSON.stringify("")} and ${(765)} and ${346}`;');
42+
verify.currentLineContentIs('`Write ${JSON.stringify("")} and ${(765)} and ${346}`;');
43+
goTo.marker("spaceInsideNewline");
44+
verify.currentLineContentIs(' ${JSON.stringify("")} and ${(765)} and ${346}`;');
45+
46+
format.setOption('InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces', true);
47+
48+
format.selection("formatStart", "formatEnd");
49+
50+
goTo.marker("spaceInside");
51+
verify.currentLineContentIs('`Write ${ JSON.stringify("") } and ${ (765) } and ${ 346 }`;');
52+
goTo.marker("spaceInsideNewline");
53+
verify.currentLineContentIs(' ${ JSON.stringify("") } and ${ (765) } and ${ 346 }`;');
54+
55+
format.setOption('InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces', false);

0 commit comments

Comments
 (0)