From e0b9ae6c6a3b9f5f639c58783fb7c78d3072dcbc Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Mon, 10 Jul 2017 09:33:56 -0700 Subject: [PATCH] Fix call to getCodeFixesAtPosition --- src/harness/fourslash.ts | 2 +- src/services/services.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index 434a3981461a6..587bed813f115 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -2337,7 +2337,7 @@ namespace FourSlash { continue; } - const newActions = this.languageService.getCodeFixesAtPosition(fileName, diagnostic.start, diagnostic.length, [diagnostic.code], this.formatCodeSettings); + const newActions = this.languageService.getCodeFixesAtPosition(fileName, diagnostic.start, diagnostic.start + diagnostic.length, [diagnostic.code], this.formatCodeSettings); if (newActions && newActions.length) { actions = actions ? actions.concat(newActions) : newActions; } diff --git a/src/services/services.ts b/src/services/services.ts index 759de900b848a..be17a35d3ed82 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1768,7 +1768,7 @@ namespace ts { function getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[], formatOptions: FormatCodeSettings): CodeAction[] { synchronizeHostData(); const sourceFile = getValidSourceFile(fileName); - const span = { start, length: end - start }; + const span = createTextSpanFromBounds(start, end); const newLineCharacter = getNewLineOrDefaultFromHost(host); let allFixes: CodeAction[] = [];