@@ -652,7 +652,7 @@ namespace ts.formatting {
652
652
consumeTokenAndAdvanceScanner ( tokenInfo , node , nodeDynamicIndentation , node ) ;
653
653
}
654
654
655
- if ( formattingScanner . isOnEOF ( ) ) {
655
+ if ( ! node . parent && formattingScanner . isOnEOF ( ) ) {
656
656
const token = formattingScanner . readEOFTokenRange ( ) ;
657
657
if ( token . end <= node . end && previousRange ) {
658
658
processPair (
@@ -1148,11 +1148,7 @@ namespace ts.formatting {
1148
1148
1149
1149
function recordDelete ( start : number , len : number ) {
1150
1150
if ( len ) {
1151
- const newEdit = createTextChangeFromStartLength ( start , len , "" ) ;
1152
- const lastEdit = lastOrUndefined ( edits ) ;
1153
- if ( ! lastEdit || ! textSpansEqual ( lastEdit . span , newEdit . span ) || lastEdit . newText !== newEdit . newText ) {
1154
- edits . push ( newEdit ) ;
1155
- }
1151
+ edits . push ( createTextChangeFromStartLength ( start , len , "" ) ) ;
1156
1152
}
1157
1153
}
1158
1154
@@ -1164,11 +1160,7 @@ namespace ts.formatting {
1164
1160
1165
1161
function recordInsert ( start : number , text : string ) {
1166
1162
if ( text ) {
1167
- const newEdit = createTextChangeFromStartLength ( start , 0 , text ) ;
1168
- const lastEdit = lastOrUndefined ( edits ) ;
1169
- if ( ! lastEdit || ! textSpansEqual ( lastEdit . span , newEdit . span ) || lastEdit . newText !== newEdit . newText ) {
1170
- edits . push ( newEdit ) ;
1171
- }
1163
+ edits . push ( createTextChangeFromStartLength ( start , 0 , text ) ) ;
1172
1164
}
1173
1165
}
1174
1166
0 commit comments