@@ -714,6 +714,11 @@ namespace ts.formatting {
714
714
715
715
processNode ( child , childContextNode , childStartLine , undecoratedChildStartLine , childIndentation . indentation , childIndentation . delta ) ;
716
716
717
+ if ( child . kind === SyntaxKind . JsxText ) {
718
+ const range : TextRange = { pos : child . getStart ( ) , end : child . getEnd ( ) } ;
719
+ indentMultilineCommentOrJsxText ( range , childIndentation . indentation , /*firstLineIsIndented*/ true , /*indentFinalLine*/ false ) ;
720
+ }
721
+
717
722
childContextNode = node ;
718
723
719
724
if ( isFirstListItem && parent . kind === SyntaxKind . ArrayLiteralExpression && inheritedIndentation === Constants . Unknown ) {
@@ -833,7 +838,7 @@ namespace ts.formatting {
833
838
switch ( triviaItem . kind ) {
834
839
case SyntaxKind . MultiLineCommentTrivia :
835
840
if ( triviaInRange ) {
836
- indentMultilineComment ( triviaItem , commentIndentation , /*firstLineIsIndented*/ ! indentNextTokenOrTrivia ) ;
841
+ indentMultilineCommentOrJsxText ( triviaItem , commentIndentation , /*firstLineIsIndented*/ ! indentNextTokenOrTrivia ) ;
837
842
}
838
843
indentNextTokenOrTrivia = false ;
839
844
break ;
@@ -985,7 +990,7 @@ namespace ts.formatting {
985
990
return indentationString !== sourceFile . text . substr ( startLinePosition , indentationString . length ) ;
986
991
}
987
992
988
- function indentMultilineComment ( commentRange : TextRange , indentation : number , firstLineIsIndented : boolean ) {
993
+ function indentMultilineCommentOrJsxText ( commentRange : TextRange , indentation : number , firstLineIsIndented : boolean , indentFinalLine = true ) {
989
994
// split comment in lines
990
995
let startLine = sourceFile . getLineAndCharacterOfPosition ( commentRange . pos ) . line ;
991
996
const endLine = sourceFile . getLineAndCharacterOfPosition ( commentRange . end ) . line ;
@@ -1006,7 +1011,9 @@ namespace ts.formatting {
1006
1011
startPos = getStartPositionOfLine ( line + 1 , sourceFile ) ;
1007
1012
}
1008
1013
1009
- parts . push ( { pos : startPos , end : commentRange . end } ) ;
1014
+ if ( indentFinalLine ) {
1015
+ parts . push ( { pos : startPos , end : commentRange . end } ) ;
1016
+ }
1010
1017
}
1011
1018
1012
1019
const startLinePos = getStartPositionOfLine ( startLine , sourceFile ) ;
0 commit comments