@@ -695,7 +695,7 @@ namespace ts {
695695 }
696696
697697 export function getSupportedCodeFixes ( ) {
698- return codefix . CodeFixProvider . getSupportedErrorCodes ( ) ;
698+ return codefix . getSupportedErrorCodes ( ) ;
699699 }
700700
701701 // Cache host information about script Should be refreshed
@@ -918,7 +918,6 @@ namespace ts {
918918 documentRegistry : DocumentRegistry = createDocumentRegistry ( host . useCaseSensitiveFileNames && host . useCaseSensitiveFileNames ( ) , host . getCurrentDirectory ( ) ) ) : LanguageService {
919919
920920 const syntaxTreeCache : SyntaxTreeCache = new SyntaxTreeCache ( host ) ;
921- const codeFixProvider : codefix . CodeFixProvider = new codefix . CodeFixProvider ( ) ;
922921 let ruleProvider : formatting . RulesProvider ;
923922 let program : Program ;
924923 let lastProjectVersion : string ;
@@ -1588,19 +1587,18 @@ namespace ts {
15881587 function getCodeFixesAtPosition ( fileName : string , start : number , end : number , errorCodes : string [ ] ) : CodeAction [ ] {
15891588 synchronizeHostData ( ) ;
15901589 const sourceFile = getValidSourceFile ( fileName ) ;
1591- const checker = program . getTypeChecker ( ) ;
15921590 let allFixes : CodeAction [ ] = [ ] ;
15931591
15941592 forEach ( errorCodes , error => {
15951593 const context = {
15961594 errorCode : error ,
15971595 sourceFile : sourceFile ,
15981596 span : { start, length : end - start } ,
1599- checker : checker ,
1597+ program : program ,
16001598 newLineCharacter : getNewLineOrDefaultFromHost ( host )
16011599 } ;
16021600
1603- const fixes = codeFixProvider . getFixes ( context ) ;
1601+ const fixes = codefix . getFixes ( context ) ;
16041602 if ( fixes ) {
16051603 allFixes = allFixes . concat ( fixes ) ;
16061604 }
0 commit comments