Merge pull request #4330 from SaschaNaz/formatTsx
Fix JsxElement formatting
This commit is contained in:
commit
96286e9400
|
@ -428,6 +428,7 @@ namespace ts.formatting {
|
|||
case SyntaxKind.ConditionalExpression:
|
||||
case SyntaxKind.ArrayBindingPattern:
|
||||
case SyntaxKind.ObjectBindingPattern:
|
||||
case SyntaxKind.JsxElement:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
19
tests/cases/fourslash/formattingJsxElements.ts
Normal file
19
tests/cases/fourslash/formattingJsxElements.ts
Normal file
|
@ -0,0 +1,19 @@
|
|||
/// <reference path='fourslash.ts' />
|
||||
|
||||
//@Filename: file.tsx
|
||||
////function () {
|
||||
//// return (
|
||||
//// <div className="commentBox" >
|
||||
////Hello, World!/*autoformat*/
|
||||
/////*indent*/
|
||||
//// </div>
|
||||
//// )
|
||||
////}
|
||||
////
|
||||
|
||||
|
||||
format.document();
|
||||
goTo.marker("autoformat");
|
||||
verify.currentLineContentIs(' Hello, World!');
|
||||
goTo.marker("indent");
|
||||
verify.indentationIs(12);
|
Loading…
Reference in a new issue