(importingFile, targetSymbol, exportingModuleSymbol, symbolName, isJsxTagName, host, program, preferences, useAutoImportProvider)
| 153149 | } |
| 153150 | } |
| 153151 | function getAllReExportingModules(importingFile, targetSymbol, exportingModuleSymbol, symbolName, isJsxTagName, host, program, preferences, useAutoImportProvider) { |
| 153152 | var result = []; |
| 153153 | var compilerOptions = program.getCompilerOptions(); |
| 153154 | var getModuleSpecifierResolutionHost = ts.memoizeOne(function (isFromPackageJson) { |
| 153155 | return ts.createModuleSpecifierResolutionHost(isFromPackageJson ? host.getPackageJsonAutoImportProvider() : program, host); |
| 153156 | }); |
| 153157 | ts.forEachExternalModuleToImportFrom(program, host, useAutoImportProvider, function (moduleSymbol, moduleFile, program, isFromPackageJson) { |
| 153158 | var checker = program.getTypeChecker(); |
| 153159 | // Don't import from a re-export when looking "up" like to `./index` or `../index`. |
| 153160 | if (moduleFile && moduleSymbol !== exportingModuleSymbol && ts.startsWith(importingFile.fileName, ts.getDirectoryPath(moduleFile.fileName))) { |
| 153161 | return; |
| 153162 | } |
| 153163 | var defaultInfo = ts.getDefaultLikeExportInfo(moduleSymbol, checker, compilerOptions); |
| 153164 | if (defaultInfo && (defaultInfo.name === symbolName || moduleSymbolToValidIdentifier(moduleSymbol, ts.getEmitScriptTarget(compilerOptions), isJsxTagName) === symbolName) && ts.skipAlias(defaultInfo.symbol, checker) === targetSymbol && isImportable(program, moduleFile, isFromPackageJson)) { |
| 153165 | result.push({ symbol: defaultInfo.symbol, moduleSymbol: moduleSymbol, moduleFileName: moduleFile === null || moduleFile === void 0 ? void 0 : moduleFile.fileName, exportKind: defaultInfo.exportKind, targetFlags: ts.skipAlias(defaultInfo.symbol, checker).flags, isFromPackageJson: isFromPackageJson }); |
| 153166 | } |
| 153167 | for (var _i = 0, _a = checker.getExportsAndPropertiesOfModule(moduleSymbol); _i < _a.length; _i++) { |
| 153168 | var exported = _a[_i]; |
| 153169 | if (exported.name === symbolName && checker.getMergedSymbol(ts.skipAlias(exported, checker)) === targetSymbol && isImportable(program, moduleFile, isFromPackageJson)) { |
| 153170 | result.push({ symbol: exported, moduleSymbol: moduleSymbol, moduleFileName: moduleFile === null || moduleFile === void 0 ? void 0 : moduleFile.fileName, exportKind: 0 /* ExportKind.Named */, targetFlags: ts.skipAlias(exported, checker).flags, isFromPackageJson: isFromPackageJson }); |
| 153171 | } |
| 153172 | } |
| 153173 | }); |
| 153174 | return result; |
| 153175 | function isImportable(program, moduleFile, isFromPackageJson) { |
| 153176 | var _a; |
| 153177 | return !moduleFile || ts.isImportableFile(program, importingFile, moduleFile, preferences, /*packageJsonFilter*/ undefined, getModuleSpecifierResolutionHost(isFromPackageJson), (_a = host.getModuleSpecifierCache) === null || _a === void 0 ? void 0 : _a.call(host)); |
| 153178 | } |
| 153179 | } |
| 153180 | function getImportFixes(exportInfos, useNamespaceInfo, |
| 153181 | /** undefined only for missing JSX namespace */ |
| 153182 | isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences, importMap, fromCacheOnly) { |
no test coverage detected