typescript 5.0.0-dev.20221205 → 5.0.0-dev.20221207
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +592 -435
- package/lib/tsserver.js +153270 -150849
- package/lib/tsserverlibrary.d.ts +46 -24
- package/lib/tsserverlibrary.js +683 -493
- package/lib/typescript.d.ts +46 -21
- package/lib/typescript.js +662 -476
- package/lib/typingsInstaller.js +72 -77
- package/package.json +1 -1
package/lib/tsserverlibrary.js
CHANGED
|
@@ -42,7 +42,7 @@ var ts = (() => {
|
|
|
42
42
|
"src/compiler/corePublic.ts"() {
|
|
43
43
|
"use strict";
|
|
44
44
|
versionMajorMinor = "5.0";
|
|
45
|
-
version = `${versionMajorMinor}.0-dev.
|
|
45
|
+
version = `${versionMajorMinor}.0-dev.20221207`;
|
|
46
46
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
47
47
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
48
48
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -2190,22 +2190,8 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
2190
2190
|
function enableDebugInfo() {
|
|
2191
2191
|
if (isDebugInfoEnabled)
|
|
2192
2192
|
return;
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
function getWeakTypeTextMap() {
|
|
2196
|
-
if (weakTypeTextMap === void 0) {
|
|
2197
|
-
if (typeof WeakMap === "function")
|
|
2198
|
-
weakTypeTextMap = /* @__PURE__ */ new WeakMap();
|
|
2199
|
-
}
|
|
2200
|
-
return weakTypeTextMap;
|
|
2201
|
-
}
|
|
2202
|
-
function getWeakNodeTextMap() {
|
|
2203
|
-
if (weakNodeTextMap === void 0) {
|
|
2204
|
-
if (typeof WeakMap === "function")
|
|
2205
|
-
weakNodeTextMap = /* @__PURE__ */ new WeakMap();
|
|
2206
|
-
}
|
|
2207
|
-
return weakNodeTextMap;
|
|
2208
|
-
}
|
|
2193
|
+
const weakTypeTextMap = /* @__PURE__ */ new WeakMap();
|
|
2194
|
+
const weakNodeTextMap = /* @__PURE__ */ new WeakMap();
|
|
2209
2195
|
Object.defineProperties(objectAllocator.getSymbolConstructor().prototype, {
|
|
2210
2196
|
__tsDebuggerDisplay: {
|
|
2211
2197
|
value() {
|
|
@@ -2234,11 +2220,10 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
2234
2220
|
} },
|
|
2235
2221
|
__debugTypeToString: {
|
|
2236
2222
|
value() {
|
|
2237
|
-
|
|
2238
|
-
let text = map2 == null ? void 0 : map2.get(this);
|
|
2223
|
+
let text = weakTypeTextMap.get(this);
|
|
2239
2224
|
if (text === void 0) {
|
|
2240
2225
|
text = this.checker.typeToString(this);
|
|
2241
|
-
|
|
2226
|
+
weakTypeTextMap.set(this, text);
|
|
2242
2227
|
}
|
|
2243
2228
|
return text;
|
|
2244
2229
|
}
|
|
@@ -2290,13 +2275,12 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
2290
2275
|
value(includeTrivia) {
|
|
2291
2276
|
if (nodeIsSynthesized(this))
|
|
2292
2277
|
return "";
|
|
2293
|
-
|
|
2294
|
-
let text = map2 == null ? void 0 : map2.get(this);
|
|
2278
|
+
let text = weakNodeTextMap.get(this);
|
|
2295
2279
|
if (text === void 0) {
|
|
2296
2280
|
const parseNode = getParseTreeNode(this);
|
|
2297
2281
|
const sourceFile = parseNode && getSourceFileOfNode(parseNode);
|
|
2298
2282
|
text = sourceFile ? getSourceTextOfNodeFromSourceFile(sourceFile, parseNode, includeTrivia) : "";
|
|
2299
|
-
|
|
2283
|
+
weakNodeTextMap.set(this, text);
|
|
2300
2284
|
}
|
|
2301
2285
|
return text;
|
|
2302
2286
|
}
|
|
@@ -4097,6 +4081,7 @@ ${lanes.join("\n")}
|
|
|
4097
4081
|
FilePreprocessingDiagnosticsKind = /* @__PURE__ */ ((FilePreprocessingDiagnosticsKind2) => {
|
|
4098
4082
|
FilePreprocessingDiagnosticsKind2[FilePreprocessingDiagnosticsKind2["FilePreprocessingReferencedDiagnostic"] = 0] = "FilePreprocessingReferencedDiagnostic";
|
|
4099
4083
|
FilePreprocessingDiagnosticsKind2[FilePreprocessingDiagnosticsKind2["FilePreprocessingFileExplainingDiagnostic"] = 1] = "FilePreprocessingFileExplainingDiagnostic";
|
|
4084
|
+
FilePreprocessingDiagnosticsKind2[FilePreprocessingDiagnosticsKind2["ResolutionDiagnostics"] = 2] = "ResolutionDiagnostics";
|
|
4100
4085
|
return FilePreprocessingDiagnosticsKind2;
|
|
4101
4086
|
})(FilePreprocessingDiagnosticsKind || {});
|
|
4102
4087
|
EmitOnly = /* @__PURE__ */ ((EmitOnly4) => {
|
|
@@ -12244,7 +12229,8 @@ ${lanes.join("\n")}
|
|
|
12244
12229
|
return node.end - node.pos;
|
|
12245
12230
|
}
|
|
12246
12231
|
function getResolvedModule(sourceFile, moduleNameText, mode) {
|
|
12247
|
-
|
|
12232
|
+
var _a2, _b;
|
|
12233
|
+
return (_b = (_a2 = sourceFile == null ? void 0 : sourceFile.resolvedModules) == null ? void 0 : _a2.get(moduleNameText, mode)) == null ? void 0 : _b.resolvedModule;
|
|
12248
12234
|
}
|
|
12249
12235
|
function setResolvedModule(sourceFile, moduleNameText, resolvedModule, mode) {
|
|
12250
12236
|
if (!sourceFile.resolvedModules) {
|
|
@@ -12259,14 +12245,14 @@ ${lanes.join("\n")}
|
|
|
12259
12245
|
sourceFile.resolvedTypeReferenceDirectiveNames.set(typeReferenceDirectiveName, mode, resolvedTypeReferenceDirective);
|
|
12260
12246
|
}
|
|
12261
12247
|
function getResolvedTypeReferenceDirective(sourceFile, typeReferenceDirectiveName, mode) {
|
|
12262
|
-
var _a2;
|
|
12263
|
-
return (_a2 = sourceFile == null ? void 0 : sourceFile.resolvedTypeReferenceDirectiveNames) == null ? void 0 : _a2.get(typeReferenceDirectiveName, mode);
|
|
12248
|
+
var _a2, _b;
|
|
12249
|
+
return (_b = (_a2 = sourceFile == null ? void 0 : sourceFile.resolvedTypeReferenceDirectiveNames) == null ? void 0 : _a2.get(typeReferenceDirectiveName, mode)) == null ? void 0 : _b.resolvedTypeReferenceDirective;
|
|
12264
12250
|
}
|
|
12265
12251
|
function projectReferenceIsEqualTo(oldRef, newRef) {
|
|
12266
12252
|
return oldRef.path === newRef.path && !oldRef.prepend === !newRef.prepend && !oldRef.circular === !newRef.circular;
|
|
12267
12253
|
}
|
|
12268
12254
|
function moduleResolutionIsEqualTo(oldResolution, newResolution) {
|
|
12269
|
-
return oldResolution.isExternalLibraryImport === newResolution.isExternalLibraryImport && oldResolution.extension === newResolution.extension && oldResolution.resolvedFileName === newResolution.resolvedFileName && oldResolution.originalPath === newResolution.originalPath && packageIdIsEqual(oldResolution.packageId, newResolution.packageId);
|
|
12255
|
+
return oldResolution === newResolution || oldResolution.resolvedModule === newResolution.resolvedModule || !!oldResolution.resolvedModule && !!newResolution.resolvedModule && oldResolution.resolvedModule.isExternalLibraryImport === newResolution.resolvedModule.isExternalLibraryImport && oldResolution.resolvedModule.extension === newResolution.resolvedModule.extension && oldResolution.resolvedModule.resolvedFileName === newResolution.resolvedModule.resolvedFileName && oldResolution.resolvedModule.originalPath === newResolution.resolvedModule.originalPath && packageIdIsEqual(oldResolution.resolvedModule.packageId, newResolution.resolvedModule.packageId);
|
|
12270
12256
|
}
|
|
12271
12257
|
function packageIdIsEqual(a, b) {
|
|
12272
12258
|
return a === b || !!a && !!b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version;
|
|
@@ -12278,15 +12264,15 @@ ${lanes.join("\n")}
|
|
|
12278
12264
|
return `${packageIdToPackageName(packageId)}@${packageId.version}`;
|
|
12279
12265
|
}
|
|
12280
12266
|
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
|
|
12281
|
-
return oldResolution.resolvedFileName === newResolution.resolvedFileName && oldResolution.primary === newResolution.primary && oldResolution.originalPath === newResolution.originalPath;
|
|
12267
|
+
return oldResolution === newResolution || oldResolution.resolvedTypeReferenceDirective === newResolution.resolvedTypeReferenceDirective || !!oldResolution.resolvedTypeReferenceDirective && !!newResolution.resolvedTypeReferenceDirective && oldResolution.resolvedTypeReferenceDirective.resolvedFileName === newResolution.resolvedTypeReferenceDirective.resolvedFileName && !!oldResolution.resolvedTypeReferenceDirective.primary === !!newResolution.resolvedTypeReferenceDirective.primary && oldResolution.resolvedTypeReferenceDirective.originalPath === newResolution.resolvedTypeReferenceDirective.originalPath;
|
|
12282
12268
|
}
|
|
12283
|
-
function hasChangesInResolutions(names, newSourceFile, newResolutions, oldResolutions, comparer) {
|
|
12269
|
+
function hasChangesInResolutions(names, newSourceFile, newResolutions, oldResolutions, comparer, nameAndModeGetter) {
|
|
12284
12270
|
Debug.assert(names.length === newResolutions.length);
|
|
12285
12271
|
for (let i = 0; i < names.length; i++) {
|
|
12286
12272
|
const newResolution = newResolutions[i];
|
|
12287
12273
|
const entry = names[i];
|
|
12288
|
-
const name =
|
|
12289
|
-
const mode =
|
|
12274
|
+
const name = nameAndModeGetter.getName(entry);
|
|
12275
|
+
const mode = nameAndModeGetter.getMode(entry, newSourceFile);
|
|
12290
12276
|
const oldResolution = oldResolutions && oldResolutions.get(name, mode);
|
|
12291
12277
|
const changed = oldResolution ? !newResolution || !comparer(oldResolution, newResolution) : newResolution;
|
|
12292
12278
|
if (changed) {
|
|
@@ -16635,13 +16621,14 @@ ${lanes.join("\n")}
|
|
|
16635
16621
|
}
|
|
16636
16622
|
},
|
|
16637
16623
|
setSymlinksFromResolutions(files, typeReferenceDirectives) {
|
|
16638
|
-
var _a2;
|
|
16624
|
+
var _a2, _b;
|
|
16639
16625
|
Debug.assert(!hasProcessedResolutions);
|
|
16640
16626
|
hasProcessedResolutions = true;
|
|
16641
16627
|
for (const file of files) {
|
|
16642
|
-
(_a2 = file.resolvedModules) == null ? void 0 : _a2.forEach((resolution) => processResolution(this, resolution));
|
|
16628
|
+
(_a2 = file.resolvedModules) == null ? void 0 : _a2.forEach((resolution) => processResolution(this, resolution.resolvedModule));
|
|
16629
|
+
(_b = file.resolvedTypeReferenceDirectiveNames) == null ? void 0 : _b.forEach((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective));
|
|
16643
16630
|
}
|
|
16644
|
-
typeReferenceDirectives
|
|
16631
|
+
typeReferenceDirectives.forEach((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective));
|
|
16645
16632
|
},
|
|
16646
16633
|
hasProcessedResolutions: () => hasProcessedResolutions
|
|
16647
16634
|
};
|
|
@@ -34981,17 +34968,29 @@ ${lanes.join("\n")}
|
|
|
34981
34968
|
}
|
|
34982
34969
|
function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache) {
|
|
34983
34970
|
if (resultFromCache) {
|
|
34984
|
-
resultFromCache.failedLookupLocations.
|
|
34985
|
-
resultFromCache.affectingLocations.
|
|
34971
|
+
resultFromCache.failedLookupLocations = updateResolutionField(resultFromCache.failedLookupLocations, failedLookupLocations);
|
|
34972
|
+
resultFromCache.affectingLocations = updateResolutionField(resultFromCache.affectingLocations, affectingLocations);
|
|
34973
|
+
resultFromCache.resolutionDiagnostics = updateResolutionField(resultFromCache.resolutionDiagnostics, diagnostics);
|
|
34986
34974
|
return resultFromCache;
|
|
34987
34975
|
}
|
|
34988
34976
|
return {
|
|
34989
34977
|
resolvedModule: resolved && { resolvedFileName: resolved.path, originalPath: resolved.originalPath === true ? void 0 : resolved.originalPath, extension: resolved.extension, isExternalLibraryImport, packageId: resolved.packageId },
|
|
34990
|
-
failedLookupLocations,
|
|
34991
|
-
affectingLocations,
|
|
34992
|
-
resolutionDiagnostics: diagnostics
|
|
34978
|
+
failedLookupLocations: initializeResolutionField(failedLookupLocations),
|
|
34979
|
+
affectingLocations: initializeResolutionField(affectingLocations),
|
|
34980
|
+
resolutionDiagnostics: initializeResolutionField(diagnostics)
|
|
34993
34981
|
};
|
|
34994
34982
|
}
|
|
34983
|
+
function initializeResolutionField(value) {
|
|
34984
|
+
return value.length ? value : void 0;
|
|
34985
|
+
}
|
|
34986
|
+
function updateResolutionField(to, value) {
|
|
34987
|
+
if (!(value == null ? void 0 : value.length))
|
|
34988
|
+
return to;
|
|
34989
|
+
if (!(to == null ? void 0 : to.length))
|
|
34990
|
+
return value;
|
|
34991
|
+
to.push(...value);
|
|
34992
|
+
return to;
|
|
34993
|
+
}
|
|
34995
34994
|
function readPackageJsonField(jsonContent, fieldName, typeOfTag, state) {
|
|
34996
34995
|
if (!hasProperty(jsonContent, fieldName)) {
|
|
34997
34996
|
if (state.traceEnabled) {
|
|
@@ -35124,8 +35123,10 @@ ${lanes.join("\n")}
|
|
|
35124
35123
|
options = redirectedReference.commandLine.options;
|
|
35125
35124
|
}
|
|
35126
35125
|
const containingDirectory = containingFile ? getDirectoryPath(containingFile) : void 0;
|
|
35127
|
-
|
|
35128
|
-
|
|
35126
|
+
let result = containingDirectory ? cache == null ? void 0 : cache.getFromDirectoryCache(typeReferenceDirectiveName, resolutionMode, containingDirectory, redirectedReference) : void 0;
|
|
35127
|
+
if (!result && containingDirectory && !isExternalModuleNameRelative(typeReferenceDirectiveName)) {
|
|
35128
|
+
result = cache == null ? void 0 : cache.getFromNonRelativeNameCache(typeReferenceDirectiveName, resolutionMode, containingDirectory, redirectedReference);
|
|
35129
|
+
}
|
|
35129
35130
|
if (result) {
|
|
35130
35131
|
if (traceEnabled) {
|
|
35131
35132
|
trace(host, Diagnostics.Resolving_type_reference_directive_0_containing_file_1, typeReferenceDirectiveName, containingFile);
|
|
@@ -35195,8 +35196,18 @@ ${lanes.join("\n")}
|
|
|
35195
35196
|
isExternalLibraryImport: pathContainsNodeModules(fileName)
|
|
35196
35197
|
};
|
|
35197
35198
|
}
|
|
35198
|
-
result = {
|
|
35199
|
-
|
|
35199
|
+
result = {
|
|
35200
|
+
resolvedTypeReferenceDirective,
|
|
35201
|
+
failedLookupLocations: initializeResolutionField(failedLookupLocations),
|
|
35202
|
+
affectingLocations: initializeResolutionField(affectingLocations),
|
|
35203
|
+
resolutionDiagnostics: initializeResolutionField(diagnostics)
|
|
35204
|
+
};
|
|
35205
|
+
if (containingDirectory) {
|
|
35206
|
+
cache == null ? void 0 : cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference).set(typeReferenceDirectiveName, resolutionMode, result);
|
|
35207
|
+
if (!isExternalModuleNameRelative(typeReferenceDirectiveName)) {
|
|
35208
|
+
cache == null ? void 0 : cache.getOrCreateCacheForNonRelativeName(typeReferenceDirectiveName, resolutionMode, redirectedReference).set(containingDirectory, result);
|
|
35209
|
+
}
|
|
35210
|
+
}
|
|
35200
35211
|
if (traceEnabled)
|
|
35201
35212
|
traceResult(result);
|
|
35202
35213
|
return result;
|
|
@@ -35326,23 +35337,27 @@ ${lanes.join("\n")}
|
|
|
35326
35337
|
if (ownOptions)
|
|
35327
35338
|
redirectsMap.set(ownOptions, ownMap);
|
|
35328
35339
|
return {
|
|
35340
|
+
getMapOfCacheRedirects,
|
|
35329
35341
|
getOrCreateMapOfCacheRedirects,
|
|
35330
35342
|
update,
|
|
35331
35343
|
clear: clear2
|
|
35332
35344
|
};
|
|
35345
|
+
function getMapOfCacheRedirects(redirectedReference) {
|
|
35346
|
+
return redirectedReference ? getOrCreateMap(redirectedReference.commandLine.options, false) : ownMap;
|
|
35347
|
+
}
|
|
35333
35348
|
function getOrCreateMapOfCacheRedirects(redirectedReference) {
|
|
35334
|
-
return redirectedReference ? getOrCreateMap(redirectedReference.commandLine.options) : ownMap;
|
|
35349
|
+
return redirectedReference ? getOrCreateMap(redirectedReference.commandLine.options, true) : ownMap;
|
|
35335
35350
|
}
|
|
35336
35351
|
function update(newOptions) {
|
|
35337
35352
|
if (ownOptions !== newOptions) {
|
|
35338
35353
|
if (ownOptions)
|
|
35339
|
-
ownMap = getOrCreateMap(newOptions);
|
|
35354
|
+
ownMap = getOrCreateMap(newOptions, true);
|
|
35340
35355
|
else
|
|
35341
35356
|
redirectsMap.set(newOptions, ownMap);
|
|
35342
35357
|
ownOptions = newOptions;
|
|
35343
35358
|
}
|
|
35344
35359
|
}
|
|
35345
|
-
function getOrCreateMap(redirectOptions) {
|
|
35360
|
+
function getOrCreateMap(redirectOptions, create) {
|
|
35346
35361
|
let result = redirectsMap.get(redirectOptions);
|
|
35347
35362
|
if (result)
|
|
35348
35363
|
return result;
|
|
@@ -35356,9 +35371,13 @@ ${lanes.join("\n")}
|
|
|
35356
35371
|
else if (!redirectsKeyToMap.has(ownKey))
|
|
35357
35372
|
redirectsKeyToMap.set(ownKey, ownMap);
|
|
35358
35373
|
}
|
|
35359
|
-
|
|
35374
|
+
if (create)
|
|
35375
|
+
result != null ? result : result = /* @__PURE__ */ new Map();
|
|
35376
|
+
if (result)
|
|
35377
|
+
redirectsKeyToMap.set(key, result);
|
|
35360
35378
|
}
|
|
35361
|
-
|
|
35379
|
+
if (result)
|
|
35380
|
+
redirectsMap.set(redirectOptions, result);
|
|
35362
35381
|
return result;
|
|
35363
35382
|
}
|
|
35364
35383
|
function clear2() {
|
|
@@ -35410,8 +35429,10 @@ ${lanes.join("\n")}
|
|
|
35410
35429
|
}
|
|
35411
35430
|
return result;
|
|
35412
35431
|
}
|
|
35413
|
-
function createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName,
|
|
35432
|
+
function createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, options) {
|
|
35433
|
+
const directoryToModuleNameMap = createCacheWithRedirects(options);
|
|
35414
35434
|
return {
|
|
35435
|
+
getFromDirectoryCache,
|
|
35415
35436
|
getOrCreateCacheForDirectory,
|
|
35416
35437
|
clear: clear2,
|
|
35417
35438
|
update
|
|
@@ -35419,13 +35440,18 @@ ${lanes.join("\n")}
|
|
|
35419
35440
|
function clear2() {
|
|
35420
35441
|
directoryToModuleNameMap.clear();
|
|
35421
35442
|
}
|
|
35422
|
-
function update(
|
|
35423
|
-
directoryToModuleNameMap.update(
|
|
35443
|
+
function update(options2) {
|
|
35444
|
+
directoryToModuleNameMap.update(options2);
|
|
35424
35445
|
}
|
|
35425
35446
|
function getOrCreateCacheForDirectory(directoryName, redirectedReference) {
|
|
35426
35447
|
const path = toPath(directoryName, currentDirectory, getCanonicalFileName);
|
|
35427
35448
|
return getOrCreateCache(directoryToModuleNameMap, redirectedReference, path, () => createModeAwareCache());
|
|
35428
35449
|
}
|
|
35450
|
+
function getFromDirectoryCache(name, mode, directoryName, redirectedReference) {
|
|
35451
|
+
var _a2, _b;
|
|
35452
|
+
const path = toPath(directoryName, currentDirectory, getCanonicalFileName);
|
|
35453
|
+
return (_b = (_a2 = directoryToModuleNameMap.getMapOfCacheRedirects(redirectedReference)) == null ? void 0 : _a2.get(path)) == null ? void 0 : _b.get(name, mode);
|
|
35454
|
+
}
|
|
35429
35455
|
}
|
|
35430
35456
|
function createModeAwareCacheKey(specifier, mode) {
|
|
35431
35457
|
return mode === void 0 ? specifier : `${mode}|${specifier}`;
|
|
@@ -35465,48 +35491,41 @@ ${lanes.join("\n")}
|
|
|
35465
35491
|
return result;
|
|
35466
35492
|
}
|
|
35467
35493
|
}
|
|
35468
|
-
function
|
|
35469
|
-
return !isString(entry) ? isStringLiteralLike(entry) ? entry.text : toFileNameLowerCase(entry.fileName) : entry;
|
|
35470
|
-
}
|
|
35471
|
-
function getResolutionMode(entry, file) {
|
|
35472
|
-
return isStringLiteralLike(entry) ? getModeForUsageLocation(file, entry) : entry.resolutionMode || file.impliedNodeFormat;
|
|
35473
|
-
}
|
|
35474
|
-
function zipToModeAwareCache(file, keys, values) {
|
|
35494
|
+
function zipToModeAwareCache(file, keys, values, nameAndModeGetter) {
|
|
35475
35495
|
Debug.assert(keys.length === values.length);
|
|
35476
35496
|
const map2 = createModeAwareCache();
|
|
35477
35497
|
for (let i = 0; i < keys.length; ++i) {
|
|
35478
35498
|
const entry = keys[i];
|
|
35479
|
-
map2.set(
|
|
35499
|
+
map2.set(nameAndModeGetter.getName(entry), nameAndModeGetter.getMode(entry, file), values[i]);
|
|
35480
35500
|
}
|
|
35481
35501
|
return map2;
|
|
35482
35502
|
}
|
|
35483
|
-
function
|
|
35484
|
-
|
|
35485
|
-
|
|
35503
|
+
function getOriginalOrResolvedModuleFileName(result) {
|
|
35504
|
+
return result.resolvedModule && (result.resolvedModule.originalPath || result.resolvedModule.resolvedFileName);
|
|
35505
|
+
}
|
|
35506
|
+
function getOriginalOrResolvedTypeReferenceFileName(result) {
|
|
35507
|
+
return result.resolvedTypeReferenceDirective && (result.resolvedTypeReferenceDirective.originalPath || result.resolvedTypeReferenceDirective.resolvedFileName);
|
|
35508
|
+
}
|
|
35509
|
+
function createNonRelativeNameResolutionCache(currentDirectory, getCanonicalFileName, options, getResolvedFileName) {
|
|
35486
35510
|
const moduleNameToDirectoryMap = createCacheWithRedirects(options);
|
|
35487
|
-
const packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName);
|
|
35488
35511
|
return {
|
|
35489
|
-
|
|
35490
|
-
|
|
35491
|
-
getOrCreateCacheForModuleName,
|
|
35512
|
+
getFromNonRelativeNameCache,
|
|
35513
|
+
getOrCreateCacheForNonRelativeName,
|
|
35492
35514
|
clear: clear2,
|
|
35493
|
-
update
|
|
35494
|
-
getPackageJsonInfoCache: () => packageJsonInfoCache,
|
|
35495
|
-
clearAllExceptPackageJsonInfoCache
|
|
35515
|
+
update
|
|
35496
35516
|
};
|
|
35497
35517
|
function clear2() {
|
|
35498
|
-
clearAllExceptPackageJsonInfoCache();
|
|
35499
|
-
packageJsonInfoCache.clear();
|
|
35500
|
-
}
|
|
35501
|
-
function clearAllExceptPackageJsonInfoCache() {
|
|
35502
|
-
perDirectoryResolutionCache.clear();
|
|
35503
35518
|
moduleNameToDirectoryMap.clear();
|
|
35504
35519
|
}
|
|
35505
35520
|
function update(options2) {
|
|
35506
|
-
directoryToModuleNameMap.update(options2);
|
|
35507
35521
|
moduleNameToDirectoryMap.update(options2);
|
|
35508
35522
|
}
|
|
35509
|
-
function
|
|
35523
|
+
function getFromNonRelativeNameCache(nonRelativeModuleName, mode, directoryName, redirectedReference) {
|
|
35524
|
+
var _a2, _b;
|
|
35525
|
+
Debug.assert(!isExternalModuleNameRelative(nonRelativeModuleName));
|
|
35526
|
+
return (_b = (_a2 = moduleNameToDirectoryMap.getMapOfCacheRedirects(redirectedReference)) == null ? void 0 : _a2.get(createModeAwareCacheKey(nonRelativeModuleName, mode))) == null ? void 0 : _b.get(directoryName);
|
|
35527
|
+
}
|
|
35528
|
+
function getOrCreateCacheForNonRelativeName(nonRelativeModuleName, mode, redirectedReference) {
|
|
35510
35529
|
Debug.assert(!isExternalModuleNameRelative(nonRelativeModuleName));
|
|
35511
35530
|
return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, createModeAwareCacheKey(nonRelativeModuleName, mode), createPerModuleNameCache);
|
|
35512
35531
|
}
|
|
@@ -35522,7 +35541,7 @@ ${lanes.join("\n")}
|
|
|
35522
35541
|
return;
|
|
35523
35542
|
}
|
|
35524
35543
|
directoryPathMap.set(path, result);
|
|
35525
|
-
const resolvedFileName =
|
|
35544
|
+
const resolvedFileName = getResolvedFileName(result);
|
|
35526
35545
|
const commonPrefix = resolvedFileName && getCommonPrefix(path, resolvedFileName);
|
|
35527
35546
|
let current = path;
|
|
35528
35547
|
while (current !== commonPrefix) {
|
|
@@ -35556,14 +35575,22 @@ ${lanes.join("\n")}
|
|
|
35556
35575
|
}
|
|
35557
35576
|
}
|
|
35558
35577
|
}
|
|
35559
|
-
function
|
|
35560
|
-
const
|
|
35561
|
-
const
|
|
35562
|
-
|
|
35578
|
+
function createModuleOrTypeReferenceResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache, getResolvedFileName) {
|
|
35579
|
+
const perDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, options);
|
|
35580
|
+
const nonRelativeNameResolutionCache = createNonRelativeNameResolutionCache(
|
|
35581
|
+
currentDirectory,
|
|
35582
|
+
getCanonicalFileName,
|
|
35583
|
+
options,
|
|
35584
|
+
getResolvedFileName
|
|
35585
|
+
);
|
|
35586
|
+
packageJsonInfoCache != null ? packageJsonInfoCache : packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName);
|
|
35563
35587
|
return {
|
|
35564
35588
|
...packageJsonInfoCache,
|
|
35565
35589
|
...perDirectoryResolutionCache,
|
|
35590
|
+
...nonRelativeNameResolutionCache,
|
|
35566
35591
|
clear: clear2,
|
|
35592
|
+
update,
|
|
35593
|
+
getPackageJsonInfoCache: () => packageJsonInfoCache,
|
|
35567
35594
|
clearAllExceptPackageJsonInfoCache
|
|
35568
35595
|
};
|
|
35569
35596
|
function clear2() {
|
|
@@ -35572,14 +35599,36 @@ ${lanes.join("\n")}
|
|
|
35572
35599
|
}
|
|
35573
35600
|
function clearAllExceptPackageJsonInfoCache() {
|
|
35574
35601
|
perDirectoryResolutionCache.clear();
|
|
35602
|
+
nonRelativeNameResolutionCache.clear();
|
|
35603
|
+
}
|
|
35604
|
+
function update(options2) {
|
|
35605
|
+
perDirectoryResolutionCache.update(options2);
|
|
35606
|
+
nonRelativeNameResolutionCache.update(options2);
|
|
35575
35607
|
}
|
|
35576
35608
|
}
|
|
35609
|
+
function createModuleResolutionCache(currentDirectory, getCanonicalFileName, options) {
|
|
35610
|
+
const result = createModuleOrTypeReferenceResolutionCache(
|
|
35611
|
+
currentDirectory,
|
|
35612
|
+
getCanonicalFileName,
|
|
35613
|
+
options,
|
|
35614
|
+
void 0,
|
|
35615
|
+
getOriginalOrResolvedModuleFileName
|
|
35616
|
+
);
|
|
35617
|
+
result.getOrCreateCacheForModuleName = (nonRelativeName, mode, redirectedReference) => result.getOrCreateCacheForNonRelativeName(nonRelativeName, mode, redirectedReference);
|
|
35618
|
+
return result;
|
|
35619
|
+
}
|
|
35620
|
+
function createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache) {
|
|
35621
|
+
return createModuleOrTypeReferenceResolutionCache(
|
|
35622
|
+
currentDirectory,
|
|
35623
|
+
getCanonicalFileName,
|
|
35624
|
+
options,
|
|
35625
|
+
packageJsonInfoCache,
|
|
35626
|
+
getOriginalOrResolvedTypeReferenceFileName
|
|
35627
|
+
);
|
|
35628
|
+
}
|
|
35577
35629
|
function resolveModuleNameFromCache(moduleName, containingFile, cache, mode) {
|
|
35578
35630
|
const containingDirectory = getDirectoryPath(containingFile);
|
|
35579
|
-
|
|
35580
|
-
if (!perFolderCache)
|
|
35581
|
-
return void 0;
|
|
35582
|
-
return perFolderCache.get(moduleName, mode);
|
|
35631
|
+
return cache.getFromDirectoryCache(moduleName, mode, containingDirectory, void 0);
|
|
35583
35632
|
}
|
|
35584
35633
|
function resolveModuleName(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
35585
35634
|
const traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
@@ -35593,8 +35642,7 @@ ${lanes.join("\n")}
|
|
|
35593
35642
|
}
|
|
35594
35643
|
}
|
|
35595
35644
|
const containingDirectory = getDirectoryPath(containingFile);
|
|
35596
|
-
|
|
35597
|
-
let result = perFolderCache && perFolderCache.get(moduleName, resolutionMode);
|
|
35645
|
+
let result = cache == null ? void 0 : cache.getFromDirectoryCache(moduleName, resolutionMode, containingDirectory, redirectedReference);
|
|
35598
35646
|
if (result) {
|
|
35599
35647
|
if (traceEnabled) {
|
|
35600
35648
|
trace(host, Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory);
|
|
@@ -35644,11 +35692,9 @@ ${lanes.join("\n")}
|
|
|
35644
35692
|
if (result && result.resolvedModule)
|
|
35645
35693
|
perfLogger.logInfoEvent(`Module "${moduleName}" resolved to "${result.resolvedModule.resolvedFileName}"`);
|
|
35646
35694
|
perfLogger.logStopResolveModule(result && result.resolvedModule ? "" + result.resolvedModule.resolvedFileName : "null");
|
|
35647
|
-
|
|
35648
|
-
|
|
35649
|
-
|
|
35650
|
-
cache.getOrCreateCacheForModuleName(moduleName, resolutionMode, redirectedReference).set(containingDirectory, result);
|
|
35651
|
-
}
|
|
35695
|
+
cache == null ? void 0 : cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference).set(moduleName, resolutionMode, result);
|
|
35696
|
+
if (!isExternalModuleNameRelative(moduleName)) {
|
|
35697
|
+
cache == null ? void 0 : cache.getOrCreateCacheForNonRelativeName(moduleName, resolutionMode, redirectedReference).set(containingDirectory, result);
|
|
35652
35698
|
}
|
|
35653
35699
|
}
|
|
35654
35700
|
if (traceEnabled) {
|
|
@@ -35765,7 +35811,7 @@ ${lanes.join("\n")}
|
|
|
35765
35811
|
function resolveJSModule(moduleName, initialDir, host) {
|
|
35766
35812
|
const { resolvedModule, failedLookupLocations } = tryResolveJSModuleWorker(moduleName, initialDir, host);
|
|
35767
35813
|
if (!resolvedModule) {
|
|
35768
|
-
throw new Error(`Could not resolve JS module '${moduleName}' starting at '${initialDir}'. Looked in: ${failedLookupLocations.join(", ")}`);
|
|
35814
|
+
throw new Error(`Could not resolve JS module '${moduleName}' starting at '${initialDir}'. Looked in: ${failedLookupLocations == null ? void 0 : failedLookupLocations.join(", ")}`);
|
|
35769
35815
|
}
|
|
35770
35816
|
return resolvedModule.resolvedFileName;
|
|
35771
35817
|
}
|
|
@@ -36627,7 +36673,7 @@ ${lanes.join("\n")}
|
|
|
36627
36673
|
return loadModuleFromNearestNodeModulesDirectoryWorker(4 /* Declaration */, moduleName, directory, state, true, void 0, void 0);
|
|
36628
36674
|
}
|
|
36629
36675
|
function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) {
|
|
36630
|
-
const
|
|
36676
|
+
const mode = state.features === 0 ? void 0 : state.features & 32 /* EsmMode */ ? 99 /* ESNext */ : 1 /* CommonJS */;
|
|
36631
36677
|
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
|
|
36632
36678
|
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
|
|
36633
36679
|
if (priorityExtensions) {
|
|
@@ -36641,7 +36687,7 @@ ${lanes.join("\n")}
|
|
|
36641
36687
|
function lookup(extensions2) {
|
|
36642
36688
|
return forEachAncestorDirectory(normalizeSlashes(directory), (ancestorDirectory) => {
|
|
36643
36689
|
if (getBaseFileName(ancestorDirectory) !== "node_modules") {
|
|
36644
|
-
const resolutionFromCache = tryFindNonRelativeModuleNameInCache(
|
|
36690
|
+
const resolutionFromCache = tryFindNonRelativeModuleNameInCache(cache, moduleName, mode, ancestorDirectory, redirectedReference, state);
|
|
36645
36691
|
if (resolutionFromCache) {
|
|
36646
36692
|
return resolutionFromCache;
|
|
36647
36693
|
}
|
|
@@ -36786,8 +36832,8 @@ ${lanes.join("\n")}
|
|
|
36786
36832
|
function unmangleScopedPackageName(typesPackageName) {
|
|
36787
36833
|
return stringContains(typesPackageName, mangledScopedPackageSeparator) ? "@" + typesPackageName.replace(mangledScopedPackageSeparator, directorySeparator) : typesPackageName;
|
|
36788
36834
|
}
|
|
36789
|
-
function tryFindNonRelativeModuleNameInCache(cache, moduleName, containingDirectory, state) {
|
|
36790
|
-
const result = cache && cache.
|
|
36835
|
+
function tryFindNonRelativeModuleNameInCache(cache, moduleName, mode, containingDirectory, redirectedReference, state) {
|
|
36836
|
+
const result = cache && cache.getFromNonRelativeNameCache(moduleName, mode, containingDirectory, redirectedReference);
|
|
36791
36837
|
if (result) {
|
|
36792
36838
|
if (state.traceEnabled) {
|
|
36793
36839
|
trace(state.host, Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory);
|
|
@@ -36830,9 +36876,8 @@ ${lanes.join("\n")}
|
|
|
36830
36876
|
return { value: resolvedUsingSettings };
|
|
36831
36877
|
}
|
|
36832
36878
|
if (!isExternalModuleNameRelative(moduleName)) {
|
|
36833
|
-
const perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName, void 0, redirectedReference);
|
|
36834
36879
|
const resolved2 = forEachAncestorDirectory(containingDirectory, (directory) => {
|
|
36835
|
-
const resolutionFromCache = tryFindNonRelativeModuleNameInCache(
|
|
36880
|
+
const resolutionFromCache = tryFindNonRelativeModuleNameInCache(cache, moduleName, void 0, directory, redirectedReference, state);
|
|
36836
36881
|
if (resolutionFromCache) {
|
|
36837
36882
|
return resolutionFromCache;
|
|
36838
36883
|
}
|
|
@@ -40244,7 +40289,7 @@ ${lanes.join("\n")}
|
|
|
40244
40289
|
if (!shortest) {
|
|
40245
40290
|
return void 0;
|
|
40246
40291
|
}
|
|
40247
|
-
return getEmitModuleResolutionKind(compilerOptions) ===
|
|
40292
|
+
return getEmitModuleResolutionKind(compilerOptions) === 1 /* Classic */ ? removeFileExtension(shortest) : removeExtensionAndIndexPostFix(shortest, ending, compilerOptions);
|
|
40248
40293
|
}
|
|
40249
40294
|
function tryGetModuleNameAsNodeModule({ path, isRedirect }, { getCanonicalFileName, sourceDirectory }, importingSourceFile, host, options, userPreferences, packageNameOnly, overrideMode) {
|
|
40250
40295
|
if (!host.fileExists || !host.readFile) {
|
|
@@ -40480,9 +40525,9 @@ ${lanes.join("\n")}
|
|
|
40480
40525
|
host.getSourceFiles().forEach((sf) => {
|
|
40481
40526
|
if (!sf.resolvedModules)
|
|
40482
40527
|
return;
|
|
40483
|
-
sf.resolvedModules.forEach((
|
|
40484
|
-
if (
|
|
40485
|
-
map2.set(
|
|
40528
|
+
sf.resolvedModules.forEach(({ resolvedModule }) => {
|
|
40529
|
+
if (resolvedModule == null ? void 0 : resolvedModule.packageId)
|
|
40530
|
+
map2.set(resolvedModule.packageId.name, resolvedModule.extension === ".d.ts" /* Dts */ || !!map2.get(resolvedModule.packageId.name));
|
|
40486
40531
|
});
|
|
40487
40532
|
});
|
|
40488
40533
|
return map2;
|
|
@@ -41286,6 +41331,12 @@ ${lanes.join("\n")}
|
|
|
41286
41331
|
return diagnostic;
|
|
41287
41332
|
}
|
|
41288
41333
|
function isDeprecatedSymbol(symbol) {
|
|
41334
|
+
if (length(symbol.declarations) > 1) {
|
|
41335
|
+
const parentSymbol = getParentOfSymbol(symbol);
|
|
41336
|
+
if (parentSymbol && parentSymbol.flags & 64 /* Interface */) {
|
|
41337
|
+
return some(symbol.declarations, (d) => !!(getCombinedNodeFlags(d) & 268435456 /* Deprecated */));
|
|
41338
|
+
}
|
|
41339
|
+
}
|
|
41289
41340
|
return !!(getDeclarationNodeFlagsFromSymbol(symbol) & 268435456 /* Deprecated */);
|
|
41290
41341
|
}
|
|
41291
41342
|
function addDeprecatedSuggestion(location, declarations, deprecatedEntity) {
|
|
@@ -50979,7 +51030,7 @@ ${lanes.join("\n")}
|
|
|
50979
51030
|
const resolved = resolveAlias(aliasSymbol2);
|
|
50980
51031
|
if (resolved && resolved.flags & 524288 /* TypeAlias */) {
|
|
50981
51032
|
newAliasSymbol = resolved;
|
|
50982
|
-
aliasTypeArguments = typeArgumentsFromTypeReferenceNode(node);
|
|
51033
|
+
aliasTypeArguments = typeArgumentsFromTypeReferenceNode(node) || (typeParameters ? [] : void 0);
|
|
50983
51034
|
}
|
|
50984
51035
|
}
|
|
50985
51036
|
}
|
|
@@ -59795,13 +59846,13 @@ ${lanes.join("\n")}
|
|
|
59795
59846
|
}
|
|
59796
59847
|
const target = getReferenceCandidate(typeOfExpr.expression);
|
|
59797
59848
|
if (!isMatchingReference(reference, target)) {
|
|
59798
|
-
|
|
59849
|
+
if (strictNullChecks && optionalChainContainsReference(target, reference) && assumeTrue === (literal.text !== "undefined")) {
|
|
59850
|
+
type = getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
|
|
59851
|
+
}
|
|
59852
|
+
const propertyAccess = getDiscriminantPropertyAccess(target, type);
|
|
59799
59853
|
if (propertyAccess) {
|
|
59800
59854
|
return narrowTypeByDiscriminant(type, propertyAccess, (t) => narrowTypeByLiteralExpression(t, literal, assumeTrue));
|
|
59801
59855
|
}
|
|
59802
|
-
if (strictNullChecks && optionalChainContainsReference(target, reference) && assumeTrue === (literal.text !== "undefined")) {
|
|
59803
|
-
return getAdjustedTypeWithFacts(type, 2097152 /* NEUndefinedOrNull */);
|
|
59804
|
-
}
|
|
59805
59856
|
return type;
|
|
59806
59857
|
}
|
|
59807
59858
|
return narrowTypeByLiteralExpression(type, literal, assumeTrue);
|
|
@@ -70284,7 +70335,6 @@ ${lanes.join("\n")}
|
|
|
70284
70335
|
let firstDefaultClause;
|
|
70285
70336
|
let hasDuplicateDefaultClause = false;
|
|
70286
70337
|
const expressionType = checkExpression(node.expression);
|
|
70287
|
-
const expressionIsLiteral = isLiteralType(expressionType);
|
|
70288
70338
|
forEach(node.caseBlock.clauses, (clause) => {
|
|
70289
70339
|
if (clause.kind === 293 /* DefaultClause */ && !hasDuplicateDefaultClause) {
|
|
70290
70340
|
if (firstDefaultClause === void 0) {
|
|
@@ -70303,15 +70353,9 @@ ${lanes.join("\n")}
|
|
|
70303
70353
|
}
|
|
70304
70354
|
function createLazyCaseClauseDiagnostics(clause2) {
|
|
70305
70355
|
return () => {
|
|
70306
|
-
|
|
70307
|
-
|
|
70308
|
-
|
|
70309
|
-
if (!caseIsLiteral || !expressionIsLiteral) {
|
|
70310
|
-
caseType = caseIsLiteral ? getBaseTypeOfLiteralType(caseType) : caseType;
|
|
70311
|
-
comparedExpressionType = getBaseTypeOfLiteralType(expressionType);
|
|
70312
|
-
}
|
|
70313
|
-
if (!isTypeEqualityComparableTo(comparedExpressionType, caseType)) {
|
|
70314
|
-
checkTypeComparableTo(caseType, comparedExpressionType, clause2.expression, void 0);
|
|
70356
|
+
const caseType = checkExpression(clause2.expression);
|
|
70357
|
+
if (!isTypeEqualityComparableTo(expressionType, caseType)) {
|
|
70358
|
+
checkTypeComparableTo(caseType, expressionType, clause2.expression, void 0);
|
|
70315
70359
|
}
|
|
70316
70360
|
};
|
|
70317
70361
|
}
|
|
@@ -73412,11 +73456,11 @@ ${lanes.join("\n")}
|
|
|
73412
73456
|
let fileToDirective;
|
|
73413
73457
|
if (resolvedTypeReferenceDirectives) {
|
|
73414
73458
|
fileToDirective = /* @__PURE__ */ new Map();
|
|
73415
|
-
resolvedTypeReferenceDirectives.forEach((
|
|
73416
|
-
if (!
|
|
73459
|
+
resolvedTypeReferenceDirectives.forEach(({ resolvedTypeReferenceDirective }, key, mode) => {
|
|
73460
|
+
if (!(resolvedTypeReferenceDirective == null ? void 0 : resolvedTypeReferenceDirective.resolvedFileName)) {
|
|
73417
73461
|
return;
|
|
73418
73462
|
}
|
|
73419
|
-
const file = host.getSourceFile(
|
|
73463
|
+
const file = host.getSourceFile(resolvedTypeReferenceDirective.resolvedFileName);
|
|
73420
73464
|
if (file) {
|
|
73421
73465
|
addReferencedFilesToTypeDirective(file, key, mode);
|
|
73422
73466
|
}
|
|
@@ -100199,25 +100243,6 @@ ${lanes.join("\n")}
|
|
|
100199
100243
|
}
|
|
100200
100244
|
return result;
|
|
100201
100245
|
}
|
|
100202
|
-
function loadWithTypeDirectiveCache(names, containingFile, redirectedReference, containingFileMode, loader) {
|
|
100203
|
-
if (names.length === 0) {
|
|
100204
|
-
return [];
|
|
100205
|
-
}
|
|
100206
|
-
const resolutions = [];
|
|
100207
|
-
const cache = createModeAwareCache();
|
|
100208
|
-
for (const name of names) {
|
|
100209
|
-
let result;
|
|
100210
|
-
const mode = getModeForFileReference(name, containingFileMode);
|
|
100211
|
-
const strName = getResolutionName(name);
|
|
100212
|
-
if (cache.has(strName, mode)) {
|
|
100213
|
-
result = cache.get(strName, mode);
|
|
100214
|
-
} else {
|
|
100215
|
-
cache.set(strName, mode, result = loader(strName, containingFile, redirectedReference, mode));
|
|
100216
|
-
}
|
|
100217
|
-
resolutions.push(result);
|
|
100218
|
-
}
|
|
100219
|
-
return resolutions;
|
|
100220
|
-
}
|
|
100221
100246
|
function getModeForFileReference(ref, containingFileMode) {
|
|
100222
100247
|
return (isString(ref) ? containingFileMode : ref.resolutionMode) || containingFileMode;
|
|
100223
100248
|
}
|
|
@@ -100283,22 +100308,53 @@ ${lanes.join("\n")}
|
|
|
100283
100308
|
}
|
|
100284
100309
|
return elem.value.text === "import" ? 99 /* ESNext */ : 1 /* CommonJS */;
|
|
100285
100310
|
}
|
|
100286
|
-
function
|
|
100287
|
-
|
|
100288
|
-
|
|
100289
|
-
|
|
100311
|
+
function getModuleResolutionName(literal) {
|
|
100312
|
+
return literal.text;
|
|
100313
|
+
}
|
|
100314
|
+
function createModuleResolutionLoader(containingFile, redirectedReference, options, host, cache) {
|
|
100315
|
+
return {
|
|
100316
|
+
nameAndMode: moduleResolutionNameAndModeGetter,
|
|
100317
|
+
resolve: (moduleName, resoluionMode) => resolveModuleName(
|
|
100318
|
+
moduleName,
|
|
100319
|
+
containingFile,
|
|
100320
|
+
options,
|
|
100321
|
+
host,
|
|
100322
|
+
cache,
|
|
100323
|
+
redirectedReference,
|
|
100324
|
+
resoluionMode
|
|
100325
|
+
)
|
|
100326
|
+
};
|
|
100327
|
+
}
|
|
100328
|
+
function getTypeReferenceResolutionName(entry) {
|
|
100329
|
+
return !isString(entry) ? toFileNameLowerCase(entry.fileName) : entry;
|
|
100330
|
+
}
|
|
100331
|
+
function createTypeReferenceResolutionLoader(containingFile, redirectedReference, options, host, cache) {
|
|
100332
|
+
return {
|
|
100333
|
+
nameAndMode: typeReferenceResolutionNameAndModeGetter,
|
|
100334
|
+
resolve: (typeRef, resoluionMode) => resolveTypeReferenceDirective(
|
|
100335
|
+
typeRef,
|
|
100336
|
+
containingFile,
|
|
100337
|
+
options,
|
|
100338
|
+
host,
|
|
100339
|
+
redirectedReference,
|
|
100340
|
+
cache,
|
|
100341
|
+
resoluionMode
|
|
100342
|
+
)
|
|
100343
|
+
};
|
|
100344
|
+
}
|
|
100345
|
+
function loadWithModeAwareCache(entries, containingFile, redirectedReference, options, containingSourceFile, host, resolutionCache, createLoader) {
|
|
100346
|
+
if (entries.length === 0)
|
|
100347
|
+
return emptyArray;
|
|
100290
100348
|
const resolutions = [];
|
|
100291
|
-
const cache =
|
|
100292
|
-
|
|
100293
|
-
for (const entry of
|
|
100294
|
-
|
|
100295
|
-
const mode =
|
|
100296
|
-
|
|
100297
|
-
|
|
100298
|
-
if (
|
|
100299
|
-
result =
|
|
100300
|
-
} else {
|
|
100301
|
-
cache.set(name, mode, result = loader(name, mode, containingFileName, redirectedReference));
|
|
100349
|
+
const cache = /* @__PURE__ */ new Map();
|
|
100350
|
+
const loader = createLoader(containingFile, redirectedReference, options, host, resolutionCache);
|
|
100351
|
+
for (const entry of entries) {
|
|
100352
|
+
const name = loader.nameAndMode.getName(entry);
|
|
100353
|
+
const mode = loader.nameAndMode.getMode(entry, containingSourceFile);
|
|
100354
|
+
const key = createModeAwareCacheKey(name, mode);
|
|
100355
|
+
let result = cache.get(key);
|
|
100356
|
+
if (!result) {
|
|
100357
|
+
cache.set(key, result = loader.resolve(name, mode));
|
|
100302
100358
|
}
|
|
100303
100359
|
resolutions.push(result);
|
|
100304
100360
|
}
|
|
@@ -100343,14 +100399,14 @@ ${lanes.join("\n")}
|
|
|
100343
100399
|
return location.pos !== void 0;
|
|
100344
100400
|
}
|
|
100345
100401
|
function getReferencedFileLocation(getSourceFileByPath, ref) {
|
|
100346
|
-
var _a2, _b, _c, _d;
|
|
100402
|
+
var _a2, _b, _c, _d, _e, _f;
|
|
100347
100403
|
const file = Debug.checkDefined(getSourceFileByPath(ref.file));
|
|
100348
100404
|
const { kind, index } = ref;
|
|
100349
100405
|
let pos, end, packageId, resolutionMode;
|
|
100350
100406
|
switch (kind) {
|
|
100351
100407
|
case 3 /* Import */:
|
|
100352
100408
|
const importLiteral = getModuleNameStringLiteralAt(file, index);
|
|
100353
|
-
packageId = (_b = (_a2 = file.resolvedModules) == null ? void 0 : _a2.get(importLiteral.text, getModeForResolutionAtIndex(file, index))) == null ? void 0 : _b.packageId;
|
|
100409
|
+
packageId = (_c = (_b = (_a2 = file.resolvedModules) == null ? void 0 : _a2.get(importLiteral.text, getModeForResolutionAtIndex(file, index))) == null ? void 0 : _b.resolvedModule) == null ? void 0 : _c.packageId;
|
|
100354
100410
|
if (importLiteral.pos === -1)
|
|
100355
100411
|
return { file, packageId, text: importLiteral.text };
|
|
100356
100412
|
pos = skipTrivia(file.text, importLiteral.pos);
|
|
@@ -100361,7 +100417,7 @@ ${lanes.join("\n")}
|
|
|
100361
100417
|
break;
|
|
100362
100418
|
case 5 /* TypeReferenceDirective */:
|
|
100363
100419
|
({ pos, end, resolutionMode } = file.typeReferenceDirectives[index]);
|
|
100364
|
-
packageId = (
|
|
100420
|
+
packageId = (_f = (_e = (_d = file.resolvedTypeReferenceDirectiveNames) == null ? void 0 : _d.get(toFileNameLowerCase(file.typeReferenceDirectives[index].fileName), resolutionMode || file.impliedNodeFormat)) == null ? void 0 : _e.resolvedTypeReferenceDirective) == null ? void 0 : _f.packageId;
|
|
100365
100421
|
break;
|
|
100366
100422
|
case 7 /* LibReferenceDirective */:
|
|
100367
100423
|
({ pos, end } = file.libReferenceDirectives[index]);
|
|
@@ -100457,7 +100513,7 @@ ${lanes.join("\n")}
|
|
|
100457
100513
|
};
|
|
100458
100514
|
}
|
|
100459
100515
|
function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) {
|
|
100460
|
-
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
100516
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
100461
100517
|
const createProgramOptions = isArray(rootNamesOrOptions) ? createCreateProgramOptions(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : rootNamesOrOptions;
|
|
100462
100518
|
const { rootNames, options, configFileParsingDiagnostics, projectReferences } = createProgramOptions;
|
|
100463
100519
|
let { oldProgram } = createProgramOptions;
|
|
@@ -100474,6 +100530,8 @@ ${lanes.join("\n")}
|
|
|
100474
100530
|
const cachedDeclarationDiagnosticsForFile = {};
|
|
100475
100531
|
let resolvedTypeReferenceDirectives = createModeAwareCache();
|
|
100476
100532
|
let fileProcessingDiagnostics;
|
|
100533
|
+
let automaticTypeDirectiveNames;
|
|
100534
|
+
let automaticTypeDirectiveResolutions;
|
|
100477
100535
|
const maxNodeModuleJsDepth = typeof options.maxNodeModuleJsDepth === "number" ? options.maxNodeModuleJsDepth : 0;
|
|
100478
100536
|
let currentNodeModulesDepth = 0;
|
|
100479
100537
|
const modulesWithElidedImports = /* @__PURE__ */ new Map();
|
|
@@ -100492,50 +100550,59 @@ ${lanes.join("\n")}
|
|
|
100492
100550
|
const hasEmitBlockingDiagnostics = /* @__PURE__ */ new Map();
|
|
100493
100551
|
let _compilerOptionsObjectLiteralSyntax;
|
|
100494
100552
|
let moduleResolutionCache;
|
|
100495
|
-
let typeReferenceDirectiveResolutionCache;
|
|
100496
100553
|
let actualResolveModuleNamesWorker;
|
|
100497
100554
|
const hasInvalidatedResolutions = host.hasInvalidatedResolutions || returnFalse;
|
|
100498
|
-
if (host.
|
|
100499
|
-
actualResolveModuleNamesWorker = (
|
|
100500
|
-
var _a3;
|
|
100501
|
-
return host.resolveModuleNames(
|
|
100502
|
-
moduleNames.map((literal) => literal.text),
|
|
100503
|
-
containingFileName,
|
|
100504
|
-
(_a3 = resolutionInfo == null ? void 0 : resolutionInfo.reusedNames) == null ? void 0 : _a3.map((literal) => literal.text),
|
|
100505
|
-
redirectedReference,
|
|
100506
|
-
options,
|
|
100507
|
-
containingFile,
|
|
100508
|
-
resolutionInfo
|
|
100509
|
-
).map((resolved) => {
|
|
100510
|
-
if (!resolved || resolved.extension !== void 0) {
|
|
100511
|
-
return resolved;
|
|
100512
|
-
}
|
|
100513
|
-
const withExtension = clone(resolved);
|
|
100514
|
-
withExtension.extension = extensionFromPath(resolved.resolvedFileName);
|
|
100515
|
-
return withExtension;
|
|
100516
|
-
});
|
|
100517
|
-
};
|
|
100555
|
+
if (host.resolveModuleNameLiterals) {
|
|
100556
|
+
actualResolveModuleNamesWorker = host.resolveModuleNameLiterals.bind(host);
|
|
100518
100557
|
moduleResolutionCache = (_b = host.getModuleResolutionCache) == null ? void 0 : _b.call(host);
|
|
100558
|
+
} else if (host.resolveModuleNames) {
|
|
100559
|
+
actualResolveModuleNamesWorker = (moduleNames, containingFile, redirectedReference, options2, containingSourceFile, reusedNames) => host.resolveModuleNames(
|
|
100560
|
+
moduleNames.map(getModuleResolutionName),
|
|
100561
|
+
containingFile,
|
|
100562
|
+
reusedNames == null ? void 0 : reusedNames.map(getModuleResolutionName),
|
|
100563
|
+
redirectedReference,
|
|
100564
|
+
options2,
|
|
100565
|
+
containingSourceFile
|
|
100566
|
+
).map(
|
|
100567
|
+
(resolved) => resolved ? resolved.extension !== void 0 ? { resolvedModule: resolved } : { resolvedModule: { ...resolved, extension: extensionFromPath(resolved.resolvedFileName) } } : emptyResolution
|
|
100568
|
+
);
|
|
100569
|
+
moduleResolutionCache = (_c = host.getModuleResolutionCache) == null ? void 0 : _c.call(host);
|
|
100519
100570
|
} else {
|
|
100520
100571
|
moduleResolutionCache = createModuleResolutionCache(currentDirectory, getCanonicalFileName, options);
|
|
100521
|
-
|
|
100522
|
-
|
|
100572
|
+
actualResolveModuleNamesWorker = (moduleNames, containingFile, redirectedReference, options2, containingSourceFile) => loadWithModeAwareCache(
|
|
100573
|
+
moduleNames,
|
|
100574
|
+
containingFile,
|
|
100575
|
+
redirectedReference,
|
|
100576
|
+
options2,
|
|
100577
|
+
containingSourceFile,
|
|
100578
|
+
host,
|
|
100579
|
+
moduleResolutionCache,
|
|
100580
|
+
createModuleResolutionLoader
|
|
100581
|
+
);
|
|
100523
100582
|
}
|
|
100524
100583
|
let actualResolveTypeReferenceDirectiveNamesWorker;
|
|
100525
|
-
if (host.
|
|
100526
|
-
actualResolveTypeReferenceDirectiveNamesWorker =
|
|
100584
|
+
if (host.resolveTypeReferenceDirectiveReferences) {
|
|
100585
|
+
actualResolveTypeReferenceDirectiveNamesWorker = host.resolveTypeReferenceDirectiveReferences.bind(host);
|
|
100586
|
+
} else if (host.resolveTypeReferenceDirectives) {
|
|
100587
|
+
actualResolveTypeReferenceDirectiveNamesWorker = (typeDirectiveNames, containingFile, redirectedReference, options2, containingSourceFile) => host.resolveTypeReferenceDirectives(
|
|
100588
|
+
typeDirectiveNames.map(getTypeReferenceResolutionName),
|
|
100589
|
+
containingFile,
|
|
100590
|
+
redirectedReference,
|
|
100591
|
+
options2,
|
|
100592
|
+
containingSourceFile == null ? void 0 : containingSourceFile.impliedNodeFormat
|
|
100593
|
+
).map((resolvedTypeReferenceDirective) => ({ resolvedTypeReferenceDirective }));
|
|
100527
100594
|
} else {
|
|
100528
|
-
typeReferenceDirectiveResolutionCache = createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, void 0, moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache());
|
|
100529
|
-
|
|
100530
|
-
|
|
100595
|
+
const typeReferenceDirectiveResolutionCache = createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, void 0, moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache());
|
|
100596
|
+
actualResolveTypeReferenceDirectiveNamesWorker = (typeDirectiveNames, containingFile, redirectedReference, options2, containingSourceFile) => loadWithModeAwareCache(
|
|
100597
|
+
typeDirectiveNames,
|
|
100531
100598
|
containingFile,
|
|
100532
|
-
options,
|
|
100533
|
-
host,
|
|
100534
100599
|
redirectedReference,
|
|
100600
|
+
options2,
|
|
100601
|
+
containingSourceFile,
|
|
100602
|
+
host,
|
|
100535
100603
|
typeReferenceDirectiveResolutionCache,
|
|
100536
|
-
|
|
100537
|
-
)
|
|
100538
|
-
actualResolveTypeReferenceDirectiveNamesWorker = (typeReferenceDirectiveNames, containingFile, redirectedReference, containingFileMode) => loadWithTypeDirectiveCache(Debug.checkEachDefined(typeReferenceDirectiveNames), containingFile, redirectedReference, containingFileMode, loader);
|
|
100604
|
+
createTypeReferenceResolutionLoader
|
|
100605
|
+
);
|
|
100539
100606
|
}
|
|
100540
100607
|
const packageIdToSourceFile = /* @__PURE__ */ new Map();
|
|
100541
100608
|
let sourceFileToPackageName = /* @__PURE__ */ new Map();
|
|
@@ -100548,7 +100615,7 @@ ${lanes.join("\n")}
|
|
|
100548
100615
|
let projectReferenceRedirects;
|
|
100549
100616
|
let mapFromFileToProjectReferenceRedirects;
|
|
100550
100617
|
let mapFromToProjectReferenceRedirectSource;
|
|
100551
|
-
const useSourceOfProjectReferenceRedirect = !!((
|
|
100618
|
+
const useSourceOfProjectReferenceRedirect = !!((_d = host.useSourceOfProjectReferenceRedirect) == null ? void 0 : _d.call(host)) && !options.disableSourceOfProjectReferenceRedirect;
|
|
100552
100619
|
const { onProgramCreateComplete, fileExists, directoryExists } = updateHostForUseSourceOfProjectReferenceRedirect({
|
|
100553
100620
|
compilerHost: host,
|
|
100554
100621
|
getSymlinkCache,
|
|
@@ -100559,13 +100626,13 @@ ${lanes.join("\n")}
|
|
|
100559
100626
|
forEachResolvedProjectReference: forEachResolvedProjectReference2
|
|
100560
100627
|
});
|
|
100561
100628
|
const readFile = host.readFile.bind(host);
|
|
100562
|
-
(
|
|
100629
|
+
(_e = tracing) == null ? void 0 : _e.push(tracing.Phase.Program, "shouldProgramCreateNewSourceFiles", { hasOldProgram: !!oldProgram });
|
|
100563
100630
|
const shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options);
|
|
100564
|
-
(
|
|
100631
|
+
(_f = tracing) == null ? void 0 : _f.pop();
|
|
100565
100632
|
let structureIsReused;
|
|
100566
|
-
(
|
|
100633
|
+
(_g = tracing) == null ? void 0 : _g.push(tracing.Phase.Program, "tryReuseStructureFromOldProgram", {});
|
|
100567
100634
|
structureIsReused = tryReuseStructureFromOldProgram();
|
|
100568
|
-
(
|
|
100635
|
+
(_h = tracing) == null ? void 0 : _h.pop();
|
|
100569
100636
|
if (structureIsReused !== 2 /* Completely */) {
|
|
100570
100637
|
processingDefaultLibFiles = [];
|
|
100571
100638
|
processingOtherFiles = [];
|
|
@@ -100599,19 +100666,30 @@ ${lanes.join("\n")}
|
|
|
100599
100666
|
});
|
|
100600
100667
|
}
|
|
100601
100668
|
}
|
|
100602
|
-
(
|
|
100669
|
+
(_i = tracing) == null ? void 0 : _i.push(tracing.Phase.Program, "processRootFiles", { count: rootNames.length });
|
|
100603
100670
|
forEach(rootNames, (name, index) => processRootFile(name, false, false, { kind: 0 /* RootFile */, index }));
|
|
100604
|
-
(
|
|
100605
|
-
|
|
100606
|
-
|
|
100607
|
-
|
|
100671
|
+
(_j = tracing) == null ? void 0 : _j.pop();
|
|
100672
|
+
automaticTypeDirectiveNames != null ? automaticTypeDirectiveNames : automaticTypeDirectiveNames = rootNames.length ? getAutomaticTypeDirectiveNames(options, host) : emptyArray;
|
|
100673
|
+
automaticTypeDirectiveResolutions = createModeAwareCache();
|
|
100674
|
+
if (automaticTypeDirectiveNames.length) {
|
|
100675
|
+
(_k = tracing) == null ? void 0 : _k.push(tracing.Phase.Program, "processTypeReferences", { count: automaticTypeDirectiveNames.length });
|
|
100608
100676
|
const containingDirectory = options.configFilePath ? getDirectoryPath(options.configFilePath) : host.getCurrentDirectory();
|
|
100609
100677
|
const containingFilename = combinePaths(containingDirectory, inferredTypesContainingFile);
|
|
100610
|
-
const resolutions = resolveTypeReferenceDirectiveNamesReusingOldState(
|
|
100611
|
-
for (let i = 0; i <
|
|
100612
|
-
|
|
100678
|
+
const resolutions = resolveTypeReferenceDirectiveNamesReusingOldState(automaticTypeDirectiveNames, containingFilename);
|
|
100679
|
+
for (let i = 0; i < automaticTypeDirectiveNames.length; i++) {
|
|
100680
|
+
automaticTypeDirectiveResolutions.set(automaticTypeDirectiveNames[i], void 0, resolutions[i]);
|
|
100681
|
+
processTypeReferenceDirective(
|
|
100682
|
+
automaticTypeDirectiveNames[i],
|
|
100683
|
+
void 0,
|
|
100684
|
+
resolutions[i],
|
|
100685
|
+
{
|
|
100686
|
+
kind: 8 /* AutomaticTypeDirectiveFile */,
|
|
100687
|
+
typeReference: automaticTypeDirectiveNames[i],
|
|
100688
|
+
packageId: (_m = (_l = resolutions[i]) == null ? void 0 : _l.resolvedTypeReferenceDirective) == null ? void 0 : _m.packageId
|
|
100689
|
+
}
|
|
100690
|
+
);
|
|
100613
100691
|
}
|
|
100614
|
-
(
|
|
100692
|
+
(_n = tracing) == null ? void 0 : _n.pop();
|
|
100615
100693
|
}
|
|
100616
100694
|
if (rootNames.length && !skipDefaultLib) {
|
|
100617
100695
|
const defaultLibraryFileName = getDefaultLibraryFileName();
|
|
@@ -100658,7 +100736,6 @@ ${lanes.join("\n")}
|
|
|
100658
100736
|
}
|
|
100659
100737
|
);
|
|
100660
100738
|
}
|
|
100661
|
-
typeReferenceDirectiveResolutionCache = void 0;
|
|
100662
100739
|
oldProgram = void 0;
|
|
100663
100740
|
const program = {
|
|
100664
100741
|
getRootFileNames: () => rootNames,
|
|
@@ -100691,6 +100768,8 @@ ${lanes.join("\n")}
|
|
|
100691
100768
|
getRelationCacheSizes: () => getTypeChecker().getRelationCacheSizes(),
|
|
100692
100769
|
getFileProcessingDiagnostics: () => fileProcessingDiagnostics,
|
|
100693
100770
|
getResolvedTypeReferenceDirectives: () => resolvedTypeReferenceDirectives,
|
|
100771
|
+
getAutomaticTypeDirectiveNames: () => automaticTypeDirectiveNames,
|
|
100772
|
+
getAutomaticTypeDirectiveResolutions: () => automaticTypeDirectiveResolutions,
|
|
100694
100773
|
isSourceFileFromExternalLibrary,
|
|
100695
100774
|
isSourceFileDefaultLibrary,
|
|
100696
100775
|
getSourceFileFromReference,
|
|
@@ -100700,7 +100779,6 @@ ${lanes.join("\n")}
|
|
|
100700
100779
|
usesUriStyleNodeCoreModules,
|
|
100701
100780
|
isEmittedFile,
|
|
100702
100781
|
getConfigFileParsingDiagnostics: getConfigFileParsingDiagnostics2,
|
|
100703
|
-
getResolvedModuleWithFailedLookupLocationsFromCache,
|
|
100704
100782
|
getProjectReferences,
|
|
100705
100783
|
getResolvedProjectReferences,
|
|
100706
100784
|
getProjectReferenceRedirect,
|
|
@@ -100713,7 +100791,7 @@ ${lanes.join("\n")}
|
|
|
100713
100791
|
readFile,
|
|
100714
100792
|
directoryExists,
|
|
100715
100793
|
getSymlinkCache,
|
|
100716
|
-
realpath: (
|
|
100794
|
+
realpath: (_o = host.realpath) == null ? void 0 : _o.bind(host),
|
|
100717
100795
|
useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(),
|
|
100718
100796
|
getFileIncludeReasons: () => fileReasons,
|
|
100719
100797
|
structureIsReused,
|
|
@@ -100727,6 +100805,8 @@ ${lanes.join("\n")}
|
|
|
100727
100805
|
case 0 /* FilePreprocessingReferencedDiagnostic */:
|
|
100728
100806
|
const { file, pos, end } = getReferencedFileLocation(getSourceFileByPath, diagnostic.reason);
|
|
100729
100807
|
return programDiagnostics.add(createFileDiagnostic(file, Debug.checkDefined(pos), Debug.checkDefined(end) - pos, diagnostic.diagnostic, ...diagnostic.args || emptyArray));
|
|
100808
|
+
case 2 /* ResolutionDiagnostics */:
|
|
100809
|
+
return diagnostic.diagnostics.forEach((d) => programDiagnostics.add(d));
|
|
100730
100810
|
default:
|
|
100731
100811
|
Debug.assertNever(diagnostic);
|
|
100732
100812
|
}
|
|
@@ -100734,32 +100814,30 @@ ${lanes.join("\n")}
|
|
|
100734
100814
|
verifyCompilerOptions();
|
|
100735
100815
|
mark("afterProgram");
|
|
100736
100816
|
measure("Program", "beforeProgram", "afterProgram");
|
|
100737
|
-
(
|
|
100817
|
+
(_p = tracing) == null ? void 0 : _p.pop();
|
|
100738
100818
|
return program;
|
|
100739
|
-
function addResolutionDiagnostics(
|
|
100740
|
-
|
|
100819
|
+
function addResolutionDiagnostics(resolution) {
|
|
100820
|
+
var _a3;
|
|
100821
|
+
if (!((_a3 = resolution.resolutionDiagnostics) == null ? void 0 : _a3.length))
|
|
100741
100822
|
return;
|
|
100742
|
-
|
|
100743
|
-
|
|
100744
|
-
|
|
100823
|
+
(fileProcessingDiagnostics != null ? fileProcessingDiagnostics : fileProcessingDiagnostics = []).push({
|
|
100824
|
+
kind: 2 /* ResolutionDiagnostics */,
|
|
100825
|
+
diagnostics: resolution.resolutionDiagnostics
|
|
100826
|
+
});
|
|
100745
100827
|
}
|
|
100746
|
-
function
|
|
100747
|
-
|
|
100748
|
-
|
|
100828
|
+
function addResolutionDiagnosticsFromResolutionOrCache(containingFile, name, resolution, mode) {
|
|
100829
|
+
if (host.resolveModuleNameLiterals || !host.resolveModuleNames)
|
|
100830
|
+
return addResolutionDiagnostics(resolution);
|
|
100831
|
+
if (!moduleResolutionCache || isExternalModuleNameRelative(name))
|
|
100749
100832
|
return;
|
|
100750
100833
|
const containingFileName = getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory);
|
|
100751
100834
|
const containingDir = getDirectoryPath(containingFileName);
|
|
100752
100835
|
const redirectedReference = getRedirectReferenceForResolution(containingFile);
|
|
100753
|
-
|
|
100754
|
-
|
|
100755
|
-
|
|
100756
|
-
if (isExternalModuleNameRelative(name))
|
|
100757
|
-
continue;
|
|
100758
|
-
const diags = (_a3 = moduleResolutionCache.getOrCreateCacheForModuleName(name, mode, redirectedReference).get(containingDir)) == null ? void 0 : _a3.resolutionDiagnostics;
|
|
100759
|
-
addResolutionDiagnostics(diags);
|
|
100760
|
-
}
|
|
100836
|
+
const fromCache = moduleResolutionCache.getFromNonRelativeNameCache(name, mode, containingDir, redirectedReference);
|
|
100837
|
+
if (fromCache)
|
|
100838
|
+
addResolutionDiagnostics(fromCache);
|
|
100761
100839
|
}
|
|
100762
|
-
function resolveModuleNamesWorker(moduleNames, containingFile,
|
|
100840
|
+
function resolveModuleNamesWorker(moduleNames, containingFile, reusedNames) {
|
|
100763
100841
|
var _a3, _b2;
|
|
100764
100842
|
if (!moduleNames.length)
|
|
100765
100843
|
return emptyArray;
|
|
@@ -100767,23 +100845,22 @@ ${lanes.join("\n")}
|
|
|
100767
100845
|
const redirectedReference = getRedirectReferenceForResolution(containingFile);
|
|
100768
100846
|
(_a3 = tracing) == null ? void 0 : _a3.push(tracing.Phase.Program, "resolveModuleNamesWorker", { containingFileName });
|
|
100769
100847
|
mark("beforeResolveModule");
|
|
100770
|
-
const result = actualResolveModuleNamesWorker(moduleNames,
|
|
100848
|
+
const result = actualResolveModuleNamesWorker(moduleNames, containingFileName, redirectedReference, options, containingFile, reusedNames);
|
|
100771
100849
|
mark("afterResolveModule");
|
|
100772
100850
|
measure("ResolveModule", "beforeResolveModule", "afterResolveModule");
|
|
100773
100851
|
(_b2 = tracing) == null ? void 0 : _b2.pop();
|
|
100774
|
-
pullDiagnosticsFromCache(moduleNames, containingFile);
|
|
100775
100852
|
return result;
|
|
100776
100853
|
}
|
|
100777
|
-
function resolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFile,
|
|
100854
|
+
function resolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFile, reusedNames) {
|
|
100778
100855
|
var _a3, _b2;
|
|
100779
100856
|
if (!typeDirectiveNames.length)
|
|
100780
100857
|
return [];
|
|
100858
|
+
const containingSourceFile = !isString(containingFile) ? containingFile : void 0;
|
|
100781
100859
|
const containingFileName = !isString(containingFile) ? getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory) : containingFile;
|
|
100782
|
-
const redirectedReference =
|
|
100783
|
-
const containingFileMode = !isString(containingFile) ? containingFile.impliedNodeFormat : void 0;
|
|
100860
|
+
const redirectedReference = containingSourceFile && getRedirectReferenceForResolution(containingSourceFile);
|
|
100784
100861
|
(_a3 = tracing) == null ? void 0 : _a3.push(tracing.Phase.Program, "resolveTypeReferenceDirectiveNamesWorker", { containingFileName });
|
|
100785
100862
|
mark("beforeResolveTypeReference");
|
|
100786
|
-
const result = actualResolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFileName, redirectedReference,
|
|
100863
|
+
const result = actualResolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFileName, redirectedReference, options, containingSourceFile, reusedNames);
|
|
100787
100864
|
mark("afterResolveTypeReference");
|
|
100788
100865
|
measure("ResolveTypeReference", "beforeResolveTypeReference", "afterResolveTypeReference");
|
|
100789
100866
|
(_b2 = tracing) == null ? void 0 : _b2.pop();
|
|
@@ -100829,9 +100906,6 @@ ${lanes.join("\n")}
|
|
|
100829
100906
|
}
|
|
100830
100907
|
return libs.length + 2;
|
|
100831
100908
|
}
|
|
100832
|
-
function getResolvedModuleWithFailedLookupLocationsFromCache(moduleName, containingFile, mode) {
|
|
100833
|
-
return moduleResolutionCache && resolveModuleNameFromCache(moduleName, containingFile, moduleResolutionCache, mode);
|
|
100834
|
-
}
|
|
100835
100909
|
function toPath3(fileName) {
|
|
100836
100910
|
return toPath(fileName, currentDirectory, getCanonicalFileName);
|
|
100837
100911
|
}
|
|
@@ -100860,6 +100934,7 @@ ${lanes.join("\n")}
|
|
|
100860
100934
|
return classifiableNames;
|
|
100861
100935
|
}
|
|
100862
100936
|
function resolveModuleNamesReusingOldState(moduleNames, file) {
|
|
100937
|
+
var _a3;
|
|
100863
100938
|
if (structureIsReused === 0 /* Not */ && !file.ambientModuleNames.length) {
|
|
100864
100939
|
return resolveModuleNamesWorker(moduleNames, file, void 0);
|
|
100865
100940
|
}
|
|
@@ -100875,24 +100950,24 @@ ${lanes.join("\n")}
|
|
|
100875
100950
|
let unknownModuleNames;
|
|
100876
100951
|
let result;
|
|
100877
100952
|
let reusedNames;
|
|
100878
|
-
const predictedToResolveToAmbientModuleMarker =
|
|
100953
|
+
const predictedToResolveToAmbientModuleMarker = emptyResolution;
|
|
100879
100954
|
for (let i = 0; i < moduleNames.length; i++) {
|
|
100880
100955
|
const moduleName = moduleNames[i];
|
|
100881
100956
|
if (file === oldSourceFile && !hasInvalidatedResolutions(oldSourceFile.path)) {
|
|
100882
100957
|
const mode = getModeForUsageLocation(file, moduleName);
|
|
100883
|
-
const
|
|
100884
|
-
if (
|
|
100958
|
+
const oldResolution = (_a3 = oldSourceFile.resolvedModules) == null ? void 0 : _a3.get(moduleName.text, mode);
|
|
100959
|
+
if (oldResolution == null ? void 0 : oldResolution.resolvedModule) {
|
|
100885
100960
|
if (isTraceEnabled(options, host)) {
|
|
100886
100961
|
trace(
|
|
100887
100962
|
host,
|
|
100888
|
-
|
|
100963
|
+
oldResolution.resolvedModule.packageId ? Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3 : Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2,
|
|
100889
100964
|
moduleName.text,
|
|
100890
100965
|
getNormalizedAbsolutePath(file.originalFileName, currentDirectory),
|
|
100891
|
-
|
|
100892
|
-
|
|
100966
|
+
oldResolution.resolvedModule.resolvedFileName,
|
|
100967
|
+
oldResolution.resolvedModule.packageId && packageIdToString(oldResolution.resolvedModule.packageId)
|
|
100893
100968
|
);
|
|
100894
100969
|
}
|
|
100895
|
-
(result != null ? result : result = new Array(moduleNames.length))[i] =
|
|
100970
|
+
(result != null ? result : result = new Array(moduleNames.length))[i] = oldResolution;
|
|
100896
100971
|
(reusedNames != null ? reusedNames : reusedNames = []).push(moduleName);
|
|
100897
100972
|
continue;
|
|
100898
100973
|
}
|
|
@@ -100912,18 +100987,14 @@ ${lanes.join("\n")}
|
|
|
100912
100987
|
(unknownModuleNames != null ? unknownModuleNames : unknownModuleNames = []).push(moduleName);
|
|
100913
100988
|
}
|
|
100914
100989
|
}
|
|
100915
|
-
const resolutions = unknownModuleNames && unknownModuleNames.length ? resolveModuleNamesWorker(unknownModuleNames, file,
|
|
100990
|
+
const resolutions = unknownModuleNames && unknownModuleNames.length ? resolveModuleNamesWorker(unknownModuleNames, file, reusedNames) : emptyArray;
|
|
100916
100991
|
if (!result) {
|
|
100917
100992
|
Debug.assert(resolutions.length === moduleNames.length);
|
|
100918
100993
|
return resolutions;
|
|
100919
100994
|
}
|
|
100920
100995
|
let j = 0;
|
|
100921
100996
|
for (let i = 0; i < result.length; i++) {
|
|
100922
|
-
if (result[i]) {
|
|
100923
|
-
if (result[i] === predictedToResolveToAmbientModuleMarker) {
|
|
100924
|
-
result[i] = void 0;
|
|
100925
|
-
}
|
|
100926
|
-
} else {
|
|
100997
|
+
if (!result[i]) {
|
|
100927
100998
|
result[i] = resolutions[j];
|
|
100928
100999
|
j++;
|
|
100929
101000
|
}
|
|
@@ -100947,6 +101018,7 @@ ${lanes.join("\n")}
|
|
|
100947
101018
|
}
|
|
100948
101019
|
}
|
|
100949
101020
|
function resolveTypeReferenceDirectiveNamesReusingOldState(typeDirectiveNames, containingFile) {
|
|
101021
|
+
var _a3;
|
|
100950
101022
|
if (structureIsReused === 0 /* Not */) {
|
|
100951
101023
|
return resolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFile, void 0);
|
|
100952
101024
|
}
|
|
@@ -100955,7 +101027,7 @@ ${lanes.join("\n")}
|
|
|
100955
101027
|
if (oldSourceFile !== containingFile && containingFile.resolvedTypeReferenceDirectiveNames) {
|
|
100956
101028
|
const result2 = [];
|
|
100957
101029
|
for (const typeDirectiveName of typeDirectiveNames) {
|
|
100958
|
-
const resolvedTypeReferenceDirective = containingFile.resolvedTypeReferenceDirectiveNames.get(
|
|
101030
|
+
const resolvedTypeReferenceDirective = containingFile.resolvedTypeReferenceDirectiveNames.get(getTypeReferenceResolutionName(typeDirectiveName), getModeForFileReference(typeDirectiveName, containingFile.impliedNodeFormat));
|
|
100959
101031
|
result2.push(resolvedTypeReferenceDirective);
|
|
100960
101032
|
}
|
|
100961
101033
|
return result2;
|
|
@@ -100969,21 +101041,21 @@ ${lanes.join("\n")}
|
|
|
100969
101041
|
for (let i = 0; i < typeDirectiveNames.length; i++) {
|
|
100970
101042
|
const entry = typeDirectiveNames[i];
|
|
100971
101043
|
if (canReuseResolutions) {
|
|
100972
|
-
const typeDirectiveName =
|
|
101044
|
+
const typeDirectiveName = getTypeReferenceResolutionName(entry);
|
|
100973
101045
|
const mode = getModeForFileReference(entry, containingSourceFile == null ? void 0 : containingSourceFile.impliedNodeFormat);
|
|
100974
|
-
const
|
|
100975
|
-
if (
|
|
101046
|
+
const oldResolution = (_a3 = !isString(containingFile) ? oldSourceFile == null ? void 0 : oldSourceFile.resolvedTypeReferenceDirectiveNames : oldProgram == null ? void 0 : oldProgram.getAutomaticTypeDirectiveResolutions()) == null ? void 0 : _a3.get(typeDirectiveName, mode);
|
|
101047
|
+
if (oldResolution == null ? void 0 : oldResolution.resolvedTypeReferenceDirective) {
|
|
100976
101048
|
if (isTraceEnabled(options, host)) {
|
|
100977
101049
|
trace(
|
|
100978
101050
|
host,
|
|
100979
|
-
|
|
101051
|
+
oldResolution.resolvedTypeReferenceDirective.packageId ? Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3 : Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2,
|
|
100980
101052
|
typeDirectiveName,
|
|
100981
101053
|
!isString(containingFile) ? getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory) : containingFile,
|
|
100982
|
-
|
|
100983
|
-
|
|
101054
|
+
oldResolution.resolvedTypeReferenceDirective.resolvedFileName,
|
|
101055
|
+
oldResolution.resolvedTypeReferenceDirective.packageId && packageIdToString(oldResolution.resolvedTypeReferenceDirective.packageId)
|
|
100984
101056
|
);
|
|
100985
101057
|
}
|
|
100986
|
-
(result != null ? result : result = new Array(typeDirectiveNames.length))[i] =
|
|
101058
|
+
(result != null ? result : result = new Array(typeDirectiveNames.length))[i] = oldResolution;
|
|
100987
101059
|
(reusedNames != null ? reusedNames : reusedNames = []).push(entry);
|
|
100988
101060
|
continue;
|
|
100989
101061
|
}
|
|
@@ -100995,7 +101067,7 @@ ${lanes.join("\n")}
|
|
|
100995
101067
|
const resolutions = resolveTypeReferenceDirectiveNamesWorker(
|
|
100996
101068
|
unknownTypeReferenceDirectiveNames,
|
|
100997
101069
|
containingFile,
|
|
100998
|
-
|
|
101070
|
+
reusedNames
|
|
100999
101071
|
);
|
|
101000
101072
|
if (!result) {
|
|
101001
101073
|
Debug.assert(resolutions.length === typeDirectiveNames.length);
|
|
@@ -101031,7 +101103,7 @@ ${lanes.join("\n")}
|
|
|
101031
101103
|
);
|
|
101032
101104
|
}
|
|
101033
101105
|
function tryReuseStructureFromOldProgram() {
|
|
101034
|
-
var _a3
|
|
101106
|
+
var _a3;
|
|
101035
101107
|
if (!oldProgram) {
|
|
101036
101108
|
return 0 /* Not */;
|
|
101037
101109
|
}
|
|
@@ -101141,19 +101213,19 @@ ${lanes.join("\n")}
|
|
|
101141
101213
|
for (const { oldFile: oldSourceFile, newFile: newSourceFile } of modifiedSourceFiles) {
|
|
101142
101214
|
const moduleNames = getModuleNames(newSourceFile);
|
|
101143
101215
|
const resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFile);
|
|
101144
|
-
const resolutionsChanged = hasChangesInResolutions(moduleNames, newSourceFile, resolutions, oldSourceFile.resolvedModules, moduleResolutionIsEqualTo);
|
|
101216
|
+
const resolutionsChanged = hasChangesInResolutions(moduleNames, newSourceFile, resolutions, oldSourceFile.resolvedModules, moduleResolutionIsEqualTo, moduleResolutionNameAndModeGetter);
|
|
101145
101217
|
if (resolutionsChanged) {
|
|
101146
101218
|
structureIsReused = 1 /* SafeModules */;
|
|
101147
|
-
newSourceFile.resolvedModules = zipToModeAwareCache(newSourceFile, moduleNames, resolutions);
|
|
101219
|
+
newSourceFile.resolvedModules = zipToModeAwareCache(newSourceFile, moduleNames, resolutions, moduleResolutionNameAndModeGetter);
|
|
101148
101220
|
} else {
|
|
101149
101221
|
newSourceFile.resolvedModules = oldSourceFile.resolvedModules;
|
|
101150
101222
|
}
|
|
101151
101223
|
const typesReferenceDirectives = newSourceFile.typeReferenceDirectives;
|
|
101152
101224
|
const typeReferenceResolutions = resolveTypeReferenceDirectiveNamesReusingOldState(typesReferenceDirectives, newSourceFile);
|
|
101153
|
-
const typeReferenceResolutionsChanged = hasChangesInResolutions(typesReferenceDirectives, newSourceFile, typeReferenceResolutions, oldSourceFile.resolvedTypeReferenceDirectiveNames, typeDirectiveIsEqualTo);
|
|
101225
|
+
const typeReferenceResolutionsChanged = hasChangesInResolutions(typesReferenceDirectives, newSourceFile, typeReferenceResolutions, oldSourceFile.resolvedTypeReferenceDirectiveNames, typeDirectiveIsEqualTo, typeReferenceResolutionNameAndModeGetter);
|
|
101154
101226
|
if (typeReferenceResolutionsChanged) {
|
|
101155
101227
|
structureIsReused = 1 /* SafeModules */;
|
|
101156
|
-
newSourceFile.resolvedTypeReferenceDirectiveNames = zipToModeAwareCache(newSourceFile, typesReferenceDirectives, typeReferenceResolutions);
|
|
101228
|
+
newSourceFile.resolvedTypeReferenceDirectiveNames = zipToModeAwareCache(newSourceFile, typesReferenceDirectives, typeReferenceResolutions, typeReferenceResolutionNameAndModeGetter);
|
|
101157
101229
|
} else {
|
|
101158
101230
|
newSourceFile.resolvedTypeReferenceDirectiveNames = oldSourceFile.resolvedTypeReferenceDirectiveNames;
|
|
101159
101231
|
}
|
|
@@ -101161,9 +101233,17 @@ ${lanes.join("\n")}
|
|
|
101161
101233
|
if (structureIsReused !== 2 /* Completely */) {
|
|
101162
101234
|
return structureIsReused;
|
|
101163
101235
|
}
|
|
101164
|
-
if (changesAffectingProgramStructure(oldOptions, options)
|
|
101236
|
+
if (changesAffectingProgramStructure(oldOptions, options)) {
|
|
101165
101237
|
return 1 /* SafeModules */;
|
|
101166
101238
|
}
|
|
101239
|
+
if (host.hasChangedAutomaticTypeDirectiveNames) {
|
|
101240
|
+
if (host.hasChangedAutomaticTypeDirectiveNames())
|
|
101241
|
+
return 1 /* SafeModules */;
|
|
101242
|
+
} else {
|
|
101243
|
+
automaticTypeDirectiveNames = getAutomaticTypeDirectiveNames(options, host);
|
|
101244
|
+
if (!arrayIsEqualTo(oldProgram.getAutomaticTypeDirectiveNames(), automaticTypeDirectiveNames))
|
|
101245
|
+
return 1 /* SafeModules */;
|
|
101246
|
+
}
|
|
101167
101247
|
missingFilePaths = oldProgram.getMissingFilePaths();
|
|
101168
101248
|
Debug.assert(newSourceFiles.length === oldProgram.getSourceFiles().length);
|
|
101169
101249
|
for (const newSourceFile of newSourceFiles) {
|
|
@@ -101187,6 +101267,8 @@ ${lanes.join("\n")}
|
|
|
101187
101267
|
fileReasons = oldProgram.getFileIncludeReasons();
|
|
101188
101268
|
fileProcessingDiagnostics = oldProgram.getFileProcessingDiagnostics();
|
|
101189
101269
|
resolvedTypeReferenceDirectives = oldProgram.getResolvedTypeReferenceDirectives();
|
|
101270
|
+
automaticTypeDirectiveNames = oldProgram.getAutomaticTypeDirectiveNames();
|
|
101271
|
+
automaticTypeDirectiveResolutions = oldProgram.getAutomaticTypeDirectiveResolutions();
|
|
101190
101272
|
sourceFileToPackageName = oldProgram.sourceFileToPackageName;
|
|
101191
101273
|
redirectTargetsMap = oldProgram.redirectTargetsMap;
|
|
101192
101274
|
usesUriStyleNodeCoreModules = oldProgram.usesUriStyleNodeCoreModules;
|
|
@@ -102130,7 +102212,8 @@ ${lanes.join("\n")}
|
|
|
102130
102212
|
}
|
|
102131
102213
|
function processTypeReferenceDirectives(file) {
|
|
102132
102214
|
const typeDirectives = file.typeReferenceDirectives;
|
|
102133
|
-
if (!typeDirectives) {
|
|
102215
|
+
if (!typeDirectives.length) {
|
|
102216
|
+
file.resolvedTypeReferenceDirectiveNames = void 0;
|
|
102134
102217
|
return;
|
|
102135
102218
|
}
|
|
102136
102219
|
const resolutions = resolveTypeReferenceDirectiveNamesReusingOldState(typeDirectives, file);
|
|
@@ -102141,23 +102224,31 @@ ${lanes.join("\n")}
|
|
|
102141
102224
|
setResolvedTypeReferenceDirective(file, fileName, resolvedTypeReferenceDirective, getModeForFileReference(ref, file.impliedNodeFormat));
|
|
102142
102225
|
const mode = ref.resolutionMode || file.impliedNodeFormat;
|
|
102143
102226
|
if (mode && getEmitModuleResolutionKind(options) !== 3 /* Node16 */ && getEmitModuleResolutionKind(options) !== 99 /* NodeNext */) {
|
|
102144
|
-
|
|
102227
|
+
(fileProcessingDiagnostics != null ? fileProcessingDiagnostics : fileProcessingDiagnostics = []).push({
|
|
102228
|
+
kind: 2 /* ResolutionDiagnostics */,
|
|
102229
|
+
diagnostics: [
|
|
102230
|
+
createDiagnosticForRange(file, ref, Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext)
|
|
102231
|
+
]
|
|
102232
|
+
});
|
|
102145
102233
|
}
|
|
102146
102234
|
processTypeReferenceDirective(fileName, mode, resolvedTypeReferenceDirective, { kind: 5 /* TypeReferenceDirective */, file: file.path, index });
|
|
102147
102235
|
}
|
|
102148
102236
|
}
|
|
102149
|
-
function processTypeReferenceDirective(typeReferenceDirective, mode,
|
|
102237
|
+
function processTypeReferenceDirective(typeReferenceDirective, mode, resolution, reason) {
|
|
102150
102238
|
var _a3, _b2;
|
|
102151
|
-
(_a3 = tracing) == null ? void 0 : _a3.push(tracing.Phase.Program, "processTypeReferenceDirective", { directive: typeReferenceDirective, hasResolved: !!resolvedTypeReferenceDirective, refKind: reason.kind, refPath: isReferencedFile(reason) ? reason.file : void 0 });
|
|
102152
|
-
processTypeReferenceDirectiveWorker(typeReferenceDirective, mode,
|
|
102239
|
+
(_a3 = tracing) == null ? void 0 : _a3.push(tracing.Phase.Program, "processTypeReferenceDirective", { directive: typeReferenceDirective, hasResolved: !!resolution.resolvedTypeReferenceDirective, refKind: reason.kind, refPath: isReferencedFile(reason) ? reason.file : void 0 });
|
|
102240
|
+
processTypeReferenceDirectiveWorker(typeReferenceDirective, mode, resolution, reason);
|
|
102153
102241
|
(_b2 = tracing) == null ? void 0 : _b2.pop();
|
|
102154
102242
|
}
|
|
102155
|
-
function processTypeReferenceDirectiveWorker(typeReferenceDirective, mode,
|
|
102156
|
-
|
|
102243
|
+
function processTypeReferenceDirectiveWorker(typeReferenceDirective, mode, resolution, reason) {
|
|
102244
|
+
var _a3;
|
|
102245
|
+
addResolutionDiagnostics(resolution);
|
|
102246
|
+
const previousResolution = (_a3 = resolvedTypeReferenceDirectives.get(typeReferenceDirective, mode)) == null ? void 0 : _a3.resolvedTypeReferenceDirective;
|
|
102157
102247
|
if (previousResolution && previousResolution.primary) {
|
|
102158
102248
|
return;
|
|
102159
102249
|
}
|
|
102160
102250
|
let saveResolution = true;
|
|
102251
|
+
const { resolvedTypeReferenceDirective } = resolution;
|
|
102161
102252
|
if (resolvedTypeReferenceDirective) {
|
|
102162
102253
|
if (resolvedTypeReferenceDirective.isExternalLibraryImport)
|
|
102163
102254
|
currentNodeModulesDepth++;
|
|
@@ -102188,7 +102279,7 @@ ${lanes.join("\n")}
|
|
|
102188
102279
|
addFilePreprocessingFileExplainingDiagnostic(void 0, reason, Diagnostics.Cannot_find_type_definition_file_for_0, [typeReferenceDirective]);
|
|
102189
102280
|
}
|
|
102190
102281
|
if (saveResolution) {
|
|
102191
|
-
resolvedTypeReferenceDirectives.set(typeReferenceDirective, mode,
|
|
102282
|
+
resolvedTypeReferenceDirectives.set(typeReferenceDirective, mode, resolution);
|
|
102192
102283
|
}
|
|
102193
102284
|
}
|
|
102194
102285
|
function pathForLibFile(libFileName) {
|
|
@@ -102237,8 +102328,11 @@ ${lanes.join("\n")}
|
|
|
102237
102328
|
Debug.assert(resolutions.length === moduleNames.length);
|
|
102238
102329
|
const optionsForFile = (useSourceOfProjectReferenceRedirect ? (_a3 = getRedirectReferenceForResolution(file)) == null ? void 0 : _a3.commandLine.options : void 0) || options;
|
|
102239
102330
|
for (let index = 0; index < moduleNames.length; index++) {
|
|
102240
|
-
const resolution = resolutions[index];
|
|
102241
|
-
|
|
102331
|
+
const resolution = resolutions[index].resolvedModule;
|
|
102332
|
+
const moduleName = moduleNames[index].text;
|
|
102333
|
+
const mode = getModeForUsageLocation(file, moduleNames[index]);
|
|
102334
|
+
setResolvedModule(file, moduleName, resolutions[index], mode);
|
|
102335
|
+
addResolutionDiagnosticsFromResolutionOrCache(file, moduleName, resolutions[index], mode);
|
|
102242
102336
|
if (!resolution) {
|
|
102243
102337
|
continue;
|
|
102244
102338
|
}
|
|
@@ -102879,8 +102973,8 @@ ${lanes.join("\n")}
|
|
|
102879
102973
|
if (!symlinks) {
|
|
102880
102974
|
symlinks = createSymlinkCache(currentDirectory, getCanonicalFileName);
|
|
102881
102975
|
}
|
|
102882
|
-
if (files &&
|
|
102883
|
-
symlinks.setSymlinksFromResolutions(files,
|
|
102976
|
+
if (files && automaticTypeDirectiveResolutions && !symlinks.hasProcessedResolutions()) {
|
|
102977
|
+
symlinks.setSymlinksFromResolutions(files, automaticTypeDirectiveResolutions);
|
|
102884
102978
|
}
|
|
102885
102979
|
return symlinks;
|
|
102886
102980
|
}
|
|
@@ -103123,7 +103217,7 @@ ${lanes.join("\n")}
|
|
|
103123
103217
|
}
|
|
103124
103218
|
Debug.fail("should never ask for module name at index higher than possible module name");
|
|
103125
103219
|
}
|
|
103126
|
-
var ForegroundColorEscapeSequences, gutterStyleSequence, gutterSeparator, resetEscapeSequence, ellipsis, halfIndent, indent, inferredTypesContainingFile, plainJSErrors, emitSkippedWithNoDiagnostics;
|
|
103220
|
+
var ForegroundColorEscapeSequences, gutterStyleSequence, gutterSeparator, resetEscapeSequence, ellipsis, halfIndent, indent, emptyResolution, moduleResolutionNameAndModeGetter, typeReferenceResolutionNameAndModeGetter, inferredTypesContainingFile, plainJSErrors, emitSkippedWithNoDiagnostics;
|
|
103127
103221
|
var init_program = __esm({
|
|
103128
103222
|
"src/compiler/program.ts"() {
|
|
103129
103223
|
"use strict";
|
|
@@ -103144,6 +103238,18 @@ ${lanes.join("\n")}
|
|
|
103144
103238
|
ellipsis = "...";
|
|
103145
103239
|
halfIndent = " ";
|
|
103146
103240
|
indent = " ";
|
|
103241
|
+
emptyResolution = {
|
|
103242
|
+
resolvedModule: void 0,
|
|
103243
|
+
resolvedTypeReferenceDirective: void 0
|
|
103244
|
+
};
|
|
103245
|
+
moduleResolutionNameAndModeGetter = {
|
|
103246
|
+
getName: getModuleResolutionName,
|
|
103247
|
+
getMode: (entry, file) => getModeForUsageLocation(file, entry)
|
|
103248
|
+
};
|
|
103249
|
+
typeReferenceResolutionNameAndModeGetter = {
|
|
103250
|
+
getName: getTypeReferenceResolutionName,
|
|
103251
|
+
getMode: (entry, file) => getModeForFileReference(entry, file == null ? void 0 : file.impliedNodeFormat)
|
|
103252
|
+
};
|
|
103147
103253
|
inferredTypesContainingFile = "__inferred type names__.ts";
|
|
103148
103254
|
plainJSErrors = /* @__PURE__ */ new Set([
|
|
103149
103255
|
Diagnostics.Cannot_redeclare_block_scoped_variable_0.code,
|
|
@@ -103350,7 +103456,7 @@ ${lanes.join("\n")}
|
|
|
103350
103456
|
}
|
|
103351
103457
|
}
|
|
103352
103458
|
if (sourceFile.resolvedTypeReferenceDirectiveNames) {
|
|
103353
|
-
sourceFile.resolvedTypeReferenceDirectiveNames.forEach((resolvedTypeReferenceDirective) => {
|
|
103459
|
+
sourceFile.resolvedTypeReferenceDirectiveNames.forEach(({ resolvedTypeReferenceDirective }) => {
|
|
103354
103460
|
if (!resolvedTypeReferenceDirective) {
|
|
103355
103461
|
return;
|
|
103356
103462
|
}
|
|
@@ -103472,6 +103578,26 @@ ${lanes.join("\n")}
|
|
|
103472
103578
|
(state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = /* @__PURE__ */ new Set())).add(path);
|
|
103473
103579
|
}
|
|
103474
103580
|
BuilderState2.updateSignatureOfFile = updateSignatureOfFile;
|
|
103581
|
+
function computeDtsSignature(programOfThisState, sourceFile, cancellationToken, host, onNewSignature) {
|
|
103582
|
+
programOfThisState.emit(
|
|
103583
|
+
sourceFile,
|
|
103584
|
+
(fileName, text, _writeByteOrderMark, _onError, sourceFiles, data) => {
|
|
103585
|
+
Debug.assert(isDeclarationFileName(fileName), `File extension for signature expected to be dts: Got:: ${fileName}`);
|
|
103586
|
+
onNewSignature(computeSignatureWithDiagnostics(
|
|
103587
|
+
programOfThisState,
|
|
103588
|
+
sourceFile,
|
|
103589
|
+
text,
|
|
103590
|
+
host,
|
|
103591
|
+
data
|
|
103592
|
+
), sourceFiles);
|
|
103593
|
+
},
|
|
103594
|
+
cancellationToken,
|
|
103595
|
+
true,
|
|
103596
|
+
void 0,
|
|
103597
|
+
true
|
|
103598
|
+
);
|
|
103599
|
+
}
|
|
103600
|
+
BuilderState2.computeDtsSignature = computeDtsSignature;
|
|
103475
103601
|
function updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, host, useFileVersionAsSignature = state.useFileVersionAsSignature) {
|
|
103476
103602
|
var _a2;
|
|
103477
103603
|
if ((_a2 = state.hasCalledUpdateShapeSignature) == null ? void 0 : _a2.has(sourceFile.resolvedPath))
|
|
@@ -103480,26 +103606,12 @@ ${lanes.join("\n")}
|
|
|
103480
103606
|
const prevSignature = info.signature;
|
|
103481
103607
|
let latestSignature;
|
|
103482
103608
|
if (!sourceFile.isDeclarationFile && !useFileVersionAsSignature) {
|
|
103483
|
-
programOfThisState
|
|
103484
|
-
|
|
103485
|
-
(
|
|
103486
|
-
|
|
103487
|
-
|
|
103488
|
-
|
|
103489
|
-
sourceFile,
|
|
103490
|
-
text,
|
|
103491
|
-
host,
|
|
103492
|
-
data
|
|
103493
|
-
);
|
|
103494
|
-
if (latestSignature !== prevSignature) {
|
|
103495
|
-
updateExportedModules(state, sourceFile, sourceFiles[0].exportedModulesFromDeclarationEmit);
|
|
103496
|
-
}
|
|
103497
|
-
},
|
|
103498
|
-
cancellationToken,
|
|
103499
|
-
true,
|
|
103500
|
-
void 0,
|
|
103501
|
-
true
|
|
103502
|
-
);
|
|
103609
|
+
computeDtsSignature(programOfThisState, sourceFile, cancellationToken, host, (signature, sourceFiles) => {
|
|
103610
|
+
latestSignature = signature;
|
|
103611
|
+
if (latestSignature !== prevSignature) {
|
|
103612
|
+
updateExportedModules(state, sourceFile, sourceFiles[0].exportedModulesFromDeclarationEmit);
|
|
103613
|
+
}
|
|
103614
|
+
});
|
|
103503
103615
|
}
|
|
103504
103616
|
if (latestSignature === void 0) {
|
|
103505
103617
|
latestSignature = sourceFile.version;
|
|
@@ -103523,27 +103635,24 @@ ${lanes.join("\n")}
|
|
|
103523
103635
|
if (!state.exportedModulesMap)
|
|
103524
103636
|
return;
|
|
103525
103637
|
(state.oldExportedModulesMap || (state.oldExportedModulesMap = /* @__PURE__ */ new Map())).set(sourceFile.resolvedPath, state.exportedModulesMap.getValues(sourceFile.resolvedPath) || false);
|
|
103526
|
-
|
|
103527
|
-
state.exportedModulesMap.deleteKey(sourceFile.resolvedPath);
|
|
103528
|
-
return;
|
|
103529
|
-
}
|
|
103530
|
-
let exportedModules;
|
|
103531
|
-
exportedModulesFromDeclarationEmit.forEach((symbol) => addExportedModule(getReferencedFilesFromImportedModuleSymbol(symbol)));
|
|
103638
|
+
const exportedModules = getExportedModules(exportedModulesFromDeclarationEmit);
|
|
103532
103639
|
if (exportedModules) {
|
|
103533
103640
|
state.exportedModulesMap.set(sourceFile.resolvedPath, exportedModules);
|
|
103534
103641
|
} else {
|
|
103535
103642
|
state.exportedModulesMap.deleteKey(sourceFile.resolvedPath);
|
|
103536
103643
|
}
|
|
103537
|
-
function addExportedModule(exportedModulePaths) {
|
|
103538
|
-
if (exportedModulePaths == null ? void 0 : exportedModulePaths.length) {
|
|
103539
|
-
if (!exportedModules) {
|
|
103540
|
-
exportedModules = /* @__PURE__ */ new Set();
|
|
103541
|
-
}
|
|
103542
|
-
exportedModulePaths.forEach((path) => exportedModules.add(path));
|
|
103543
|
-
}
|
|
103544
|
-
}
|
|
103545
103644
|
}
|
|
103546
103645
|
BuilderState2.updateExportedModules = updateExportedModules;
|
|
103646
|
+
function getExportedModules(exportedModulesFromDeclarationEmit) {
|
|
103647
|
+
let exportedModules;
|
|
103648
|
+
exportedModulesFromDeclarationEmit == null ? void 0 : exportedModulesFromDeclarationEmit.forEach(
|
|
103649
|
+
(symbol) => getReferencedFilesFromImportedModuleSymbol(symbol).forEach(
|
|
103650
|
+
(path) => (exportedModules != null ? exportedModules : exportedModules = /* @__PURE__ */ new Set()).add(path)
|
|
103651
|
+
)
|
|
103652
|
+
);
|
|
103653
|
+
return exportedModules;
|
|
103654
|
+
}
|
|
103655
|
+
BuilderState2.getExportedModules = getExportedModules;
|
|
103547
103656
|
function getAllDependencies(state, programOfThisState, sourceFile) {
|
|
103548
103657
|
const compilerOptions = programOfThisState.getCompilerOptions();
|
|
103549
103658
|
if (outFile(compilerOptions)) {
|
|
@@ -103687,9 +103796,9 @@ ${lanes.join("\n")}
|
|
|
103687
103796
|
function hasSameKeys(map1, map2) {
|
|
103688
103797
|
return map1 === map2 || map1 !== void 0 && map2 !== void 0 && map1.size === map2.size && !forEachKey(map1, (key) => !map2.has(key));
|
|
103689
103798
|
}
|
|
103690
|
-
function createBuilderProgramState(newProgram, oldState
|
|
103799
|
+
function createBuilderProgramState(newProgram, oldState) {
|
|
103691
103800
|
var _a2, _b;
|
|
103692
|
-
const state = BuilderState.create(newProgram, oldState,
|
|
103801
|
+
const state = BuilderState.create(newProgram, oldState, false);
|
|
103693
103802
|
state.program = newProgram;
|
|
103694
103803
|
const compilerOptions = newProgram.getCompilerOptions();
|
|
103695
103804
|
state.compilerOptions = compilerOptions;
|
|
@@ -103981,7 +104090,7 @@ ${lanes.join("\n")}
|
|
|
103981
104090
|
sourceFile,
|
|
103982
104091
|
cancellationToken,
|
|
103983
104092
|
host,
|
|
103984
|
-
|
|
104093
|
+
true
|
|
103985
104094
|
);
|
|
103986
104095
|
if (getEmitDeclarations(state.compilerOptions)) {
|
|
103987
104096
|
addToAffectedFilesPendingEmit(state, path, state.compilerOptions.declarationMap ? 24 /* AllDts */ : 8 /* Dts */);
|
|
@@ -104364,7 +104473,7 @@ ${lanes.join("\n")}
|
|
|
104364
104473
|
oldState = void 0;
|
|
104365
104474
|
return oldProgram;
|
|
104366
104475
|
}
|
|
104367
|
-
const state = createBuilderProgramState(newProgram, oldState
|
|
104476
|
+
const state = createBuilderProgramState(newProgram, oldState);
|
|
104368
104477
|
newProgram.getBuildInfo = (bundle) => getBuildInfo2(state, bundle);
|
|
104369
104478
|
newProgram = void 0;
|
|
104370
104479
|
oldProgram = void 0;
|
|
@@ -104861,9 +104970,9 @@ ${lanes.join("\n")}
|
|
|
104861
104970
|
let filesWithInvalidatedResolutions;
|
|
104862
104971
|
let filesWithInvalidatedNonRelativeUnresolvedImports;
|
|
104863
104972
|
const nonRelativeExternalModuleResolutions = createMultiMap();
|
|
104864
|
-
const resolutionsWithFailedLookups =
|
|
104865
|
-
const resolutionsWithOnlyAffectingLocations =
|
|
104866
|
-
const resolvedFileToResolution =
|
|
104973
|
+
const resolutionsWithFailedLookups = /* @__PURE__ */ new Set();
|
|
104974
|
+
const resolutionsWithOnlyAffectingLocations = /* @__PURE__ */ new Set();
|
|
104975
|
+
const resolvedFileToResolution = /* @__PURE__ */ new Map();
|
|
104867
104976
|
const impliedFormatPackageJsons = /* @__PURE__ */ new Map();
|
|
104868
104977
|
let hasChangedAutomaticTypeDirectiveNames = false;
|
|
104869
104978
|
let affectingPathChecksForFile;
|
|
@@ -104900,9 +105009,9 @@ ${lanes.join("\n")}
|
|
|
104900
105009
|
finishRecordingFilesWithChangedResolutions,
|
|
104901
105010
|
startCachingPerDirectoryResolution,
|
|
104902
105011
|
finishCachingPerDirectoryResolution,
|
|
104903
|
-
|
|
104904
|
-
|
|
104905
|
-
|
|
105012
|
+
resolveModuleNameLiterals,
|
|
105013
|
+
resolveTypeReferenceDirectiveReferences,
|
|
105014
|
+
resolveSingleModuleNameWithoutWatching,
|
|
104906
105015
|
removeResolutionsFromProjectReferenceRedirects,
|
|
104907
105016
|
removeResolutionsOfFile,
|
|
104908
105017
|
hasChangedAutomaticTypeDirectiveNames: () => hasChangedAutomaticTypeDirectiveNames,
|
|
@@ -104936,8 +105045,8 @@ ${lanes.join("\n")}
|
|
|
104936
105045
|
resolvedModuleNames.clear();
|
|
104937
105046
|
resolvedTypeReferenceDirectives.clear();
|
|
104938
105047
|
resolvedFileToResolution.clear();
|
|
104939
|
-
resolutionsWithFailedLookups.
|
|
104940
|
-
resolutionsWithOnlyAffectingLocations.
|
|
105048
|
+
resolutionsWithFailedLookups.clear();
|
|
105049
|
+
resolutionsWithOnlyAffectingLocations.clear();
|
|
104941
105050
|
failedLookupChecks = void 0;
|
|
104942
105051
|
startsWithPathChecks = void 0;
|
|
104943
105052
|
isInDirectoryChecks = void 0;
|
|
@@ -105020,14 +105129,16 @@ ${lanes.join("\n")}
|
|
|
105020
105129
|
});
|
|
105021
105130
|
hasChangedAutomaticTypeDirectiveNames = false;
|
|
105022
105131
|
}
|
|
105023
|
-
function resolveModuleName2(moduleName, containingFile, compilerOptions,
|
|
105132
|
+
function resolveModuleName2(moduleName, containingFile, compilerOptions, redirectedReference, mode) {
|
|
105133
|
+
var _a2;
|
|
105134
|
+
const host = ((_a2 = resolutionHost.getCompilerHost) == null ? void 0 : _a2.call(resolutionHost)) || resolutionHost;
|
|
105024
105135
|
const primaryResult = resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference, mode);
|
|
105025
105136
|
if (!resolutionHost.getGlobalCache) {
|
|
105026
105137
|
return primaryResult;
|
|
105027
105138
|
}
|
|
105028
105139
|
const globalCache = resolutionHost.getGlobalCache();
|
|
105029
105140
|
if (globalCache !== void 0 && !isExternalModuleNameRelative(moduleName) && !(primaryResult.resolvedModule && extensionIsTS(primaryResult.resolvedModule.extension))) {
|
|
105030
|
-
const { resolvedModule, failedLookupLocations, affectingLocations } = loadModuleFromGlobalCache(
|
|
105141
|
+
const { resolvedModule, failedLookupLocations, affectingLocations, resolutionDiagnostics } = loadModuleFromGlobalCache(
|
|
105031
105142
|
Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName),
|
|
105032
105143
|
resolutionHost.projectName,
|
|
105033
105144
|
compilerOptions,
|
|
@@ -105037,49 +105148,55 @@ ${lanes.join("\n")}
|
|
|
105037
105148
|
);
|
|
105038
105149
|
if (resolvedModule) {
|
|
105039
105150
|
primaryResult.resolvedModule = resolvedModule;
|
|
105040
|
-
primaryResult.failedLookupLocations.
|
|
105041
|
-
primaryResult.affectingLocations.
|
|
105151
|
+
primaryResult.failedLookupLocations = updateResolutionField(primaryResult.failedLookupLocations, failedLookupLocations);
|
|
105152
|
+
primaryResult.affectingLocations = updateResolutionField(primaryResult.affectingLocations, affectingLocations);
|
|
105153
|
+
primaryResult.resolutionDiagnostics = updateResolutionField(primaryResult.resolutionDiagnostics, resolutionDiagnostics);
|
|
105042
105154
|
return primaryResult;
|
|
105043
105155
|
}
|
|
105044
105156
|
}
|
|
105045
105157
|
return primaryResult;
|
|
105046
105158
|
}
|
|
105047
|
-
function
|
|
105048
|
-
return
|
|
105159
|
+
function createModuleResolutionLoader2(containingFile, redirectedReference, options) {
|
|
105160
|
+
return {
|
|
105161
|
+
nameAndMode: moduleResolutionNameAndModeGetter,
|
|
105162
|
+
resolve: (moduleName, resoluionMode) => resolveModuleName2(
|
|
105163
|
+
moduleName,
|
|
105164
|
+
containingFile,
|
|
105165
|
+
options,
|
|
105166
|
+
redirectedReference,
|
|
105167
|
+
resoluionMode
|
|
105168
|
+
)
|
|
105169
|
+
};
|
|
105049
105170
|
}
|
|
105050
105171
|
function resolveNamesWithLocalCache({
|
|
105051
|
-
|
|
105172
|
+
entries,
|
|
105052
105173
|
containingFile,
|
|
105174
|
+
containingSourceFile,
|
|
105053
105175
|
redirectedReference,
|
|
105176
|
+
options,
|
|
105054
105177
|
perFileCache,
|
|
105178
|
+
reusedNames,
|
|
105055
105179
|
loader,
|
|
105056
105180
|
getResolutionWithResolvedFileName,
|
|
105057
105181
|
shouldRetryResolution,
|
|
105058
|
-
|
|
105059
|
-
resolutionInfo,
|
|
105060
|
-
logChanges,
|
|
105061
|
-
containingSourceFile,
|
|
105062
|
-
containingSourceFileMode
|
|
105182
|
+
logChanges
|
|
105063
105183
|
}) {
|
|
105064
|
-
var _a2
|
|
105184
|
+
var _a2;
|
|
105065
105185
|
const path = resolutionHost.toPath(containingFile);
|
|
105066
105186
|
const resolutionsInFile = perFileCache.get(path) || perFileCache.set(path, createModeAwareCache()).get(path);
|
|
105067
105187
|
const resolvedModules = [];
|
|
105068
|
-
const compilerOptions = resolutionHost.getCompilationSettings();
|
|
105069
105188
|
const hasInvalidatedNonRelativeUnresolvedImport = logChanges && isFileWithInvalidatedNonRelativeUnresolvedImports(path);
|
|
105070
105189
|
const program = resolutionHost.getCurrentProgram();
|
|
105071
105190
|
const oldRedirect = program && program.getResolvedProjectReferenceToRedirect(containingFile);
|
|
105072
105191
|
const unmatchedRedirects = oldRedirect ? !redirectedReference || redirectedReference.sourceFile.path !== oldRedirect.sourceFile.path : !!redirectedReference;
|
|
105073
105192
|
const seenNamesInFile = createModeAwareCache();
|
|
105074
|
-
|
|
105075
|
-
|
|
105076
|
-
const
|
|
105077
|
-
const mode = !isString(entry) ? isStringLiteralLike(entry) ? getModeForUsageLocation(containingSourceFile, entry) : getModeForFileReference(entry, containingSourceFileMode) : containingSourceFile ? getModeForResolutionAtIndex(containingSourceFile, i) : void 0;
|
|
105078
|
-
i++;
|
|
105193
|
+
for (const entry of entries) {
|
|
105194
|
+
const name = loader.nameAndMode.getName(entry);
|
|
105195
|
+
const mode = loader.nameAndMode.getMode(entry, containingSourceFile);
|
|
105079
105196
|
let resolution = resolutionsInFile.get(name, mode);
|
|
105080
105197
|
if (!seenNamesInFile.has(name, mode) && unmatchedRedirects || !resolution || resolution.isInvalidated || hasInvalidatedNonRelativeUnresolvedImport && !isExternalModuleNameRelative(name) && shouldRetryResolution(resolution)) {
|
|
105081
105198
|
const existingResolution = resolution;
|
|
105082
|
-
resolution = loader(name,
|
|
105199
|
+
resolution = loader.resolve(name, mode);
|
|
105083
105200
|
if (resolutionHost.onDiscoveredSymlink && resolutionIsSymlink(resolution)) {
|
|
105084
105201
|
resolutionHost.onDiscoveredSymlink();
|
|
105085
105202
|
}
|
|
@@ -105093,12 +105210,12 @@ ${lanes.join("\n")}
|
|
|
105093
105210
|
logChanges = false;
|
|
105094
105211
|
}
|
|
105095
105212
|
} else {
|
|
105096
|
-
const host = ((
|
|
105097
|
-
if (isTraceEnabled(
|
|
105213
|
+
const host = ((_a2 = resolutionHost.getCompilerHost) == null ? void 0 : _a2.call(resolutionHost)) || resolutionHost;
|
|
105214
|
+
if (isTraceEnabled(options, host) && !seenNamesInFile.has(name, mode)) {
|
|
105098
105215
|
const resolved = getResolutionWithResolvedFileName(resolution);
|
|
105099
105216
|
trace(
|
|
105100
105217
|
host,
|
|
105101
|
-
|
|
105218
|
+
perFileCache === resolvedModuleNames ? (resolved == null ? void 0 : resolved.resolvedFileName) ? resolved.packageId ? Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3 : Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2 : Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved : (resolved == null ? void 0 : resolved.resolvedFileName) ? resolved.packageId ? Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3 : Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_successfully_resolved_to_2 : Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_of_old_program_it_was_not_resolved,
|
|
105102
105219
|
name,
|
|
105103
105220
|
containingFile,
|
|
105104
105221
|
resolved == null ? void 0 : resolved.resolvedFileName,
|
|
@@ -105108,19 +105225,16 @@ ${lanes.join("\n")}
|
|
|
105108
105225
|
}
|
|
105109
105226
|
Debug.assert(resolution !== void 0 && !resolution.isInvalidated);
|
|
105110
105227
|
seenNamesInFile.set(name, mode, true);
|
|
105111
|
-
resolvedModules.push(
|
|
105112
|
-
}
|
|
105113
|
-
if (resolutionInfo && (loader === resolveTypeReferenceDirective2 || containingSourceFile)) {
|
|
105114
|
-
(_c = resolutionInfo.reusedNames) == null ? void 0 : _c.forEach((entry) => seenNamesInFile.set(
|
|
105115
|
-
getResolutionName(entry),
|
|
105116
|
-
!isString(entry) && isStringLiteralLike(entry) ? getModeForUsageLocation(containingSourceFile, entry) : getModeForFileReference(entry, containingSourceFileMode),
|
|
105117
|
-
true
|
|
105118
|
-
));
|
|
105119
|
-
reusedNames = void 0;
|
|
105228
|
+
resolvedModules.push(resolution);
|
|
105120
105229
|
}
|
|
105230
|
+
reusedNames == null ? void 0 : reusedNames.forEach((entry) => seenNamesInFile.set(
|
|
105231
|
+
loader.nameAndMode.getName(entry),
|
|
105232
|
+
loader.nameAndMode.getMode(entry, containingSourceFile),
|
|
105233
|
+
true
|
|
105234
|
+
));
|
|
105121
105235
|
if (resolutionsInFile.size() !== seenNamesInFile.size()) {
|
|
105122
105236
|
resolutionsInFile.forEach((resolution, name, mode) => {
|
|
105123
|
-
if (!seenNamesInFile.has(name, mode)
|
|
105237
|
+
if (!seenNamesInFile.has(name, mode)) {
|
|
105124
105238
|
stopWatchFailedLookupLocationOfResolution(resolution, path, getResolutionWithResolvedFileName);
|
|
105125
105239
|
resolutionsInFile.delete(name, mode);
|
|
105126
105240
|
}
|
|
@@ -105145,39 +105259,53 @@ ${lanes.join("\n")}
|
|
|
105145
105259
|
return oldResult.resolvedFileName === newResult.resolvedFileName;
|
|
105146
105260
|
}
|
|
105147
105261
|
}
|
|
105148
|
-
function
|
|
105262
|
+
function resolveTypeReferenceDirectiveReferences(typeDirectiveReferences, containingFile, redirectedReference, options, containingSourceFile, reusedNames) {
|
|
105263
|
+
var _a2;
|
|
105149
105264
|
return resolveNamesWithLocalCache({
|
|
105150
|
-
|
|
105265
|
+
entries: typeDirectiveReferences,
|
|
105151
105266
|
containingFile,
|
|
105267
|
+
containingSourceFile,
|
|
105152
105268
|
redirectedReference,
|
|
105269
|
+
options,
|
|
105270
|
+
reusedNames,
|
|
105153
105271
|
perFileCache: resolvedTypeReferenceDirectives,
|
|
105154
|
-
loader:
|
|
105272
|
+
loader: createTypeReferenceResolutionLoader(
|
|
105273
|
+
containingFile,
|
|
105274
|
+
redirectedReference,
|
|
105275
|
+
options,
|
|
105276
|
+
((_a2 = resolutionHost.getCompilerHost) == null ? void 0 : _a2.call(resolutionHost)) || resolutionHost,
|
|
105277
|
+
typeReferenceDirectiveResolutionCache
|
|
105278
|
+
),
|
|
105155
105279
|
getResolutionWithResolvedFileName: getResolvedTypeReferenceDirective2,
|
|
105156
|
-
shouldRetryResolution: (resolution) => resolution.resolvedTypeReferenceDirective === void 0
|
|
105157
|
-
containingSourceFileMode: containingFileMode,
|
|
105158
|
-
resolutionInfo
|
|
105280
|
+
shouldRetryResolution: (resolution) => resolution.resolvedTypeReferenceDirective === void 0
|
|
105159
105281
|
});
|
|
105160
105282
|
}
|
|
105161
|
-
function
|
|
105283
|
+
function resolveModuleNameLiterals(moduleLiterals, containingFile, redirectedReference, options, containingSourceFile, reusedNames) {
|
|
105162
105284
|
return resolveNamesWithLocalCache({
|
|
105163
|
-
|
|
105285
|
+
entries: moduleLiterals,
|
|
105164
105286
|
containingFile,
|
|
105287
|
+
containingSourceFile,
|
|
105165
105288
|
redirectedReference,
|
|
105289
|
+
options,
|
|
105290
|
+
reusedNames,
|
|
105166
105291
|
perFileCache: resolvedModuleNames,
|
|
105167
|
-
loader:
|
|
105292
|
+
loader: createModuleResolutionLoader2(
|
|
105293
|
+
containingFile,
|
|
105294
|
+
redirectedReference,
|
|
105295
|
+
options
|
|
105296
|
+
),
|
|
105168
105297
|
getResolutionWithResolvedFileName: getResolvedModule2,
|
|
105169
105298
|
shouldRetryResolution: (resolution) => !resolution.resolvedModule || !resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension),
|
|
105170
|
-
|
|
105171
|
-
resolutionInfo,
|
|
105172
|
-
logChanges: logChangesWhenResolvingModule,
|
|
105173
|
-
containingSourceFile
|
|
105299
|
+
logChanges: logChangesWhenResolvingModule
|
|
105174
105300
|
});
|
|
105175
105301
|
}
|
|
105176
|
-
function
|
|
105177
|
-
const
|
|
105178
|
-
|
|
105179
|
-
|
|
105180
|
-
|
|
105302
|
+
function resolveSingleModuleNameWithoutWatching(moduleName, containingFile) {
|
|
105303
|
+
const path = resolutionHost.toPath(containingFile);
|
|
105304
|
+
const resolutionsInFile = resolvedModuleNames.get(path);
|
|
105305
|
+
const resolution = resolutionsInFile == null ? void 0 : resolutionsInFile.get(moduleName, void 0);
|
|
105306
|
+
if (resolution && !resolution.isInvalidated)
|
|
105307
|
+
return resolution;
|
|
105308
|
+
return resolveModuleName2(moduleName, containingFile, resolutionHost.getCompilationSettings());
|
|
105181
105309
|
}
|
|
105182
105310
|
function isNodeModulesAtTypesDirectory(dirPath) {
|
|
105183
105311
|
return endsWith(dirPath, "/node_modules/@types");
|
|
@@ -105235,12 +105363,13 @@ ${lanes.join("\n")}
|
|
|
105235
105363
|
return fileExtensionIsOneOf(path, failedLookupDefaultExtensions);
|
|
105236
105364
|
}
|
|
105237
105365
|
function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, filePath, getResolutionWithResolvedFileName) {
|
|
105366
|
+
var _a2, _b;
|
|
105238
105367
|
if (resolution.refCount) {
|
|
105239
105368
|
resolution.refCount++;
|
|
105240
105369
|
Debug.assertIsDefined(resolution.files);
|
|
105241
105370
|
} else {
|
|
105242
105371
|
resolution.refCount = 1;
|
|
105243
|
-
Debug.assert(
|
|
105372
|
+
Debug.assert(!((_a2 = resolution.files) == null ? void 0 : _a2.size));
|
|
105244
105373
|
if (isExternalModuleNameRelative(name)) {
|
|
105245
105374
|
watchFailedLookupLocationOfResolution(resolution);
|
|
105246
105375
|
} else {
|
|
@@ -105248,48 +105377,54 @@ ${lanes.join("\n")}
|
|
|
105248
105377
|
}
|
|
105249
105378
|
const resolved = getResolutionWithResolvedFileName(resolution);
|
|
105250
105379
|
if (resolved && resolved.resolvedFileName) {
|
|
105251
|
-
|
|
105380
|
+
const key = resolutionHost.toPath(resolved.resolvedFileName);
|
|
105381
|
+
let resolutions = resolvedFileToResolution.get(key);
|
|
105382
|
+
if (!resolutions)
|
|
105383
|
+
resolvedFileToResolution.set(key, resolutions = /* @__PURE__ */ new Set());
|
|
105384
|
+
resolutions.add(resolution);
|
|
105252
105385
|
}
|
|
105253
105386
|
}
|
|
105254
|
-
(resolution.files
|
|
105387
|
+
((_b = resolution.files) != null ? _b : resolution.files = /* @__PURE__ */ new Set()).add(filePath);
|
|
105255
105388
|
}
|
|
105256
105389
|
function watchFailedLookupLocationOfResolution(resolution) {
|
|
105257
105390
|
Debug.assert(!!resolution.refCount);
|
|
105258
105391
|
const { failedLookupLocations, affectingLocations } = resolution;
|
|
105259
|
-
if (!failedLookupLocations.length && !affectingLocations.length)
|
|
105392
|
+
if (!(failedLookupLocations == null ? void 0 : failedLookupLocations.length) && !(affectingLocations == null ? void 0 : affectingLocations.length))
|
|
105260
105393
|
return;
|
|
105261
|
-
if (failedLookupLocations.length)
|
|
105262
|
-
resolutionsWithFailedLookups.
|
|
105394
|
+
if (failedLookupLocations == null ? void 0 : failedLookupLocations.length)
|
|
105395
|
+
resolutionsWithFailedLookups.add(resolution);
|
|
105263
105396
|
let setAtRoot = false;
|
|
105264
|
-
|
|
105265
|
-
const
|
|
105266
|
-
|
|
105267
|
-
|
|
105268
|
-
|
|
105269
|
-
|
|
105270
|
-
|
|
105271
|
-
|
|
105272
|
-
|
|
105273
|
-
|
|
105274
|
-
|
|
105275
|
-
|
|
105276
|
-
|
|
105277
|
-
|
|
105397
|
+
if (failedLookupLocations) {
|
|
105398
|
+
for (const failedLookupLocation of failedLookupLocations) {
|
|
105399
|
+
const failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation);
|
|
105400
|
+
const toWatch = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath);
|
|
105401
|
+
if (toWatch) {
|
|
105402
|
+
const { dir, dirPath, nonRecursive } = toWatch;
|
|
105403
|
+
if (!isPathWithDefaultFailedLookupExtension(failedLookupLocationPath)) {
|
|
105404
|
+
const refCount = customFailedLookupPaths.get(failedLookupLocationPath) || 0;
|
|
105405
|
+
customFailedLookupPaths.set(failedLookupLocationPath, refCount + 1);
|
|
105406
|
+
}
|
|
105407
|
+
if (dirPath === rootPath) {
|
|
105408
|
+
Debug.assert(!nonRecursive);
|
|
105409
|
+
setAtRoot = true;
|
|
105410
|
+
} else {
|
|
105411
|
+
setDirectoryWatcher(dir, dirPath, nonRecursive);
|
|
105412
|
+
}
|
|
105278
105413
|
}
|
|
105279
105414
|
}
|
|
105415
|
+
if (setAtRoot) {
|
|
105416
|
+
setDirectoryWatcher(rootDir, rootPath, true);
|
|
105417
|
+
}
|
|
105280
105418
|
}
|
|
105281
|
-
|
|
105282
|
-
setDirectoryWatcher(rootDir, rootPath, true);
|
|
105283
|
-
}
|
|
105284
|
-
watchAffectingLocationsOfResolution(resolution, !failedLookupLocations.length);
|
|
105419
|
+
watchAffectingLocationsOfResolution(resolution, !(failedLookupLocations == null ? void 0 : failedLookupLocations.length));
|
|
105285
105420
|
}
|
|
105286
105421
|
function watchAffectingLocationsOfResolution(resolution, addToResolutionsWithOnlyAffectingLocations) {
|
|
105287
105422
|
Debug.assert(!!resolution.refCount);
|
|
105288
105423
|
const { affectingLocations } = resolution;
|
|
105289
|
-
if (!affectingLocations.length)
|
|
105424
|
+
if (!(affectingLocations == null ? void 0 : affectingLocations.length))
|
|
105290
105425
|
return;
|
|
105291
105426
|
if (addToResolutionsWithOnlyAffectingLocations)
|
|
105292
|
-
resolutionsWithOnlyAffectingLocations.
|
|
105427
|
+
resolutionsWithOnlyAffectingLocations.add(resolution);
|
|
105293
105428
|
for (const affectingLocation of affectingLocations) {
|
|
105294
105429
|
createFileWatcherOfAffectingLocation(affectingLocation, true);
|
|
105295
105430
|
}
|
|
@@ -105368,17 +105503,20 @@ ${lanes.join("\n")}
|
|
|
105368
105503
|
}
|
|
105369
105504
|
}
|
|
105370
105505
|
function stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName) {
|
|
105371
|
-
|
|
105506
|
+
Debug.checkDefined(resolution.files).delete(filePath);
|
|
105372
105507
|
resolution.refCount--;
|
|
105373
105508
|
if (resolution.refCount) {
|
|
105374
105509
|
return;
|
|
105375
105510
|
}
|
|
105376
105511
|
const resolved = getResolutionWithResolvedFileName(resolution);
|
|
105377
105512
|
if (resolved && resolved.resolvedFileName) {
|
|
105378
|
-
|
|
105513
|
+
const key = resolutionHost.toPath(resolved.resolvedFileName);
|
|
105514
|
+
const resolutions = resolvedFileToResolution.get(key);
|
|
105515
|
+
if ((resolutions == null ? void 0 : resolutions.delete(resolution)) && !resolutions.size)
|
|
105516
|
+
resolvedFileToResolution.delete(key);
|
|
105379
105517
|
}
|
|
105380
105518
|
const { failedLookupLocations, affectingLocations } = resolution;
|
|
105381
|
-
if (
|
|
105519
|
+
if (resolutionsWithFailedLookups.delete(resolution)) {
|
|
105382
105520
|
let removeAtRoot = false;
|
|
105383
105521
|
for (const failedLookupLocation of failedLookupLocations) {
|
|
105384
105522
|
const failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation);
|
|
@@ -105404,12 +105542,14 @@ ${lanes.join("\n")}
|
|
|
105404
105542
|
if (removeAtRoot) {
|
|
105405
105543
|
removeDirectoryWatcher(rootPath);
|
|
105406
105544
|
}
|
|
105407
|
-
} else if (affectingLocations.length) {
|
|
105408
|
-
|
|
105545
|
+
} else if (affectingLocations == null ? void 0 : affectingLocations.length) {
|
|
105546
|
+
resolutionsWithOnlyAffectingLocations.delete(resolution);
|
|
105409
105547
|
}
|
|
105410
|
-
|
|
105411
|
-
const
|
|
105412
|
-
|
|
105548
|
+
if (affectingLocations) {
|
|
105549
|
+
for (const affectingLocation of affectingLocations) {
|
|
105550
|
+
const watcher = fileWatchesOfAffectingLocations.get(affectingLocation);
|
|
105551
|
+
watcher.resolutions--;
|
|
105552
|
+
}
|
|
105413
105553
|
}
|
|
105414
105554
|
}
|
|
105415
105555
|
function removeDirectoryWatcher(dirPath) {
|
|
@@ -105451,15 +105591,15 @@ ${lanes.join("\n")}
|
|
|
105451
105591
|
if (!resolutions)
|
|
105452
105592
|
return false;
|
|
105453
105593
|
let invalidated = false;
|
|
105454
|
-
|
|
105594
|
+
resolutions.forEach((resolution) => {
|
|
105455
105595
|
if (resolution.isInvalidated || !canInvalidate(resolution))
|
|
105456
|
-
|
|
105596
|
+
return;
|
|
105457
105597
|
resolution.isInvalidated = invalidated = true;
|
|
105458
105598
|
for (const containingFilePath of Debug.checkDefined(resolution.files)) {
|
|
105459
105599
|
(filesWithInvalidatedResolutions != null ? filesWithInvalidatedResolutions : filesWithInvalidatedResolutions = /* @__PURE__ */ new Set()).add(containingFilePath);
|
|
105460
105600
|
hasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames || endsWith(containingFilePath, inferredTypesContainingFile);
|
|
105461
105601
|
}
|
|
105462
|
-
}
|
|
105602
|
+
});
|
|
105463
105603
|
return invalidated;
|
|
105464
105604
|
}
|
|
105465
105605
|
function invalidateResolutionOfFile(filePath) {
|
|
@@ -105531,17 +105671,19 @@ ${lanes.join("\n")}
|
|
|
105531
105671
|
return invalidated;
|
|
105532
105672
|
}
|
|
105533
105673
|
function canInvalidateFailedLookupResolution(resolution) {
|
|
105674
|
+
var _a2;
|
|
105534
105675
|
if (canInvalidatedFailedLookupResolutionWithAffectingLocation(resolution))
|
|
105535
105676
|
return true;
|
|
105536
105677
|
if (!failedLookupChecks && !startsWithPathChecks && !isInDirectoryChecks)
|
|
105537
105678
|
return false;
|
|
105538
|
-
return resolution.failedLookupLocations.some((location) => isInvalidatedFailedLookup(resolutionHost.toPath(location)));
|
|
105679
|
+
return (_a2 = resolution.failedLookupLocations) == null ? void 0 : _a2.some((location) => isInvalidatedFailedLookup(resolutionHost.toPath(location)));
|
|
105539
105680
|
}
|
|
105540
105681
|
function isInvalidatedFailedLookup(locationPath) {
|
|
105541
105682
|
return (failedLookupChecks == null ? void 0 : failedLookupChecks.has(locationPath)) || firstDefinedIterator((startsWithPathChecks == null ? void 0 : startsWithPathChecks.keys()) || emptyIterator, (fileOrDirectoryPath) => startsWith(locationPath, fileOrDirectoryPath) ? true : void 0) || firstDefinedIterator((isInDirectoryChecks == null ? void 0 : isInDirectoryChecks.keys()) || emptyIterator, (fileOrDirectoryPath) => isInDirectoryPath(fileOrDirectoryPath, locationPath) ? true : void 0);
|
|
105542
105683
|
}
|
|
105543
105684
|
function canInvalidatedFailedLookupResolutionWithAffectingLocation(resolution) {
|
|
105544
|
-
|
|
105685
|
+
var _a2;
|
|
105686
|
+
return !!affectingPathChecks && ((_a2 = resolution.affectingLocations) == null ? void 0 : _a2.some((location) => affectingPathChecks.has(location)));
|
|
105545
105687
|
}
|
|
105546
105688
|
function closeTypeRootsWatch() {
|
|
105547
105689
|
clearMap(typeRootsWatches, closeFileWatcher);
|
|
@@ -106022,7 +106164,6 @@ ${lanes.join("\n")}
|
|
|
106022
106164
|
getEnvironmentVariable: maybeBind(host, host.getEnvironmentVariable) || (() => ""),
|
|
106023
106165
|
createHash: maybeBind(host, host.createHash),
|
|
106024
106166
|
readDirectory: maybeBind(host, host.readDirectory),
|
|
106025
|
-
disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
|
|
106026
106167
|
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit
|
|
106027
106168
|
};
|
|
106028
106169
|
return compilerHost;
|
|
@@ -106089,7 +106230,6 @@ ${lanes.join("\n")}
|
|
|
106089
106230
|
writeFile: (path, data, writeByteOrderMark) => system.writeFile(path, data, writeByteOrderMark),
|
|
106090
106231
|
createHash: maybeBind(system, system.createHash),
|
|
106091
106232
|
createProgram: createProgram2 || createEmitAndSemanticDiagnosticsBuilderProgram,
|
|
106092
|
-
disableUseFileVersionAsSignature: system.disableUseFileVersionAsSignature,
|
|
106093
106233
|
storeFilesChangingSignatureDuringEmit: system.storeFilesChangingSignatureDuringEmit,
|
|
106094
106234
|
now: maybeBind(system, system.now)
|
|
106095
106235
|
};
|
|
@@ -106230,7 +106370,6 @@ ${lanes.join("\n")}
|
|
|
106230
106370
|
function createIncrementalCompilerHost(options, system = sys) {
|
|
106231
106371
|
const host = createCompilerHostWorker(options, void 0, system);
|
|
106232
106372
|
host.createHash = maybeBind(system, system.createHash);
|
|
106233
|
-
host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
|
|
106234
106373
|
host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
|
|
106235
106374
|
setGetSourceFileAsHashVersioned(host);
|
|
106236
106375
|
changeCompilerHostLikeToUseCache(host, (fileName) => toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName));
|
|
@@ -106346,10 +106485,18 @@ ${lanes.join("\n")}
|
|
|
106346
106485
|
configFileName ? getDirectoryPath(getNormalizedAbsolutePath(configFileName, currentDirectory)) : currentDirectory,
|
|
106347
106486
|
false
|
|
106348
106487
|
);
|
|
106349
|
-
compilerHost.
|
|
106350
|
-
compilerHost.
|
|
106351
|
-
compilerHost.
|
|
106352
|
-
|
|
106488
|
+
compilerHost.resolveModuleNameLiterals = maybeBind(host, host.resolveModuleNameLiterals);
|
|
106489
|
+
compilerHost.resolveModuleNames = maybeBind(host, host.resolveModuleNames);
|
|
106490
|
+
if (!compilerHost.resolveModuleNameLiterals && !compilerHost.resolveModuleNames) {
|
|
106491
|
+
compilerHost.resolveModuleNameLiterals = resolutionCache.resolveModuleNameLiterals.bind(resolutionCache);
|
|
106492
|
+
}
|
|
106493
|
+
compilerHost.resolveTypeReferenceDirectiveReferences = maybeBind(host, host.resolveTypeReferenceDirectiveReferences);
|
|
106494
|
+
compilerHost.resolveTypeReferenceDirectives = maybeBind(host, host.resolveTypeReferenceDirectives);
|
|
106495
|
+
if (!compilerHost.resolveTypeReferenceDirectiveReferences && !compilerHost.resolveTypeReferenceDirectives) {
|
|
106496
|
+
compilerHost.resolveTypeReferenceDirectiveReferences = resolutionCache.resolveTypeReferenceDirectiveReferences.bind(resolutionCache);
|
|
106497
|
+
}
|
|
106498
|
+
compilerHost.getModuleResolutionCache = host.resolveModuleNameLiterals || host.resolveModuleNames ? maybeBind(host, host.getModuleResolutionCache) : () => resolutionCache.getModuleResolutionCache();
|
|
106499
|
+
const userProvidedResolution = !!host.resolveModuleNameLiterals || !!host.resolveTypeReferenceDirectiveReferences || !!host.resolveModuleNames || !!host.resolveTypeReferenceDirectives;
|
|
106353
106500
|
const customHasInvalidatedResolutions = userProvidedResolution ? maybeBind(host, host.hasInvalidatedResolutions) || returnTrue : returnFalse;
|
|
106354
106501
|
builderProgram = readBuilderProgram(compilerOptions, compilerHost);
|
|
106355
106502
|
synchronizeProgram();
|
|
@@ -107020,19 +107167,38 @@ ${lanes.join("\n")}
|
|
|
107020
107167
|
const compilerHost = createCompilerHostFromProgramHost(host, () => state.projectCompilerOptions);
|
|
107021
107168
|
setGetSourceFileAsHashVersioned(compilerHost);
|
|
107022
107169
|
compilerHost.getParsedCommandLine = (fileName) => parseConfigFile(state, fileName, toResolvedConfigFilePath(state, fileName));
|
|
107170
|
+
compilerHost.resolveModuleNameLiterals = maybeBind(host, host.resolveModuleNameLiterals);
|
|
107171
|
+
compilerHost.resolveTypeReferenceDirectiveReferences = maybeBind(host, host.resolveTypeReferenceDirectiveReferences);
|
|
107023
107172
|
compilerHost.resolveModuleNames = maybeBind(host, host.resolveModuleNames);
|
|
107024
107173
|
compilerHost.resolveTypeReferenceDirectives = maybeBind(host, host.resolveTypeReferenceDirectives);
|
|
107025
107174
|
compilerHost.getModuleResolutionCache = maybeBind(host, host.getModuleResolutionCache);
|
|
107026
|
-
|
|
107027
|
-
|
|
107028
|
-
|
|
107029
|
-
|
|
107030
|
-
|
|
107175
|
+
let moduleResolutionCache, typeReferenceDirectiveResolutionCache;
|
|
107176
|
+
if (!compilerHost.resolveModuleNameLiterals && !compilerHost.resolveModuleNames) {
|
|
107177
|
+
moduleResolutionCache = createModuleResolutionCache(currentDirectory, getCanonicalFileName);
|
|
107178
|
+
compilerHost.resolveModuleNameLiterals = (moduleNames, containingFile, redirectedReference, options2, containingSourceFile) => loadWithModeAwareCache(
|
|
107179
|
+
moduleNames,
|
|
107180
|
+
containingFile,
|
|
107181
|
+
redirectedReference,
|
|
107182
|
+
options2,
|
|
107183
|
+
containingSourceFile,
|
|
107184
|
+
host,
|
|
107185
|
+
moduleResolutionCache,
|
|
107186
|
+
createModuleResolutionLoader
|
|
107187
|
+
);
|
|
107031
107188
|
compilerHost.getModuleResolutionCache = () => moduleResolutionCache;
|
|
107032
107189
|
}
|
|
107033
|
-
if (!compilerHost.resolveTypeReferenceDirectives) {
|
|
107034
|
-
|
|
107035
|
-
compilerHost.
|
|
107190
|
+
if (!compilerHost.resolveTypeReferenceDirectiveReferences && !compilerHost.resolveTypeReferenceDirectives) {
|
|
107191
|
+
typeReferenceDirectiveResolutionCache = createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, void 0, moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache());
|
|
107192
|
+
compilerHost.resolveTypeReferenceDirectiveReferences = (typeDirectiveNames, containingFile, redirectedReference, options2, containingSourceFile) => loadWithModeAwareCache(
|
|
107193
|
+
typeDirectiveNames,
|
|
107194
|
+
containingFile,
|
|
107195
|
+
redirectedReference,
|
|
107196
|
+
options2,
|
|
107197
|
+
containingSourceFile,
|
|
107198
|
+
host,
|
|
107199
|
+
typeReferenceDirectiveResolutionCache,
|
|
107200
|
+
createTypeReferenceResolutionLoader
|
|
107201
|
+
);
|
|
107036
107202
|
}
|
|
107037
107203
|
compilerHost.getBuildInfo = (fileName, configFilePath) => getBuildInfo3(state, fileName, toResolvedConfigFilePath(state, configFilePath), void 0);
|
|
107038
107204
|
const { watchFile: watchFile2, watchDirectory, writeLog } = createWatchFactory(hostWithWatch, options);
|
|
@@ -114067,13 +114233,14 @@ ${lanes.join("\n")}
|
|
|
114067
114233
|
return ensurePathIsNonModuleName(combineNormal(pathA, pathB));
|
|
114068
114234
|
}
|
|
114069
114235
|
function getSourceFileToImport(importedModuleSymbol, importLiteral, importingSourceFile, program, host, oldToNew) {
|
|
114236
|
+
var _a2;
|
|
114070
114237
|
if (importedModuleSymbol) {
|
|
114071
114238
|
const oldFileName = find(importedModuleSymbol.declarations, isSourceFile).fileName;
|
|
114072
114239
|
const newFileName = oldToNew(oldFileName);
|
|
114073
114240
|
return newFileName === void 0 ? { newFileName: oldFileName, updated: false } : { newFileName, updated: true };
|
|
114074
114241
|
} else {
|
|
114075
114242
|
const mode = getModeForUsageLocation(importingSourceFile, importLiteral);
|
|
114076
|
-
const resolved = host.resolveModuleNames ?
|
|
114243
|
+
const resolved = host.resolveModuleNameLiterals || !host.resolveModuleNames ? (_a2 = importingSourceFile.resolvedModules) == null ? void 0 : _a2.get(importLiteral.text, mode) : host.getResolvedModuleWithFailedLookupLocationsFromCache && host.getResolvedModuleWithFailedLookupLocationsFromCache(importLiteral.text, importingSourceFile.fileName, mode);
|
|
114077
114244
|
return getSourceFileToImportFromResolved(importLiteral, resolved, oldToNew, program.getSourceFiles());
|
|
114078
114245
|
}
|
|
114079
114246
|
}
|
|
@@ -116394,6 +116561,8 @@ ${lanes.join("\n")}
|
|
|
116394
116561
|
getModuleResolutionCache: maybeBind(host, host.getModuleResolutionCache),
|
|
116395
116562
|
createHash: maybeBind(host, host.createHash),
|
|
116396
116563
|
resolveTypeReferenceDirectives: maybeBind(host, host.resolveTypeReferenceDirectives),
|
|
116564
|
+
resolveModuleNameLiterals: maybeBind(host, host.resolveModuleNameLiterals),
|
|
116565
|
+
resolveTypeReferenceDirectiveReferences: maybeBind(host, host.resolveTypeReferenceDirectiveReferences),
|
|
116397
116566
|
useSourceOfProjectReferenceRedirect: maybeBind(host, host.useSourceOfProjectReferenceRedirect),
|
|
116398
116567
|
getParsedCommandLine
|
|
116399
116568
|
};
|
|
@@ -124590,6 +124759,7 @@ ${lanes.join("\n")}
|
|
|
124590
124759
|
|
|
124591
124760
|
// src/services/codefixes/fixAddMissingMember.ts
|
|
124592
124761
|
function getInfo7(sourceFile, tokenPos, errorCode, checker, program) {
|
|
124762
|
+
var _a2;
|
|
124593
124763
|
const token = getTokenAtPosition(sourceFile, tokenPos);
|
|
124594
124764
|
const parent2 = token.parent;
|
|
124595
124765
|
if (errorCode === Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code) {
|
|
@@ -124625,7 +124795,7 @@ ${lanes.join("\n")}
|
|
|
124625
124795
|
return { kind: 4 /* JsxAttributes */, token, attributes, parentDeclaration: token.parent };
|
|
124626
124796
|
}
|
|
124627
124797
|
if (isIdentifier(token)) {
|
|
124628
|
-
const type = checker.getContextualType(token);
|
|
124798
|
+
const type = (_a2 = checker.getContextualType(token)) == null ? void 0 : _a2.getNonNullableType();
|
|
124629
124799
|
if (type && getObjectFlags(type) & 16 /* Anonymous */) {
|
|
124630
124800
|
const signature = firstOrUndefined(checker.getSignaturesOfType(type, 0 /* Call */));
|
|
124631
124801
|
if (signature === void 0)
|
|
@@ -129496,6 +129666,7 @@ ${lanes.join("\n")}
|
|
|
129496
129666
|
isTypeOnlyLocation,
|
|
129497
129667
|
isJsxIdentifierExpected,
|
|
129498
129668
|
isRightOfOpenTag,
|
|
129669
|
+
isRightOfDotOrQuestionDot,
|
|
129499
129670
|
importStatementCompletion,
|
|
129500
129671
|
insideJsDocTagTypeExpression,
|
|
129501
129672
|
symbolToSortTextMap,
|
|
@@ -129561,7 +129732,7 @@ ${lanes.join("\n")}
|
|
|
129561
129732
|
getJSCompletionEntries(sourceFile, location.pos, uniqueNames, getEmitScriptTarget(compilerOptions), entries);
|
|
129562
129733
|
}
|
|
129563
129734
|
let caseBlock;
|
|
129564
|
-
if (preferences.includeCompletionsWithInsertText && contextToken && (caseBlock = findAncestor(contextToken, isCaseBlock))) {
|
|
129735
|
+
if (preferences.includeCompletionsWithInsertText && contextToken && !isRightOfOpenTag && !isRightOfDotOrQuestionDot && (caseBlock = findAncestor(contextToken, isCaseBlock))) {
|
|
129565
129736
|
const cases = getExhaustiveCaseSnippets(caseBlock, sourceFile, preferences, compilerOptions, host, program, formatContext);
|
|
129566
129737
|
if (cases) {
|
|
129567
129738
|
entries.push(cases.entry);
|
|
@@ -130932,6 +131103,7 @@ ${lanes.join("\n")}
|
|
|
130932
131103
|
isTypeOnlyLocation,
|
|
130933
131104
|
isJsxIdentifierExpected,
|
|
130934
131105
|
isRightOfOpenTag,
|
|
131106
|
+
isRightOfDotOrQuestionDot: isRightOfDot || isRightOfQuestionDot,
|
|
130935
131107
|
importStatementCompletion,
|
|
130936
131108
|
hasUnresolvedAutoImports,
|
|
130937
131109
|
flags
|
|
@@ -133495,6 +133667,7 @@ ${lanes.join("\n")}
|
|
|
133495
133667
|
});
|
|
133496
133668
|
}
|
|
133497
133669
|
function findModuleReferences(program, sourceFiles, searchModuleSymbol) {
|
|
133670
|
+
var _a2;
|
|
133498
133671
|
const refs = [];
|
|
133499
133672
|
const checker = program.getTypeChecker();
|
|
133500
133673
|
for (const referencingFile of sourceFiles) {
|
|
@@ -133506,7 +133679,7 @@ ${lanes.join("\n")}
|
|
|
133506
133679
|
}
|
|
133507
133680
|
}
|
|
133508
133681
|
for (const ref of referencingFile.typeReferenceDirectives) {
|
|
133509
|
-
const referenced = program.getResolvedTypeReferenceDirectives().get(ref.fileName, ref.resolutionMode || referencingFile.impliedNodeFormat);
|
|
133682
|
+
const referenced = (_a2 = program.getResolvedTypeReferenceDirectives().get(ref.fileName, ref.resolutionMode || referencingFile.impliedNodeFormat)) == null ? void 0 : _a2.resolvedTypeReferenceDirective;
|
|
133510
133683
|
if (referenced !== void 0 && referenced.resolvedFileName === searchSourceFile.fileName) {
|
|
133511
133684
|
refs.push({ kind: "reference", referencingFile, ref });
|
|
133512
133685
|
}
|
|
@@ -134217,7 +134390,7 @@ ${lanes.join("\n")}
|
|
|
134217
134390
|
})(FindReferencesUse || {});
|
|
134218
134391
|
((Core2) => {
|
|
134219
134392
|
function getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options = {}, sourceFilesSet = new Set(sourceFiles.map((f) => f.fileName))) {
|
|
134220
|
-
var _a2, _b;
|
|
134393
|
+
var _a2, _b, _c;
|
|
134221
134394
|
node = getAdjustedNode(node, options);
|
|
134222
134395
|
if (isSourceFile(node)) {
|
|
134223
134396
|
const resolvedRef = ts_GoToDefinition_exports.getReferenceAtPosition(node, position, program);
|
|
@@ -134249,7 +134422,7 @@ ${lanes.join("\n")}
|
|
|
134249
134422
|
if (!options.implementations && isStringLiteralLike(node)) {
|
|
134250
134423
|
if (isModuleSpecifierLike(node)) {
|
|
134251
134424
|
const fileIncludeReasons = program.getFileIncludeReasons();
|
|
134252
|
-
const referencedFileName = (_b = (_a2 = node.getSourceFile().resolvedModules) == null ? void 0 : _a2.get(node.text, getModeForUsageLocation(node.getSourceFile(), node))) == null ? void 0 : _b.resolvedFileName;
|
|
134425
|
+
const referencedFileName = (_c = (_b = (_a2 = node.getSourceFile().resolvedModules) == null ? void 0 : _a2.get(node.text, getModeForUsageLocation(node.getSourceFile(), node))) == null ? void 0 : _b.resolvedModule) == null ? void 0 : _c.resolvedFileName;
|
|
134253
134426
|
const referencedFile = referencedFileName ? program.getSourceFile(referencedFileName) : void 0;
|
|
134254
134427
|
if (referencedFile) {
|
|
134255
134428
|
return [{ definition: { type: 4 /* String */, node }, references: getReferencesForNonModule(referencedFile, fileIncludeReasons, program) || emptyArray }];
|
|
@@ -135494,7 +135667,7 @@ ${lanes.join("\n")}
|
|
|
135494
135667
|
|
|
135495
135668
|
// src/services/goToDefinition.ts
|
|
135496
135669
|
function getDefinitionAtPosition(program, sourceFile, position, searchOtherFilesOnly, stopAtAlias) {
|
|
135497
|
-
var _a2;
|
|
135670
|
+
var _a2, _b;
|
|
135498
135671
|
const resolvedRef = getReferenceAtPosition(sourceFile, position, program);
|
|
135499
135672
|
const fileReferenceDefinition = resolvedRef && [getDefinitionInfoForFileReference(resolvedRef.reference.fileName, resolvedRef.fileName, resolvedRef.unverified)] || emptyArray;
|
|
135500
135673
|
if (resolvedRef == null ? void 0 : resolvedRef.file) {
|
|
@@ -135540,7 +135713,7 @@ ${lanes.join("\n")}
|
|
|
135540
135713
|
}
|
|
135541
135714
|
}
|
|
135542
135715
|
if (!symbol && isModuleSpecifierLike(fallbackNode)) {
|
|
135543
|
-
const ref = (_a2 = sourceFile.resolvedModules) == null ? void 0 : _a2.get(fallbackNode.text, getModeForUsageLocation(sourceFile, fallbackNode));
|
|
135716
|
+
const ref = (_b = (_a2 = sourceFile.resolvedModules) == null ? void 0 : _a2.get(fallbackNode.text, getModeForUsageLocation(sourceFile, fallbackNode))) == null ? void 0 : _b.resolvedModule;
|
|
135544
135717
|
if (ref) {
|
|
135545
135718
|
return [{
|
|
135546
135719
|
name: fallbackNode.text,
|
|
@@ -135618,7 +135791,7 @@ ${lanes.join("\n")}
|
|
|
135618
135791
|
return getDefinitionFromSymbol(typeChecker, symbol, node);
|
|
135619
135792
|
}
|
|
135620
135793
|
function getReferenceAtPosition(sourceFile, position, program) {
|
|
135621
|
-
var _a2, _b;
|
|
135794
|
+
var _a2, _b, _c, _d;
|
|
135622
135795
|
const referencePath = findReferenceInPosition(sourceFile.referencedFiles, position);
|
|
135623
135796
|
if (referencePath) {
|
|
135624
135797
|
const file = program.getSourceFileFromReference(sourceFile, referencePath);
|
|
@@ -135626,7 +135799,7 @@ ${lanes.join("\n")}
|
|
|
135626
135799
|
}
|
|
135627
135800
|
const typeReferenceDirective = findReferenceInPosition(sourceFile.typeReferenceDirectives, position);
|
|
135628
135801
|
if (typeReferenceDirective) {
|
|
135629
|
-
const reference = program.getResolvedTypeReferenceDirectives().get(typeReferenceDirective.fileName, typeReferenceDirective.resolutionMode || sourceFile.impliedNodeFormat);
|
|
135802
|
+
const reference = (_a2 = program.getResolvedTypeReferenceDirectives().get(typeReferenceDirective.fileName, typeReferenceDirective.resolutionMode || sourceFile.impliedNodeFormat)) == null ? void 0 : _a2.resolvedTypeReferenceDirective;
|
|
135630
135803
|
const file = reference && program.getSourceFile(reference.resolvedFileName);
|
|
135631
135804
|
return file && { reference: typeReferenceDirective, fileName: file.fileName, file, unverified: false };
|
|
135632
135805
|
}
|
|
@@ -135635,10 +135808,10 @@ ${lanes.join("\n")}
|
|
|
135635
135808
|
const file = program.getLibFileFromReference(libReferenceDirective);
|
|
135636
135809
|
return file && { reference: libReferenceDirective, fileName: file.fileName, file, unverified: false };
|
|
135637
135810
|
}
|
|
135638
|
-
if ((
|
|
135811
|
+
if ((_b = sourceFile.resolvedModules) == null ? void 0 : _b.size()) {
|
|
135639
135812
|
const node = getTouchingToken(sourceFile, position);
|
|
135640
135813
|
if (isModuleSpecifierLike(node) && isExternalModuleNameRelative(node.text) && sourceFile.resolvedModules.has(node.text, getModeForUsageLocation(sourceFile, node))) {
|
|
135641
|
-
const verifiedFileName = (
|
|
135814
|
+
const verifiedFileName = (_d = (_c = sourceFile.resolvedModules.get(node.text, getModeForUsageLocation(sourceFile, node))) == null ? void 0 : _c.resolvedModule) == null ? void 0 : _d.resolvedFileName;
|
|
135642
135815
|
const fileName = verifiedFileName || resolvePath(getDirectoryPath(sourceFile.fileName), node.text);
|
|
135643
135816
|
return {
|
|
135644
135817
|
file: program.getSourceFile(fileName),
|
|
@@ -137868,7 +138041,8 @@ ${lanes.join("\n")}
|
|
|
137868
138041
|
changes.insertNodeBefore(file, enclosingNode, ignoreSourceNewlines(newTypeNode), true);
|
|
137869
138042
|
changes.replaceNode(file, selection, factory.createTypeReferenceNode(name, typeParameters.map((id) => factory.createTypeReferenceNode(id.name, void 0))), { leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.Exclude, trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.ExcludeWhitespace });
|
|
137870
138043
|
}
|
|
137871
|
-
function doTypedefChange(changes,
|
|
138044
|
+
function doTypedefChange(changes, context, file, name, info) {
|
|
138045
|
+
var _a2;
|
|
137872
138046
|
const { enclosingNode, selection, typeParameters } = info;
|
|
137873
138047
|
setEmitFlags(selection, 3072 /* NoComments */ | 4096 /* NoNestedComments */);
|
|
137874
138048
|
const node = factory.createJSDocTypedefTag(
|
|
@@ -137890,7 +138064,7 @@ ${lanes.join("\n")}
|
|
|
137890
138064
|
const jsDoc = factory.createJSDocComment(void 0, factory.createNodeArray(concatenate(templates, [node])));
|
|
137891
138065
|
if (isJSDoc(enclosingNode)) {
|
|
137892
138066
|
const pos = enclosingNode.getStart(file);
|
|
137893
|
-
const newLineCharacter =
|
|
138067
|
+
const newLineCharacter = getNewLineOrDefaultFromHost(context.host, (_a2 = context.formatContext) == null ? void 0 : _a2.options);
|
|
137894
138068
|
changes.insertNodeAt(file, enclosingNode.getStart(file), jsDoc, {
|
|
137895
138069
|
suffix: newLineCharacter + newLineCharacter + file.text.slice(getPrecedingNonSpaceCharacterPosition(file.text, pos - 1), pos)
|
|
137896
138070
|
});
|
|
@@ -137955,7 +138129,7 @@ ${lanes.join("\n")}
|
|
|
137955
138129
|
return emptyArray;
|
|
137956
138130
|
},
|
|
137957
138131
|
getEditsForAction: function getRefactorEditsToExtractType(context, actionName2) {
|
|
137958
|
-
const { file
|
|
138132
|
+
const { file } = context;
|
|
137959
138133
|
const info = getRangeToExtract(context);
|
|
137960
138134
|
Debug.assert(info && !isRefactorErrorInfo(info), "Expected to find a range to extract");
|
|
137961
138135
|
const name = getUniqueName("NewType", file);
|
|
@@ -137966,7 +138140,7 @@ ${lanes.join("\n")}
|
|
|
137966
138140
|
return doTypeAliasChange(changes, file, name, info);
|
|
137967
138141
|
case extractToTypeDefAction.name:
|
|
137968
138142
|
Debug.assert(info.isJS, "Invalid actionName/JS combo");
|
|
137969
|
-
return doTypedefChange(changes,
|
|
138143
|
+
return doTypedefChange(changes, context, file, name, info);
|
|
137970
138144
|
case extractToInterfaceAction.name:
|
|
137971
138145
|
Debug.assert(!info.isJS && !!info.typeElements, "Invalid actionName/JS combo");
|
|
137972
138146
|
return doInterfaceChange(changes, file, name, info);
|
|
@@ -138024,10 +138198,17 @@ ${lanes.join("\n")}
|
|
|
138024
138198
|
const usage = getUsageInfo(oldFile, toMove.all, checker);
|
|
138025
138199
|
const currentDirectory = getDirectoryPath(oldFile.fileName);
|
|
138026
138200
|
const extension = extensionFromPath(oldFile.fileName);
|
|
138027
|
-
const
|
|
138028
|
-
|
|
138029
|
-
|
|
138030
|
-
|
|
138201
|
+
const newFilename = combinePaths(
|
|
138202
|
+
currentDirectory,
|
|
138203
|
+
makeUniqueFilename(
|
|
138204
|
+
inferNewFilename(usage.oldFileImportsFromNewFile, usage.movedSymbols),
|
|
138205
|
+
extension,
|
|
138206
|
+
currentDirectory,
|
|
138207
|
+
host
|
|
138208
|
+
)
|
|
138209
|
+
) + extension;
|
|
138210
|
+
changes.createNewFile(oldFile, newFilename, getNewStatementsAndRemoveFromOldFile(oldFile, usage, changes, toMove, program, host, newFilename, preferences));
|
|
138211
|
+
addNewFileToTsconfig(program, changes, oldFile.fileName, newFilename, hostGetCanonicalFileName(host));
|
|
138031
138212
|
}
|
|
138032
138213
|
function getStatementsToMove(context) {
|
|
138033
138214
|
const rangeToMove = getRangeToMove(context);
|
|
@@ -138070,7 +138251,7 @@ ${lanes.join("\n")}
|
|
|
138070
138251
|
changes.insertNodeInListAfter(cfg, last(filesProp.initializer.elements), factory.createStringLiteral(newFilePath), filesProp.initializer.elements);
|
|
138071
138252
|
}
|
|
138072
138253
|
}
|
|
138073
|
-
function getNewStatementsAndRemoveFromOldFile(oldFile, usage, changes, toMove, program,
|
|
138254
|
+
function getNewStatementsAndRemoveFromOldFile(oldFile, usage, changes, toMove, program, host, newFilename, preferences) {
|
|
138074
138255
|
const checker = program.getTypeChecker();
|
|
138075
138256
|
const prologueDirectives = takeWhile(oldFile.statements, isPrologueDirective);
|
|
138076
138257
|
if (oldFile.externalModuleIndicator === void 0 && oldFile.commonJsModuleIndicator === void 0 && usage.oldImportsNeededByNewFile.size() === 0) {
|
|
@@ -138079,14 +138260,14 @@ ${lanes.join("\n")}
|
|
|
138079
138260
|
}
|
|
138080
138261
|
const useEsModuleSyntax = !!oldFile.externalModuleIndicator;
|
|
138081
138262
|
const quotePreference = getQuotePreference(oldFile, preferences);
|
|
138082
|
-
const importsFromNewFile = createOldFileImportsFromNewFile(usage.oldFileImportsFromNewFile,
|
|
138263
|
+
const importsFromNewFile = createOldFileImportsFromNewFile(oldFile, usage.oldFileImportsFromNewFile, newFilename, program, host, useEsModuleSyntax, quotePreference);
|
|
138083
138264
|
if (importsFromNewFile) {
|
|
138084
138265
|
insertImports(changes, oldFile, importsFromNewFile, true);
|
|
138085
138266
|
}
|
|
138086
138267
|
deleteUnusedOldImports(oldFile, toMove.all, changes, usage.unusedImportsFromOldFile, checker);
|
|
138087
138268
|
deleteMovedStatements(oldFile, toMove.ranges, changes);
|
|
138088
|
-
updateImportsInOtherFiles(changes, program, oldFile, usage.movedSymbols,
|
|
138089
|
-
const imports = getNewFileImportsAndAddExportInOldFile(oldFile, usage.oldImportsNeededByNewFile, usage.newFileImportsFromOldFile, changes, checker, useEsModuleSyntax, quotePreference);
|
|
138269
|
+
updateImportsInOtherFiles(changes, program, host, oldFile, usage.movedSymbols, newFilename);
|
|
138270
|
+
const imports = getNewFileImportsAndAddExportInOldFile(oldFile, usage.oldImportsNeededByNewFile, usage.newFileImportsFromOldFile, changes, checker, program, host, useEsModuleSyntax, quotePreference);
|
|
138090
138271
|
const body = addExports(oldFile, toMove.all, usage.oldFileImportsFromNewFile, useEsModuleSyntax);
|
|
138091
138272
|
if (imports.length && body.length) {
|
|
138092
138273
|
return [
|
|
@@ -138114,7 +138295,7 @@ ${lanes.join("\n")}
|
|
|
138114
138295
|
forEachImportInStatement(statement, (i) => deleteUnusedImports(oldFile, i, changes, (name) => toDelete.has(checker.getSymbolAtLocation(name))));
|
|
138115
138296
|
}
|
|
138116
138297
|
}
|
|
138117
|
-
function updateImportsInOtherFiles(changes, program, oldFile, movedSymbols,
|
|
138298
|
+
function updateImportsInOtherFiles(changes, program, host, oldFile, movedSymbols, newFilename) {
|
|
138118
138299
|
const checker = program.getTypeChecker();
|
|
138119
138300
|
for (const sourceFile of program.getSourceFiles()) {
|
|
138120
138301
|
if (sourceFile === oldFile)
|
|
@@ -138128,13 +138309,14 @@ ${lanes.join("\n")}
|
|
|
138128
138309
|
return !!symbol && movedSymbols.has(symbol);
|
|
138129
138310
|
};
|
|
138130
138311
|
deleteUnusedImports(sourceFile, importNode, changes, shouldMove);
|
|
138131
|
-
const
|
|
138312
|
+
const pathToNewFileWithExtension = resolvePath(getDirectoryPath(oldFile.path), newFilename);
|
|
138313
|
+
const newModuleSpecifier = getModuleSpecifier(program.getCompilerOptions(), sourceFile, sourceFile.path, pathToNewFileWithExtension, createModuleSpecifierResolutionHost(program, host));
|
|
138132
138314
|
const newImportDeclaration = filterImport(importNode, factory.createStringLiteral(newModuleSpecifier), shouldMove);
|
|
138133
138315
|
if (newImportDeclaration)
|
|
138134
138316
|
changes.insertNodeAfter(sourceFile, statement, newImportDeclaration);
|
|
138135
138317
|
const ns = getNamespaceLikeImport(importNode);
|
|
138136
138318
|
if (ns)
|
|
138137
|
-
updateNamespaceLikeImport(changes, sourceFile, checker, movedSymbols,
|
|
138319
|
+
updateNamespaceLikeImport(changes, sourceFile, checker, movedSymbols, newModuleSpecifier, ns, importNode);
|
|
138138
138320
|
});
|
|
138139
138321
|
}
|
|
138140
138322
|
}
|
|
@@ -138151,8 +138333,8 @@ ${lanes.join("\n")}
|
|
|
138151
138333
|
return Debug.assertNever(node, `Unexpected node kind ${node.kind}`);
|
|
138152
138334
|
}
|
|
138153
138335
|
}
|
|
138154
|
-
function updateNamespaceLikeImport(changes, sourceFile, checker, movedSymbols,
|
|
138155
|
-
const preferredNewNamespaceName = ts_codefix_exports.moduleSpecifierToValidIdentifier(
|
|
138336
|
+
function updateNamespaceLikeImport(changes, sourceFile, checker, movedSymbols, newModuleSpecifier, oldImportId, oldImportNode) {
|
|
138337
|
+
const preferredNewNamespaceName = ts_codefix_exports.moduleSpecifierToValidIdentifier(newModuleSpecifier, 99 /* ESNext */);
|
|
138156
138338
|
let needUniqueName = false;
|
|
138157
138339
|
const toChange = [];
|
|
138158
138340
|
ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(oldImportId, checker, sourceFile, (ref) => {
|
|
@@ -138168,7 +138350,7 @@ ${lanes.join("\n")}
|
|
|
138168
138350
|
for (const ref of toChange) {
|
|
138169
138351
|
changes.replaceNode(sourceFile, ref, factory.createIdentifier(newNamespaceName));
|
|
138170
138352
|
}
|
|
138171
|
-
changes.insertNodeAfter(sourceFile, oldImportNode, updateNamespaceLikeImportNode(oldImportNode,
|
|
138353
|
+
changes.insertNodeAfter(sourceFile, oldImportNode, updateNamespaceLikeImportNode(oldImportNode, preferredNewNamespaceName, newModuleSpecifier));
|
|
138172
138354
|
}
|
|
138173
138355
|
}
|
|
138174
138356
|
function updateNamespaceLikeImportNode(node, newNamespaceName, newModuleSpecifier) {
|
|
@@ -138209,7 +138391,7 @@ ${lanes.join("\n")}
|
|
|
138209
138391
|
}
|
|
138210
138392
|
}
|
|
138211
138393
|
}
|
|
138212
|
-
function createOldFileImportsFromNewFile(newFileNeedExport, newFileNameWithExtension, useEs6Imports, quotePreference) {
|
|
138394
|
+
function createOldFileImportsFromNewFile(sourceFile, newFileNeedExport, newFileNameWithExtension, program, host, useEs6Imports, quotePreference) {
|
|
138213
138395
|
let defaultImport;
|
|
138214
138396
|
const imports = [];
|
|
138215
138397
|
newFileNeedExport.forEach((symbol) => {
|
|
@@ -138219,17 +138401,18 @@ ${lanes.join("\n")}
|
|
|
138219
138401
|
imports.push(symbol.name);
|
|
138220
138402
|
}
|
|
138221
138403
|
});
|
|
138222
|
-
return makeImportOrRequire(defaultImport, imports, newFileNameWithExtension, useEs6Imports, quotePreference);
|
|
138404
|
+
return makeImportOrRequire(sourceFile, defaultImport, imports, newFileNameWithExtension, program, host, useEs6Imports, quotePreference);
|
|
138223
138405
|
}
|
|
138224
|
-
function makeImportOrRequire(defaultImport, imports,
|
|
138225
|
-
|
|
138406
|
+
function makeImportOrRequire(sourceFile, defaultImport, imports, newFileNameWithExtension, program, host, useEs6Imports, quotePreference) {
|
|
138407
|
+
const pathToNewFile = resolvePath(getDirectoryPath(sourceFile.path), newFileNameWithExtension);
|
|
138408
|
+
const pathToNewFileWithCorrectExtension = getModuleSpecifier(program.getCompilerOptions(), sourceFile, sourceFile.path, pathToNewFile, createModuleSpecifierResolutionHost(program, host));
|
|
138226
138409
|
if (useEs6Imports) {
|
|
138227
138410
|
const specifiers = imports.map((i) => factory.createImportSpecifier(false, void 0, factory.createIdentifier(i)));
|
|
138228
|
-
return makeImportIfNecessary(defaultImport, specifiers,
|
|
138411
|
+
return makeImportIfNecessary(defaultImport, specifiers, pathToNewFileWithCorrectExtension, quotePreference);
|
|
138229
138412
|
} else {
|
|
138230
138413
|
Debug.assert(!defaultImport, "No default import should exist");
|
|
138231
138414
|
const bindingElements = imports.map((i) => factory.createBindingElement(void 0, void 0, i));
|
|
138232
|
-
return bindingElements.length ? makeVariableStatement(factory.createObjectBindingPattern(bindingElements), void 0, createRequireCall(factory.createStringLiteral(
|
|
138415
|
+
return bindingElements.length ? makeVariableStatement(factory.createObjectBindingPattern(bindingElements), void 0, createRequireCall(factory.createStringLiteral(pathToNewFileWithCorrectExtension))) : void 0;
|
|
138233
138416
|
}
|
|
138234
138417
|
}
|
|
138235
138418
|
function makeVariableStatement(name, type, initializer, flags = 2 /* Const */) {
|
|
@@ -138326,7 +138509,7 @@ ${lanes.join("\n")}
|
|
|
138326
138509
|
break;
|
|
138327
138510
|
}
|
|
138328
138511
|
}
|
|
138329
|
-
function getNewFileImportsAndAddExportInOldFile(oldFile, importsToCopy, newFileImportsFromOldFile, changes, checker, useEsModuleSyntax, quotePreference) {
|
|
138512
|
+
function getNewFileImportsAndAddExportInOldFile(oldFile, importsToCopy, newFileImportsFromOldFile, changes, checker, program, host, useEsModuleSyntax, quotePreference) {
|
|
138330
138513
|
const copiedOldImports = [];
|
|
138331
138514
|
for (const oldStatement of oldFile.statements) {
|
|
138332
138515
|
forEachImportInStatement(oldStatement, (i) => {
|
|
@@ -138357,19 +138540,19 @@ ${lanes.join("\n")}
|
|
|
138357
138540
|
}
|
|
138358
138541
|
}
|
|
138359
138542
|
});
|
|
138360
|
-
append(copiedOldImports, makeImportOrRequire(oldFileDefault, oldFileNamedImports,
|
|
138543
|
+
append(copiedOldImports, makeImportOrRequire(oldFile, oldFileDefault, oldFileNamedImports, getBaseFileName(oldFile.fileName), program, host, useEsModuleSyntax, quotePreference));
|
|
138361
138544
|
return copiedOldImports;
|
|
138362
138545
|
}
|
|
138363
|
-
function
|
|
138364
|
-
let
|
|
138546
|
+
function makeUniqueFilename(proposedFilename, extension, inDirectory, host) {
|
|
138547
|
+
let newFilename = proposedFilename;
|
|
138365
138548
|
for (let i = 1; ; i++) {
|
|
138366
|
-
const name = combinePaths(inDirectory,
|
|
138549
|
+
const name = combinePaths(inDirectory, newFilename + extension);
|
|
138367
138550
|
if (!host.fileExists(name))
|
|
138368
|
-
return
|
|
138369
|
-
|
|
138551
|
+
return newFilename;
|
|
138552
|
+
newFilename = `${proposedFilename}.${i}`;
|
|
138370
138553
|
}
|
|
138371
138554
|
}
|
|
138372
|
-
function
|
|
138555
|
+
function inferNewFilename(importsFromNewFile, movedSymbols) {
|
|
138373
138556
|
return importsFromNewFile.forEachEntry(symbolNameNoDefault) || movedSymbols.forEachEntry(symbolNameNoDefault) || "newFile";
|
|
138374
138557
|
}
|
|
138375
138558
|
function getUsageInfo(oldFile, toMove, checker) {
|
|
@@ -138643,6 +138826,7 @@ ${lanes.join("\n")}
|
|
|
138643
138826
|
var init_moveToNewFile = __esm({
|
|
138644
138827
|
"src/services/refactors/moveToNewFile.ts"() {
|
|
138645
138828
|
"use strict";
|
|
138829
|
+
init_moduleSpecifiers();
|
|
138646
138830
|
init_ts4();
|
|
138647
138831
|
init_ts_refactor();
|
|
138648
138832
|
refactorName4 = "Move to a new file";
|
|
@@ -149604,7 +149788,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
149604
149788
|
if (!file.resolvedModules)
|
|
149605
149789
|
return emptyArray2;
|
|
149606
149790
|
let unresolvedImports;
|
|
149607
|
-
file.resolvedModules.forEach((resolvedModule, name) => {
|
|
149791
|
+
file.resolvedModules.forEach(({ resolvedModule }, name) => {
|
|
149608
149792
|
if ((!resolvedModule || !resolutionExtensionIsTSOrJson(resolvedModule.extension)) && !isExternalModuleNameRelative(name) && !ambientModules.some((m) => m === name)) {
|
|
149609
149793
|
unresolvedImports = append(unresolvedImports, parsePackageName(name).packageName);
|
|
149610
149794
|
}
|
|
@@ -149768,7 +149952,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
149768
149952
|
if (this.program && !this.symlinks.hasProcessedResolutions()) {
|
|
149769
149953
|
this.symlinks.setSymlinksFromResolutions(
|
|
149770
149954
|
this.program.getSourceFiles(),
|
|
149771
|
-
this.program.
|
|
149955
|
+
this.program.getAutomaticTypeDirectiveResolutions()
|
|
149772
149956
|
);
|
|
149773
149957
|
}
|
|
149774
149958
|
return this.symlinks;
|
|
@@ -149852,17 +150036,21 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
149852
150036
|
const path = this.toPath(file);
|
|
149853
150037
|
return !this.isWatchedMissingFile(path) && this.directoryStructureHost.fileExists(file);
|
|
149854
150038
|
}
|
|
149855
|
-
|
|
149856
|
-
return this.resolutionCache.
|
|
150039
|
+
resolveModuleNameLiterals(moduleLiterals, containingFile, redirectedReference, options, containingSourceFile, reusedNames) {
|
|
150040
|
+
return this.resolutionCache.resolveModuleNameLiterals(moduleLiterals, containingFile, redirectedReference, options, containingSourceFile, reusedNames);
|
|
149857
150041
|
}
|
|
149858
150042
|
getModuleResolutionCache() {
|
|
149859
150043
|
return this.resolutionCache.getModuleResolutionCache();
|
|
149860
150044
|
}
|
|
149861
|
-
|
|
149862
|
-
return this.resolutionCache.
|
|
149863
|
-
|
|
149864
|
-
|
|
149865
|
-
|
|
150045
|
+
resolveTypeReferenceDirectiveReferences(typeDirectiveReferences, containingFile, redirectedReference, options, containingSourceFile, reusedNames) {
|
|
150046
|
+
return this.resolutionCache.resolveTypeReferenceDirectiveReferences(
|
|
150047
|
+
typeDirectiveReferences,
|
|
150048
|
+
containingFile,
|
|
150049
|
+
redirectedReference,
|
|
150050
|
+
options,
|
|
150051
|
+
containingSourceFile,
|
|
150052
|
+
reusedNames
|
|
150053
|
+
);
|
|
149866
150054
|
}
|
|
149867
150055
|
directoryExists(path) {
|
|
149868
150056
|
return this.directoryStructureHost.directoryExists(path);
|
|
@@ -155967,7 +156155,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
155967
156155
|
definitions = definitions.filter((d) => !d.isAmbient && !d.failedAliasResolution);
|
|
155968
156156
|
return this.mapDefinitionInfo(definitions, project);
|
|
155969
156157
|
function findImplementationFileFromDtsFileName(fileName, resolveFromFile, auxiliaryProject) {
|
|
155970
|
-
var _a3;
|
|
156158
|
+
var _a3, _b, _c;
|
|
155971
156159
|
const nodeModulesPathParts = getNodeModulePathParts(fileName);
|
|
155972
156160
|
if (nodeModulesPathParts && fileName.lastIndexOf(nodeModulesPathPart) === nodeModulesPathParts.topLevelNodeModulesIndex) {
|
|
155973
156161
|
const packageDirectory = fileName.substring(0, nodeModulesPathParts.packageRootIndex);
|
|
@@ -155989,13 +156177,11 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
155989
156177
|
const packageName = getPackageNameFromTypesPackageName(unmangleScopedPackageName(packageNamePathPart));
|
|
155990
156178
|
const path = project.toPath(fileName);
|
|
155991
156179
|
if (entrypoints && some(entrypoints, (e) => project.toPath(e) === path)) {
|
|
155992
|
-
|
|
155993
|
-
return implementationResolution == null ? void 0 : implementationResolution.resolvedFileName;
|
|
156180
|
+
return (_b = auxiliaryProject.resolutionCache.resolveSingleModuleNameWithoutWatching(packageName, resolveFromFile).resolvedModule) == null ? void 0 : _b.resolvedFileName;
|
|
155994
156181
|
} else {
|
|
155995
156182
|
const pathToFileInPackage = fileName.substring(nodeModulesPathParts.packageRootIndex + 1);
|
|
155996
156183
|
const specifier = `${packageName}/${removeFileExtension(pathToFileInPackage)}`;
|
|
155997
|
-
|
|
155998
|
-
return implementationResolution == null ? void 0 : implementationResolution.resolvedFileName;
|
|
156184
|
+
return (_c = auxiliaryProject.resolutionCache.resolveSingleModuleNameWithoutWatching(specifier, resolveFromFile).resolvedModule) == null ? void 0 : _c.resolvedFileName;
|
|
155999
156185
|
}
|
|
156000
156186
|
}
|
|
156001
156187
|
return void 0;
|
|
@@ -158645,6 +158831,7 @@ ${e.message}`;
|
|
|
158645
158831
|
createModuleBlock: () => createModuleBlock,
|
|
158646
158832
|
createModuleDeclaration: () => createModuleDeclaration,
|
|
158647
158833
|
createModuleResolutionCache: () => createModuleResolutionCache,
|
|
158834
|
+
createModuleResolutionLoader: () => createModuleResolutionLoader,
|
|
158648
158835
|
createModuleSpecifierResolutionHost: () => createModuleSpecifierResolutionHost,
|
|
158649
158836
|
createMultiMap: () => createMultiMap,
|
|
158650
158837
|
createNamedExports: () => createNamedExports,
|
|
@@ -158767,6 +158954,7 @@ ${e.message}`;
|
|
|
158767
158954
|
createTypeQueryNode: () => createTypeQueryNode,
|
|
158768
158955
|
createTypeReferenceDirectiveResolutionCache: () => createTypeReferenceDirectiveResolutionCache,
|
|
158769
158956
|
createTypeReferenceNode: () => createTypeReferenceNode,
|
|
158957
|
+
createTypeReferenceResolutionLoader: () => createTypeReferenceResolutionLoader,
|
|
158770
158958
|
createUnderscoreEscapedMultiMap: () => createUnderscoreEscapedMultiMap,
|
|
158771
158959
|
createUnionTypeNode: () => createUnionTypeNode,
|
|
158772
158960
|
createUniqueName: () => createUniqueName,
|
|
@@ -159256,9 +159444,7 @@ ${e.message}`;
|
|
|
159256
159444
|
getRenameLocation: () => getRenameLocation,
|
|
159257
159445
|
getReplacementSpanForContextToken: () => getReplacementSpanForContextToken,
|
|
159258
159446
|
getResolutionDiagnostic: () => getResolutionDiagnostic,
|
|
159259
|
-
getResolutionMode: () => getResolutionMode,
|
|
159260
159447
|
getResolutionModeOverrideForClause: () => getResolutionModeOverrideForClause,
|
|
159261
|
-
getResolutionName: () => getResolutionName,
|
|
159262
159448
|
getResolvedExternalModuleName: () => getResolvedExternalModuleName,
|
|
159263
159449
|
getResolvedModule: () => getResolvedModule,
|
|
159264
159450
|
getResolvedTypeReferenceDirective: () => getResolvedTypeReferenceDirective,
|
|
@@ -160077,7 +160263,6 @@ ${e.message}`;
|
|
|
160077
160263
|
listFiles: () => listFiles,
|
|
160078
160264
|
loadModuleFromGlobalCache: () => loadModuleFromGlobalCache,
|
|
160079
160265
|
loadWithModeAwareCache: () => loadWithModeAwareCache,
|
|
160080
|
-
loadWithTypeDirectiveCache: () => loadWithTypeDirectiveCache,
|
|
160081
160266
|
makeIdentifierFromModuleName: () => makeIdentifierFromModuleName,
|
|
160082
160267
|
makeImport: () => makeImport,
|
|
160083
160268
|
makeImportIfNecessary: () => makeImportIfNecessary,
|
|
@@ -160109,6 +160294,7 @@ ${e.message}`;
|
|
|
160109
160294
|
modifiersToFlags: () => modifiersToFlags,
|
|
160110
160295
|
moduleOptionDeclaration: () => moduleOptionDeclaration,
|
|
160111
160296
|
moduleResolutionIsEqualTo: () => moduleResolutionIsEqualTo,
|
|
160297
|
+
moduleResolutionNameAndModeGetter: () => moduleResolutionNameAndModeGetter,
|
|
160112
160298
|
moduleResolutionOptionDeclarations: () => moduleResolutionOptionDeclarations,
|
|
160113
160299
|
moduleResolutionRespectsExports: () => moduleResolutionRespectsExports,
|
|
160114
160300
|
moduleResolutionUsesNodeModules: () => moduleResolutionUsesNodeModules,
|
|
@@ -160485,6 +160671,7 @@ ${e.message}`;
|
|
|
160485
160671
|
typeHasCallOrConstructSignatures: () => typeHasCallOrConstructSignatures,
|
|
160486
160672
|
typeKeywords: () => typeKeywords,
|
|
160487
160673
|
typeParameterNamePart: () => typeParameterNamePart,
|
|
160674
|
+
typeReferenceResolutionNameAndModeGetter: () => typeReferenceResolutionNameAndModeGetter,
|
|
160488
160675
|
typeToDisplayParts: () => typeToDisplayParts,
|
|
160489
160676
|
unchangedPollThresholds: () => unchangedPollThresholds,
|
|
160490
160677
|
unchangedTextChangeRange: () => unchangedTextChangeRange,
|
|
@@ -160600,6 +160787,7 @@ ${e.message}`;
|
|
|
160600
160787
|
updatePropertyAssignment: () => updatePropertyAssignment,
|
|
160601
160788
|
updatePropertySignature: () => updatePropertySignature,
|
|
160602
160789
|
updateQualifiedName: () => updateQualifiedName,
|
|
160790
|
+
updateResolutionField: () => updateResolutionField,
|
|
160603
160791
|
updateRestTypeNode: () => updateRestTypeNode,
|
|
160604
160792
|
updateReturn: () => updateReturn,
|
|
160605
160793
|
updateSetAccessor: () => updateSetAccessor,
|
|
@@ -161267,6 +161455,7 @@ ${e.message}`;
|
|
|
161267
161455
|
createModuleBlock: () => createModuleBlock,
|
|
161268
161456
|
createModuleDeclaration: () => createModuleDeclaration,
|
|
161269
161457
|
createModuleResolutionCache: () => createModuleResolutionCache,
|
|
161458
|
+
createModuleResolutionLoader: () => createModuleResolutionLoader,
|
|
161270
161459
|
createModuleSpecifierResolutionHost: () => createModuleSpecifierResolutionHost,
|
|
161271
161460
|
createMultiMap: () => createMultiMap,
|
|
161272
161461
|
createNamedExports: () => createNamedExports,
|
|
@@ -161389,6 +161578,7 @@ ${e.message}`;
|
|
|
161389
161578
|
createTypeQueryNode: () => createTypeQueryNode,
|
|
161390
161579
|
createTypeReferenceDirectiveResolutionCache: () => createTypeReferenceDirectiveResolutionCache,
|
|
161391
161580
|
createTypeReferenceNode: () => createTypeReferenceNode,
|
|
161581
|
+
createTypeReferenceResolutionLoader: () => createTypeReferenceResolutionLoader,
|
|
161392
161582
|
createUnderscoreEscapedMultiMap: () => createUnderscoreEscapedMultiMap,
|
|
161393
161583
|
createUnionTypeNode: () => createUnionTypeNode,
|
|
161394
161584
|
createUniqueName: () => createUniqueName,
|
|
@@ -161878,9 +162068,7 @@ ${e.message}`;
|
|
|
161878
162068
|
getRenameLocation: () => getRenameLocation,
|
|
161879
162069
|
getReplacementSpanForContextToken: () => getReplacementSpanForContextToken,
|
|
161880
162070
|
getResolutionDiagnostic: () => getResolutionDiagnostic,
|
|
161881
|
-
getResolutionMode: () => getResolutionMode,
|
|
161882
162071
|
getResolutionModeOverrideForClause: () => getResolutionModeOverrideForClause,
|
|
161883
|
-
getResolutionName: () => getResolutionName,
|
|
161884
162072
|
getResolvedExternalModuleName: () => getResolvedExternalModuleName,
|
|
161885
162073
|
getResolvedModule: () => getResolvedModule,
|
|
161886
162074
|
getResolvedTypeReferenceDirective: () => getResolvedTypeReferenceDirective,
|
|
@@ -162699,7 +162887,6 @@ ${e.message}`;
|
|
|
162699
162887
|
listFiles: () => listFiles,
|
|
162700
162888
|
loadModuleFromGlobalCache: () => loadModuleFromGlobalCache,
|
|
162701
162889
|
loadWithModeAwareCache: () => loadWithModeAwareCache,
|
|
162702
|
-
loadWithTypeDirectiveCache: () => loadWithTypeDirectiveCache,
|
|
162703
162890
|
makeIdentifierFromModuleName: () => makeIdentifierFromModuleName,
|
|
162704
162891
|
makeImport: () => makeImport,
|
|
162705
162892
|
makeImportIfNecessary: () => makeImportIfNecessary,
|
|
@@ -162731,6 +162918,7 @@ ${e.message}`;
|
|
|
162731
162918
|
modifiersToFlags: () => modifiersToFlags,
|
|
162732
162919
|
moduleOptionDeclaration: () => moduleOptionDeclaration,
|
|
162733
162920
|
moduleResolutionIsEqualTo: () => moduleResolutionIsEqualTo,
|
|
162921
|
+
moduleResolutionNameAndModeGetter: () => moduleResolutionNameAndModeGetter,
|
|
162734
162922
|
moduleResolutionOptionDeclarations: () => moduleResolutionOptionDeclarations,
|
|
162735
162923
|
moduleResolutionRespectsExports: () => moduleResolutionRespectsExports,
|
|
162736
162924
|
moduleResolutionUsesNodeModules: () => moduleResolutionUsesNodeModules,
|
|
@@ -163107,6 +163295,7 @@ ${e.message}`;
|
|
|
163107
163295
|
typeHasCallOrConstructSignatures: () => typeHasCallOrConstructSignatures,
|
|
163108
163296
|
typeKeywords: () => typeKeywords,
|
|
163109
163297
|
typeParameterNamePart: () => typeParameterNamePart,
|
|
163298
|
+
typeReferenceResolutionNameAndModeGetter: () => typeReferenceResolutionNameAndModeGetter,
|
|
163110
163299
|
typeToDisplayParts: () => typeToDisplayParts,
|
|
163111
163300
|
unchangedPollThresholds: () => unchangedPollThresholds,
|
|
163112
163301
|
unchangedTextChangeRange: () => unchangedTextChangeRange,
|
|
@@ -163222,6 +163411,7 @@ ${e.message}`;
|
|
|
163222
163411
|
updatePropertyAssignment: () => updatePropertyAssignment,
|
|
163223
163412
|
updatePropertySignature: () => updatePropertySignature,
|
|
163224
163413
|
updateQualifiedName: () => updateQualifiedName,
|
|
163414
|
+
updateResolutionField: () => updateResolutionField,
|
|
163225
163415
|
updateRestTypeNode: () => updateRestTypeNode,
|
|
163226
163416
|
updateReturn: () => updateReturn,
|
|
163227
163417
|
updateSetAccessor: () => updateSetAccessor,
|