Fix call to getCodeFixesAtPosition (#17063)

This commit is contained in:
Andy
2017-07-10 13:25:48 -07:00
committed by GitHub
parent bb3253e544
commit dab682767c
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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;
}
+1 -1
View File
@@ -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[] = [];