Move the declaration for lastImportDeclaration out of the getCodeActions lambda into getCodeActionForImport
This commit is contained in:
parent
de7b821a82
commit
fa33d5016b
|
@ -178,8 +178,6 @@ namespace ts.codefix {
|
|||
const name = token.getText();
|
||||
const symbolIdActionMap = new ImportCodeActionMap();
|
||||
|
||||
let lastImportDeclaration: Node;
|
||||
|
||||
const currentTokenMeaning = getMeaningFromLocation(token);
|
||||
if (context.errorCode === Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code) {
|
||||
const umdSymbol = checker.getSymbolAtLocation(token);
|
||||
|
@ -245,6 +243,7 @@ namespace ts.codefix {
|
|||
}
|
||||
|
||||
function getCodeActionForImport(moduleSymbol: Symbol, context: ImportCodeFixContext, symbolName: string, isDefault?: boolean, isNamespaceImport?: boolean): ImportCodeAction[] {
|
||||
let lastImportDeclaration: Node;
|
||||
const { symbolName: name, sourceFile, getCanonicalFileName, newLineCharacter, host, checker, symbolToken, compilerOptions } = context;
|
||||
getCanonicalFileName;
|
||||
newLineCharacter;
|
||||
|
|
Loading…
Reference in a new issue