(changeTracker)
| 153030 | } |
| 153031 | } |
| 153032 | function writeFixes(changeTracker) { |
| 153033 | var quotePreference = ts.getQuotePreference(sourceFile, preferences); |
| 153034 | for (var _i = 0, addToNamespace_1 = addToNamespace; _i < addToNamespace_1.length; _i++) { |
| 153035 | var fix = addToNamespace_1[_i]; |
| 153036 | addNamespaceQualifier(changeTracker, sourceFile, fix); |
| 153037 | } |
| 153038 | for (var _a = 0, importType_1 = importType; _a < importType_1.length; _a++) { |
| 153039 | var fix = importType_1[_a]; |
| 153040 | addImportType(changeTracker, sourceFile, fix, quotePreference); |
| 153041 | } |
| 153042 | addToExisting.forEach(function (_a) { |
| 153043 | var importClauseOrBindingPattern = _a.importClauseOrBindingPattern, defaultImport = _a.defaultImport, namedImports = _a.namedImports; |
| 153044 | doAddExistingFix(changeTracker, sourceFile, importClauseOrBindingPattern, defaultImport, ts.arrayFrom(namedImports.entries(), function (_a) { |
| 153045 | var name = _a[0], addAsTypeOnly = _a[1]; |
| 153046 | return ({ addAsTypeOnly: addAsTypeOnly, name: name }); |
| 153047 | }), compilerOptions); |
| 153048 | }); |
| 153049 | var newDeclarations; |
| 153050 | newImports.forEach(function (_a, key) { |
| 153051 | var useRequire = _a.useRequire, defaultImport = _a.defaultImport, namedImports = _a.namedImports, namespaceLikeImport = _a.namespaceLikeImport; |
| 153052 | var moduleSpecifier = key.slice(2); // From `${0 | 1}|${moduleSpecifier}` format |
| 153053 | var getDeclarations = useRequire ? getNewRequires : getNewImports; |
| 153054 | var declarations = getDeclarations(moduleSpecifier, quotePreference, defaultImport, namedImports && ts.arrayFrom(namedImports.entries(), function (_a) { |
| 153055 | var name = _a[0], addAsTypeOnly = _a[1]; |
| 153056 | return ({ addAsTypeOnly: addAsTypeOnly, name: name }); |
| 153057 | }), namespaceLikeImport); |
| 153058 | newDeclarations = ts.combine(newDeclarations, declarations); |
| 153059 | }); |
| 153060 | if (newDeclarations) { |
| 153061 | ts.insertImports(changeTracker, sourceFile, newDeclarations, /*blankLineBetween*/ true); |
| 153062 | } |
| 153063 | } |
| 153064 | function hasFixes() { |
| 153065 | return addToNamespace.length > 0 || importType.length > 0 || addToExisting.size > 0 || newImports.size > 0; |
| 153066 | } |
nothing calls this directly
no test coverage detected