@@ -62,7 +62,6 @@ namespace ts.codefix {
62
62
}
63
63
64
64
const classDeclarationSourceFile = getSourceFileOfNode ( classDeclaration ) ;
65
- const classOpenBrace = getOpenBraceOfClassLike ( classDeclaration , classDeclarationSourceFile ) ;
66
65
67
66
return isInJavaScriptFile ( classDeclarationSourceFile ) ?
68
67
getActionsForAddMissingMemberInJavaScriptFile ( classDeclaration , makeStatic ) :
@@ -154,7 +153,7 @@ namespace ts.codefix {
154
153
typeNode ,
155
154
/*initializer*/ undefined ) ;
156
155
const propertyChangeTracker = textChanges . ChangeTracker . fromContext ( context ) ;
157
- propertyChangeTracker . insertNodeAfter ( classDeclarationSourceFile , classOpenBrace , property , { suffix : context . newLineCharacter } ) ;
156
+ propertyChangeTracker . insertNodeAtClassStart ( classDeclarationSourceFile , classDeclaration , property , context . newLineCharacter ) ;
158
157
159
158
const diag = makeStatic ? Diagnostics . Declare_static_property_0 : Diagnostics . Declare_property_0 ;
160
159
actions = append ( actions , {
@@ -180,7 +179,7 @@ namespace ts.codefix {
180
179
typeNode ) ;
181
180
182
181
const indexSignatureChangeTracker = textChanges . ChangeTracker . fromContext ( context ) ;
183
- indexSignatureChangeTracker . insertNodeAfter ( classDeclarationSourceFile , classOpenBrace , indexSignature , { suffix : context . newLineCharacter } ) ;
182
+ indexSignatureChangeTracker . insertNodeAtClassStart ( classDeclarationSourceFile , classDeclaration , indexSignature , context . newLineCharacter ) ;
184
183
185
184
actions . push ( {
186
185
description : formatStringFromArgs ( getLocaleSpecificMessage ( Diagnostics . Add_index_signature_for_property_0 ) , [ tokenName ] ) ,
@@ -197,7 +196,7 @@ namespace ts.codefix {
197
196
const methodDeclaration = createMethodFromCallExpression ( callExpression , tokenName , includeTypeScriptSyntax , makeStatic ) ;
198
197
199
198
const methodDeclarationChangeTracker = textChanges . ChangeTracker . fromContext ( context ) ;
200
- methodDeclarationChangeTracker . insertNodeAfter ( classDeclarationSourceFile , classOpenBrace , methodDeclaration , { suffix : context . newLineCharacter } ) ;
199
+ methodDeclarationChangeTracker . insertNodeAtClassStart ( classDeclarationSourceFile , classDeclaration , methodDeclaration , context . newLineCharacter ) ;
201
200
const diag = makeStatic ? Diagnostics . Declare_static_method_0 : Diagnostics . Declare_method_0 ;
202
201
return {
203
202
description : formatStringFromArgs ( getLocaleSpecificMessage ( diag ) , [ tokenName ] ) ,
0 commit comments