diff --git a/src/services/formatting/smartIndenter.ts b/src/services/formatting/smartIndenter.ts index 3b291b6e39..c7f762fea6 100644 --- a/src/services/formatting/smartIndenter.ts +++ b/src/services/formatting/smartIndenter.ts @@ -428,6 +428,7 @@ namespace ts.formatting { case SyntaxKind.ConditionalExpression: case SyntaxKind.ArrayBindingPattern: case SyntaxKind.ObjectBindingPattern: + case SyntaxKind.JsxElement: return true; } return false; diff --git a/tests/cases/fourslash/formattingJsxElements.ts b/tests/cases/fourslash/formattingJsxElements.ts new file mode 100644 index 0000000000..d0c77804ed --- /dev/null +++ b/tests/cases/fourslash/formattingJsxElements.ts @@ -0,0 +1,19 @@ +/// + +//@Filename: file.tsx +////function () { +//// return ( +////
+////Hello, World!/*autoformat*/ +/////*indent*/ +////
+//// ) +////} +//// + + +format.document(); +goTo.marker("autoformat"); +verify.currentLineContentIs(' Hello, World!'); +goTo.marker("indent"); +verify.indentationIs(12); \ No newline at end of file