@typescript-deploys/pr-build 5.3.0-pr-56048-8 → 5.3.0-pr-56072-6
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 +148 -75
- package/lib/tsserver.js +245 -178
- package/lib/typescript.d.ts +15 -3
- package/lib/typescript.js +245 -178
- package/lib/typingsInstaller.js +39 -16
- package/package.json +4 -3
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-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20231011`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -36904,7 +36904,7 @@ function resolvedTypeScriptOnly(resolved) {
|
|
|
36904
36904
|
Debug.assert(extensionIsTS(resolved.extension));
|
|
36905
36905
|
return { fileName: resolved.path, packageId: resolved.packageId };
|
|
36906
36906
|
}
|
|
36907
|
-
function createResolvedModuleWithFailedLookupLocationsHandlingSymlink(moduleName, resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, state, legacyResult) {
|
|
36907
|
+
function createResolvedModuleWithFailedLookupLocationsHandlingSymlink(moduleName, resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, state, cache, legacyResult) {
|
|
36908
36908
|
if (!state.resultFromCache && !state.compilerOptions.preserveSymlinks && resolved && isExternalLibraryImport && !resolved.originalPath && !isExternalModuleNameRelative(moduleName)) {
|
|
36909
36909
|
const { resolvedFileName, originalPath } = getOriginalAndResolvedFileName(resolved.path, state.host, state.traceEnabled);
|
|
36910
36910
|
if (originalPath)
|
|
@@ -36917,15 +36917,25 @@ function createResolvedModuleWithFailedLookupLocationsHandlingSymlink(moduleName
|
|
|
36917
36917
|
affectingLocations,
|
|
36918
36918
|
diagnostics,
|
|
36919
36919
|
state.resultFromCache,
|
|
36920
|
+
cache,
|
|
36920
36921
|
legacyResult
|
|
36921
36922
|
);
|
|
36922
36923
|
}
|
|
36923
|
-
function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, legacyResult) {
|
|
36924
|
+
function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, cache, legacyResult) {
|
|
36924
36925
|
if (resultFromCache) {
|
|
36925
|
-
|
|
36926
|
-
|
|
36927
|
-
|
|
36928
|
-
|
|
36926
|
+
if (!(cache == null ? void 0 : cache.isReadonly)) {
|
|
36927
|
+
resultFromCache.failedLookupLocations = updateResolutionField(resultFromCache.failedLookupLocations, failedLookupLocations);
|
|
36928
|
+
resultFromCache.affectingLocations = updateResolutionField(resultFromCache.affectingLocations, affectingLocations);
|
|
36929
|
+
resultFromCache.resolutionDiagnostics = updateResolutionField(resultFromCache.resolutionDiagnostics, diagnostics);
|
|
36930
|
+
return resultFromCache;
|
|
36931
|
+
} else {
|
|
36932
|
+
return {
|
|
36933
|
+
...resultFromCache,
|
|
36934
|
+
failedLookupLocations: initializeResolutionFieldForReadonlyCache(resultFromCache.failedLookupLocations, failedLookupLocations),
|
|
36935
|
+
affectingLocations: initializeResolutionFieldForReadonlyCache(resultFromCache.affectingLocations, affectingLocations),
|
|
36936
|
+
resolutionDiagnostics: initializeResolutionFieldForReadonlyCache(resultFromCache.resolutionDiagnostics, diagnostics)
|
|
36937
|
+
};
|
|
36938
|
+
}
|
|
36929
36939
|
}
|
|
36930
36940
|
return {
|
|
36931
36941
|
resolvedModule: resolved && {
|
|
@@ -36953,6 +36963,13 @@ function updateResolutionField(to, value) {
|
|
|
36953
36963
|
to.push(...value);
|
|
36954
36964
|
return to;
|
|
36955
36965
|
}
|
|
36966
|
+
function initializeResolutionFieldForReadonlyCache(fromCache, value) {
|
|
36967
|
+
if (!(fromCache == null ? void 0 : fromCache.length))
|
|
36968
|
+
return initializeResolutionField(value);
|
|
36969
|
+
if (!value.length)
|
|
36970
|
+
return fromCache.slice();
|
|
36971
|
+
return [...fromCache, ...value];
|
|
36972
|
+
}
|
|
36956
36973
|
function readPackageJsonField(jsonContent, fieldName, typeOfTag, state) {
|
|
36957
36974
|
if (!hasProperty(jsonContent, fieldName)) {
|
|
36958
36975
|
if (state.traceEnabled) {
|
|
@@ -37180,15 +37197,15 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
|
|
|
37180
37197
|
affectingLocations: initializeResolutionField(affectingLocations),
|
|
37181
37198
|
resolutionDiagnostics: initializeResolutionField(diagnostics)
|
|
37182
37199
|
};
|
|
37183
|
-
if (containingDirectory) {
|
|
37184
|
-
cache
|
|
37200
|
+
if (containingDirectory && cache && !cache.isReadonly) {
|
|
37201
|
+
cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference).set(
|
|
37185
37202
|
typeReferenceDirectiveName,
|
|
37186
37203
|
/*mode*/
|
|
37187
37204
|
resolutionMode,
|
|
37188
37205
|
result
|
|
37189
37206
|
);
|
|
37190
37207
|
if (!isExternalModuleNameRelative(typeReferenceDirectiveName)) {
|
|
37191
|
-
cache
|
|
37208
|
+
cache.getOrCreateCacheForNonRelativeName(typeReferenceDirectiveName, resolutionMode, redirectedReference).set(containingDirectory, result);
|
|
37192
37209
|
}
|
|
37193
37210
|
}
|
|
37194
37211
|
if (traceEnabled)
|
|
@@ -37380,7 +37397,8 @@ function createCacheWithRedirects(ownOptions, optionsToRedirectsKey) {
|
|
|
37380
37397
|
getMapOfCacheRedirects,
|
|
37381
37398
|
getOrCreateMapOfCacheRedirects,
|
|
37382
37399
|
update,
|
|
37383
|
-
clear: clear2
|
|
37400
|
+
clear: clear2,
|
|
37401
|
+
getOwnMap: () => ownMap
|
|
37384
37402
|
};
|
|
37385
37403
|
function getMapOfCacheRedirects(redirectedReference) {
|
|
37386
37404
|
return redirectedReference ? getOrCreateMap(
|
|
@@ -37487,7 +37505,8 @@ function createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileNam
|
|
|
37487
37505
|
getFromDirectoryCache,
|
|
37488
37506
|
getOrCreateCacheForDirectory,
|
|
37489
37507
|
clear: clear2,
|
|
37490
|
-
update
|
|
37508
|
+
update,
|
|
37509
|
+
directoryToModuleNameMap
|
|
37491
37510
|
};
|
|
37492
37511
|
function clear2() {
|
|
37493
37512
|
directoryToModuleNameMap.clear();
|
|
@@ -37751,9 +37770,11 @@ function resolveModuleName(moduleName, containingFile, compilerOptions, host, ca
|
|
|
37751
37770
|
if (result && result.resolvedModule)
|
|
37752
37771
|
(_b = perfLogger) == null ? void 0 : _b.logInfoEvent(`Module "${moduleName}" resolved to "${result.resolvedModule.resolvedFileName}"`);
|
|
37753
37772
|
(_c = perfLogger) == null ? void 0 : _c.logStopResolveModule(result && result.resolvedModule ? "" + result.resolvedModule.resolvedFileName : "null");
|
|
37754
|
-
cache
|
|
37755
|
-
|
|
37756
|
-
|
|
37773
|
+
if (cache && !cache.isReadonly) {
|
|
37774
|
+
cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference).set(moduleName, resolutionMode, result);
|
|
37775
|
+
if (!isExternalModuleNameRelative(moduleName)) {
|
|
37776
|
+
cache.getOrCreateCacheForNonRelativeName(moduleName, resolutionMode, redirectedReference).set(containingDirectory, result);
|
|
37777
|
+
}
|
|
37757
37778
|
}
|
|
37758
37779
|
}
|
|
37759
37780
|
if (traceEnabled) {
|
|
@@ -38055,6 +38076,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
38055
38076
|
affectingLocations,
|
|
38056
38077
|
diagnostics,
|
|
38057
38078
|
state,
|
|
38079
|
+
cache,
|
|
38058
38080
|
legacyResult
|
|
38059
38081
|
);
|
|
38060
38082
|
function tryResolve(extensions2, state2) {
|
|
@@ -38334,7 +38356,7 @@ function getVersionPathsOfPackageJsonInfo(packageJsonInfo, state) {
|
|
|
38334
38356
|
return packageJsonInfo.contents.versionPaths || void 0;
|
|
38335
38357
|
}
|
|
38336
38358
|
function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
|
|
38337
|
-
var _a, _b, _c, _d, _e, _f
|
|
38359
|
+
var _a, _b, _c, _d, _e, _f;
|
|
38338
38360
|
const { host, traceEnabled } = state;
|
|
38339
38361
|
const packageJsonPath = combinePaths(packageDirectory, "package.json");
|
|
38340
38362
|
if (onlyRecordFailures) {
|
|
@@ -38362,15 +38384,17 @@ function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
|
|
|
38362
38384
|
trace(host, Diagnostics.Found_package_json_at_0, packageJsonPath);
|
|
38363
38385
|
}
|
|
38364
38386
|
const result = { packageDirectory, contents: { packageJsonContent, versionPaths: void 0, resolvedEntrypoints: void 0 } };
|
|
38365
|
-
(
|
|
38366
|
-
|
|
38387
|
+
if (state.packageJsonInfoCache && !state.packageJsonInfoCache.isReadonly)
|
|
38388
|
+
state.packageJsonInfoCache.setPackageJsonInfo(packageJsonPath, result);
|
|
38389
|
+
(_e = state.affectingLocations) == null ? void 0 : _e.push(packageJsonPath);
|
|
38367
38390
|
return result;
|
|
38368
38391
|
} else {
|
|
38369
38392
|
if (directoryExists && traceEnabled) {
|
|
38370
38393
|
trace(host, Diagnostics.File_0_does_not_exist, packageJsonPath);
|
|
38371
38394
|
}
|
|
38372
|
-
(
|
|
38373
|
-
|
|
38395
|
+
if (state.packageJsonInfoCache && !state.packageJsonInfoCache.isReadonly)
|
|
38396
|
+
state.packageJsonInfoCache.setPackageJsonInfo(packageJsonPath, directoryExists);
|
|
38397
|
+
(_f = state.failedLookupLocations) == null ? void 0 : _f.push(packageJsonPath);
|
|
38374
38398
|
}
|
|
38375
38399
|
}
|
|
38376
38400
|
function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, jsonContent, versionPaths) {
|
|
@@ -39160,7 +39184,8 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
|
|
|
39160
39184
|
failedLookupLocations,
|
|
39161
39185
|
affectingLocations,
|
|
39162
39186
|
diagnostics,
|
|
39163
|
-
state
|
|
39187
|
+
state,
|
|
39188
|
+
cache
|
|
39164
39189
|
);
|
|
39165
39190
|
function tryResolve(extensions) {
|
|
39166
39191
|
const resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, state);
|
|
@@ -39279,7 +39304,9 @@ function loadModuleFromGlobalCache(moduleName, projectName, compilerOptions, hos
|
|
|
39279
39304
|
failedLookupLocations,
|
|
39280
39305
|
affectingLocations,
|
|
39281
39306
|
diagnostics,
|
|
39282
|
-
state.resultFromCache
|
|
39307
|
+
state.resultFromCache,
|
|
39308
|
+
/*cache*/
|
|
39309
|
+
void 0
|
|
39283
39310
|
);
|
|
39284
39311
|
}
|
|
39285
39312
|
function toSearchResult(value) {
|
|
@@ -39967,9 +39994,6 @@ function createBinder() {
|
|
|
39967
39994
|
case 213 /* CallExpression */:
|
|
39968
39995
|
return hasNarrowableArgument(expr);
|
|
39969
39996
|
case 217 /* ParenthesizedExpression */:
|
|
39970
|
-
if (isJSDocTypeAssertion(expr)) {
|
|
39971
|
-
return false;
|
|
39972
|
-
}
|
|
39973
39997
|
case 235 /* NonNullExpression */:
|
|
39974
39998
|
return isNarrowingExpression(expr.expression);
|
|
39975
39999
|
case 226 /* BinaryExpression */:
|
|
@@ -66438,7 +66462,25 @@ function createTypeChecker(host) {
|
|
|
66438
66462
|
const matching = discriminant && getConstituentTypeForKeyType(type, discriminant);
|
|
66439
66463
|
const directlyRelated = mapType(
|
|
66440
66464
|
matching || type,
|
|
66441
|
-
checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) =>
|
|
66465
|
+
checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => {
|
|
66466
|
+
if (t.flags & 2944 /* Literal */ && c.flags & 2944 /* Literal */) {
|
|
66467
|
+
if (t.flags & 512 /* BooleanLiteral */ && c.flags & 512 /* BooleanLiteral */) {
|
|
66468
|
+
return t === c ? t : neverType;
|
|
66469
|
+
}
|
|
66470
|
+
return t.value === c.value ? t : neverType;
|
|
66471
|
+
}
|
|
66472
|
+
if (isTypeStrictSubtypeOf(t, c))
|
|
66473
|
+
return t;
|
|
66474
|
+
if (isTypeStrictSubtypeOf(c, t))
|
|
66475
|
+
return c;
|
|
66476
|
+
if (t.flags & 109472 /* Unit */ && c.flags & 109472 /* Unit */)
|
|
66477
|
+
return neverType;
|
|
66478
|
+
if (isTypeSubtypeOf(t, c))
|
|
66479
|
+
return t;
|
|
66480
|
+
if (isTypeSubtypeOf(c, t))
|
|
66481
|
+
return c;
|
|
66482
|
+
return neverType;
|
|
66483
|
+
}
|
|
66442
66484
|
);
|
|
66443
66485
|
return directlyRelated.flags & 131072 /* Never */ ? mapType(type, (t) => maybeTypeOfKind(t, 465829888 /* Instantiable */) && isRelated(c, getBaseConstraintOfType(t) || unknownType) ? getIntersectionType([t, c]) : neverType) : directlyRelated;
|
|
66444
66486
|
});
|
|
@@ -73354,8 +73396,20 @@ function createTypeChecker(host) {
|
|
|
73354
73396
|
let hasReturnWithNoExpression = functionHasImplicitReturn(func);
|
|
73355
73397
|
let hasReturnOfTypeNever = false;
|
|
73356
73398
|
forEachReturnStatement(func.body, (returnStatement) => {
|
|
73357
|
-
|
|
73399
|
+
let expr = returnStatement.expression;
|
|
73358
73400
|
if (expr) {
|
|
73401
|
+
expr = skipParentheses(
|
|
73402
|
+
expr,
|
|
73403
|
+
/*excludeJSDocTypeAssertions*/
|
|
73404
|
+
true
|
|
73405
|
+
);
|
|
73406
|
+
if (functionFlags & 2 /* Async */ && expr.kind === 223 /* AwaitExpression */) {
|
|
73407
|
+
expr = skipParentheses(
|
|
73408
|
+
expr.expression,
|
|
73409
|
+
/*excludeJSDocTypeAssertions*/
|
|
73410
|
+
true
|
|
73411
|
+
);
|
|
73412
|
+
}
|
|
73359
73413
|
if (expr.kind === 213 /* CallExpression */ && expr.expression.kind === 80 /* Identifier */ && checkExpressionCached(expr.expression).symbol === func.symbol) {
|
|
73360
73414
|
hasReturnOfTypeNever = true;
|
|
73361
73415
|
return;
|
|
@@ -121003,6 +121057,10 @@ function getRootDirectoryOfResolutionCache(rootDirForResolution, getCurrentDirec
|
|
|
121003
121057
|
const normalized = getNormalizedAbsolutePath(rootDirForResolution, getCurrentDirectory());
|
|
121004
121058
|
return !isDiskPathRoot(normalized) ? removeTrailingDirectorySeparator(normalized) : normalized;
|
|
121005
121059
|
}
|
|
121060
|
+
function getModuleResolutionHost(resolutionHost) {
|
|
121061
|
+
var _a;
|
|
121062
|
+
return ((_a = resolutionHost.getCompilerHost) == null ? void 0 : _a.call(resolutionHost)) || resolutionHost;
|
|
121063
|
+
}
|
|
121006
121064
|
function createModuleResolutionLoaderUsingGlobalCache(containingFile, redirectedReference, options, resolutionHost, moduleResolutionCache) {
|
|
121007
121065
|
return {
|
|
121008
121066
|
nameAndMode: moduleResolutionNameAndModeGetter,
|
|
@@ -121018,8 +121076,7 @@ function createModuleResolutionLoaderUsingGlobalCache(containingFile, redirected
|
|
|
121018
121076
|
};
|
|
121019
121077
|
}
|
|
121020
121078
|
function resolveModuleNameUsingGlobalCache(resolutionHost, moduleResolutionCache, moduleName, containingFile, compilerOptions, redirectedReference, mode) {
|
|
121021
|
-
|
|
121022
|
-
const host = ((_a = resolutionHost.getCompilerHost) == null ? void 0 : _a.call(resolutionHost)) || resolutionHost;
|
|
121079
|
+
const host = getModuleResolutionHost(resolutionHost);
|
|
121023
121080
|
const primaryResult = resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference, mode);
|
|
121024
121081
|
if (!resolutionHost.getGlobalCache) {
|
|
121025
121082
|
return primaryResult;
|
|
@@ -121190,6 +121247,10 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121190
121247
|
};
|
|
121191
121248
|
}
|
|
121192
121249
|
function startCachingPerDirectoryResolution() {
|
|
121250
|
+
moduleResolutionCache.isReadonly = void 0;
|
|
121251
|
+
typeReferenceDirectiveResolutionCache.isReadonly = void 0;
|
|
121252
|
+
libraryResolutionCache.isReadonly = void 0;
|
|
121253
|
+
moduleResolutionCache.getPackageJsonInfoCache().isReadonly = void 0;
|
|
121193
121254
|
moduleResolutionCache.clearAllExceptPackageJsonInfoCache();
|
|
121194
121255
|
typeReferenceDirectiveResolutionCache.clearAllExceptPackageJsonInfoCache();
|
|
121195
121256
|
libraryResolutionCache.clearAllExceptPackageJsonInfoCache();
|
|
@@ -121247,6 +121308,10 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121247
121308
|
directoryWatchesOfFailedLookups.forEach(closeDirectoryWatchesOfFailedLookup);
|
|
121248
121309
|
fileWatchesOfAffectingLocations.forEach(closeFileWatcherOfAffectingLocation);
|
|
121249
121310
|
hasChangedAutomaticTypeDirectiveNames = false;
|
|
121311
|
+
moduleResolutionCache.isReadonly = true;
|
|
121312
|
+
typeReferenceDirectiveResolutionCache.isReadonly = true;
|
|
121313
|
+
libraryResolutionCache.isReadonly = true;
|
|
121314
|
+
moduleResolutionCache.getPackageJsonInfoCache().isReadonly = true;
|
|
121250
121315
|
}
|
|
121251
121316
|
function closeDirectoryWatchesOfFailedLookup(watcher, path) {
|
|
121252
121317
|
if (watcher.refCount === 0) {
|
|
@@ -121275,7 +121340,6 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121275
121340
|
shouldRetryResolution,
|
|
121276
121341
|
logChanges
|
|
121277
121342
|
}) {
|
|
121278
|
-
var _a;
|
|
121279
121343
|
const path = resolutionHost.toPath(containingFile);
|
|
121280
121344
|
const resolutionsInFile = perFileCache.get(path) || perFileCache.set(path, createModeAwareCache()).get(path);
|
|
121281
121345
|
const resolvedModules = [];
|
|
@@ -121307,7 +121371,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121307
121371
|
logChanges = false;
|
|
121308
121372
|
}
|
|
121309
121373
|
} else {
|
|
121310
|
-
const host = (
|
|
121374
|
+
const host = getModuleResolutionHost(resolutionHost);
|
|
121311
121375
|
if (isTraceEnabled(options, host) && !seenNamesInFile.has(name, mode)) {
|
|
121312
121376
|
const resolved = getResolutionWithResolvedFileName(resolution);
|
|
121313
121377
|
trace(
|
|
@@ -121359,7 +121423,6 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121359
121423
|
}
|
|
121360
121424
|
}
|
|
121361
121425
|
function resolveTypeReferenceDirectiveReferences(typeDirectiveReferences, containingFile, redirectedReference, options, containingSourceFile, reusedNames) {
|
|
121362
|
-
var _a;
|
|
121363
121426
|
return resolveNamesWithLocalCache({
|
|
121364
121427
|
entries: typeDirectiveReferences,
|
|
121365
121428
|
containingFile,
|
|
@@ -121372,7 +121435,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121372
121435
|
containingFile,
|
|
121373
121436
|
redirectedReference,
|
|
121374
121437
|
options,
|
|
121375
|
-
(
|
|
121438
|
+
getModuleResolutionHost(resolutionHost),
|
|
121376
121439
|
typeReferenceDirectiveResolutionCache
|
|
121377
121440
|
),
|
|
121378
121441
|
getResolutionWithResolvedFileName: getResolvedTypeReferenceDirective,
|
|
@@ -121404,8 +121467,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121404
121467
|
});
|
|
121405
121468
|
}
|
|
121406
121469
|
function resolveLibrary2(libraryName, resolveFrom, options, libFileName) {
|
|
121407
|
-
|
|
121408
|
-
const host = ((_a = resolutionHost.getCompilerHost) == null ? void 0 : _a.call(resolutionHost)) || resolutionHost;
|
|
121470
|
+
const host = getModuleResolutionHost(resolutionHost);
|
|
121409
121471
|
let resolution = resolvedLibraries == null ? void 0 : resolvedLibraries.get(libFileName);
|
|
121410
121472
|
if (!resolution || resolution.isInvalidated) {
|
|
121411
121473
|
const existingResolution = resolution;
|
|
@@ -121439,6 +121501,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121439
121501
|
return resolution;
|
|
121440
121502
|
}
|
|
121441
121503
|
function resolveSingleModuleNameWithoutWatching(moduleName, containingFile) {
|
|
121504
|
+
var _a, _b;
|
|
121442
121505
|
const path = resolutionHost.toPath(containingFile);
|
|
121443
121506
|
const resolutionsInFile = resolvedModuleNames.get(path);
|
|
121444
121507
|
const resolution = resolutionsInFile == null ? void 0 : resolutionsInFile.get(
|
|
@@ -121448,7 +121511,17 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121448
121511
|
);
|
|
121449
121512
|
if (resolution && !resolution.isInvalidated)
|
|
121450
121513
|
return resolution;
|
|
121451
|
-
|
|
121514
|
+
const data = (_a = resolutionHost.beforeResolveSingleModuleNameWithoutWatching) == null ? void 0 : _a.call(resolutionHost, moduleResolutionCache);
|
|
121515
|
+
const host = getModuleResolutionHost(resolutionHost);
|
|
121516
|
+
const result = resolveModuleName(
|
|
121517
|
+
moduleName,
|
|
121518
|
+
containingFile,
|
|
121519
|
+
resolutionHost.getCompilationSettings(),
|
|
121520
|
+
host,
|
|
121521
|
+
moduleResolutionCache
|
|
121522
|
+
);
|
|
121523
|
+
(_b = resolutionHost.afterResolveSingleModuleNameWithoutWatching) == null ? void 0 : _b.call(resolutionHost, moduleResolutionCache, moduleName, containingFile, result, data);
|
|
121524
|
+
return result;
|
|
121452
121525
|
}
|
|
121453
121526
|
function isNodeModulesAtTypesDirectory(dirPath) {
|
|
121454
121527
|
return endsWith(dirPath, "/node_modules/@types");
|
|
@@ -122594,7 +122667,7 @@ function createIncrementalProgram({
|
|
|
122594
122667
|
}
|
|
122595
122668
|
function createWatchProgram(host) {
|
|
122596
122669
|
let builderProgram;
|
|
122597
|
-
let
|
|
122670
|
+
let updateLevel;
|
|
122598
122671
|
let missingFilesMap;
|
|
122599
122672
|
let watchedWildcardDirectories;
|
|
122600
122673
|
let timerToUpdateProgram;
|
|
@@ -122953,7 +123026,7 @@ function createWatchProgram(host) {
|
|
|
122953
123026
|
}
|
|
122954
123027
|
function scheduleProgramReload() {
|
|
122955
123028
|
Debug.assert(!!configFileName);
|
|
122956
|
-
|
|
123029
|
+
updateLevel = 2 /* Full */;
|
|
122957
123030
|
scheduleProgramUpdate();
|
|
122958
123031
|
}
|
|
122959
123032
|
function updateProgramWithWatchStatus() {
|
|
@@ -122963,8 +123036,8 @@ function createWatchProgram(host) {
|
|
|
122963
123036
|
}
|
|
122964
123037
|
function updateProgram() {
|
|
122965
123038
|
var _a, _b, _c, _d;
|
|
122966
|
-
switch (
|
|
122967
|
-
case 1 /*
|
|
123039
|
+
switch (updateLevel) {
|
|
123040
|
+
case 1 /* RootNamesAndUpdate */:
|
|
122968
123041
|
(_a = perfLogger) == null ? void 0 : _a.logStartUpdateProgram("PartialConfigReload");
|
|
122969
123042
|
reloadFileNamesFromConfigFile();
|
|
122970
123043
|
break;
|
|
@@ -122984,7 +123057,7 @@ function createWatchProgram(host) {
|
|
|
122984
123057
|
writeLog("Reloading new file names and options");
|
|
122985
123058
|
Debug.assert(compilerOptions);
|
|
122986
123059
|
Debug.assert(configFileName);
|
|
122987
|
-
|
|
123060
|
+
updateLevel = 0 /* Update */;
|
|
122988
123061
|
rootFileNames = getFileNamesFromConfigSpecs(compilerOptions.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions);
|
|
122989
123062
|
if (updateErrorForNoInputFiles(rootFileNames, getNormalizedAbsolutePath(configFileName, currentDirectory), compilerOptions.configFile.configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) {
|
|
122990
123063
|
hasChangedConfigFileParsingErrors = true;
|
|
@@ -122994,7 +123067,7 @@ function createWatchProgram(host) {
|
|
|
122994
123067
|
function reloadConfigFile() {
|
|
122995
123068
|
Debug.assert(configFileName);
|
|
122996
123069
|
writeLog(`Reloading config file: ${configFileName}`);
|
|
122997
|
-
|
|
123070
|
+
updateLevel = 0 /* Update */;
|
|
122998
123071
|
if (cachedDirectoryStructureHost) {
|
|
122999
123072
|
cachedDirectoryStructureHost.clearCache();
|
|
123000
123073
|
}
|
|
@@ -123031,9 +123104,9 @@ function createWatchProgram(host) {
|
|
|
123031
123104
|
const configPath = toPath3(configFileName2);
|
|
123032
123105
|
let config = parsedConfigs == null ? void 0 : parsedConfigs.get(configPath);
|
|
123033
123106
|
if (config) {
|
|
123034
|
-
if (!config.
|
|
123107
|
+
if (!config.updateLevel)
|
|
123035
123108
|
return config.parsedCommandLine;
|
|
123036
|
-
if (config.parsedCommandLine && config.
|
|
123109
|
+
if (config.parsedCommandLine && config.updateLevel === 1 /* RootNamesAndUpdate */ && !host.getParsedCommandLine) {
|
|
123037
123110
|
writeLog("Reloading new file names and options");
|
|
123038
123111
|
Debug.assert(compilerOptions);
|
|
123039
123112
|
const fileNames = getFileNamesFromConfigSpecs(
|
|
@@ -123043,7 +123116,7 @@ function createWatchProgram(host) {
|
|
|
123043
123116
|
parseConfigFileHost
|
|
123044
123117
|
);
|
|
123045
123118
|
config.parsedCommandLine = { ...config.parsedCommandLine, fileNames };
|
|
123046
|
-
config.
|
|
123119
|
+
config.updateLevel = void 0;
|
|
123047
123120
|
return config.parsedCommandLine;
|
|
123048
123121
|
}
|
|
123049
123122
|
}
|
|
@@ -123051,7 +123124,7 @@ function createWatchProgram(host) {
|
|
|
123051
123124
|
const parsedCommandLine = host.getParsedCommandLine ? host.getParsedCommandLine(configFileName2) : getParsedCommandLineFromConfigFileHost(configFileName2);
|
|
123052
123125
|
if (config) {
|
|
123053
123126
|
config.parsedCommandLine = parsedCommandLine;
|
|
123054
|
-
config.
|
|
123127
|
+
config.updateLevel = void 0;
|
|
123055
123128
|
} else {
|
|
123056
123129
|
(parsedConfigs || (parsedConfigs = /* @__PURE__ */ new Map())).set(configPath, config = { parsedCommandLine });
|
|
123057
123130
|
}
|
|
@@ -123148,8 +123221,8 @@ function createWatchProgram(host) {
|
|
|
123148
123221
|
toPath: toPath3
|
|
123149
123222
|
}))
|
|
123150
123223
|
return;
|
|
123151
|
-
if (
|
|
123152
|
-
|
|
123224
|
+
if (updateLevel !== 2 /* Full */) {
|
|
123225
|
+
updateLevel = 1 /* RootNamesAndUpdate */;
|
|
123153
123226
|
scheduleProgramUpdate();
|
|
123154
123227
|
}
|
|
123155
123228
|
},
|
|
@@ -123175,11 +123248,11 @@ function createWatchProgram(host) {
|
|
|
123175
123248
|
return;
|
|
123176
123249
|
projects.forEach((projectPath) => {
|
|
123177
123250
|
if (configFileName && toPath3(configFileName) === projectPath) {
|
|
123178
|
-
|
|
123251
|
+
updateLevel = 2 /* Full */;
|
|
123179
123252
|
} else {
|
|
123180
123253
|
const config = parsedConfigs == null ? void 0 : parsedConfigs.get(projectPath);
|
|
123181
123254
|
if (config)
|
|
123182
|
-
config.
|
|
123255
|
+
config.updateLevel = 2 /* Full */;
|
|
123183
123256
|
resolutionCache.removeResolutionsFromProjectReferenceRedirects(projectPath);
|
|
123184
123257
|
}
|
|
123185
123258
|
scheduleProgramUpdate();
|
|
@@ -123200,7 +123273,7 @@ function createWatchProgram(host) {
|
|
|
123200
123273
|
updateCachedSystemWithFile(configFileName2, configPath, eventKind);
|
|
123201
123274
|
const config = parsedConfigs == null ? void 0 : parsedConfigs.get(configPath);
|
|
123202
123275
|
if (config)
|
|
123203
|
-
config.
|
|
123276
|
+
config.updateLevel = 2 /* Full */;
|
|
123204
123277
|
resolutionCache.removeResolutionsFromProjectReferenceRedirects(configPath);
|
|
123205
123278
|
scheduleProgramUpdate();
|
|
123206
123279
|
},
|
|
@@ -123238,8 +123311,8 @@ function createWatchProgram(host) {
|
|
|
123238
123311
|
toPath: toPath3
|
|
123239
123312
|
}))
|
|
123240
123313
|
return;
|
|
123241
|
-
if (config.
|
|
123242
|
-
config.
|
|
123314
|
+
if (config.updateLevel !== 2 /* Full */) {
|
|
123315
|
+
config.updateLevel = 1 /* RootNamesAndUpdate */;
|
|
123243
123316
|
scheduleProgramUpdate();
|
|
123244
123317
|
}
|
|
123245
123318
|
},
|
|
@@ -123681,12 +123754,12 @@ function clearProjectStatus(state, resolved) {
|
|
|
123681
123754
|
state.projectStatus.delete(resolved);
|
|
123682
123755
|
state.diagnostics.delete(resolved);
|
|
123683
123756
|
}
|
|
123684
|
-
function addProjToQueue({ projectPendingBuild }, proj,
|
|
123757
|
+
function addProjToQueue({ projectPendingBuild }, proj, updateLevel) {
|
|
123685
123758
|
const value = projectPendingBuild.get(proj);
|
|
123686
123759
|
if (value === void 0) {
|
|
123687
|
-
projectPendingBuild.set(proj,
|
|
123688
|
-
} else if (value <
|
|
123689
|
-
projectPendingBuild.set(proj,
|
|
123760
|
+
projectPendingBuild.set(proj, updateLevel);
|
|
123761
|
+
} else if (value < updateLevel) {
|
|
123762
|
+
projectPendingBuild.set(proj, updateLevel);
|
|
123690
123763
|
}
|
|
123691
123764
|
}
|
|
123692
123765
|
function setupInitialBuild(state, cancellationToken) {
|
|
@@ -123700,7 +123773,7 @@ function setupInitialBuild(state, cancellationToken) {
|
|
|
123700
123773
|
buildOrder.forEach(
|
|
123701
123774
|
(configFileName) => state.projectPendingBuild.set(
|
|
123702
123775
|
toResolvedConfigFilePath(state, configFileName),
|
|
123703
|
-
0 /*
|
|
123776
|
+
0 /* Update */
|
|
123704
123777
|
)
|
|
123705
123778
|
);
|
|
123706
123779
|
if (cancellationToken) {
|
|
@@ -124136,8 +124209,8 @@ function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) {
|
|
|
124136
124209
|
for (let projectIndex = 0; projectIndex < buildOrder.length; projectIndex++) {
|
|
124137
124210
|
const project = buildOrder[projectIndex];
|
|
124138
124211
|
const projectPath = toResolvedConfigFilePath(state, project);
|
|
124139
|
-
const
|
|
124140
|
-
if (
|
|
124212
|
+
const updateLevel = state.projectPendingBuild.get(projectPath);
|
|
124213
|
+
if (updateLevel === void 0)
|
|
124141
124214
|
continue;
|
|
124142
124215
|
if (reportQueue) {
|
|
124143
124216
|
reportQueue = false;
|
|
@@ -124149,13 +124222,13 @@ function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) {
|
|
|
124149
124222
|
projectPendingBuild.delete(projectPath);
|
|
124150
124223
|
continue;
|
|
124151
124224
|
}
|
|
124152
|
-
if (
|
|
124225
|
+
if (updateLevel === 2 /* Full */) {
|
|
124153
124226
|
watchConfigFile(state, project, projectPath, config);
|
|
124154
124227
|
watchExtendedConfigFiles(state, projectPath, config);
|
|
124155
124228
|
watchWildCardDirectories(state, project, projectPath, config);
|
|
124156
124229
|
watchInputFiles(state, project, projectPath, config);
|
|
124157
124230
|
watchPackageJsonFiles(state, project, projectPath, config);
|
|
124158
|
-
} else if (
|
|
124231
|
+
} else if (updateLevel === 1 /* RootNamesAndUpdate */) {
|
|
124159
124232
|
config.fileNames = getFileNamesFromConfigSpecs(config.options.configFile.configFileSpecs, getDirectoryPath(project), config.options, state.parseConfigFileHost);
|
|
124160
124233
|
updateErrorForNoInputFiles(config.fileNames, project, config.options.configFile.configFileSpecs, config.errors, canJsonReportNoInputFiles(config.raw));
|
|
124161
124234
|
watchInputFiles(state, project, projectPath, config);
|
|
@@ -124742,7 +124815,7 @@ function queueReferencingProjects(state, project, projectPath, projectIndex, con
|
|
|
124742
124815
|
break;
|
|
124743
124816
|
}
|
|
124744
124817
|
}
|
|
124745
|
-
addProjToQueue(state, nextProjectPath, 0 /*
|
|
124818
|
+
addProjToQueue(state, nextProjectPath, 0 /* Update */);
|
|
124746
124819
|
break;
|
|
124747
124820
|
}
|
|
124748
124821
|
}
|
|
@@ -124811,7 +124884,7 @@ function cleanWorker(state, project, onlyReferences) {
|
|
|
124811
124884
|
filesToDelete.push(output);
|
|
124812
124885
|
} else {
|
|
124813
124886
|
host.deleteFile(output);
|
|
124814
|
-
invalidateProject(state, resolvedPath, 0 /*
|
|
124887
|
+
invalidateProject(state, resolvedPath, 0 /* Update */);
|
|
124815
124888
|
}
|
|
124816
124889
|
}
|
|
124817
124890
|
}
|
|
@@ -124822,22 +124895,22 @@ function cleanWorker(state, project, onlyReferences) {
|
|
|
124822
124895
|
}
|
|
124823
124896
|
return 0 /* Success */;
|
|
124824
124897
|
}
|
|
124825
|
-
function invalidateProject(state, resolved,
|
|
124826
|
-
if (state.host.getParsedCommandLine &&
|
|
124827
|
-
|
|
124898
|
+
function invalidateProject(state, resolved, updateLevel) {
|
|
124899
|
+
if (state.host.getParsedCommandLine && updateLevel === 1 /* RootNamesAndUpdate */) {
|
|
124900
|
+
updateLevel = 2 /* Full */;
|
|
124828
124901
|
}
|
|
124829
|
-
if (
|
|
124902
|
+
if (updateLevel === 2 /* Full */) {
|
|
124830
124903
|
state.configFileCache.delete(resolved);
|
|
124831
124904
|
state.buildOrder = void 0;
|
|
124832
124905
|
}
|
|
124833
124906
|
state.needsSummary = true;
|
|
124834
124907
|
clearProjectStatus(state, resolved);
|
|
124835
|
-
addProjToQueue(state, resolved,
|
|
124908
|
+
addProjToQueue(state, resolved, updateLevel);
|
|
124836
124909
|
enableCache(state);
|
|
124837
124910
|
}
|
|
124838
|
-
function invalidateProjectAndScheduleBuilds(state, resolvedPath,
|
|
124911
|
+
function invalidateProjectAndScheduleBuilds(state, resolvedPath, updateLevel) {
|
|
124839
124912
|
state.reportFileChangeDetected = true;
|
|
124840
|
-
invalidateProject(state, resolvedPath,
|
|
124913
|
+
invalidateProject(state, resolvedPath, updateLevel);
|
|
124841
124914
|
scheduleBuildInvalidatedProject(
|
|
124842
124915
|
state,
|
|
124843
124916
|
250,
|
|
@@ -124968,7 +125041,7 @@ function watchWildCardDirectories(state, resolved, resolvedPath, parsed) {
|
|
|
124968
125041
|
toPath: (fileName) => toPath2(state, fileName)
|
|
124969
125042
|
}))
|
|
124970
125043
|
return;
|
|
124971
|
-
invalidateProjectAndScheduleBuilds(state, resolvedPath, 1 /*
|
|
125044
|
+
invalidateProjectAndScheduleBuilds(state, resolvedPath, 1 /* RootNamesAndUpdate */);
|
|
124972
125045
|
},
|
|
124973
125046
|
flags,
|
|
124974
125047
|
parsed == null ? void 0 : parsed.watchOptions,
|
|
@@ -124987,7 +125060,7 @@ function watchInputFiles(state, resolved, resolvedPath, parsed) {
|
|
|
124987
125060
|
createNewValue: (_path, input) => watchFile(
|
|
124988
125061
|
state,
|
|
124989
125062
|
input,
|
|
124990
|
-
() => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /*
|
|
125063
|
+
() => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /* Update */),
|
|
124991
125064
|
250 /* Low */,
|
|
124992
125065
|
parsed == null ? void 0 : parsed.watchOptions,
|
|
124993
125066
|
WatchType.SourceFile,
|
|
@@ -125007,7 +125080,7 @@ function watchPackageJsonFiles(state, resolved, resolvedPath, parsed) {
|
|
|
125007
125080
|
createNewValue: (path, _input) => watchFile(
|
|
125008
125081
|
state,
|
|
125009
125082
|
path,
|
|
125010
|
-
() => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /*
|
|
125083
|
+
() => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /* Update */),
|
|
125011
125084
|
2e3 /* High */,
|
|
125012
125085
|
parsed == null ? void 0 : parsed.watchOptions,
|
|
125013
125086
|
WatchType.PackageJson,
|
|
@@ -125078,7 +125151,7 @@ function createSolutionBuilderWorker(watch, hostOrHostWithWatch, rootNames, opti
|
|
|
125078
125151
|
const configFilePath = toResolvedConfigFilePath(state, configFileName);
|
|
125079
125152
|
return getUpToDateStatus(state, parseConfigFile(state, configFileName, configFilePath), configFilePath);
|
|
125080
125153
|
},
|
|
125081
|
-
invalidateProject: (configFilePath,
|
|
125154
|
+
invalidateProject: (configFilePath, updateLevel) => invalidateProject(state, configFilePath, updateLevel || 0 /* Update */),
|
|
125082
125155
|
close: () => stopWatching(state)
|
|
125083
125156
|
};
|
|
125084
125157
|
}
|