From dab682767cc62e2c6f8dbd71a7f965d9913adb17 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 10 Jul 2017 13:25:48 -0700 Subject: [PATCH] Fix call to getCodeFixesAtPosition (#17063) --- 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 434a3981461..587bed813f1 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 759de900b84..be17a35d3ed 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[] = [];