@typescript-deploys/pr-build 5.3.0-pr-56020-20 → 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 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.20231009`;
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
- resultFromCache.failedLookupLocations = updateResolutionField(resultFromCache.failedLookupLocations, failedLookupLocations);
36926
- resultFromCache.affectingLocations = updateResolutionField(resultFromCache.affectingLocations, affectingLocations);
36927
- resultFromCache.resolutionDiagnostics = updateResolutionField(resultFromCache.resolutionDiagnostics, diagnostics);
36928
- return resultFromCache;
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 == null ? void 0 : cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference).set(
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 == null ? void 0 : cache.getOrCreateCacheForNonRelativeName(typeReferenceDirectiveName, resolutionMode, redirectedReference).set(containingDirectory, result);
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 == null ? void 0 : cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference).set(moduleName, resolutionMode, result);
37755
- if (!isExternalModuleNameRelative(moduleName)) {
37756
- cache == null ? void 0 : cache.getOrCreateCacheForNonRelativeName(moduleName, resolutionMode, redirectedReference).set(containingDirectory, result);
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, _g, _h;
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
- (_e = state.packageJsonInfoCache) == null ? void 0 : _e.setPackageJsonInfo(packageJsonPath, result);
38366
- (_f = state.affectingLocations) == null ? void 0 : _f.push(packageJsonPath);
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
- (_g = state.packageJsonInfoCache) == null ? void 0 : _g.setPackageJsonInfo(packageJsonPath, directoryExists);
38373
- (_h = state.failedLookupLocations) == null ? void 0 : _h.push(packageJsonPath);
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) {
@@ -66435,7 +66462,25 @@ function createTypeChecker(host) {
66435
66462
  const matching = discriminant && getConstituentTypeForKeyType(type, discriminant);
66436
66463
  const directlyRelated = mapType(
66437
66464
  matching || type,
66438
- checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeStrictSubtypeOf(t, c) ? t : isTypeStrictSubtypeOf(c, t) ? c : isTypeSubtypeOf(t, c) ? t : isTypeSubtypeOf(c, t) ? c : neverType
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
+ }
66439
66484
  );
66440
66485
  return directlyRelated.flags & 131072 /* Never */ ? mapType(type, (t) => maybeTypeOfKind(t, 465829888 /* Instantiable */) && isRelated(c, getBaseConstraintOfType(t) || unknownType) ? getIntersectionType([t, c]) : neverType) : directlyRelated;
66441
66486
  });
@@ -121012,6 +121057,10 @@ function getRootDirectoryOfResolutionCache(rootDirForResolution, getCurrentDirec
121012
121057
  const normalized = getNormalizedAbsolutePath(rootDirForResolution, getCurrentDirectory());
121013
121058
  return !isDiskPathRoot(normalized) ? removeTrailingDirectorySeparator(normalized) : normalized;
121014
121059
  }
121060
+ function getModuleResolutionHost(resolutionHost) {
121061
+ var _a;
121062
+ return ((_a = resolutionHost.getCompilerHost) == null ? void 0 : _a.call(resolutionHost)) || resolutionHost;
121063
+ }
121015
121064
  function createModuleResolutionLoaderUsingGlobalCache(containingFile, redirectedReference, options, resolutionHost, moduleResolutionCache) {
121016
121065
  return {
121017
121066
  nameAndMode: moduleResolutionNameAndModeGetter,
@@ -121027,8 +121076,7 @@ function createModuleResolutionLoaderUsingGlobalCache(containingFile, redirected
121027
121076
  };
121028
121077
  }
121029
121078
  function resolveModuleNameUsingGlobalCache(resolutionHost, moduleResolutionCache, moduleName, containingFile, compilerOptions, redirectedReference, mode) {
121030
- var _a;
121031
- const host = ((_a = resolutionHost.getCompilerHost) == null ? void 0 : _a.call(resolutionHost)) || resolutionHost;
121079
+ const host = getModuleResolutionHost(resolutionHost);
121032
121080
  const primaryResult = resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference, mode);
121033
121081
  if (!resolutionHost.getGlobalCache) {
121034
121082
  return primaryResult;
@@ -121199,6 +121247,10 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
121199
121247
  };
121200
121248
  }
121201
121249
  function startCachingPerDirectoryResolution() {
121250
+ moduleResolutionCache.isReadonly = void 0;
121251
+ typeReferenceDirectiveResolutionCache.isReadonly = void 0;
121252
+ libraryResolutionCache.isReadonly = void 0;
121253
+ moduleResolutionCache.getPackageJsonInfoCache().isReadonly = void 0;
121202
121254
  moduleResolutionCache.clearAllExceptPackageJsonInfoCache();
121203
121255
  typeReferenceDirectiveResolutionCache.clearAllExceptPackageJsonInfoCache();
121204
121256
  libraryResolutionCache.clearAllExceptPackageJsonInfoCache();
@@ -121256,6 +121308,10 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
121256
121308
  directoryWatchesOfFailedLookups.forEach(closeDirectoryWatchesOfFailedLookup);
121257
121309
  fileWatchesOfAffectingLocations.forEach(closeFileWatcherOfAffectingLocation);
121258
121310
  hasChangedAutomaticTypeDirectiveNames = false;
121311
+ moduleResolutionCache.isReadonly = true;
121312
+ typeReferenceDirectiveResolutionCache.isReadonly = true;
121313
+ libraryResolutionCache.isReadonly = true;
121314
+ moduleResolutionCache.getPackageJsonInfoCache().isReadonly = true;
121259
121315
  }
121260
121316
  function closeDirectoryWatchesOfFailedLookup(watcher, path) {
121261
121317
  if (watcher.refCount === 0) {
@@ -121284,7 +121340,6 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
121284
121340
  shouldRetryResolution,
121285
121341
  logChanges
121286
121342
  }) {
121287
- var _a;
121288
121343
  const path = resolutionHost.toPath(containingFile);
121289
121344
  const resolutionsInFile = perFileCache.get(path) || perFileCache.set(path, createModeAwareCache()).get(path);
121290
121345
  const resolvedModules = [];
@@ -121316,7 +121371,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
121316
121371
  logChanges = false;
121317
121372
  }
121318
121373
  } else {
121319
- const host = ((_a = resolutionHost.getCompilerHost) == null ? void 0 : _a.call(resolutionHost)) || resolutionHost;
121374
+ const host = getModuleResolutionHost(resolutionHost);
121320
121375
  if (isTraceEnabled(options, host) && !seenNamesInFile.has(name, mode)) {
121321
121376
  const resolved = getResolutionWithResolvedFileName(resolution);
121322
121377
  trace(
@@ -121368,7 +121423,6 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
121368
121423
  }
121369
121424
  }
121370
121425
  function resolveTypeReferenceDirectiveReferences(typeDirectiveReferences, containingFile, redirectedReference, options, containingSourceFile, reusedNames) {
121371
- var _a;
121372
121426
  return resolveNamesWithLocalCache({
121373
121427
  entries: typeDirectiveReferences,
121374
121428
  containingFile,
@@ -121381,7 +121435,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
121381
121435
  containingFile,
121382
121436
  redirectedReference,
121383
121437
  options,
121384
- ((_a = resolutionHost.getCompilerHost) == null ? void 0 : _a.call(resolutionHost)) || resolutionHost,
121438
+ getModuleResolutionHost(resolutionHost),
121385
121439
  typeReferenceDirectiveResolutionCache
121386
121440
  ),
121387
121441
  getResolutionWithResolvedFileName: getResolvedTypeReferenceDirective,
@@ -121413,8 +121467,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
121413
121467
  });
121414
121468
  }
121415
121469
  function resolveLibrary2(libraryName, resolveFrom, options, libFileName) {
121416
- var _a;
121417
- const host = ((_a = resolutionHost.getCompilerHost) == null ? void 0 : _a.call(resolutionHost)) || resolutionHost;
121470
+ const host = getModuleResolutionHost(resolutionHost);
121418
121471
  let resolution = resolvedLibraries == null ? void 0 : resolvedLibraries.get(libFileName);
121419
121472
  if (!resolution || resolution.isInvalidated) {
121420
121473
  const existingResolution = resolution;
@@ -121448,6 +121501,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
121448
121501
  return resolution;
121449
121502
  }
121450
121503
  function resolveSingleModuleNameWithoutWatching(moduleName, containingFile) {
121504
+ var _a, _b;
121451
121505
  const path = resolutionHost.toPath(containingFile);
121452
121506
  const resolutionsInFile = resolvedModuleNames.get(path);
121453
121507
  const resolution = resolutionsInFile == null ? void 0 : resolutionsInFile.get(
@@ -121457,7 +121511,17 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
121457
121511
  );
121458
121512
  if (resolution && !resolution.isInvalidated)
121459
121513
  return resolution;
121460
- return resolveModuleNameUsingGlobalCache(resolutionHost, moduleResolutionCache, moduleName, containingFile, resolutionHost.getCompilationSettings());
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;
121461
121525
  }
121462
121526
  function isNodeModulesAtTypesDirectory(dirPath) {
121463
121527
  return endsWith(dirPath, "/node_modules/@types");
@@ -122603,7 +122667,7 @@ function createIncrementalProgram({
122603
122667
  }
122604
122668
  function createWatchProgram(host) {
122605
122669
  let builderProgram;
122606
- let reloadLevel;
122670
+ let updateLevel;
122607
122671
  let missingFilesMap;
122608
122672
  let watchedWildcardDirectories;
122609
122673
  let timerToUpdateProgram;
@@ -122962,7 +123026,7 @@ function createWatchProgram(host) {
122962
123026
  }
122963
123027
  function scheduleProgramReload() {
122964
123028
  Debug.assert(!!configFileName);
122965
- reloadLevel = 2 /* Full */;
123029
+ updateLevel = 2 /* Full */;
122966
123030
  scheduleProgramUpdate();
122967
123031
  }
122968
123032
  function updateProgramWithWatchStatus() {
@@ -122972,8 +123036,8 @@ function createWatchProgram(host) {
122972
123036
  }
122973
123037
  function updateProgram() {
122974
123038
  var _a, _b, _c, _d;
122975
- switch (reloadLevel) {
122976
- case 1 /* Partial */:
123039
+ switch (updateLevel) {
123040
+ case 1 /* RootNamesAndUpdate */:
122977
123041
  (_a = perfLogger) == null ? void 0 : _a.logStartUpdateProgram("PartialConfigReload");
122978
123042
  reloadFileNamesFromConfigFile();
122979
123043
  break;
@@ -122993,7 +123057,7 @@ function createWatchProgram(host) {
122993
123057
  writeLog("Reloading new file names and options");
122994
123058
  Debug.assert(compilerOptions);
122995
123059
  Debug.assert(configFileName);
122996
- reloadLevel = 0 /* None */;
123060
+ updateLevel = 0 /* Update */;
122997
123061
  rootFileNames = getFileNamesFromConfigSpecs(compilerOptions.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions);
122998
123062
  if (updateErrorForNoInputFiles(rootFileNames, getNormalizedAbsolutePath(configFileName, currentDirectory), compilerOptions.configFile.configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) {
122999
123063
  hasChangedConfigFileParsingErrors = true;
@@ -123003,7 +123067,7 @@ function createWatchProgram(host) {
123003
123067
  function reloadConfigFile() {
123004
123068
  Debug.assert(configFileName);
123005
123069
  writeLog(`Reloading config file: ${configFileName}`);
123006
- reloadLevel = 0 /* None */;
123070
+ updateLevel = 0 /* Update */;
123007
123071
  if (cachedDirectoryStructureHost) {
123008
123072
  cachedDirectoryStructureHost.clearCache();
123009
123073
  }
@@ -123040,9 +123104,9 @@ function createWatchProgram(host) {
123040
123104
  const configPath = toPath3(configFileName2);
123041
123105
  let config = parsedConfigs == null ? void 0 : parsedConfigs.get(configPath);
123042
123106
  if (config) {
123043
- if (!config.reloadLevel)
123107
+ if (!config.updateLevel)
123044
123108
  return config.parsedCommandLine;
123045
- if (config.parsedCommandLine && config.reloadLevel === 1 /* Partial */ && !host.getParsedCommandLine) {
123109
+ if (config.parsedCommandLine && config.updateLevel === 1 /* RootNamesAndUpdate */ && !host.getParsedCommandLine) {
123046
123110
  writeLog("Reloading new file names and options");
123047
123111
  Debug.assert(compilerOptions);
123048
123112
  const fileNames = getFileNamesFromConfigSpecs(
@@ -123052,7 +123116,7 @@ function createWatchProgram(host) {
123052
123116
  parseConfigFileHost
123053
123117
  );
123054
123118
  config.parsedCommandLine = { ...config.parsedCommandLine, fileNames };
123055
- config.reloadLevel = void 0;
123119
+ config.updateLevel = void 0;
123056
123120
  return config.parsedCommandLine;
123057
123121
  }
123058
123122
  }
@@ -123060,7 +123124,7 @@ function createWatchProgram(host) {
123060
123124
  const parsedCommandLine = host.getParsedCommandLine ? host.getParsedCommandLine(configFileName2) : getParsedCommandLineFromConfigFileHost(configFileName2);
123061
123125
  if (config) {
123062
123126
  config.parsedCommandLine = parsedCommandLine;
123063
- config.reloadLevel = void 0;
123127
+ config.updateLevel = void 0;
123064
123128
  } else {
123065
123129
  (parsedConfigs || (parsedConfigs = /* @__PURE__ */ new Map())).set(configPath, config = { parsedCommandLine });
123066
123130
  }
@@ -123157,8 +123221,8 @@ function createWatchProgram(host) {
123157
123221
  toPath: toPath3
123158
123222
  }))
123159
123223
  return;
123160
- if (reloadLevel !== 2 /* Full */) {
123161
- reloadLevel = 1 /* Partial */;
123224
+ if (updateLevel !== 2 /* Full */) {
123225
+ updateLevel = 1 /* RootNamesAndUpdate */;
123162
123226
  scheduleProgramUpdate();
123163
123227
  }
123164
123228
  },
@@ -123184,11 +123248,11 @@ function createWatchProgram(host) {
123184
123248
  return;
123185
123249
  projects.forEach((projectPath) => {
123186
123250
  if (configFileName && toPath3(configFileName) === projectPath) {
123187
- reloadLevel = 2 /* Full */;
123251
+ updateLevel = 2 /* Full */;
123188
123252
  } else {
123189
123253
  const config = parsedConfigs == null ? void 0 : parsedConfigs.get(projectPath);
123190
123254
  if (config)
123191
- config.reloadLevel = 2 /* Full */;
123255
+ config.updateLevel = 2 /* Full */;
123192
123256
  resolutionCache.removeResolutionsFromProjectReferenceRedirects(projectPath);
123193
123257
  }
123194
123258
  scheduleProgramUpdate();
@@ -123209,7 +123273,7 @@ function createWatchProgram(host) {
123209
123273
  updateCachedSystemWithFile(configFileName2, configPath, eventKind);
123210
123274
  const config = parsedConfigs == null ? void 0 : parsedConfigs.get(configPath);
123211
123275
  if (config)
123212
- config.reloadLevel = 2 /* Full */;
123276
+ config.updateLevel = 2 /* Full */;
123213
123277
  resolutionCache.removeResolutionsFromProjectReferenceRedirects(configPath);
123214
123278
  scheduleProgramUpdate();
123215
123279
  },
@@ -123247,8 +123311,8 @@ function createWatchProgram(host) {
123247
123311
  toPath: toPath3
123248
123312
  }))
123249
123313
  return;
123250
- if (config.reloadLevel !== 2 /* Full */) {
123251
- config.reloadLevel = 1 /* Partial */;
123314
+ if (config.updateLevel !== 2 /* Full */) {
123315
+ config.updateLevel = 1 /* RootNamesAndUpdate */;
123252
123316
  scheduleProgramUpdate();
123253
123317
  }
123254
123318
  },
@@ -123690,12 +123754,12 @@ function clearProjectStatus(state, resolved) {
123690
123754
  state.projectStatus.delete(resolved);
123691
123755
  state.diagnostics.delete(resolved);
123692
123756
  }
123693
- function addProjToQueue({ projectPendingBuild }, proj, reloadLevel) {
123757
+ function addProjToQueue({ projectPendingBuild }, proj, updateLevel) {
123694
123758
  const value = projectPendingBuild.get(proj);
123695
123759
  if (value === void 0) {
123696
- projectPendingBuild.set(proj, reloadLevel);
123697
- } else if (value < reloadLevel) {
123698
- projectPendingBuild.set(proj, reloadLevel);
123760
+ projectPendingBuild.set(proj, updateLevel);
123761
+ } else if (value < updateLevel) {
123762
+ projectPendingBuild.set(proj, updateLevel);
123699
123763
  }
123700
123764
  }
123701
123765
  function setupInitialBuild(state, cancellationToken) {
@@ -123709,7 +123773,7 @@ function setupInitialBuild(state, cancellationToken) {
123709
123773
  buildOrder.forEach(
123710
123774
  (configFileName) => state.projectPendingBuild.set(
123711
123775
  toResolvedConfigFilePath(state, configFileName),
123712
- 0 /* None */
123776
+ 0 /* Update */
123713
123777
  )
123714
123778
  );
123715
123779
  if (cancellationToken) {
@@ -124145,8 +124209,8 @@ function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) {
124145
124209
  for (let projectIndex = 0; projectIndex < buildOrder.length; projectIndex++) {
124146
124210
  const project = buildOrder[projectIndex];
124147
124211
  const projectPath = toResolvedConfigFilePath(state, project);
124148
- const reloadLevel = state.projectPendingBuild.get(projectPath);
124149
- if (reloadLevel === void 0)
124212
+ const updateLevel = state.projectPendingBuild.get(projectPath);
124213
+ if (updateLevel === void 0)
124150
124214
  continue;
124151
124215
  if (reportQueue) {
124152
124216
  reportQueue = false;
@@ -124158,13 +124222,13 @@ function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) {
124158
124222
  projectPendingBuild.delete(projectPath);
124159
124223
  continue;
124160
124224
  }
124161
- if (reloadLevel === 2 /* Full */) {
124225
+ if (updateLevel === 2 /* Full */) {
124162
124226
  watchConfigFile(state, project, projectPath, config);
124163
124227
  watchExtendedConfigFiles(state, projectPath, config);
124164
124228
  watchWildCardDirectories(state, project, projectPath, config);
124165
124229
  watchInputFiles(state, project, projectPath, config);
124166
124230
  watchPackageJsonFiles(state, project, projectPath, config);
124167
- } else if (reloadLevel === 1 /* Partial */) {
124231
+ } else if (updateLevel === 1 /* RootNamesAndUpdate */) {
124168
124232
  config.fileNames = getFileNamesFromConfigSpecs(config.options.configFile.configFileSpecs, getDirectoryPath(project), config.options, state.parseConfigFileHost);
124169
124233
  updateErrorForNoInputFiles(config.fileNames, project, config.options.configFile.configFileSpecs, config.errors, canJsonReportNoInputFiles(config.raw));
124170
124234
  watchInputFiles(state, project, projectPath, config);
@@ -124751,7 +124815,7 @@ function queueReferencingProjects(state, project, projectPath, projectIndex, con
124751
124815
  break;
124752
124816
  }
124753
124817
  }
124754
- addProjToQueue(state, nextProjectPath, 0 /* None */);
124818
+ addProjToQueue(state, nextProjectPath, 0 /* Update */);
124755
124819
  break;
124756
124820
  }
124757
124821
  }
@@ -124820,7 +124884,7 @@ function cleanWorker(state, project, onlyReferences) {
124820
124884
  filesToDelete.push(output);
124821
124885
  } else {
124822
124886
  host.deleteFile(output);
124823
- invalidateProject(state, resolvedPath, 0 /* None */);
124887
+ invalidateProject(state, resolvedPath, 0 /* Update */);
124824
124888
  }
124825
124889
  }
124826
124890
  }
@@ -124831,22 +124895,22 @@ function cleanWorker(state, project, onlyReferences) {
124831
124895
  }
124832
124896
  return 0 /* Success */;
124833
124897
  }
124834
- function invalidateProject(state, resolved, reloadLevel) {
124835
- if (state.host.getParsedCommandLine && reloadLevel === 1 /* Partial */) {
124836
- reloadLevel = 2 /* Full */;
124898
+ function invalidateProject(state, resolved, updateLevel) {
124899
+ if (state.host.getParsedCommandLine && updateLevel === 1 /* RootNamesAndUpdate */) {
124900
+ updateLevel = 2 /* Full */;
124837
124901
  }
124838
- if (reloadLevel === 2 /* Full */) {
124902
+ if (updateLevel === 2 /* Full */) {
124839
124903
  state.configFileCache.delete(resolved);
124840
124904
  state.buildOrder = void 0;
124841
124905
  }
124842
124906
  state.needsSummary = true;
124843
124907
  clearProjectStatus(state, resolved);
124844
- addProjToQueue(state, resolved, reloadLevel);
124908
+ addProjToQueue(state, resolved, updateLevel);
124845
124909
  enableCache(state);
124846
124910
  }
124847
- function invalidateProjectAndScheduleBuilds(state, resolvedPath, reloadLevel) {
124911
+ function invalidateProjectAndScheduleBuilds(state, resolvedPath, updateLevel) {
124848
124912
  state.reportFileChangeDetected = true;
124849
- invalidateProject(state, resolvedPath, reloadLevel);
124913
+ invalidateProject(state, resolvedPath, updateLevel);
124850
124914
  scheduleBuildInvalidatedProject(
124851
124915
  state,
124852
124916
  250,
@@ -124977,7 +125041,7 @@ function watchWildCardDirectories(state, resolved, resolvedPath, parsed) {
124977
125041
  toPath: (fileName) => toPath2(state, fileName)
124978
125042
  }))
124979
125043
  return;
124980
- invalidateProjectAndScheduleBuilds(state, resolvedPath, 1 /* Partial */);
125044
+ invalidateProjectAndScheduleBuilds(state, resolvedPath, 1 /* RootNamesAndUpdate */);
124981
125045
  },
124982
125046
  flags,
124983
125047
  parsed == null ? void 0 : parsed.watchOptions,
@@ -124996,7 +125060,7 @@ function watchInputFiles(state, resolved, resolvedPath, parsed) {
124996
125060
  createNewValue: (_path, input) => watchFile(
124997
125061
  state,
124998
125062
  input,
124999
- () => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /* None */),
125063
+ () => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /* Update */),
125000
125064
  250 /* Low */,
125001
125065
  parsed == null ? void 0 : parsed.watchOptions,
125002
125066
  WatchType.SourceFile,
@@ -125016,7 +125080,7 @@ function watchPackageJsonFiles(state, resolved, resolvedPath, parsed) {
125016
125080
  createNewValue: (path, _input) => watchFile(
125017
125081
  state,
125018
125082
  path,
125019
- () => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /* None */),
125083
+ () => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /* Update */),
125020
125084
  2e3 /* High */,
125021
125085
  parsed == null ? void 0 : parsed.watchOptions,
125022
125086
  WatchType.PackageJson,
@@ -125087,7 +125151,7 @@ function createSolutionBuilderWorker(watch, hostOrHostWithWatch, rootNames, opti
125087
125151
  const configFilePath = toResolvedConfigFilePath(state, configFileName);
125088
125152
  return getUpToDateStatus(state, parseConfigFile(state, configFileName, configFilePath), configFilePath);
125089
125153
  },
125090
- invalidateProject: (configFilePath, reloadLevel) => invalidateProject(state, configFilePath, reloadLevel || 0 /* None */),
125154
+ invalidateProject: (configFilePath, updateLevel) => invalidateProject(state, configFilePath, updateLevel || 0 /* Update */),
125091
125155
  close: () => stopWatching(state)
125092
125156
  };
125093
125157
  }