@typescript-deploys/pr-build 5.3.0-pr-56048-8 → 5.3.0-pr-55267-31
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 +129 -74
- package/lib/tsserver.js +226 -177
- package/lib/typescript.d.ts +15 -3
- package/lib/typescript.js +226 -177
- 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 */:
|
|
@@ -73354,8 +73378,20 @@ function createTypeChecker(host) {
|
|
|
73354
73378
|
let hasReturnWithNoExpression = functionHasImplicitReturn(func);
|
|
73355
73379
|
let hasReturnOfTypeNever = false;
|
|
73356
73380
|
forEachReturnStatement(func.body, (returnStatement) => {
|
|
73357
|
-
|
|
73381
|
+
let expr = returnStatement.expression;
|
|
73358
73382
|
if (expr) {
|
|
73383
|
+
expr = skipParentheses(
|
|
73384
|
+
expr,
|
|
73385
|
+
/*excludeJSDocTypeAssertions*/
|
|
73386
|
+
true
|
|
73387
|
+
);
|
|
73388
|
+
if (functionFlags & 2 /* Async */ && expr.kind === 223 /* AwaitExpression */) {
|
|
73389
|
+
expr = skipParentheses(
|
|
73390
|
+
expr.expression,
|
|
73391
|
+
/*excludeJSDocTypeAssertions*/
|
|
73392
|
+
true
|
|
73393
|
+
);
|
|
73394
|
+
}
|
|
73359
73395
|
if (expr.kind === 213 /* CallExpression */ && expr.expression.kind === 80 /* Identifier */ && checkExpressionCached(expr.expression).symbol === func.symbol) {
|
|
73360
73396
|
hasReturnOfTypeNever = true;
|
|
73361
73397
|
return;
|
|
@@ -121003,6 +121039,10 @@ function getRootDirectoryOfResolutionCache(rootDirForResolution, getCurrentDirec
|
|
|
121003
121039
|
const normalized = getNormalizedAbsolutePath(rootDirForResolution, getCurrentDirectory());
|
|
121004
121040
|
return !isDiskPathRoot(normalized) ? removeTrailingDirectorySeparator(normalized) : normalized;
|
|
121005
121041
|
}
|
|
121042
|
+
function getModuleResolutionHost(resolutionHost) {
|
|
121043
|
+
var _a;
|
|
121044
|
+
return ((_a = resolutionHost.getCompilerHost) == null ? void 0 : _a.call(resolutionHost)) || resolutionHost;
|
|
121045
|
+
}
|
|
121006
121046
|
function createModuleResolutionLoaderUsingGlobalCache(containingFile, redirectedReference, options, resolutionHost, moduleResolutionCache) {
|
|
121007
121047
|
return {
|
|
121008
121048
|
nameAndMode: moduleResolutionNameAndModeGetter,
|
|
@@ -121018,8 +121058,7 @@ function createModuleResolutionLoaderUsingGlobalCache(containingFile, redirected
|
|
|
121018
121058
|
};
|
|
121019
121059
|
}
|
|
121020
121060
|
function resolveModuleNameUsingGlobalCache(resolutionHost, moduleResolutionCache, moduleName, containingFile, compilerOptions, redirectedReference, mode) {
|
|
121021
|
-
|
|
121022
|
-
const host = ((_a = resolutionHost.getCompilerHost) == null ? void 0 : _a.call(resolutionHost)) || resolutionHost;
|
|
121061
|
+
const host = getModuleResolutionHost(resolutionHost);
|
|
121023
121062
|
const primaryResult = resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference, mode);
|
|
121024
121063
|
if (!resolutionHost.getGlobalCache) {
|
|
121025
121064
|
return primaryResult;
|
|
@@ -121190,6 +121229,10 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121190
121229
|
};
|
|
121191
121230
|
}
|
|
121192
121231
|
function startCachingPerDirectoryResolution() {
|
|
121232
|
+
moduleResolutionCache.isReadonly = void 0;
|
|
121233
|
+
typeReferenceDirectiveResolutionCache.isReadonly = void 0;
|
|
121234
|
+
libraryResolutionCache.isReadonly = void 0;
|
|
121235
|
+
moduleResolutionCache.getPackageJsonInfoCache().isReadonly = void 0;
|
|
121193
121236
|
moduleResolutionCache.clearAllExceptPackageJsonInfoCache();
|
|
121194
121237
|
typeReferenceDirectiveResolutionCache.clearAllExceptPackageJsonInfoCache();
|
|
121195
121238
|
libraryResolutionCache.clearAllExceptPackageJsonInfoCache();
|
|
@@ -121247,6 +121290,10 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121247
121290
|
directoryWatchesOfFailedLookups.forEach(closeDirectoryWatchesOfFailedLookup);
|
|
121248
121291
|
fileWatchesOfAffectingLocations.forEach(closeFileWatcherOfAffectingLocation);
|
|
121249
121292
|
hasChangedAutomaticTypeDirectiveNames = false;
|
|
121293
|
+
moduleResolutionCache.isReadonly = true;
|
|
121294
|
+
typeReferenceDirectiveResolutionCache.isReadonly = true;
|
|
121295
|
+
libraryResolutionCache.isReadonly = true;
|
|
121296
|
+
moduleResolutionCache.getPackageJsonInfoCache().isReadonly = true;
|
|
121250
121297
|
}
|
|
121251
121298
|
function closeDirectoryWatchesOfFailedLookup(watcher, path) {
|
|
121252
121299
|
if (watcher.refCount === 0) {
|
|
@@ -121275,7 +121322,6 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121275
121322
|
shouldRetryResolution,
|
|
121276
121323
|
logChanges
|
|
121277
121324
|
}) {
|
|
121278
|
-
var _a;
|
|
121279
121325
|
const path = resolutionHost.toPath(containingFile);
|
|
121280
121326
|
const resolutionsInFile = perFileCache.get(path) || perFileCache.set(path, createModeAwareCache()).get(path);
|
|
121281
121327
|
const resolvedModules = [];
|
|
@@ -121307,7 +121353,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121307
121353
|
logChanges = false;
|
|
121308
121354
|
}
|
|
121309
121355
|
} else {
|
|
121310
|
-
const host = (
|
|
121356
|
+
const host = getModuleResolutionHost(resolutionHost);
|
|
121311
121357
|
if (isTraceEnabled(options, host) && !seenNamesInFile.has(name, mode)) {
|
|
121312
121358
|
const resolved = getResolutionWithResolvedFileName(resolution);
|
|
121313
121359
|
trace(
|
|
@@ -121359,7 +121405,6 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121359
121405
|
}
|
|
121360
121406
|
}
|
|
121361
121407
|
function resolveTypeReferenceDirectiveReferences(typeDirectiveReferences, containingFile, redirectedReference, options, containingSourceFile, reusedNames) {
|
|
121362
|
-
var _a;
|
|
121363
121408
|
return resolveNamesWithLocalCache({
|
|
121364
121409
|
entries: typeDirectiveReferences,
|
|
121365
121410
|
containingFile,
|
|
@@ -121372,7 +121417,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121372
121417
|
containingFile,
|
|
121373
121418
|
redirectedReference,
|
|
121374
121419
|
options,
|
|
121375
|
-
(
|
|
121420
|
+
getModuleResolutionHost(resolutionHost),
|
|
121376
121421
|
typeReferenceDirectiveResolutionCache
|
|
121377
121422
|
),
|
|
121378
121423
|
getResolutionWithResolvedFileName: getResolvedTypeReferenceDirective,
|
|
@@ -121404,8 +121449,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121404
121449
|
});
|
|
121405
121450
|
}
|
|
121406
121451
|
function resolveLibrary2(libraryName, resolveFrom, options, libFileName) {
|
|
121407
|
-
|
|
121408
|
-
const host = ((_a = resolutionHost.getCompilerHost) == null ? void 0 : _a.call(resolutionHost)) || resolutionHost;
|
|
121452
|
+
const host = getModuleResolutionHost(resolutionHost);
|
|
121409
121453
|
let resolution = resolvedLibraries == null ? void 0 : resolvedLibraries.get(libFileName);
|
|
121410
121454
|
if (!resolution || resolution.isInvalidated) {
|
|
121411
121455
|
const existingResolution = resolution;
|
|
@@ -121439,6 +121483,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121439
121483
|
return resolution;
|
|
121440
121484
|
}
|
|
121441
121485
|
function resolveSingleModuleNameWithoutWatching(moduleName, containingFile) {
|
|
121486
|
+
var _a, _b;
|
|
121442
121487
|
const path = resolutionHost.toPath(containingFile);
|
|
121443
121488
|
const resolutionsInFile = resolvedModuleNames.get(path);
|
|
121444
121489
|
const resolution = resolutionsInFile == null ? void 0 : resolutionsInFile.get(
|
|
@@ -121448,7 +121493,17 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121448
121493
|
);
|
|
121449
121494
|
if (resolution && !resolution.isInvalidated)
|
|
121450
121495
|
return resolution;
|
|
121451
|
-
|
|
121496
|
+
const data = (_a = resolutionHost.beforeResolveSingleModuleNameWithoutWatching) == null ? void 0 : _a.call(resolutionHost, moduleResolutionCache);
|
|
121497
|
+
const host = getModuleResolutionHost(resolutionHost);
|
|
121498
|
+
const result = resolveModuleName(
|
|
121499
|
+
moduleName,
|
|
121500
|
+
containingFile,
|
|
121501
|
+
resolutionHost.getCompilationSettings(),
|
|
121502
|
+
host,
|
|
121503
|
+
moduleResolutionCache
|
|
121504
|
+
);
|
|
121505
|
+
(_b = resolutionHost.afterResolveSingleModuleNameWithoutWatching) == null ? void 0 : _b.call(resolutionHost, moduleResolutionCache, moduleName, containingFile, result, data);
|
|
121506
|
+
return result;
|
|
121452
121507
|
}
|
|
121453
121508
|
function isNodeModulesAtTypesDirectory(dirPath) {
|
|
121454
121509
|
return endsWith(dirPath, "/node_modules/@types");
|
|
@@ -122594,7 +122649,7 @@ function createIncrementalProgram({
|
|
|
122594
122649
|
}
|
|
122595
122650
|
function createWatchProgram(host) {
|
|
122596
122651
|
let builderProgram;
|
|
122597
|
-
let
|
|
122652
|
+
let updateLevel;
|
|
122598
122653
|
let missingFilesMap;
|
|
122599
122654
|
let watchedWildcardDirectories;
|
|
122600
122655
|
let timerToUpdateProgram;
|
|
@@ -122953,7 +123008,7 @@ function createWatchProgram(host) {
|
|
|
122953
123008
|
}
|
|
122954
123009
|
function scheduleProgramReload() {
|
|
122955
123010
|
Debug.assert(!!configFileName);
|
|
122956
|
-
|
|
123011
|
+
updateLevel = 2 /* Full */;
|
|
122957
123012
|
scheduleProgramUpdate();
|
|
122958
123013
|
}
|
|
122959
123014
|
function updateProgramWithWatchStatus() {
|
|
@@ -122963,8 +123018,8 @@ function createWatchProgram(host) {
|
|
|
122963
123018
|
}
|
|
122964
123019
|
function updateProgram() {
|
|
122965
123020
|
var _a, _b, _c, _d;
|
|
122966
|
-
switch (
|
|
122967
|
-
case 1 /*
|
|
123021
|
+
switch (updateLevel) {
|
|
123022
|
+
case 1 /* RootNamesAndUpdate */:
|
|
122968
123023
|
(_a = perfLogger) == null ? void 0 : _a.logStartUpdateProgram("PartialConfigReload");
|
|
122969
123024
|
reloadFileNamesFromConfigFile();
|
|
122970
123025
|
break;
|
|
@@ -122984,7 +123039,7 @@ function createWatchProgram(host) {
|
|
|
122984
123039
|
writeLog("Reloading new file names and options");
|
|
122985
123040
|
Debug.assert(compilerOptions);
|
|
122986
123041
|
Debug.assert(configFileName);
|
|
122987
|
-
|
|
123042
|
+
updateLevel = 0 /* Update */;
|
|
122988
123043
|
rootFileNames = getFileNamesFromConfigSpecs(compilerOptions.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions);
|
|
122989
123044
|
if (updateErrorForNoInputFiles(rootFileNames, getNormalizedAbsolutePath(configFileName, currentDirectory), compilerOptions.configFile.configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) {
|
|
122990
123045
|
hasChangedConfigFileParsingErrors = true;
|
|
@@ -122994,7 +123049,7 @@ function createWatchProgram(host) {
|
|
|
122994
123049
|
function reloadConfigFile() {
|
|
122995
123050
|
Debug.assert(configFileName);
|
|
122996
123051
|
writeLog(`Reloading config file: ${configFileName}`);
|
|
122997
|
-
|
|
123052
|
+
updateLevel = 0 /* Update */;
|
|
122998
123053
|
if (cachedDirectoryStructureHost) {
|
|
122999
123054
|
cachedDirectoryStructureHost.clearCache();
|
|
123000
123055
|
}
|
|
@@ -123031,9 +123086,9 @@ function createWatchProgram(host) {
|
|
|
123031
123086
|
const configPath = toPath3(configFileName2);
|
|
123032
123087
|
let config = parsedConfigs == null ? void 0 : parsedConfigs.get(configPath);
|
|
123033
123088
|
if (config) {
|
|
123034
|
-
if (!config.
|
|
123089
|
+
if (!config.updateLevel)
|
|
123035
123090
|
return config.parsedCommandLine;
|
|
123036
|
-
if (config.parsedCommandLine && config.
|
|
123091
|
+
if (config.parsedCommandLine && config.updateLevel === 1 /* RootNamesAndUpdate */ && !host.getParsedCommandLine) {
|
|
123037
123092
|
writeLog("Reloading new file names and options");
|
|
123038
123093
|
Debug.assert(compilerOptions);
|
|
123039
123094
|
const fileNames = getFileNamesFromConfigSpecs(
|
|
@@ -123043,7 +123098,7 @@ function createWatchProgram(host) {
|
|
|
123043
123098
|
parseConfigFileHost
|
|
123044
123099
|
);
|
|
123045
123100
|
config.parsedCommandLine = { ...config.parsedCommandLine, fileNames };
|
|
123046
|
-
config.
|
|
123101
|
+
config.updateLevel = void 0;
|
|
123047
123102
|
return config.parsedCommandLine;
|
|
123048
123103
|
}
|
|
123049
123104
|
}
|
|
@@ -123051,7 +123106,7 @@ function createWatchProgram(host) {
|
|
|
123051
123106
|
const parsedCommandLine = host.getParsedCommandLine ? host.getParsedCommandLine(configFileName2) : getParsedCommandLineFromConfigFileHost(configFileName2);
|
|
123052
123107
|
if (config) {
|
|
123053
123108
|
config.parsedCommandLine = parsedCommandLine;
|
|
123054
|
-
config.
|
|
123109
|
+
config.updateLevel = void 0;
|
|
123055
123110
|
} else {
|
|
123056
123111
|
(parsedConfigs || (parsedConfigs = /* @__PURE__ */ new Map())).set(configPath, config = { parsedCommandLine });
|
|
123057
123112
|
}
|
|
@@ -123148,8 +123203,8 @@ function createWatchProgram(host) {
|
|
|
123148
123203
|
toPath: toPath3
|
|
123149
123204
|
}))
|
|
123150
123205
|
return;
|
|
123151
|
-
if (
|
|
123152
|
-
|
|
123206
|
+
if (updateLevel !== 2 /* Full */) {
|
|
123207
|
+
updateLevel = 1 /* RootNamesAndUpdate */;
|
|
123153
123208
|
scheduleProgramUpdate();
|
|
123154
123209
|
}
|
|
123155
123210
|
},
|
|
@@ -123175,11 +123230,11 @@ function createWatchProgram(host) {
|
|
|
123175
123230
|
return;
|
|
123176
123231
|
projects.forEach((projectPath) => {
|
|
123177
123232
|
if (configFileName && toPath3(configFileName) === projectPath) {
|
|
123178
|
-
|
|
123233
|
+
updateLevel = 2 /* Full */;
|
|
123179
123234
|
} else {
|
|
123180
123235
|
const config = parsedConfigs == null ? void 0 : parsedConfigs.get(projectPath);
|
|
123181
123236
|
if (config)
|
|
123182
|
-
config.
|
|
123237
|
+
config.updateLevel = 2 /* Full */;
|
|
123183
123238
|
resolutionCache.removeResolutionsFromProjectReferenceRedirects(projectPath);
|
|
123184
123239
|
}
|
|
123185
123240
|
scheduleProgramUpdate();
|
|
@@ -123200,7 +123255,7 @@ function createWatchProgram(host) {
|
|
|
123200
123255
|
updateCachedSystemWithFile(configFileName2, configPath, eventKind);
|
|
123201
123256
|
const config = parsedConfigs == null ? void 0 : parsedConfigs.get(configPath);
|
|
123202
123257
|
if (config)
|
|
123203
|
-
config.
|
|
123258
|
+
config.updateLevel = 2 /* Full */;
|
|
123204
123259
|
resolutionCache.removeResolutionsFromProjectReferenceRedirects(configPath);
|
|
123205
123260
|
scheduleProgramUpdate();
|
|
123206
123261
|
},
|
|
@@ -123238,8 +123293,8 @@ function createWatchProgram(host) {
|
|
|
123238
123293
|
toPath: toPath3
|
|
123239
123294
|
}))
|
|
123240
123295
|
return;
|
|
123241
|
-
if (config.
|
|
123242
|
-
config.
|
|
123296
|
+
if (config.updateLevel !== 2 /* Full */) {
|
|
123297
|
+
config.updateLevel = 1 /* RootNamesAndUpdate */;
|
|
123243
123298
|
scheduleProgramUpdate();
|
|
123244
123299
|
}
|
|
123245
123300
|
},
|
|
@@ -123681,12 +123736,12 @@ function clearProjectStatus(state, resolved) {
|
|
|
123681
123736
|
state.projectStatus.delete(resolved);
|
|
123682
123737
|
state.diagnostics.delete(resolved);
|
|
123683
123738
|
}
|
|
123684
|
-
function addProjToQueue({ projectPendingBuild }, proj,
|
|
123739
|
+
function addProjToQueue({ projectPendingBuild }, proj, updateLevel) {
|
|
123685
123740
|
const value = projectPendingBuild.get(proj);
|
|
123686
123741
|
if (value === void 0) {
|
|
123687
|
-
projectPendingBuild.set(proj,
|
|
123688
|
-
} else if (value <
|
|
123689
|
-
projectPendingBuild.set(proj,
|
|
123742
|
+
projectPendingBuild.set(proj, updateLevel);
|
|
123743
|
+
} else if (value < updateLevel) {
|
|
123744
|
+
projectPendingBuild.set(proj, updateLevel);
|
|
123690
123745
|
}
|
|
123691
123746
|
}
|
|
123692
123747
|
function setupInitialBuild(state, cancellationToken) {
|
|
@@ -123700,7 +123755,7 @@ function setupInitialBuild(state, cancellationToken) {
|
|
|
123700
123755
|
buildOrder.forEach(
|
|
123701
123756
|
(configFileName) => state.projectPendingBuild.set(
|
|
123702
123757
|
toResolvedConfigFilePath(state, configFileName),
|
|
123703
|
-
0 /*
|
|
123758
|
+
0 /* Update */
|
|
123704
123759
|
)
|
|
123705
123760
|
);
|
|
123706
123761
|
if (cancellationToken) {
|
|
@@ -124136,8 +124191,8 @@ function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) {
|
|
|
124136
124191
|
for (let projectIndex = 0; projectIndex < buildOrder.length; projectIndex++) {
|
|
124137
124192
|
const project = buildOrder[projectIndex];
|
|
124138
124193
|
const projectPath = toResolvedConfigFilePath(state, project);
|
|
124139
|
-
const
|
|
124140
|
-
if (
|
|
124194
|
+
const updateLevel = state.projectPendingBuild.get(projectPath);
|
|
124195
|
+
if (updateLevel === void 0)
|
|
124141
124196
|
continue;
|
|
124142
124197
|
if (reportQueue) {
|
|
124143
124198
|
reportQueue = false;
|
|
@@ -124149,13 +124204,13 @@ function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) {
|
|
|
124149
124204
|
projectPendingBuild.delete(projectPath);
|
|
124150
124205
|
continue;
|
|
124151
124206
|
}
|
|
124152
|
-
if (
|
|
124207
|
+
if (updateLevel === 2 /* Full */) {
|
|
124153
124208
|
watchConfigFile(state, project, projectPath, config);
|
|
124154
124209
|
watchExtendedConfigFiles(state, projectPath, config);
|
|
124155
124210
|
watchWildCardDirectories(state, project, projectPath, config);
|
|
124156
124211
|
watchInputFiles(state, project, projectPath, config);
|
|
124157
124212
|
watchPackageJsonFiles(state, project, projectPath, config);
|
|
124158
|
-
} else if (
|
|
124213
|
+
} else if (updateLevel === 1 /* RootNamesAndUpdate */) {
|
|
124159
124214
|
config.fileNames = getFileNamesFromConfigSpecs(config.options.configFile.configFileSpecs, getDirectoryPath(project), config.options, state.parseConfigFileHost);
|
|
124160
124215
|
updateErrorForNoInputFiles(config.fileNames, project, config.options.configFile.configFileSpecs, config.errors, canJsonReportNoInputFiles(config.raw));
|
|
124161
124216
|
watchInputFiles(state, project, projectPath, config);
|
|
@@ -124742,7 +124797,7 @@ function queueReferencingProjects(state, project, projectPath, projectIndex, con
|
|
|
124742
124797
|
break;
|
|
124743
124798
|
}
|
|
124744
124799
|
}
|
|
124745
|
-
addProjToQueue(state, nextProjectPath, 0 /*
|
|
124800
|
+
addProjToQueue(state, nextProjectPath, 0 /* Update */);
|
|
124746
124801
|
break;
|
|
124747
124802
|
}
|
|
124748
124803
|
}
|
|
@@ -124811,7 +124866,7 @@ function cleanWorker(state, project, onlyReferences) {
|
|
|
124811
124866
|
filesToDelete.push(output);
|
|
124812
124867
|
} else {
|
|
124813
124868
|
host.deleteFile(output);
|
|
124814
|
-
invalidateProject(state, resolvedPath, 0 /*
|
|
124869
|
+
invalidateProject(state, resolvedPath, 0 /* Update */);
|
|
124815
124870
|
}
|
|
124816
124871
|
}
|
|
124817
124872
|
}
|
|
@@ -124822,22 +124877,22 @@ function cleanWorker(state, project, onlyReferences) {
|
|
|
124822
124877
|
}
|
|
124823
124878
|
return 0 /* Success */;
|
|
124824
124879
|
}
|
|
124825
|
-
function invalidateProject(state, resolved,
|
|
124826
|
-
if (state.host.getParsedCommandLine &&
|
|
124827
|
-
|
|
124880
|
+
function invalidateProject(state, resolved, updateLevel) {
|
|
124881
|
+
if (state.host.getParsedCommandLine && updateLevel === 1 /* RootNamesAndUpdate */) {
|
|
124882
|
+
updateLevel = 2 /* Full */;
|
|
124828
124883
|
}
|
|
124829
|
-
if (
|
|
124884
|
+
if (updateLevel === 2 /* Full */) {
|
|
124830
124885
|
state.configFileCache.delete(resolved);
|
|
124831
124886
|
state.buildOrder = void 0;
|
|
124832
124887
|
}
|
|
124833
124888
|
state.needsSummary = true;
|
|
124834
124889
|
clearProjectStatus(state, resolved);
|
|
124835
|
-
addProjToQueue(state, resolved,
|
|
124890
|
+
addProjToQueue(state, resolved, updateLevel);
|
|
124836
124891
|
enableCache(state);
|
|
124837
124892
|
}
|
|
124838
|
-
function invalidateProjectAndScheduleBuilds(state, resolvedPath,
|
|
124893
|
+
function invalidateProjectAndScheduleBuilds(state, resolvedPath, updateLevel) {
|
|
124839
124894
|
state.reportFileChangeDetected = true;
|
|
124840
|
-
invalidateProject(state, resolvedPath,
|
|
124895
|
+
invalidateProject(state, resolvedPath, updateLevel);
|
|
124841
124896
|
scheduleBuildInvalidatedProject(
|
|
124842
124897
|
state,
|
|
124843
124898
|
250,
|
|
@@ -124968,7 +125023,7 @@ function watchWildCardDirectories(state, resolved, resolvedPath, parsed) {
|
|
|
124968
125023
|
toPath: (fileName) => toPath2(state, fileName)
|
|
124969
125024
|
}))
|
|
124970
125025
|
return;
|
|
124971
|
-
invalidateProjectAndScheduleBuilds(state, resolvedPath, 1 /*
|
|
125026
|
+
invalidateProjectAndScheduleBuilds(state, resolvedPath, 1 /* RootNamesAndUpdate */);
|
|
124972
125027
|
},
|
|
124973
125028
|
flags,
|
|
124974
125029
|
parsed == null ? void 0 : parsed.watchOptions,
|
|
@@ -124987,7 +125042,7 @@ function watchInputFiles(state, resolved, resolvedPath, parsed) {
|
|
|
124987
125042
|
createNewValue: (_path, input) => watchFile(
|
|
124988
125043
|
state,
|
|
124989
125044
|
input,
|
|
124990
|
-
() => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /*
|
|
125045
|
+
() => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /* Update */),
|
|
124991
125046
|
250 /* Low */,
|
|
124992
125047
|
parsed == null ? void 0 : parsed.watchOptions,
|
|
124993
125048
|
WatchType.SourceFile,
|
|
@@ -125007,7 +125062,7 @@ function watchPackageJsonFiles(state, resolved, resolvedPath, parsed) {
|
|
|
125007
125062
|
createNewValue: (path, _input) => watchFile(
|
|
125008
125063
|
state,
|
|
125009
125064
|
path,
|
|
125010
|
-
() => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /*
|
|
125065
|
+
() => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /* Update */),
|
|
125011
125066
|
2e3 /* High */,
|
|
125012
125067
|
parsed == null ? void 0 : parsed.watchOptions,
|
|
125013
125068
|
WatchType.PackageJson,
|
|
@@ -125078,7 +125133,7 @@ function createSolutionBuilderWorker(watch, hostOrHostWithWatch, rootNames, opti
|
|
|
125078
125133
|
const configFilePath = toResolvedConfigFilePath(state, configFileName);
|
|
125079
125134
|
return getUpToDateStatus(state, parseConfigFile(state, configFileName, configFilePath), configFilePath);
|
|
125080
125135
|
},
|
|
125081
|
-
invalidateProject: (configFilePath,
|
|
125136
|
+
invalidateProject: (configFilePath, updateLevel) => invalidateProject(state, configFilePath, updateLevel || 0 /* Update */),
|
|
125082
125137
|
close: () => stopWatching(state)
|
|
125083
125138
|
};
|
|
125084
125139
|
}
|