@@ -96,7 +96,7 @@ namespace ts.codefix {
9696 }
9797
9898 function getActionsForAddMissingMemberInJavaScriptFile ( context : CodeFixContext , classDeclarationSourceFile : SourceFile , classDeclaration : ClassLikeDeclaration , tokenName : string , makeStatic : boolean ) : CodeFixAction | undefined {
99- const changes = textChanges . ChangeTracker . with ( context , t => addMissingMemberInJs ( t , classDeclarationSourceFile , classDeclaration , tokenName , makeStatic ) ) ;
99+ const changes = textChanges . ChangeTracker . with ( toTextChangesContext ( context ) , t => addMissingMemberInJs ( t , classDeclarationSourceFile , classDeclaration , tokenName , makeStatic ) ) ;
100100 if ( changes . length === 0 ) return undefined ;
101101 const description = formatStringFromArgs ( getLocaleSpecificMessage ( makeStatic ? Diagnostics . Initialize_static_property_0 : Diagnostics . Initialize_property_0_in_the_constructor ) , [ tokenName ] ) ;
102102 return { description, changes, fixId } ;
@@ -142,9 +142,9 @@ namespace ts.codefix {
142142 return typeNode || createKeywordTypeNode ( SyntaxKind . AnyKeyword ) ;
143143 }
144144
145- function createAddPropertyDeclarationAction ( context : textChanges . TextChangesContext , classDeclarationSourceFile : SourceFile , classDeclaration : ClassLikeDeclaration , makeStatic : boolean , tokenName : string , typeNode : TypeNode ) : CodeFixAction {
145+ function createAddPropertyDeclarationAction ( context : CodeFixContext , classDeclarationSourceFile : SourceFile , classDeclaration : ClassLikeDeclaration , makeStatic : boolean , tokenName : string , typeNode : TypeNode ) : CodeFixAction {
146146 const description = formatStringFromArgs ( getLocaleSpecificMessage ( makeStatic ? Diagnostics . Declare_static_property_0 : Diagnostics . Declare_property_0 ) , [ tokenName ] ) ;
147- const changes = textChanges . ChangeTracker . with ( context , t => addPropertyDeclaration ( t , classDeclarationSourceFile , classDeclaration , tokenName , typeNode , makeStatic ) ) ;
147+ const changes = textChanges . ChangeTracker . with ( toTextChangesContext ( context ) , t => addPropertyDeclaration ( t , classDeclarationSourceFile , classDeclaration , tokenName , typeNode , makeStatic ) ) ;
148148 return { description, changes, fixId } ;
149149 }
150150
@@ -159,7 +159,7 @@ namespace ts.codefix {
159159 changeTracker . insertNodeAtClassStart ( classDeclarationSourceFile , classDeclaration , property ) ;
160160 }
161161
162- function createAddIndexSignatureAction ( context : textChanges . TextChangesContext , classDeclarationSourceFile : SourceFile , classDeclaration : ClassLikeDeclaration , tokenName : string , typeNode : TypeNode ) : CodeFixAction {
162+ function createAddIndexSignatureAction ( context : CodeFixContext , classDeclarationSourceFile : SourceFile , classDeclaration : ClassLikeDeclaration , tokenName : string , typeNode : TypeNode ) : CodeFixAction {
163163 // Index signatures cannot have the static modifier.
164164 const stringTypeNode = createKeywordTypeNode ( SyntaxKind . StringKeyword ) ;
165165 const indexingParameter = createParameter (
@@ -176,14 +176,14 @@ namespace ts.codefix {
176176 [ indexingParameter ] ,
177177 typeNode ) ;
178178
179- const changes = textChanges . ChangeTracker . with ( context , t => t . insertNodeAtClassStart ( classDeclarationSourceFile , classDeclaration , indexSignature ) ) ;
179+ const changes = textChanges . ChangeTracker . with ( toTextChangesContext ( context ) , t => t . insertNodeAtClassStart ( classDeclarationSourceFile , classDeclaration , indexSignature ) ) ;
180180 // No fixId here because code-fix-all currently only works on adding individual named properties.
181181 return { description : formatStringFromArgs ( getLocaleSpecificMessage ( Diagnostics . Add_index_signature_for_property_0 ) , [ tokenName ] ) , changes, fixId : undefined } ;
182182 }
183183
184- function getActionForMethodDeclaration ( context : textChanges . TextChangesContext , classDeclarationSourceFile : SourceFile , classDeclaration : ClassLikeDeclaration , token : Identifier , callExpression : CallExpression , makeStatic : boolean , inJs : boolean ) : CodeFixAction | undefined {
184+ function getActionForMethodDeclaration ( context : CodeFixContext , classDeclarationSourceFile : SourceFile , classDeclaration : ClassLikeDeclaration , token : Identifier , callExpression : CallExpression , makeStatic : boolean , inJs : boolean ) : CodeFixAction | undefined {
185185 const description = formatStringFromArgs ( getLocaleSpecificMessage ( makeStatic ? Diagnostics . Declare_static_method_0 : Diagnostics . Declare_method_0 ) , [ token . text ] ) ;
186- const changes = textChanges . ChangeTracker . with ( context , t => addMethodDeclaration ( t , classDeclarationSourceFile , classDeclaration , token , callExpression , makeStatic , inJs ) ) ;
186+ const changes = textChanges . ChangeTracker . with ( toTextChangesContext ( context ) , t => addMethodDeclaration ( t , classDeclarationSourceFile , classDeclaration , token , callExpression , makeStatic , inJs ) ) ;
187187 return { description, changes, fixId } ;
188188 }
189189
0 commit comments