Skip to content

Commit bcde562

Browse files
committed
fix jsxelement formatting
1 parent 7376e48 commit bcde562

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

src/services/formatting/smartIndenter.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ namespace ts.formatting {
428428
case SyntaxKind.ConditionalExpression:
429429
case SyntaxKind.ArrayBindingPattern:
430430
case SyntaxKind.ObjectBindingPattern:
431+
case SyntaxKind.JsxElement:
431432
return true;
432433
}
433434
return false;
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+
//@Filename: file.tsx
4+
////function () {
5+
//// return (
6+
//// <div className="commentBox" >
7+
////Hello, World!/*autoformat*/
8+
/////*indent*/
9+
//// </div>
10+
//// )
11+
////}
12+
////
13+
14+
15+
format.document();
16+
goTo.marker("autoformat");
17+
verify.currentLineContentIs(' Hello, World!');
18+
goTo.marker("indent");
19+
verify.indentationIs(12);

0 commit comments

Comments
 (0)