(cache, file, location, program, host, preferences, cancellationToken)
| 132213 | return !!(data === null || data === void 0 ? void 0 : data.moduleSpecifier); |
| 132214 | } |
| 132215 | function continuePreviousIncompleteResponse(cache, file, location, program, host, preferences, cancellationToken) { |
| 132216 | var previousResponse = cache.get(); |
| 132217 | if (!previousResponse) |
| 132218 | return undefined; |
| 132219 | var lowerCaseTokenText = location.text.toLowerCase(); |
| 132220 | var exportMap = ts.getExportInfoMap(file, host, program, cancellationToken); |
| 132221 | var newEntries = resolvingModuleSpecifiers("continuePreviousIncompleteResponse", host, ts.codefix.createImportSpecifierResolver(file, program, host, preferences), program, location.getStart(), preferences, |
| 132222 | /*isForImportStatementCompletion*/ false, ts.isValidTypeOnlyAliasUseSite(location), function (context) { |
| 132223 | var entries = ts.mapDefined(previousResponse.entries, function (entry) { |
| 132224 | var _a; |
| 132225 | if (!entry.hasAction || !entry.source || !entry.data || completionEntryDataIsResolved(entry.data)) { |
| 132226 | // Not an auto import or already resolved; keep as is |
| 132227 | return entry; |
| 132228 | } |
| 132229 | if (!charactersFuzzyMatchInString(entry.name, lowerCaseTokenText)) { |
| 132230 | // No longer matches typed characters; filter out |
| 132231 | return undefined; |
| 132232 | } |
| 132233 | var origin = ts.Debug.checkDefined(getAutoImportSymbolFromCompletionEntryData(entry.name, entry.data, program, host)).origin; |
| 132234 | var info = exportMap.get(file.path, entry.data.exportMapKey); |
| 132235 | var result = info && context.tryResolve(info, entry.name, !ts.isExternalModuleNameRelative(ts.stripQuotes(origin.moduleSymbol.name))); |
| 132236 | if (result === "skipped") |
| 132237 | return entry; |
| 132238 | if (!result || result === "failed") { |
| 132239 | (_a = host.log) === null || _a === void 0 ? void 0 : _a.call(host, "Unexpected failure resolving auto import for '".concat(entry.name, "' from '").concat(entry.source, "'")); |
| 132240 | return undefined; |
| 132241 | } |
| 132242 | var newOrigin = __assign(__assign({}, origin), { kind: 32 /* SymbolOriginInfoKind.ResolvedExport */, moduleSpecifier: result.moduleSpecifier }); |
| 132243 | // Mutating for performance... feels sketchy but nobody else uses the cache, |
| 132244 | // so why bother allocating a bunch of new objects? |
| 132245 | entry.data = originToCompletionEntryData(newOrigin); |
| 132246 | entry.source = getSourceFromOrigin(newOrigin); |
| 132247 | entry.sourceDisplay = [ts.textPart(newOrigin.moduleSpecifier)]; |
| 132248 | return entry; |
| 132249 | }); |
| 132250 | if (!context.skippedAny()) { |
| 132251 | previousResponse.isIncomplete = undefined; |
| 132252 | } |
| 132253 | return entries; |
| 132254 | }); |
| 132255 | previousResponse.entries = newEntries; |
| 132256 | previousResponse.flags = (previousResponse.flags || 0) | 4 /* CompletionInfoFlags.IsContinuation */; |
| 132257 | return previousResponse; |
| 132258 | } |
| 132259 | function jsdocCompletionInfo(entries) { |
| 132260 | return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: entries }; |
| 132261 | } |
no test coverage detected