@@ -62,7 +62,6 @@ namespace ts.codefix {
6262 }
6363
6464 const classDeclarationSourceFile = getSourceFileOfNode ( classDeclaration ) ;
65- const classOpenBrace = getOpenBraceOfClassLike ( classDeclaration , classDeclarationSourceFile ) ;
6665
6766 return isInJavaScriptFile ( classDeclarationSourceFile ) ?
6867 getActionsForAddMissingMemberInJavaScriptFile ( classDeclaration , makeStatic ) :
@@ -154,7 +153,7 @@ namespace ts.codefix {
154153 typeNode ,
155154 /*initializer*/ undefined ) ;
156155 const propertyChangeTracker = textChanges . ChangeTracker . fromContext ( context ) ;
157- propertyChangeTracker . insertNodeAfter ( classDeclarationSourceFile , classOpenBrace , property , { suffix : context . newLineCharacter } ) ;
156+ propertyChangeTracker . insertNodeAtClassStart ( classDeclarationSourceFile , classDeclaration , property , context . newLineCharacter ) ;
158157
159158 const diag = makeStatic ? Diagnostics . Declare_static_property_0 : Diagnostics . Declare_property_0 ;
160159 actions = append ( actions , {
@@ -180,7 +179,7 @@ namespace ts.codefix {
180179 typeNode ) ;
181180
182181 const indexSignatureChangeTracker = textChanges . ChangeTracker . fromContext ( context ) ;
183- indexSignatureChangeTracker . insertNodeAfter ( classDeclarationSourceFile , classOpenBrace , indexSignature , { suffix : context . newLineCharacter } ) ;
182+ indexSignatureChangeTracker . insertNodeAtClassStart ( classDeclarationSourceFile , classDeclaration , indexSignature , context . newLineCharacter ) ;
184183
185184 actions . push ( {
186185 description : formatStringFromArgs ( getLocaleSpecificMessage ( Diagnostics . Add_index_signature_for_property_0 ) , [ tokenName ] ) ,
@@ -197,7 +196,7 @@ namespace ts.codefix {
197196 const methodDeclaration = createMethodFromCallExpression ( callExpression , tokenName , includeTypeScriptSyntax , makeStatic ) ;
198197
199198 const methodDeclarationChangeTracker = textChanges . ChangeTracker . fromContext ( context ) ;
200- methodDeclarationChangeTracker . insertNodeAfter ( classDeclarationSourceFile , classOpenBrace , methodDeclaration , { suffix : context . newLineCharacter } ) ;
199+ methodDeclarationChangeTracker . insertNodeAtClassStart ( classDeclarationSourceFile , classDeclaration , methodDeclaration , context . newLineCharacter ) ;
201200 const diag = makeStatic ? Diagnostics . Declare_static_method_0 : Diagnostics . Declare_method_0 ;
202201 return {
203202 description : formatStringFromArgs ( getLocaleSpecificMessage ( diag ) , [ tokenName ] ) ,
0 commit comments