Skip to content

Commit dab6827

Browse files
author
Andy
authored
Fix call to getCodeFixesAtPosition (microsoft#17063)
1 parent bb3253e commit dab6827

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/harness/fourslash.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2337,7 +2337,7 @@ namespace FourSlash {
23372337
continue;
23382338
}
23392339

2340-
const newActions = this.languageService.getCodeFixesAtPosition(fileName, diagnostic.start, diagnostic.length, [diagnostic.code], this.formatCodeSettings);
2340+
const newActions = this.languageService.getCodeFixesAtPosition(fileName, diagnostic.start, diagnostic.start + diagnostic.length, [diagnostic.code], this.formatCodeSettings);
23412341
if (newActions && newActions.length) {
23422342
actions = actions ? actions.concat(newActions) : newActions;
23432343
}

src/services/services.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1768,7 +1768,7 @@ namespace ts {
17681768
function getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: number[], formatOptions: FormatCodeSettings): CodeAction[] {
17691769
synchronizeHostData();
17701770
const sourceFile = getValidSourceFile(fileName);
1771-
const span = { start, length: end - start };
1771+
const span = createTextSpanFromBounds(start, end);
17721772
const newLineCharacter = getNewLineOrDefaultFromHost(host);
17731773

17741774
let allFixes: CodeAction[] = [];

0 commit comments

Comments
 (0)