@@ -70,7 +70,7 @@ namespace ts.codefix {
7070 function getActionsForAddMissingMemberInJavaScriptFile ( classDeclaration : ClassLikeDeclaration , makeStatic : boolean ) : CodeAction [ ] | undefined {
7171 let actions : CodeAction [ ] ;
7272
73- const methodCodeAction = getActionForMethodDeclaration ( ) ;
73+ const methodCodeAction = getActionForMethodDeclaration ( /*includeTypeScriptSyntax*/ false ) ;
7474 if ( methodCodeAction ) {
7575 actions = [ methodCodeAction ] ;
7676 }
@@ -130,7 +130,7 @@ namespace ts.codefix {
130130 function getActionsForAddMissingMemberInTypeScriptFile ( classDeclaration : ClassLikeDeclaration , makeStatic : boolean ) : CodeAction [ ] | undefined {
131131 let actions : CodeAction [ ] ;
132132
133- const methodCodeAction = getActionForMethodDeclaration ( ) ;
133+ const methodCodeAction = getActionForMethodDeclaration ( /*includeTypeScriptSyntax*/ true ) ;
134134 if ( methodCodeAction ) {
135135 actions = [ methodCodeAction ] ;
136136 }
@@ -189,10 +189,10 @@ namespace ts.codefix {
189189 return actions ;
190190 }
191191
192- function getActionForMethodDeclaration ( ) : CodeAction | undefined {
192+ function getActionForMethodDeclaration ( includeTypeScriptSyntax : boolean ) : CodeAction | undefined {
193193 if ( token . parent . parent . kind === SyntaxKind . CallExpression ) {
194194 const callExpression = < CallExpression > token . parent . parent ;
195- const methodDeclaration = createMethodFromCallExpression ( callExpression , tokenName , /* includeTypeScriptSyntax*/ true , makeStatic ) ;
195+ const methodDeclaration = createMethodFromCallExpression ( callExpression , tokenName , includeTypeScriptSyntax , makeStatic ) ;
196196
197197 const methodDeclarationChangeTracker = textChanges . ChangeTracker . fromCodeFixContext ( context ) ;
198198 methodDeclarationChangeTracker . insertNodeAfter ( classDeclarationSourceFile , classOpenBrace , methodDeclaration , { suffix : context . newLineCharacter } ) ;
0 commit comments