typescript 5.3.0-dev.20230920 → 5.3.0-dev.20230921
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/lib.dom.d.ts +4 -0
- package/lib/lib.webworker.d.ts +2 -0
- package/lib/tsc.js +93 -128
- package/lib/tsserver.js +155 -189
- package/lib/typescript.js +155 -184
- package/lib/typingsInstaller.js +9 -5
- package/package.json +2 -2
package/lib/lib.dom.d.ts
CHANGED
|
@@ -1435,6 +1435,7 @@ interface RTCInboundRtpStreamStats extends RTCReceivedRtpStreamStats {
|
|
|
1435
1435
|
keyFramesDecoded?: number;
|
|
1436
1436
|
kind: string;
|
|
1437
1437
|
lastPacketReceivedTimestamp?: DOMHighResTimeStamp;
|
|
1438
|
+
mid?: string;
|
|
1438
1439
|
nackCount?: number;
|
|
1439
1440
|
packetsDiscarded?: number;
|
|
1440
1441
|
pliCount?: number;
|
|
@@ -1449,6 +1450,7 @@ interface RTCInboundRtpStreamStats extends RTCReceivedRtpStreamStats {
|
|
|
1449
1450
|
totalSamplesDuration?: number;
|
|
1450
1451
|
totalSamplesReceived?: number;
|
|
1451
1452
|
totalSquaredInterFrameDelay?: number;
|
|
1453
|
+
trackIdentifier: string;
|
|
1452
1454
|
}
|
|
1453
1455
|
|
|
1454
1456
|
interface RTCLocalSessionDescriptionInit {
|
|
@@ -21843,7 +21845,9 @@ interface SubtleCrypto {
|
|
|
21843
21845
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/exportKey) */
|
|
21844
21846
|
exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
|
|
21845
21847
|
exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>;
|
|
21848
|
+
exportKey(format: KeyFormat, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
|
|
21846
21849
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */
|
|
21850
|
+
generateKey(algorithm: "Ed25519", extractable: boolean, keyUsages: ReadonlyArray<"sign" | "verify">): Promise<CryptoKeyPair>;
|
|
21847
21851
|
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
|
|
21848
21852
|
generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
|
|
21849
21853
|
generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>;
|
package/lib/lib.webworker.d.ts
CHANGED
|
@@ -5340,7 +5340,9 @@ interface SubtleCrypto {
|
|
|
5340
5340
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/exportKey) */
|
|
5341
5341
|
exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
|
|
5342
5342
|
exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>;
|
|
5343
|
+
exportKey(format: KeyFormat, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
|
|
5343
5344
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/SubtleCrypto/generateKey) */
|
|
5345
|
+
generateKey(algorithm: "Ed25519", extractable: boolean, keyUsages: ReadonlyArray<"sign" | "verify">): Promise<CryptoKeyPair>;
|
|
5344
5346
|
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
|
|
5345
5347
|
generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
|
|
5346
5348
|
generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>;
|
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.3";
|
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20230921`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -11431,22 +11431,6 @@ function usingSingleLineStringWriter(action) {
|
|
|
11431
11431
|
function getFullWidth(node) {
|
|
11432
11432
|
return node.end - node.pos;
|
|
11433
11433
|
}
|
|
11434
|
-
function getResolvedModule(sourceFile, moduleNameText, mode) {
|
|
11435
|
-
var _a, _b;
|
|
11436
|
-
return (_b = (_a = sourceFile == null ? void 0 : sourceFile.resolvedModules) == null ? void 0 : _a.get(moduleNameText, mode)) == null ? void 0 : _b.resolvedModule;
|
|
11437
|
-
}
|
|
11438
|
-
function setResolvedModule(sourceFile, moduleNameText, resolvedModule, mode) {
|
|
11439
|
-
if (!sourceFile.resolvedModules) {
|
|
11440
|
-
sourceFile.resolvedModules = createModeAwareCache();
|
|
11441
|
-
}
|
|
11442
|
-
sourceFile.resolvedModules.set(moduleNameText, mode, resolvedModule);
|
|
11443
|
-
}
|
|
11444
|
-
function setResolvedTypeReferenceDirective(sourceFile, typeReferenceDirectiveName, resolvedTypeReferenceDirective, mode) {
|
|
11445
|
-
if (!sourceFile.resolvedTypeReferenceDirectiveNames) {
|
|
11446
|
-
sourceFile.resolvedTypeReferenceDirectiveNames = createModeAwareCache();
|
|
11447
|
-
}
|
|
11448
|
-
sourceFile.resolvedTypeReferenceDirectiveNames.set(typeReferenceDirectiveName, mode, resolvedTypeReferenceDirective);
|
|
11449
|
-
}
|
|
11450
11434
|
function projectReferenceIsEqualTo(oldRef, newRef) {
|
|
11451
11435
|
return oldRef.path === newRef.path && !oldRef.prepend === !newRef.prepend && !oldRef.circular === !newRef.circular;
|
|
11452
11436
|
}
|
|
@@ -11454,8 +11438,8 @@ function moduleResolutionIsEqualTo(oldResolution, newResolution) {
|
|
|
11454
11438
|
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) && oldResolution.node10Result === newResolution.node10Result;
|
|
11455
11439
|
}
|
|
11456
11440
|
function createModuleNotFoundChain(sourceFile, host, moduleReference, mode, packageName) {
|
|
11457
|
-
var _a, _b;
|
|
11458
|
-
const node10Result = (_b = (_a =
|
|
11441
|
+
var _a, _b, _c;
|
|
11442
|
+
const node10Result = (_c = (_b = (_a = host.resolvedModules) == null ? void 0 : _a.get(sourceFile.path)) == null ? void 0 : _b.get(moduleReference, mode)) == null ? void 0 : _c.node10Result;
|
|
11459
11443
|
const result = node10Result ? chainDiagnosticMessages(
|
|
11460
11444
|
/*details*/
|
|
11461
11445
|
void 0,
|
|
@@ -16470,14 +16454,11 @@ function createSymlinkCache(cwd, getCanonicalFileName) {
|
|
|
16470
16454
|
(symlinkedDirectories || (symlinkedDirectories = /* @__PURE__ */ new Map())).set(symlinkPath, real);
|
|
16471
16455
|
}
|
|
16472
16456
|
},
|
|
16473
|
-
setSymlinksFromResolutions(
|
|
16474
|
-
var _a, _b;
|
|
16457
|
+
setSymlinksFromResolutions(resolvedModules, resolvedTypeReferenceDirectiveNames, typeReferenceDirectives) {
|
|
16475
16458
|
Debug.assert(!hasProcessedResolutions);
|
|
16476
16459
|
hasProcessedResolutions = true;
|
|
16477
|
-
|
|
16478
|
-
|
|
16479
|
-
(_b = file.resolvedTypeReferenceDirectiveNames) == null ? void 0 : _b.forEach((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective));
|
|
16480
|
-
}
|
|
16460
|
+
resolvedModules == null ? void 0 : resolvedModules.forEach((cache) => cache.forEach((resolution) => processResolution(this, resolution.resolvedModule)));
|
|
16461
|
+
resolvedTypeReferenceDirectiveNames == null ? void 0 : resolvedTypeReferenceDirectiveNames.forEach((cache) => cache.forEach((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective)));
|
|
16481
16462
|
typeReferenceDirectives.forEach((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective));
|
|
16482
16463
|
},
|
|
16483
16464
|
hasProcessedResolutions: () => hasProcessedResolutions
|
|
@@ -21462,7 +21443,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
21462
21443
|
node.imports = void 0;
|
|
21463
21444
|
node.moduleAugmentations = void 0;
|
|
21464
21445
|
node.ambientModuleNames = void 0;
|
|
21465
|
-
node.resolvedModules = void 0;
|
|
21466
21446
|
node.classifiableNames = void 0;
|
|
21467
21447
|
node.impliedNodeFormat = void 0;
|
|
21468
21448
|
return node;
|
|
@@ -34091,6 +34071,7 @@ var moduleOptionDeclaration = {
|
|
|
34091
34071
|
node16: 100 /* Node16 */,
|
|
34092
34072
|
nodenext: 199 /* NodeNext */
|
|
34093
34073
|
})),
|
|
34074
|
+
affectsSourceFile: true,
|
|
34094
34075
|
affectsModuleResolution: true,
|
|
34095
34076
|
affectsEmit: true,
|
|
34096
34077
|
affectsBuildInfo: true,
|
|
@@ -34527,6 +34508,7 @@ var commandOptionsWithoutBuild = [
|
|
|
34527
34508
|
bundler: 100 /* Bundler */
|
|
34528
34509
|
})),
|
|
34529
34510
|
deprecatedKeys: /* @__PURE__ */ new Set(["node"]),
|
|
34511
|
+
affectsSourceFile: true,
|
|
34530
34512
|
affectsModuleResolution: true,
|
|
34531
34513
|
paramType: Diagnostics.STRATEGY,
|
|
34532
34514
|
category: Diagnostics.Modules,
|
|
@@ -35069,6 +35051,7 @@ var commandOptionsWithoutBuild = [
|
|
|
35069
35051
|
legacy: 1 /* Legacy */,
|
|
35070
35052
|
force: 3 /* Force */
|
|
35071
35053
|
})),
|
|
35054
|
+
affectsSourceFile: true,
|
|
35072
35055
|
affectsModuleResolution: true,
|
|
35073
35056
|
description: Diagnostics.Control_what_method_is_used_to_detect_module_format_JS_files,
|
|
35074
35057
|
category: Diagnostics.Language_and_Environment,
|
|
@@ -35088,7 +35071,7 @@ var semanticDiagnosticsOptionDeclarations = optionDeclarations.filter((option) =
|
|
|
35088
35071
|
var affectsEmitOptionDeclarations = optionDeclarations.filter((option) => !!option.affectsEmit);
|
|
35089
35072
|
var affectsDeclarationPathOptionDeclarations = optionDeclarations.filter((option) => !!option.affectsDeclarationPath);
|
|
35090
35073
|
var moduleResolutionOptionDeclarations = optionDeclarations.filter((option) => !!option.affectsModuleResolution);
|
|
35091
|
-
var sourceFileAffectingCompilerOptions = optionDeclarations.filter((option) => !!option.affectsSourceFile || !!option.
|
|
35074
|
+
var sourceFileAffectingCompilerOptions = optionDeclarations.filter((option) => !!option.affectsSourceFile || !!option.affectsBindDiagnostics);
|
|
35092
35075
|
var optionsAffectingProgramStructure = optionDeclarations.filter((option) => !!option.affectsProgramStructure);
|
|
35093
35076
|
var transpileOptionValueCompilerOptions = optionDeclarations.filter((option) => hasProperty(option, "transpileOptionValue"));
|
|
35094
35077
|
var optionsForBuild = [
|
|
@@ -37463,15 +37446,6 @@ function createModeAwareCache() {
|
|
|
37463
37446
|
return result;
|
|
37464
37447
|
}
|
|
37465
37448
|
}
|
|
37466
|
-
function zipToModeAwareCache(file, keys, values, nameAndModeGetter) {
|
|
37467
|
-
Debug.assert(keys.length === values.length);
|
|
37468
|
-
const map2 = createModeAwareCache();
|
|
37469
|
-
for (let i = 0; i < keys.length; ++i) {
|
|
37470
|
-
const entry = keys[i];
|
|
37471
|
-
map2.set(nameAndModeGetter.getName(entry), nameAndModeGetter.getMode(entry, file), values[i]);
|
|
37472
|
-
}
|
|
37473
|
-
return map2;
|
|
37474
|
-
}
|
|
37475
37449
|
function getOriginalOrResolvedModuleFileName(result) {
|
|
37476
37450
|
return result.resolvedModule && (result.resolvedModule.originalPath || result.resolvedModule.resolvedFileName);
|
|
37477
37451
|
}
|
|
@@ -46313,7 +46287,7 @@ function createTypeChecker(host) {
|
|
|
46313
46287
|
return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) : void 0;
|
|
46314
46288
|
}
|
|
46315
46289
|
function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) {
|
|
46316
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
46290
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
46317
46291
|
if (startsWith(moduleReference, "@types/")) {
|
|
46318
46292
|
const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
|
|
46319
46293
|
const withoutAtTypePrefix = removePrefix(moduleReference, "@types/");
|
|
@@ -46331,7 +46305,7 @@ function createTypeChecker(host) {
|
|
|
46331
46305
|
const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = findAncestor(location, isImportCall)) == null ? void 0 : _a.arguments[0]) || ((_b = findAncestor(location, isImportDeclaration)) == null ? void 0 : _b.moduleSpecifier) || ((_c = findAncestor(location, isExternalModuleImportEqualsDeclaration)) == null ? void 0 : _c.moduleReference.expression) || ((_d = findAncestor(location, isExportDeclaration)) == null ? void 0 : _d.moduleSpecifier) || ((_e = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _e.name) || ((_f = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _f.argument.literal);
|
|
46332
46306
|
const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
|
|
46333
46307
|
const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
|
|
46334
|
-
const resolvedModule =
|
|
46308
|
+
const resolvedModule = (_i = (_h = (_g = host.resolvedModules) == null ? void 0 : _g.get(currentSourceFile.path)) == null ? void 0 : _h.get(moduleReference, mode)) == null ? void 0 : _i.resolvedModule;
|
|
46335
46309
|
const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule, currentSourceFile);
|
|
46336
46310
|
const sourceFile = resolvedModule && (!resolutionDiagnostic || resolutionDiagnostic === Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set) && host.getSourceFile(resolvedModule.resolvedFileName);
|
|
46337
46311
|
if (sourceFile) {
|
|
@@ -46339,7 +46313,7 @@ function createTypeChecker(host) {
|
|
|
46339
46313
|
error(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName);
|
|
46340
46314
|
}
|
|
46341
46315
|
if (resolvedModule.resolvedUsingTsExtension && isDeclarationFileName(moduleReference)) {
|
|
46342
|
-
const importOrExport = ((
|
|
46316
|
+
const importOrExport = ((_j = findAncestor(location, isImportDeclaration)) == null ? void 0 : _j.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
|
|
46343
46317
|
if (importOrExport && !importOrExport.isTypeOnly || findAncestor(location, isImportCall)) {
|
|
46344
46318
|
error(
|
|
46345
46319
|
errorNode,
|
|
@@ -46348,7 +46322,7 @@ function createTypeChecker(host) {
|
|
|
46348
46322
|
);
|
|
46349
46323
|
}
|
|
46350
46324
|
} else if (resolvedModule.resolvedUsingTsExtension && !shouldAllowImportingTsExtension(compilerOptions, currentSourceFile.fileName)) {
|
|
46351
|
-
const importOrExport = ((
|
|
46325
|
+
const importOrExport = ((_k = findAncestor(location, isImportDeclaration)) == null ? void 0 : _k.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
|
|
46352
46326
|
if (!((importOrExport == null ? void 0 : importOrExport.isTypeOnly) || findAncestor(location, isImportTypeNode))) {
|
|
46353
46327
|
const tsExtension = Debug.checkDefined(tryExtractTSExtension(moduleReference));
|
|
46354
46328
|
error(errorNode, Diagnostics.An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled, tsExtension);
|
|
@@ -46369,7 +46343,7 @@ function createTypeChecker(host) {
|
|
|
46369
46343
|
if (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */) {
|
|
46370
46344
|
const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
|
|
46371
46345
|
const overrideClauseHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l));
|
|
46372
|
-
const overrideClause = overrideClauseHost && isImportTypeNode(overrideClauseHost) ? (
|
|
46346
|
+
const overrideClause = overrideClauseHost && isImportTypeNode(overrideClauseHost) ? (_l = overrideClauseHost.assertions) == null ? void 0 : _l.assertClause : overrideClauseHost == null ? void 0 : overrideClauseHost.assertClause;
|
|
46373
46347
|
if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !getResolutionModeOverrideForClause(overrideClause)) {
|
|
46374
46348
|
if (findAncestor(location, isImportEqualsDeclaration)) {
|
|
46375
46349
|
error(errorNode, Diagnostics.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead, moduleReference);
|
|
@@ -46476,7 +46450,7 @@ function createTypeChecker(host) {
|
|
|
46476
46450
|
error(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
|
|
46477
46451
|
} else if (mode === 99 /* ESNext */ && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) {
|
|
46478
46452
|
const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path));
|
|
46479
|
-
const suggestedExt = (
|
|
46453
|
+
const suggestedExt = (_m = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))) == null ? void 0 : _m[1];
|
|
46480
46454
|
if (suggestedExt) {
|
|
46481
46455
|
error(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0, moduleReference + suggestedExt);
|
|
46482
46456
|
} else {
|
|
@@ -115395,15 +115369,15 @@ function isReferencedFile(reason) {
|
|
|
115395
115369
|
function isReferenceFileLocation(location) {
|
|
115396
115370
|
return location.pos !== void 0;
|
|
115397
115371
|
}
|
|
115398
|
-
function getReferencedFileLocation(
|
|
115399
|
-
var _a, _b, _c, _d, _e, _f;
|
|
115400
|
-
const file = Debug.checkDefined(getSourceFileByPath(ref.file));
|
|
115372
|
+
function getReferencedFileLocation(program, ref) {
|
|
115373
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
115374
|
+
const file = Debug.checkDefined(program.getSourceFileByPath(ref.file));
|
|
115401
115375
|
const { kind, index } = ref;
|
|
115402
115376
|
let pos, end, packageId, resolutionMode;
|
|
115403
115377
|
switch (kind) {
|
|
115404
115378
|
case 3 /* Import */:
|
|
115405
115379
|
const importLiteral = getModuleNameStringLiteralAt(file, index);
|
|
115406
|
-
packageId = (_c = (_b = (_a =
|
|
115380
|
+
packageId = (_d = (_c = (_b = (_a = program.resolvedModules) == null ? void 0 : _a.get(file.path)) == null ? void 0 : _b.get(importLiteral.text, getModeForResolutionAtIndex(file, index))) == null ? void 0 : _c.resolvedModule) == null ? void 0 : _d.packageId;
|
|
115407
115381
|
if (importLiteral.pos === -1)
|
|
115408
115382
|
return { file, packageId, text: importLiteral.text };
|
|
115409
115383
|
pos = skipTrivia(file.text, importLiteral.pos);
|
|
@@ -115414,7 +115388,7 @@ function getReferencedFileLocation(getSourceFileByPath, ref) {
|
|
|
115414
115388
|
break;
|
|
115415
115389
|
case 5 /* TypeReferenceDirective */:
|
|
115416
115390
|
({ pos, end, resolutionMode } = file.typeReferenceDirectives[index]);
|
|
115417
|
-
packageId = (
|
|
115391
|
+
packageId = (_h = (_g = (_f = (_e = program.resolvedTypeReferenceDirectiveNames) == null ? void 0 : _e.get(file.path)) == null ? void 0 : _f.get(toFileNameLowerCase(file.typeReferenceDirectives[index].fileName), resolutionMode || file.impliedNodeFormat)) == null ? void 0 : _g.resolvedTypeReferenceDirective) == null ? void 0 : _h.packageId;
|
|
115418
115392
|
break;
|
|
115419
115393
|
case 7 /* LibReferenceDirective */:
|
|
115420
115394
|
({ pos, end } = file.libReferenceDirectives[index]);
|
|
@@ -115628,6 +115602,10 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
115628
115602
|
let automaticTypeDirectiveResolutions;
|
|
115629
115603
|
let resolvedLibReferences;
|
|
115630
115604
|
let resolvedLibProcessing;
|
|
115605
|
+
let resolvedModules;
|
|
115606
|
+
let resolvedModulesProcessing;
|
|
115607
|
+
let resolvedTypeReferenceDirectiveNames;
|
|
115608
|
+
let resolvedTypeReferenceDirectiveNamesProcessing;
|
|
115631
115609
|
let packageMap;
|
|
115632
115610
|
const maxNodeModuleJsDepth = typeof options.maxNodeModuleJsDepth === "number" ? options.maxNodeModuleJsDepth : 0;
|
|
115633
115611
|
let currentNodeModulesDepth = 0;
|
|
@@ -115892,6 +115870,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
115892
115870
|
}
|
|
115893
115871
|
oldProgram = void 0;
|
|
115894
115872
|
resolvedLibProcessing = void 0;
|
|
115873
|
+
resolvedModulesProcessing = void 0;
|
|
115874
|
+
resolvedTypeReferenceDirectiveNamesProcessing = void 0;
|
|
115895
115875
|
const program = {
|
|
115896
115876
|
getRootFileNames: () => rootNames,
|
|
115897
115877
|
getSourceFile,
|
|
@@ -115933,6 +115913,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
115933
115913
|
sourceFileToPackageName,
|
|
115934
115914
|
redirectTargetsMap,
|
|
115935
115915
|
usesUriStyleNodeCoreModules,
|
|
115916
|
+
resolvedModules,
|
|
115917
|
+
resolvedTypeReferenceDirectiveNames,
|
|
115936
115918
|
resolvedLibReferences,
|
|
115937
115919
|
getCurrentPackagesMap: () => packageMap,
|
|
115938
115920
|
typesPackageExists,
|
|
@@ -115964,7 +115946,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
115964
115946
|
case 1 /* FilePreprocessingFileExplainingDiagnostic */:
|
|
115965
115947
|
return programDiagnostics.add(createDiagnosticExplainingFile(diagnostic.file && getSourceFileByPath(diagnostic.file), diagnostic.fileProcessingReason, diagnostic.diagnostic, diagnostic.args || emptyArray));
|
|
115966
115948
|
case 0 /* FilePreprocessingReferencedDiagnostic */:
|
|
115967
|
-
const { file, pos, end } = getReferencedFileLocation(
|
|
115949
|
+
const { file, pos, end } = getReferencedFileLocation(program, diagnostic.reason);
|
|
115968
115950
|
return programDiagnostics.add(createFileDiagnostic(file, Debug.checkDefined(pos), Debug.checkDefined(end) - pos, diagnostic.diagnostic, ...diagnostic.args || emptyArray));
|
|
115969
115951
|
case 2 /* ResolutionDiagnostics */:
|
|
115970
115952
|
return diagnostic.diagnostics.forEach((d) => programDiagnostics.add(d));
|
|
@@ -115981,14 +115963,15 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
115981
115963
|
if (packageMap)
|
|
115982
115964
|
return packageMap;
|
|
115983
115965
|
packageMap = /* @__PURE__ */ new Map();
|
|
115984
|
-
files.forEach(
|
|
115985
|
-
|
|
115986
|
-
|
|
115987
|
-
|
|
115988
|
-
|
|
115989
|
-
|
|
115990
|
-
|
|
115991
|
-
|
|
115966
|
+
files.forEach(
|
|
115967
|
+
(sf) => {
|
|
115968
|
+
var _a2;
|
|
115969
|
+
return (_a2 = resolvedModules == null ? void 0 : resolvedModules.get(sf.path)) == null ? void 0 : _a2.forEach(({ resolvedModule }) => {
|
|
115970
|
+
if (resolvedModule == null ? void 0 : resolvedModule.packageId)
|
|
115971
|
+
packageMap.set(resolvedModule.packageId.name, resolvedModule.extension === ".d.ts" /* Dts */ || !!packageMap.get(resolvedModule.packageId.name));
|
|
115972
|
+
});
|
|
115973
|
+
}
|
|
115974
|
+
);
|
|
115992
115975
|
return packageMap;
|
|
115993
115976
|
}
|
|
115994
115977
|
function typesPackageExists(packageName) {
|
|
@@ -116120,7 +116103,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116120
116103
|
return classifiableNames;
|
|
116121
116104
|
}
|
|
116122
116105
|
function resolveModuleNamesReusingOldState(moduleNames, file) {
|
|
116123
|
-
var _a2;
|
|
116106
|
+
var _a2, _b2;
|
|
116124
116107
|
if (structureIsReused === 0 /* Not */ && !file.ambientModuleNames.length) {
|
|
116125
116108
|
return resolveModuleNamesWorker(
|
|
116126
116109
|
moduleNames,
|
|
@@ -116129,24 +116112,16 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116129
116112
|
void 0
|
|
116130
116113
|
);
|
|
116131
116114
|
}
|
|
116132
|
-
const oldSourceFile = oldProgram && oldProgram.getSourceFile(file.fileName);
|
|
116133
|
-
if (oldSourceFile !== file && file.resolvedModules) {
|
|
116134
|
-
const result2 = [];
|
|
116135
|
-
for (const moduleName of moduleNames) {
|
|
116136
|
-
const resolvedModule = file.resolvedModules.get(moduleName.text, getModeForUsageLocation(file, moduleName));
|
|
116137
|
-
result2.push(resolvedModule);
|
|
116138
|
-
}
|
|
116139
|
-
return result2;
|
|
116140
|
-
}
|
|
116141
116115
|
let unknownModuleNames;
|
|
116142
116116
|
let result;
|
|
116143
116117
|
let reusedNames;
|
|
116144
116118
|
const predictedToResolveToAmbientModuleMarker = emptyResolution;
|
|
116119
|
+
const oldSourceFile = oldProgram && oldProgram.getSourceFile(file.fileName);
|
|
116145
116120
|
for (let i = 0; i < moduleNames.length; i++) {
|
|
116146
116121
|
const moduleName = moduleNames[i];
|
|
116147
|
-
if (file === oldSourceFile && !hasInvalidatedResolutions(
|
|
116122
|
+
if (file === oldSourceFile && !hasInvalidatedResolutions(file.path)) {
|
|
116148
116123
|
const mode = getModeForUsageLocation(file, moduleName);
|
|
116149
|
-
const oldResolution = (_a2 =
|
|
116124
|
+
const oldResolution = (_b2 = (_a2 = oldProgram == null ? void 0 : oldProgram.resolvedModules) == null ? void 0 : _a2.get(file.path)) == null ? void 0 : _b2.get(moduleName.text, mode);
|
|
116150
116125
|
if (oldResolution == null ? void 0 : oldResolution.resolvedModule) {
|
|
116151
116126
|
if (isTraceEnabled(options, host)) {
|
|
116152
116127
|
trace(
|
|
@@ -116193,7 +116168,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116193
116168
|
Debug.assert(j === resolutions.length);
|
|
116194
116169
|
return result;
|
|
116195
116170
|
function moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName) {
|
|
116196
|
-
|
|
116171
|
+
var _a3, _b3, _c2;
|
|
116172
|
+
const resolutionToFile = (_c2 = (_b3 = (_a3 = oldProgram == null ? void 0 : oldProgram.resolvedModules) == null ? void 0 : _a3.get(file.path)) == null ? void 0 : _b3.get(moduleName.text, getModeForUsageLocation(file, moduleName))) == null ? void 0 : _c2.resolvedModule;
|
|
116197
116173
|
const resolvedFile = resolutionToFile && oldProgram.getSourceFile(resolutionToFile.resolvedFileName);
|
|
116198
116174
|
if (resolutionToFile && resolvedFile) {
|
|
116199
116175
|
return false;
|
|
@@ -116209,7 +116185,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116209
116185
|
}
|
|
116210
116186
|
}
|
|
116211
116187
|
function resolveTypeReferenceDirectiveNamesReusingOldState(typeDirectiveNames, containingFile) {
|
|
116212
|
-
var _a2;
|
|
116188
|
+
var _a2, _b2;
|
|
116213
116189
|
if (structureIsReused === 0 /* Not */) {
|
|
116214
116190
|
return resolveTypeReferenceDirectiveNamesWorker(
|
|
116215
116191
|
typeDirectiveNames,
|
|
@@ -116218,28 +116194,18 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116218
116194
|
void 0
|
|
116219
116195
|
);
|
|
116220
116196
|
}
|
|
116221
|
-
const oldSourceFile = !isString(containingFile) ? oldProgram && oldProgram.getSourceFile(containingFile.fileName) : void 0;
|
|
116222
|
-
if (!isString(containingFile)) {
|
|
116223
|
-
if (oldSourceFile !== containingFile && containingFile.resolvedTypeReferenceDirectiveNames) {
|
|
116224
|
-
const result2 = [];
|
|
116225
|
-
for (const typeDirectiveName of typeDirectiveNames) {
|
|
116226
|
-
const resolvedTypeReferenceDirective = containingFile.resolvedTypeReferenceDirectiveNames.get(getTypeReferenceResolutionName(typeDirectiveName), getModeForFileReference(typeDirectiveName, containingFile.impliedNodeFormat));
|
|
116227
|
-
result2.push(resolvedTypeReferenceDirective);
|
|
116228
|
-
}
|
|
116229
|
-
return result2;
|
|
116230
|
-
}
|
|
116231
|
-
}
|
|
116232
116197
|
let unknownTypeReferenceDirectiveNames;
|
|
116233
116198
|
let result;
|
|
116234
116199
|
let reusedNames;
|
|
116235
116200
|
const containingSourceFile = !isString(containingFile) ? containingFile : void 0;
|
|
116236
|
-
const
|
|
116201
|
+
const oldSourceFile = !isString(containingFile) ? oldProgram && oldProgram.getSourceFile(containingFile.fileName) : void 0;
|
|
116202
|
+
const canReuseResolutions = !isString(containingFile) ? containingFile === oldSourceFile && !hasInvalidatedResolutions(containingFile.path) : !hasInvalidatedResolutions(toPath3(containingFile));
|
|
116237
116203
|
for (let i = 0; i < typeDirectiveNames.length; i++) {
|
|
116238
116204
|
const entry = typeDirectiveNames[i];
|
|
116239
116205
|
if (canReuseResolutions) {
|
|
116240
116206
|
const typeDirectiveName = getTypeReferenceResolutionName(entry);
|
|
116241
116207
|
const mode = getModeForFileReference(entry, containingSourceFile == null ? void 0 : containingSourceFile.impliedNodeFormat);
|
|
116242
|
-
const oldResolution = (
|
|
116208
|
+
const oldResolution = (_b2 = !isString(containingFile) ? (_a2 = oldProgram == null ? void 0 : oldProgram.resolvedTypeReferenceDirectiveNames) == null ? void 0 : _a2.get(containingFile.path) : oldProgram == null ? void 0 : oldProgram.getAutomaticTypeDirectiveResolutions()) == null ? void 0 : _b2.get(typeDirectiveName, mode);
|
|
116243
116209
|
if (oldResolution == null ? void 0 : oldResolution.resolvedTypeReferenceDirective) {
|
|
116244
116210
|
if (isTraceEnabled(options, host)) {
|
|
116245
116211
|
trace(
|
|
@@ -116299,7 +116265,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116299
116265
|
);
|
|
116300
116266
|
}
|
|
116301
116267
|
function tryReuseStructureFromOldProgram() {
|
|
116302
|
-
var _a2;
|
|
116268
|
+
var _a2, _b2, _c2;
|
|
116303
116269
|
if (!oldProgram) {
|
|
116304
116270
|
return 0 /* Not */;
|
|
116305
116271
|
}
|
|
@@ -116401,42 +116367,37 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116401
116367
|
structureIsReused = 1 /* SafeModules */;
|
|
116402
116368
|
}
|
|
116403
116369
|
}
|
|
116404
|
-
modifiedSourceFiles.push(
|
|
116370
|
+
modifiedSourceFiles.push(newSourceFile);
|
|
116405
116371
|
} else if (hasInvalidatedResolutions(oldSourceFile.path)) {
|
|
116406
116372
|
structureIsReused = 1 /* SafeModules */;
|
|
116407
|
-
modifiedSourceFiles.push(
|
|
116373
|
+
modifiedSourceFiles.push(newSourceFile);
|
|
116374
|
+
} else {
|
|
116375
|
+
for (const moduleName of oldSourceFile.ambientModuleNames) {
|
|
116376
|
+
ambientModuleNameToUnmodifiedFileName.set(moduleName, oldSourceFile.fileName);
|
|
116377
|
+
}
|
|
116408
116378
|
}
|
|
116409
116379
|
newSourceFiles.push(newSourceFile);
|
|
116410
116380
|
}
|
|
116411
116381
|
if (structureIsReused !== 2 /* Completely */) {
|
|
116412
116382
|
return structureIsReused;
|
|
116413
116383
|
}
|
|
116414
|
-
const
|
|
116415
|
-
for (const oldFile of oldSourceFiles) {
|
|
116416
|
-
if (!contains(modifiedFiles, oldFile)) {
|
|
116417
|
-
for (const moduleName of oldFile.ambientModuleNames) {
|
|
116418
|
-
ambientModuleNameToUnmodifiedFileName.set(moduleName, oldFile.fileName);
|
|
116419
|
-
}
|
|
116420
|
-
}
|
|
116421
|
-
}
|
|
116422
|
-
for (const { oldFile: oldSourceFile, newFile: newSourceFile } of modifiedSourceFiles) {
|
|
116384
|
+
for (const newSourceFile of modifiedSourceFiles) {
|
|
116423
116385
|
const moduleNames = getModuleNames(newSourceFile);
|
|
116424
116386
|
const resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFile);
|
|
116425
|
-
|
|
116426
|
-
|
|
116387
|
+
(resolvedModulesProcessing ?? (resolvedModulesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, resolutions);
|
|
116388
|
+
const oldResolutions = (_b2 = oldProgram.resolvedModules) == null ? void 0 : _b2.get(newSourceFile.path);
|
|
116389
|
+
const resolutionsChanged = hasChangesInResolutions(moduleNames, newSourceFile, resolutions, oldResolutions, moduleResolutionIsEqualTo, moduleResolutionNameAndModeGetter);
|
|
116390
|
+
if (resolutionsChanged)
|
|
116427
116391
|
structureIsReused = 1 /* SafeModules */;
|
|
116428
|
-
newSourceFile.resolvedModules = zipToModeAwareCache(newSourceFile, moduleNames, resolutions, moduleResolutionNameAndModeGetter);
|
|
116429
|
-
} else {
|
|
116430
|
-
newSourceFile.resolvedModules = oldSourceFile.resolvedModules;
|
|
116431
|
-
}
|
|
116432
116392
|
const typesReferenceDirectives = newSourceFile.typeReferenceDirectives;
|
|
116433
116393
|
const typeReferenceResolutions = resolveTypeReferenceDirectiveNamesReusingOldState(typesReferenceDirectives, newSourceFile);
|
|
116434
|
-
|
|
116394
|
+
(resolvedTypeReferenceDirectiveNamesProcessing ?? (resolvedTypeReferenceDirectiveNamesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, typeReferenceResolutions);
|
|
116395
|
+
const oldTypeResolutions = (_c2 = oldProgram.resolvedTypeReferenceDirectiveNames) == null ? void 0 : _c2.get(newSourceFile.path);
|
|
116396
|
+
const typeReferenceResolutionsChanged = hasChangesInResolutions(typesReferenceDirectives, newSourceFile, typeReferenceResolutions, oldTypeResolutions, typeDirectiveIsEqualTo, typeReferenceResolutionNameAndModeGetter);
|
|
116435
116397
|
if (typeReferenceResolutionsChanged) {
|
|
116436
116398
|
structureIsReused = 1 /* SafeModules */;
|
|
116437
|
-
|
|
116438
|
-
|
|
116439
|
-
newSourceFile.resolvedTypeReferenceDirectiveNames = oldSourceFile.resolvedTypeReferenceDirectiveNames;
|
|
116399
|
+
} else if (oldTypeResolutions) {
|
|
116400
|
+
(resolvedTypeReferenceDirectiveNamesProcessing ?? (resolvedTypeReferenceDirectiveNamesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, oldTypeResolutions);
|
|
116440
116401
|
}
|
|
116441
116402
|
}
|
|
116442
116403
|
if (structureIsReused !== 2 /* Completely */) {
|
|
@@ -116484,6 +116445,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116484
116445
|
sourceFileToPackageName = oldProgram.sourceFileToPackageName;
|
|
116485
116446
|
redirectTargetsMap = oldProgram.redirectTargetsMap;
|
|
116486
116447
|
usesUriStyleNodeCoreModules = oldProgram.usesUriStyleNodeCoreModules;
|
|
116448
|
+
resolvedModules = oldProgram.resolvedModules;
|
|
116449
|
+
resolvedTypeReferenceDirectiveNames = oldProgram.resolvedTypeReferenceDirectiveNames;
|
|
116487
116450
|
resolvedLibReferences = oldProgram.resolvedLibReferences;
|
|
116488
116451
|
packageMap = oldProgram.getCurrentPackagesMap();
|
|
116489
116452
|
return 2 /* Completely */;
|
|
@@ -117529,16 +117492,16 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
117529
117492
|
}
|
|
117530
117493
|
function processTypeReferenceDirectives(file) {
|
|
117531
117494
|
const typeDirectives = file.typeReferenceDirectives;
|
|
117532
|
-
if (!typeDirectives.length)
|
|
117533
|
-
file.resolvedTypeReferenceDirectiveNames = void 0;
|
|
117495
|
+
if (!typeDirectives.length)
|
|
117534
117496
|
return;
|
|
117535
|
-
|
|
117536
|
-
const
|
|
117497
|
+
const resolutions = (resolvedTypeReferenceDirectiveNamesProcessing == null ? void 0 : resolvedTypeReferenceDirectiveNamesProcessing.get(file.path)) || resolveTypeReferenceDirectiveNamesReusingOldState(typeDirectives, file);
|
|
117498
|
+
const resolutionsInFile = createModeAwareCache();
|
|
117499
|
+
(resolvedTypeReferenceDirectiveNames ?? (resolvedTypeReferenceDirectiveNames = /* @__PURE__ */ new Map())).set(file.path, resolutionsInFile);
|
|
117537
117500
|
for (let index = 0; index < typeDirectives.length; index++) {
|
|
117538
117501
|
const ref = file.typeReferenceDirectives[index];
|
|
117539
117502
|
const resolvedTypeReferenceDirective = resolutions[index];
|
|
117540
117503
|
const fileName = toFileNameLowerCase(ref.fileName);
|
|
117541
|
-
|
|
117504
|
+
resolutionsInFile.set(fileName, getModeForFileReference(ref, file.impliedNodeFormat), resolvedTypeReferenceDirective);
|
|
117542
117505
|
const mode = ref.resolutionMode || file.impliedNodeFormat;
|
|
117543
117506
|
if (mode && getEmitModuleResolutionKind(options) !== 3 /* Node16 */ && getEmitModuleResolutionKind(options) !== 99 /* NodeNext */) {
|
|
117544
117507
|
(fileProcessingDiagnostics ?? (fileProcessingDiagnostics = [])).push({
|
|
@@ -117702,14 +117665,16 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
117702
117665
|
collectExternalModuleReferences(file);
|
|
117703
117666
|
if (file.imports.length || file.moduleAugmentations.length) {
|
|
117704
117667
|
const moduleNames = getModuleNames(file);
|
|
117705
|
-
const resolutions = resolveModuleNamesReusingOldState(moduleNames, file);
|
|
117668
|
+
const resolutions = (resolvedModulesProcessing == null ? void 0 : resolvedModulesProcessing.get(file.path)) || resolveModuleNamesReusingOldState(moduleNames, file);
|
|
117706
117669
|
Debug.assert(resolutions.length === moduleNames.length);
|
|
117707
117670
|
const optionsForFile = (useSourceOfProjectReferenceRedirect ? (_a2 = getRedirectReferenceForResolution(file)) == null ? void 0 : _a2.commandLine.options : void 0) || options;
|
|
117671
|
+
const resolutionsInFile = createModeAwareCache();
|
|
117672
|
+
(resolvedModules ?? (resolvedModules = /* @__PURE__ */ new Map())).set(file.path, resolutionsInFile);
|
|
117708
117673
|
for (let index = 0; index < moduleNames.length; index++) {
|
|
117709
117674
|
const resolution = resolutions[index].resolvedModule;
|
|
117710
117675
|
const moduleName = moduleNames[index].text;
|
|
117711
117676
|
const mode = getModeForUsageLocation(file, moduleNames[index]);
|
|
117712
|
-
|
|
117677
|
+
resolutionsInFile.set(moduleName, mode, resolutions[index]);
|
|
117713
117678
|
addResolutionDiagnosticsFromResolutionOrCache(file, moduleName, resolutions[index], mode);
|
|
117714
117679
|
if (!resolution) {
|
|
117715
117680
|
continue;
|
|
@@ -117740,8 +117705,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
117740
117705
|
currentNodeModulesDepth--;
|
|
117741
117706
|
}
|
|
117742
117707
|
}
|
|
117743
|
-
} else {
|
|
117744
|
-
file.resolvedModules = void 0;
|
|
117745
117708
|
}
|
|
117746
117709
|
}
|
|
117747
117710
|
function checkSourceFilesBelongToPath(sourceFiles, rootDirectory) {
|
|
@@ -118256,7 +118219,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
118256
118219
|
processReason(fileProcessingReason);
|
|
118257
118220
|
if (locationReason && (fileIncludeReasons == null ? void 0 : fileIncludeReasons.length) === 1)
|
|
118258
118221
|
fileIncludeReasons = void 0;
|
|
118259
|
-
const location = locationReason && getReferencedFileLocation(
|
|
118222
|
+
const location = locationReason && getReferencedFileLocation(program, locationReason);
|
|
118260
118223
|
const fileIncludeReasonDetails = fileIncludeReasons && chainDiagnosticMessages(fileIncludeReasons, Diagnostics.The_file_is_in_the_program_because_Colon);
|
|
118261
118224
|
const redirectInfo = file && explainIfFileIsRedirectAndImpliedFormat(file);
|
|
118262
118225
|
const chain = chainDiagnosticMessages(redirectInfo ? fileIncludeReasonDetails ? [fileIncludeReasonDetails, ...redirectInfo] : redirectInfo : fileIncludeReasonDetails, diagnostic, ...args || emptyArray);
|
|
@@ -118292,7 +118255,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
118292
118255
|
}
|
|
118293
118256
|
function fileIncludeReasonToRelatedInformation(reason) {
|
|
118294
118257
|
if (isReferencedFile(reason)) {
|
|
118295
|
-
const referenceLocation = getReferencedFileLocation(
|
|
118258
|
+
const referenceLocation = getReferencedFileLocation(program, reason);
|
|
118296
118259
|
let message2;
|
|
118297
118260
|
switch (reason.kind) {
|
|
118298
118261
|
case 3 /* Import */:
|
|
@@ -118581,8 +118544,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
118581
118544
|
if (!symlinks) {
|
|
118582
118545
|
symlinks = createSymlinkCache(currentDirectory, getCanonicalFileName);
|
|
118583
118546
|
}
|
|
118584
|
-
if (files &&
|
|
118585
|
-
symlinks.setSymlinksFromResolutions(
|
|
118547
|
+
if (files && !symlinks.hasProcessedResolutions()) {
|
|
118548
|
+
symlinks.setSymlinksFromResolutions(resolvedModules, resolvedTypeReferenceDirectiveNames, automaticTypeDirectiveResolutions);
|
|
118586
118549
|
}
|
|
118587
118550
|
return symlinks;
|
|
118588
118551
|
}
|
|
@@ -118936,6 +118899,7 @@ var BuilderState;
|
|
|
118936
118899
|
return toPath(program.getProjectReferenceRedirect(fileName) || fileName, sourceFileDirectory, getCanonicalFileName);
|
|
118937
118900
|
}
|
|
118938
118901
|
function getReferencedFiles(program, sourceFile, getCanonicalFileName) {
|
|
118902
|
+
var _a;
|
|
118939
118903
|
let referencedFiles;
|
|
118940
118904
|
if (sourceFile.imports && sourceFile.imports.length > 0) {
|
|
118941
118905
|
const checker = program.getTypeChecker();
|
|
@@ -118951,8 +118915,9 @@ var BuilderState;
|
|
|
118951
118915
|
addReferencedFile(referencedPath);
|
|
118952
118916
|
}
|
|
118953
118917
|
}
|
|
118954
|
-
|
|
118955
|
-
|
|
118918
|
+
const resolvedTypeReferenceDirectiveNames = (_a = program.resolvedTypeReferenceDirectiveNames) == null ? void 0 : _a.get(sourceFile.path);
|
|
118919
|
+
if (resolvedTypeReferenceDirectiveNames) {
|
|
118920
|
+
resolvedTypeReferenceDirectiveNames.forEach(({ resolvedTypeReferenceDirective }) => {
|
|
118956
118921
|
if (!resolvedTypeReferenceDirective) {
|
|
118957
118922
|
return;
|
|
118958
118923
|
}
|
|
@@ -120748,7 +120713,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
120748
120713
|
clear: clear2,
|
|
120749
120714
|
onChangesAffectModuleResolution
|
|
120750
120715
|
};
|
|
120751
|
-
function
|
|
120716
|
+
function getResolvedModule(resolution) {
|
|
120752
120717
|
return resolution.resolvedModule;
|
|
120753
120718
|
}
|
|
120754
120719
|
function getResolvedTypeReferenceDirective(resolution) {
|
|
@@ -120827,7 +120792,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
120827
120792
|
stopWatchFailedLookupLocationOfResolution(
|
|
120828
120793
|
resolution,
|
|
120829
120794
|
resolutionHost.toPath(getInferredLibraryNameResolveFrom(newProgram.getCompilerOptions(), getCurrentDirectory(), libFileName)),
|
|
120830
|
-
|
|
120795
|
+
getResolvedModule
|
|
120831
120796
|
);
|
|
120832
120797
|
resolvedLibraries.delete(libFileName);
|
|
120833
120798
|
}
|
|
@@ -121052,7 +121017,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121052
121017
|
redirectedReference,
|
|
121053
121018
|
options
|
|
121054
121019
|
),
|
|
121055
|
-
getResolutionWithResolvedFileName:
|
|
121020
|
+
getResolutionWithResolvedFileName: getResolvedModule,
|
|
121056
121021
|
shouldRetryResolution: (resolution) => !resolution.resolvedModule || !resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension),
|
|
121057
121022
|
logChanges: logChangesWhenResolvingModule,
|
|
121058
121023
|
deferWatchingNonRelativeResolution: true
|
|
@@ -121071,17 +121036,17 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121071
121036
|
libraryName,
|
|
121072
121037
|
resolution,
|
|
121073
121038
|
path,
|
|
121074
|
-
|
|
121039
|
+
getResolvedModule,
|
|
121075
121040
|
/*deferWatchingNonRelativeResolution*/
|
|
121076
121041
|
false
|
|
121077
121042
|
);
|
|
121078
121043
|
resolvedLibraries.set(libFileName, resolution);
|
|
121079
121044
|
if (existingResolution) {
|
|
121080
|
-
stopWatchFailedLookupLocationOfResolution(existingResolution, path,
|
|
121045
|
+
stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolvedModule);
|
|
121081
121046
|
}
|
|
121082
121047
|
} else {
|
|
121083
121048
|
if (isTraceEnabled(options, host)) {
|
|
121084
|
-
const resolved =
|
|
121049
|
+
const resolved = getResolvedModule(resolution);
|
|
121085
121050
|
trace(
|
|
121086
121051
|
host,
|
|
121087
121052
|
(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,
|
|
@@ -121358,7 +121323,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121358
121323
|
resolvedProjectReference.commandLine.fileNames.forEach((f) => removeResolutionsOfFile(resolutionHost.toPath(f)));
|
|
121359
121324
|
}
|
|
121360
121325
|
function removeResolutionsOfFile(filePath) {
|
|
121361
|
-
removeResolutionsOfFileFromCache(resolvedModuleNames, filePath,
|
|
121326
|
+
removeResolutionsOfFileFromCache(resolvedModuleNames, filePath, getResolvedModule);
|
|
121362
121327
|
removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath, getResolvedTypeReferenceDirective);
|
|
121363
121328
|
}
|
|
121364
121329
|
function invalidateResolutions(resolutions, canInvalidate) {
|
|
@@ -121785,7 +121750,7 @@ function fileIncludeReasonToDiagnostics(program, reason, fileNameConvertor) {
|
|
|
121785
121750
|
var _a, _b;
|
|
121786
121751
|
const options = program.getCompilerOptions();
|
|
121787
121752
|
if (isReferencedFile(reason)) {
|
|
121788
|
-
const referenceLocation = getReferencedFileLocation(
|
|
121753
|
+
const referenceLocation = getReferencedFileLocation(program, reason);
|
|
121789
121754
|
const referenceText = isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : `"${referenceLocation.text}"`;
|
|
121790
121755
|
let message;
|
|
121791
121756
|
Debug.assert(isReferenceFileLocation(referenceLocation) || reason.kind === 3 /* Import */, "Only synthetic references are imports");
|