@@ -565,9 +565,8 @@ namespace ts.formatting {
565
565
! suppressDelta && shouldAddDelta ( line , kind , container ) ? indentation + getDelta ( container ) : indentation ,
566
566
getIndentation : ( ) => indentation ,
567
567
getDelta,
568
- recomputeIndentation : ( lineAdded , parentIn ) => {
569
- const parent = node . parent || parentIn ;
570
- if ( node !== parent && SmartIndenter . shouldIndentChildNode ( options , parent , node , sourceFile ) ) {
568
+ recomputeIndentation : ( lineAdded , parent ) => {
569
+ if ( SmartIndenter . shouldIndentChildNode ( options , parent , node , sourceFile ) ) {
571
570
indentation += lineAdded ? options . indentSize ! : - options . indentSize ! ;
572
571
delta = SmartIndenter . shouldIndentChildNode ( options , node ) ? options . indentSize ! : 0 ;
573
572
}
@@ -992,15 +991,15 @@ namespace ts.formatting {
992
991
// Handle the case where the next line is moved to be the end of this line.
993
992
// In this case we don't indent the next line in the next pass.
994
993
if ( currentParent . getStart ( sourceFile ) === currentItem . pos ) {
995
- dynamicIndentation . recomputeIndentation ( /*lineAddedByFormatting*/ false , currentParent ) ;
994
+ dynamicIndentation . recomputeIndentation ( /*lineAddedByFormatting*/ false , contextNode ) ;
996
995
}
997
996
break ;
998
997
case LineAction . LineAdded :
999
998
// Handle the case where token2 is moved to the new line.
1000
999
// In this case we indent token2 in the next pass but we set
1001
1000
// sameLineIndent flag to notify the indenter that the indentation is within the line.
1002
1001
if ( currentParent . getStart ( sourceFile ) === currentItem . pos ) {
1003
- dynamicIndentation . recomputeIndentation ( /*lineAddedByFormatting*/ true , currentParent ) ;
1002
+ dynamicIndentation . recomputeIndentation ( /*lineAddedByFormatting*/ true , contextNode ) ;
1004
1003
}
1005
1004
break ;
1006
1005
default :
0 commit comments