From bcde56202eb39568c84dc53bcdaae58ecdeffa08 Mon Sep 17 00:00:00 2001 From: SaschaNaz Date: Sun, 16 Aug 2015 17:27:23 +0900 Subject: [PATCH] fix jsxelement formatting --- src/services/formatting/smartIndenter.ts | 1 + .../cases/fourslash/formattingJsxElements.ts | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 tests/cases/fourslash/formattingJsxElements.ts diff --git a/src/services/formatting/smartIndenter.ts b/src/services/formatting/smartIndenter.ts index 3b291b6e39a..c7f762fea64 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 00000000000..d0c77804ed5 --- /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