Skip to content

Commit 3a70705

Browse files
committed
removed unused code
1 parent 7c5ac09 commit 3a70705

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

src/services/codefixes/importFixes.ts

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ namespace ts.codefix {
131131
// this is a module id -> module import declaration map
132132
const cachedImportDeclarations: (ImportDeclaration | ImportEqualsDeclaration)[][] = [];
133133
let lastImportDeclaration: Node;
134-
//let cachedNewImportInsertPosition: number;
135134

136135
const currentTokenMeaning = getMeaningFromLocation(token);
137136
if (context.errorCode === Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code) {
@@ -314,25 +313,8 @@ namespace ts.codefix {
314313
if (!importList || importList.elements.length === 0) {
315314
const newImportClause = createImportClause(importClause.name, createNamedImports([newImportSpecifier]));
316315
return createChangeTracker().replaceNode(sourceFile, importClause, newImportClause).getChanges();
317-
// const start = importClause.name.getEnd();
318-
// return {
319-
// newText: `, { ${newImportText} }`,
320-
// span: { start, length: 0 }
321-
// };
322316
}
323317

324-
// if (importList.elements.length === 0) {
325-
// const start = importList.getStart();
326-
// return {
327-
// newText: `{ ${newImportText} }`,
328-
// span: { start, length: importList.getEnd() - start }
329-
// };
330-
// }
331-
332-
// case 3:
333-
// original text: import { foo, bar } from "module"
334-
// change to: import { foo, bar, name } from "module"
335-
//const insertPoint = importList.elements[importList.elements.length - 1].getEnd();
336318
/**
337319
* If the import list has one import per line, preserve that. Otherwise, insert on same line as last element
338320
* import {
@@ -346,10 +328,6 @@ namespace ts.codefix {
346328
sourceFile,
347329
importList.elements[importList.elements.length - 1],
348330
newImportSpecifier).getChanges();
349-
// return {
350-
// newText: `,${oneImportPerLine ? context.newLineCharacter : " "}${newImportText}`,
351-
// span: { start: insertPoint, length: 0 }
352-
// };
353331
}
354332

355333
function getCodeActionForNamespaceImport(declaration: ImportDeclaration | ImportEqualsDeclaration): ImportCodeAction {
@@ -408,11 +386,6 @@ namespace ts.codefix {
408386
else {
409387
changeTracker.insertNodeAfter(sourceFile, lastImportDeclaration, importDecl, { suffix: context.newLineCharacter });
410388
}
411-
// const importStatementText = isDefault
412-
// ? `import ${name} from "${moduleSpecifierWithoutQuotes}"`
413-
// : isNamespaceImport
414-
// ? `import * as ${name} from "${moduleSpecifierWithoutQuotes}"`
415-
// : `import { ${name} } from "${moduleSpecifierWithoutQuotes}"`;
416389

417390
// if this file doesn't have any import statements, insert an import statement and then insert a new line
418391
// between the only import statement and user code. Otherwise just insert the statement because chances

0 commit comments

Comments
 (0)