@@ -70,7 +70,7 @@ namespace ts.codefix {
70
70
function getActionsForAddMissingMemberInJavaScriptFile ( classDeclaration : ClassLikeDeclaration , makeStatic : boolean ) : CodeAction [ ] | undefined {
71
71
let actions : CodeAction [ ] ;
72
72
73
- const methodCodeAction = getActionForMethodDeclaration ( ) ;
73
+ const methodCodeAction = getActionForMethodDeclaration ( /*includeTypeScriptSyntax*/ false ) ;
74
74
if ( methodCodeAction ) {
75
75
actions = [ methodCodeAction ] ;
76
76
}
@@ -130,7 +130,7 @@ namespace ts.codefix {
130
130
function getActionsForAddMissingMemberInTypeScriptFile ( classDeclaration : ClassLikeDeclaration , makeStatic : boolean ) : CodeAction [ ] | undefined {
131
131
let actions : CodeAction [ ] ;
132
132
133
- const methodCodeAction = getActionForMethodDeclaration ( ) ;
133
+ const methodCodeAction = getActionForMethodDeclaration ( /*includeTypeScriptSyntax*/ true ) ;
134
134
if ( methodCodeAction ) {
135
135
actions = [ methodCodeAction ] ;
136
136
}
@@ -189,10 +189,10 @@ namespace ts.codefix {
189
189
return actions ;
190
190
}
191
191
192
- function getActionForMethodDeclaration ( ) : CodeAction | undefined {
192
+ function getActionForMethodDeclaration ( includeTypeScriptSyntax : boolean ) : CodeAction | undefined {
193
193
if ( token . parent . parent . kind === SyntaxKind . CallExpression ) {
194
194
const callExpression = < CallExpression > token . parent . parent ;
195
- const methodDeclaration = createMethodFromCallExpression ( callExpression , tokenName , /* includeTypeScriptSyntax*/ true , makeStatic ) ;
195
+ const methodDeclaration = createMethodFromCallExpression ( callExpression , tokenName , includeTypeScriptSyntax , makeStatic ) ;
196
196
197
197
const methodDeclarationChangeTracker = textChanges . ChangeTracker . fromCodeFixContext ( context ) ;
198
198
methodDeclarationChangeTracker . insertNodeAfter ( classDeclarationSourceFile , classOpenBrace , methodDeclaration , { suffix : context . newLineCharacter } ) ;
0 commit comments