@@ -720,6 +720,9 @@ namespace ts.formatting {
720720 // proceed any parent tokens that are located prior to child.getStart()
721721 const tokenInfo = formattingScanner . readTokenInfo ( node ) ;
722722 if ( tokenInfo . token . end > childStartPos ) {
723+ if ( tokenInfo . token . pos > childStartPos ) {
724+ formattingScanner . skipToStartOf ( child ) ;
725+ }
723726 // stop when formatting scanner advances past the beginning of the child
724727 break ;
725728 }
@@ -731,13 +734,15 @@ namespace ts.formatting {
731734 return inheritedIndentation ;
732735 }
733736
734- // JSX text shouldn't affect indenting
735- if ( isToken ( child ) && child . kind !== SyntaxKind . JsxText ) {
737+ if ( isToken ( child ) ) {
736738 // if child node is a token, it does not impact indentation, proceed it using parent indentation scope rules
737739 const tokenInfo = formattingScanner . readTokenInfo ( child ) ;
738- Debug . assert ( tokenInfo . token . end === child . end , "Token end is child end" ) ;
739- consumeTokenAndAdvanceScanner ( tokenInfo , node , parentDynamicIndentation , child ) ;
740- return inheritedIndentation ;
740+ // JSX text shouldn't affect indenting
741+ if ( child . kind !== SyntaxKind . JsxText ) {
742+ Debug . assert ( tokenInfo . token . end === child . end , "Token end is child end" ) ;
743+ consumeTokenAndAdvanceScanner ( tokenInfo , node , parentDynamicIndentation , child ) ;
744+ return inheritedIndentation ;
745+ }
741746 }
742747
743748 const effectiveParentStartLine = child . kind === SyntaxKind . Decorator ? childStartLine : undecoratedParentStartLine ;
0 commit comments