typescript 5.3.0-dev.20231009 → 5.3.0-dev.20231010

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/tsserver.js CHANGED
@@ -58,7 +58,6 @@ __export(server_exports, {
58
58
  CompletionInfoFlags: () => CompletionInfoFlags,
59
59
  CompletionTriggerKind: () => CompletionTriggerKind,
60
60
  Completions: () => ts_Completions_exports,
61
- ConfigFileProgramReloadLevel: () => ConfigFileProgramReloadLevel,
62
61
  ContainerFlags: () => ContainerFlags,
63
62
  ContextFlags: () => ContextFlags,
64
63
  Debug: () => Debug,
@@ -145,6 +144,7 @@ __export(server_exports, {
145
144
  PragmaKindFlags: () => PragmaKindFlags,
146
145
  PrivateIdentifierKind: () => PrivateIdentifierKind,
147
146
  ProcessLevel: () => ProcessLevel,
147
+ ProgramUpdateLevel: () => ProgramUpdateLevel,
148
148
  QuotePreference: () => QuotePreference,
149
149
  RelationComparisonResult: () => RelationComparisonResult,
150
150
  Rename: () => ts_Rename_exports,
@@ -2328,7 +2328,7 @@ module.exports = __toCommonJS(server_exports);
2328
2328
 
2329
2329
  // src/compiler/corePublic.ts
2330
2330
  var versionMajorMinor = "5.3";
2331
- var version = `${versionMajorMinor}.0-dev.20231009`;
2331
+ var version = `${versionMajorMinor}.0-dev.20231010`;
2332
2332
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2333
2333
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2334
2334
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -17481,6 +17481,7 @@ function tryGetModuleSpecifierFromDeclaration(node) {
17481
17481
  true
17482
17482
  ))) == null ? void 0 : _a.arguments[0];
17483
17483
  case 272 /* ImportDeclaration */:
17484
+ case 278 /* ExportDeclaration */:
17484
17485
  return tryCast(node.moduleSpecifier, isStringLiteralLike);
17485
17486
  case 271 /* ImportEqualsDeclaration */:
17486
17487
  return tryCast((_b = tryCast(node.moduleReference, isExternalModuleReference)) == null ? void 0 : _b.expression, isStringLiteralLike);
@@ -17492,6 +17493,8 @@ function tryGetModuleSpecifierFromDeclaration(node) {
17492
17493
  return tryCast(node.parent.parent.moduleSpecifier, isStringLiteralLike);
17493
17494
  case 276 /* ImportSpecifier */:
17494
17495
  return tryCast(node.parent.parent.parent.moduleSpecifier, isStringLiteralLike);
17496
+ case 205 /* ImportType */:
17497
+ return isLiteralImportTypeNode(node) ? node.argument.literal : void 0;
17495
17498
  default:
17496
17499
  Debug.assertNever(node);
17497
17500
  }
@@ -70444,7 +70447,7 @@ function createTypeChecker(host) {
70444
70447
  return createFlowType(narrowedType, isIncomplete(flowType));
70445
70448
  }
70446
70449
  function getTypeAtSwitchClause(flow) {
70447
- const expr = flow.switchStatement.expression;
70450
+ const expr = skipParentheses(flow.switchStatement.expression);
70448
70451
  const flowType = getTypeAtFlowNode(flow.antecedent);
70449
70452
  let type = getTypeFromFlowType(flowType);
70450
70453
  if (isMatchingReference(reference, expr)) {
@@ -87038,7 +87041,16 @@ function createTypeChecker(host) {
87038
87041
  }
87039
87042
  return !sym.exports ? [] : nodeBuilder.symbolTableToDeclarationStatements(sym.exports, node, flags, tracker, bundled);
87040
87043
  },
87041
- isImportRequiredByAugmentation
87044
+ isImportRequiredByAugmentation,
87045
+ tryFindAmbientModule: (moduleReferenceExpression) => {
87046
+ const node = getParseTreeNode(moduleReferenceExpression);
87047
+ const moduleSpecifier = node && isStringLiteralLike(node) ? node.text : void 0;
87048
+ return moduleSpecifier !== void 0 ? tryFindAmbientModule(
87049
+ moduleSpecifier,
87050
+ /*withAugmentations*/
87051
+ true
87052
+ ) : void 0;
87053
+ }
87042
87054
  };
87043
87055
  function isImportRequiredByAugmentation(node) {
87044
87056
  const file = getSourceFileOfNode(node);
@@ -111969,6 +111981,17 @@ function transformDeclarations(context) {
111969
111981
  const container = getSourceFileOfNode(node);
111970
111982
  refs.set(getOriginalNodeId(container), container);
111971
111983
  }
111984
+ function trackReferencedAmbientModuleFromImport(node) {
111985
+ const moduleSpecifier = tryGetModuleSpecifierFromDeclaration(node);
111986
+ const symbol = moduleSpecifier && resolver.tryFindAmbientModule(moduleSpecifier);
111987
+ if (symbol == null ? void 0 : symbol.declarations) {
111988
+ for (const decl of symbol.declarations) {
111989
+ if (isAmbientModule(decl) && getSourceFileOfNode(decl) !== currentSourceFile) {
111990
+ trackReferencedAmbientModule(decl, symbol);
111991
+ }
111992
+ }
111993
+ }
111994
+ }
111972
111995
  function handleSymbolAccessibilityError(symbolAccessibilityResult) {
111973
111996
  if (symbolAccessibilityResult.accessibility === 0 /* Accessible */) {
111974
111997
  if (symbolAccessibilityResult && symbolAccessibilityResult.aliasesToMakeVisible) {
@@ -112916,6 +112939,7 @@ function transformDeclarations(context) {
112916
112939
  case 205 /* ImportType */: {
112917
112940
  if (!isLiteralImportTypeNode(input))
112918
112941
  return cleanup(input);
112942
+ trackReferencedAmbientModuleFromImport(input);
112919
112943
  return cleanup(factory2.updateImportTypeNode(
112920
112944
  input,
112921
112945
  factory2.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)),
@@ -112967,6 +112991,7 @@ function transformDeclarations(context) {
112967
112991
  resultHasExternalModuleIndicator = true;
112968
112992
  }
112969
112993
  resultHasScopeMarker = true;
112994
+ trackReferencedAmbientModuleFromImport(input);
112970
112995
  return factory2.updateExportDeclaration(
112971
112996
  input,
112972
112997
  input.modifiers,
@@ -113041,10 +113066,18 @@ function transformDeclarations(context) {
113041
113066
  return;
113042
113067
  switch (input.kind) {
113043
113068
  case 271 /* ImportEqualsDeclaration */: {
113044
- return transformImportEqualsDeclaration(input);
113069
+ const transformed = transformImportEqualsDeclaration(input);
113070
+ if (transformed) {
113071
+ trackReferencedAmbientModuleFromImport(input);
113072
+ }
113073
+ return transformed;
113045
113074
  }
113046
113075
  case 272 /* ImportDeclaration */: {
113047
- return transformImportDeclaration(input);
113076
+ const transformed = transformImportDeclaration(input);
113077
+ if (transformed) {
113078
+ trackReferencedAmbientModuleFromImport(input);
113079
+ }
113080
+ return transformed;
113048
113081
  }
113049
113082
  }
113050
113083
  if (isDeclaration(input) && isDeclarationAndNotVisible(input))
@@ -114658,7 +114691,8 @@ var notImplementedResolver = {
114658
114691
  getSymbolOfExternalModuleSpecifier: notImplemented,
114659
114692
  isBindingCapturedByNode: notImplemented,
114660
114693
  getDeclarationStatementsForSourceFile: notImplemented,
114661
- isImportRequiredByAugmentation: notImplemented
114694
+ isImportRequiredByAugmentation: notImplemented,
114695
+ tryFindAmbientModule: notImplemented
114662
114696
  };
114663
114697
  function createSourceFilesFromBundleBuildInfo(bundle, buildInfoDirectory, host) {
114664
114698
  var _a;
@@ -119733,12 +119767,12 @@ function createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensi
119733
119767
  cachedReadDirectoryResult.clear();
119734
119768
  }
119735
119769
  }
119736
- var ConfigFileProgramReloadLevel = /* @__PURE__ */ ((ConfigFileProgramReloadLevel2) => {
119737
- ConfigFileProgramReloadLevel2[ConfigFileProgramReloadLevel2["None"] = 0] = "None";
119738
- ConfigFileProgramReloadLevel2[ConfigFileProgramReloadLevel2["Partial"] = 1] = "Partial";
119739
- ConfigFileProgramReloadLevel2[ConfigFileProgramReloadLevel2["Full"] = 2] = "Full";
119740
- return ConfigFileProgramReloadLevel2;
119741
- })(ConfigFileProgramReloadLevel || {});
119770
+ var ProgramUpdateLevel = /* @__PURE__ */ ((ProgramUpdateLevel2) => {
119771
+ ProgramUpdateLevel2[ProgramUpdateLevel2["Update"] = 0] = "Update";
119772
+ ProgramUpdateLevel2[ProgramUpdateLevel2["RootNamesAndUpdate"] = 1] = "RootNamesAndUpdate";
119773
+ ProgramUpdateLevel2[ProgramUpdateLevel2["Full"] = 2] = "Full";
119774
+ return ProgramUpdateLevel2;
119775
+ })(ProgramUpdateLevel || {});
119742
119776
  function updateSharedExtendedConfigFileWatcher(projectPath, options, extendedConfigFilesMap, createExtendedConfigFileWatch, toPath3) {
119743
119777
  var _a;
119744
119778
  const extendedConfigs = arrayToMap(((_a = options == null ? void 0 : options.configFile) == null ? void 0 : _a.extendedSourceFiles) || emptyArray, toPath3);
@@ -127565,7 +127599,7 @@ function createWatchCompilerHost2(rootFilesOrConfigFileName, options, system, cr
127565
127599
  }
127566
127600
  function createWatchProgram(host) {
127567
127601
  let builderProgram;
127568
- let reloadLevel;
127602
+ let updateLevel;
127569
127603
  let missingFilesMap;
127570
127604
  let watchedWildcardDirectories;
127571
127605
  let timerToUpdateProgram;
@@ -127924,7 +127958,7 @@ function createWatchProgram(host) {
127924
127958
  }
127925
127959
  function scheduleProgramReload() {
127926
127960
  Debug.assert(!!configFileName);
127927
- reloadLevel = 2 /* Full */;
127961
+ updateLevel = 2 /* Full */;
127928
127962
  scheduleProgramUpdate();
127929
127963
  }
127930
127964
  function updateProgramWithWatchStatus() {
@@ -127934,8 +127968,8 @@ function createWatchProgram(host) {
127934
127968
  }
127935
127969
  function updateProgram() {
127936
127970
  var _a, _b, _c, _d;
127937
- switch (reloadLevel) {
127938
- case 1 /* Partial */:
127971
+ switch (updateLevel) {
127972
+ case 1 /* RootNamesAndUpdate */:
127939
127973
  (_a = perfLogger) == null ? void 0 : _a.logStartUpdateProgram("PartialConfigReload");
127940
127974
  reloadFileNamesFromConfigFile();
127941
127975
  break;
@@ -127955,7 +127989,7 @@ function createWatchProgram(host) {
127955
127989
  writeLog("Reloading new file names and options");
127956
127990
  Debug.assert(compilerOptions);
127957
127991
  Debug.assert(configFileName);
127958
- reloadLevel = 0 /* None */;
127992
+ updateLevel = 0 /* Update */;
127959
127993
  rootFileNames = getFileNamesFromConfigSpecs(compilerOptions.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions);
127960
127994
  if (updateErrorForNoInputFiles(rootFileNames, getNormalizedAbsolutePath(configFileName, currentDirectory), compilerOptions.configFile.configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) {
127961
127995
  hasChangedConfigFileParsingErrors = true;
@@ -127965,7 +127999,7 @@ function createWatchProgram(host) {
127965
127999
  function reloadConfigFile() {
127966
128000
  Debug.assert(configFileName);
127967
128001
  writeLog(`Reloading config file: ${configFileName}`);
127968
- reloadLevel = 0 /* None */;
128002
+ updateLevel = 0 /* Update */;
127969
128003
  if (cachedDirectoryStructureHost) {
127970
128004
  cachedDirectoryStructureHost.clearCache();
127971
128005
  }
@@ -128002,9 +128036,9 @@ function createWatchProgram(host) {
128002
128036
  const configPath = toPath3(configFileName2);
128003
128037
  let config = parsedConfigs == null ? void 0 : parsedConfigs.get(configPath);
128004
128038
  if (config) {
128005
- if (!config.reloadLevel)
128039
+ if (!config.updateLevel)
128006
128040
  return config.parsedCommandLine;
128007
- if (config.parsedCommandLine && config.reloadLevel === 1 /* Partial */ && !host.getParsedCommandLine) {
128041
+ if (config.parsedCommandLine && config.updateLevel === 1 /* RootNamesAndUpdate */ && !host.getParsedCommandLine) {
128008
128042
  writeLog("Reloading new file names and options");
128009
128043
  Debug.assert(compilerOptions);
128010
128044
  const fileNames = getFileNamesFromConfigSpecs(
@@ -128014,7 +128048,7 @@ function createWatchProgram(host) {
128014
128048
  parseConfigFileHost
128015
128049
  );
128016
128050
  config.parsedCommandLine = { ...config.parsedCommandLine, fileNames };
128017
- config.reloadLevel = void 0;
128051
+ config.updateLevel = void 0;
128018
128052
  return config.parsedCommandLine;
128019
128053
  }
128020
128054
  }
@@ -128022,7 +128056,7 @@ function createWatchProgram(host) {
128022
128056
  const parsedCommandLine = host.getParsedCommandLine ? host.getParsedCommandLine(configFileName2) : getParsedCommandLineFromConfigFileHost(configFileName2);
128023
128057
  if (config) {
128024
128058
  config.parsedCommandLine = parsedCommandLine;
128025
- config.reloadLevel = void 0;
128059
+ config.updateLevel = void 0;
128026
128060
  } else {
128027
128061
  (parsedConfigs || (parsedConfigs = /* @__PURE__ */ new Map())).set(configPath, config = { parsedCommandLine });
128028
128062
  }
@@ -128119,8 +128153,8 @@ function createWatchProgram(host) {
128119
128153
  toPath: toPath3
128120
128154
  }))
128121
128155
  return;
128122
- if (reloadLevel !== 2 /* Full */) {
128123
- reloadLevel = 1 /* Partial */;
128156
+ if (updateLevel !== 2 /* Full */) {
128157
+ updateLevel = 1 /* RootNamesAndUpdate */;
128124
128158
  scheduleProgramUpdate();
128125
128159
  }
128126
128160
  },
@@ -128146,11 +128180,11 @@ function createWatchProgram(host) {
128146
128180
  return;
128147
128181
  projects.forEach((projectPath) => {
128148
128182
  if (configFileName && toPath3(configFileName) === projectPath) {
128149
- reloadLevel = 2 /* Full */;
128183
+ updateLevel = 2 /* Full */;
128150
128184
  } else {
128151
128185
  const config = parsedConfigs == null ? void 0 : parsedConfigs.get(projectPath);
128152
128186
  if (config)
128153
- config.reloadLevel = 2 /* Full */;
128187
+ config.updateLevel = 2 /* Full */;
128154
128188
  resolutionCache.removeResolutionsFromProjectReferenceRedirects(projectPath);
128155
128189
  }
128156
128190
  scheduleProgramUpdate();
@@ -128171,7 +128205,7 @@ function createWatchProgram(host) {
128171
128205
  updateCachedSystemWithFile(configFileName2, configPath, eventKind);
128172
128206
  const config = parsedConfigs == null ? void 0 : parsedConfigs.get(configPath);
128173
128207
  if (config)
128174
- config.reloadLevel = 2 /* Full */;
128208
+ config.updateLevel = 2 /* Full */;
128175
128209
  resolutionCache.removeResolutionsFromProjectReferenceRedirects(configPath);
128176
128210
  scheduleProgramUpdate();
128177
128211
  },
@@ -128209,8 +128243,8 @@ function createWatchProgram(host) {
128209
128243
  toPath: toPath3
128210
128244
  }))
128211
128245
  return;
128212
- if (config.reloadLevel !== 2 /* Full */) {
128213
- config.reloadLevel = 1 /* Partial */;
128246
+ if (config.updateLevel !== 2 /* Full */) {
128247
+ config.updateLevel = 1 /* RootNamesAndUpdate */;
128214
128248
  scheduleProgramUpdate();
128215
128249
  }
128216
128250
  },
@@ -128673,12 +128707,12 @@ function clearProjectStatus(state, resolved) {
128673
128707
  state.projectStatus.delete(resolved);
128674
128708
  state.diagnostics.delete(resolved);
128675
128709
  }
128676
- function addProjToQueue({ projectPendingBuild }, proj, reloadLevel) {
128710
+ function addProjToQueue({ projectPendingBuild }, proj, updateLevel) {
128677
128711
  const value = projectPendingBuild.get(proj);
128678
128712
  if (value === void 0) {
128679
- projectPendingBuild.set(proj, reloadLevel);
128680
- } else if (value < reloadLevel) {
128681
- projectPendingBuild.set(proj, reloadLevel);
128713
+ projectPendingBuild.set(proj, updateLevel);
128714
+ } else if (value < updateLevel) {
128715
+ projectPendingBuild.set(proj, updateLevel);
128682
128716
  }
128683
128717
  }
128684
128718
  function setupInitialBuild(state, cancellationToken) {
@@ -128692,7 +128726,7 @@ function setupInitialBuild(state, cancellationToken) {
128692
128726
  buildOrder.forEach(
128693
128727
  (configFileName) => state.projectPendingBuild.set(
128694
128728
  toResolvedConfigFilePath(state, configFileName),
128695
- 0 /* None */
128729
+ 0 /* Update */
128696
128730
  )
128697
128731
  );
128698
128732
  if (cancellationToken) {
@@ -129134,8 +129168,8 @@ function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) {
129134
129168
  for (let projectIndex = 0; projectIndex < buildOrder.length; projectIndex++) {
129135
129169
  const project = buildOrder[projectIndex];
129136
129170
  const projectPath = toResolvedConfigFilePath(state, project);
129137
- const reloadLevel = state.projectPendingBuild.get(projectPath);
129138
- if (reloadLevel === void 0)
129171
+ const updateLevel = state.projectPendingBuild.get(projectPath);
129172
+ if (updateLevel === void 0)
129139
129173
  continue;
129140
129174
  if (reportQueue) {
129141
129175
  reportQueue = false;
@@ -129147,13 +129181,13 @@ function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) {
129147
129181
  projectPendingBuild.delete(projectPath);
129148
129182
  continue;
129149
129183
  }
129150
- if (reloadLevel === 2 /* Full */) {
129184
+ if (updateLevel === 2 /* Full */) {
129151
129185
  watchConfigFile(state, project, projectPath, config);
129152
129186
  watchExtendedConfigFiles(state, projectPath, config);
129153
129187
  watchWildCardDirectories(state, project, projectPath, config);
129154
129188
  watchInputFiles(state, project, projectPath, config);
129155
129189
  watchPackageJsonFiles(state, project, projectPath, config);
129156
- } else if (reloadLevel === 1 /* Partial */) {
129190
+ } else if (updateLevel === 1 /* RootNamesAndUpdate */) {
129157
129191
  config.fileNames = getFileNamesFromConfigSpecs(config.options.configFile.configFileSpecs, getDirectoryPath(project), config.options, state.parseConfigFileHost);
129158
129192
  updateErrorForNoInputFiles(config.fileNames, project, config.options.configFile.configFileSpecs, config.errors, canJsonReportNoInputFiles(config.raw));
129159
129193
  watchInputFiles(state, project, projectPath, config);
@@ -129740,7 +129774,7 @@ function queueReferencingProjects(state, project, projectPath, projectIndex, con
129740
129774
  break;
129741
129775
  }
129742
129776
  }
129743
- addProjToQueue(state, nextProjectPath, 0 /* None */);
129777
+ addProjToQueue(state, nextProjectPath, 0 /* Update */);
129744
129778
  break;
129745
129779
  }
129746
129780
  }
@@ -129809,7 +129843,7 @@ function cleanWorker(state, project, onlyReferences) {
129809
129843
  filesToDelete.push(output);
129810
129844
  } else {
129811
129845
  host.deleteFile(output);
129812
- invalidateProject(state, resolvedPath, 0 /* None */);
129846
+ invalidateProject(state, resolvedPath, 0 /* Update */);
129813
129847
  }
129814
129848
  }
129815
129849
  }
@@ -129820,22 +129854,22 @@ function cleanWorker(state, project, onlyReferences) {
129820
129854
  }
129821
129855
  return 0 /* Success */;
129822
129856
  }
129823
- function invalidateProject(state, resolved, reloadLevel) {
129824
- if (state.host.getParsedCommandLine && reloadLevel === 1 /* Partial */) {
129825
- reloadLevel = 2 /* Full */;
129857
+ function invalidateProject(state, resolved, updateLevel) {
129858
+ if (state.host.getParsedCommandLine && updateLevel === 1 /* RootNamesAndUpdate */) {
129859
+ updateLevel = 2 /* Full */;
129826
129860
  }
129827
- if (reloadLevel === 2 /* Full */) {
129861
+ if (updateLevel === 2 /* Full */) {
129828
129862
  state.configFileCache.delete(resolved);
129829
129863
  state.buildOrder = void 0;
129830
129864
  }
129831
129865
  state.needsSummary = true;
129832
129866
  clearProjectStatus(state, resolved);
129833
- addProjToQueue(state, resolved, reloadLevel);
129867
+ addProjToQueue(state, resolved, updateLevel);
129834
129868
  enableCache(state);
129835
129869
  }
129836
- function invalidateProjectAndScheduleBuilds(state, resolvedPath, reloadLevel) {
129870
+ function invalidateProjectAndScheduleBuilds(state, resolvedPath, updateLevel) {
129837
129871
  state.reportFileChangeDetected = true;
129838
- invalidateProject(state, resolvedPath, reloadLevel);
129872
+ invalidateProject(state, resolvedPath, updateLevel);
129839
129873
  scheduleBuildInvalidatedProject(
129840
129874
  state,
129841
129875
  250,
@@ -129966,7 +130000,7 @@ function watchWildCardDirectories(state, resolved, resolvedPath, parsed) {
129966
130000
  toPath: (fileName) => toPath2(state, fileName)
129967
130001
  }))
129968
130002
  return;
129969
- invalidateProjectAndScheduleBuilds(state, resolvedPath, 1 /* Partial */);
130003
+ invalidateProjectAndScheduleBuilds(state, resolvedPath, 1 /* RootNamesAndUpdate */);
129970
130004
  },
129971
130005
  flags,
129972
130006
  parsed == null ? void 0 : parsed.watchOptions,
@@ -129985,7 +130019,7 @@ function watchInputFiles(state, resolved, resolvedPath, parsed) {
129985
130019
  createNewValue: (_path, input) => watchFile(
129986
130020
  state,
129987
130021
  input,
129988
- () => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /* None */),
130022
+ () => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /* Update */),
129989
130023
  250 /* Low */,
129990
130024
  parsed == null ? void 0 : parsed.watchOptions,
129991
130025
  WatchType.SourceFile,
@@ -130005,7 +130039,7 @@ function watchPackageJsonFiles(state, resolved, resolvedPath, parsed) {
130005
130039
  createNewValue: (path, _input) => watchFile(
130006
130040
  state,
130007
130041
  path,
130008
- () => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /* None */),
130042
+ () => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /* Update */),
130009
130043
  2e3 /* High */,
130010
130044
  parsed == null ? void 0 : parsed.watchOptions,
130011
130045
  WatchType.PackageJson,
@@ -130076,7 +130110,7 @@ function createSolutionBuilderWorker(watch, hostOrHostWithWatch, rootNames, opti
130076
130110
  const configFilePath = toResolvedConfigFilePath(state, configFileName);
130077
130111
  return getUpToDateStatus(state, parseConfigFile(state, configFileName, configFilePath), configFilePath);
130078
130112
  },
130079
- invalidateProject: (configFilePath, reloadLevel) => invalidateProject(state, configFilePath, reloadLevel || 0 /* None */),
130113
+ invalidateProject: (configFilePath, updateLevel) => invalidateProject(state, configFilePath, updateLevel || 0 /* Update */),
130080
130114
  close: () => stopWatching(state)
130081
130115
  };
130082
130116
  }
@@ -172020,7 +172054,6 @@ __export(ts_exports2, {
172020
172054
  CompletionInfoFlags: () => CompletionInfoFlags,
172021
172055
  CompletionTriggerKind: () => CompletionTriggerKind,
172022
172056
  Completions: () => ts_Completions_exports,
172023
- ConfigFileProgramReloadLevel: () => ConfigFileProgramReloadLevel,
172024
172057
  ContainerFlags: () => ContainerFlags,
172025
172058
  ContextFlags: () => ContextFlags,
172026
172059
  Debug: () => Debug,
@@ -172107,6 +172140,7 @@ __export(ts_exports2, {
172107
172140
  PragmaKindFlags: () => PragmaKindFlags,
172108
172141
  PrivateIdentifierKind: () => PrivateIdentifierKind,
172109
172142
  ProcessLevel: () => ProcessLevel,
172143
+ ProgramUpdateLevel: () => ProgramUpdateLevel,
172110
172144
  QuotePreference: () => QuotePreference,
172111
172145
  RelationComparisonResult: () => RelationComparisonResult,
172112
172146
  Rename: () => ts_Rename_exports,
@@ -176519,12 +176553,12 @@ var Project3 = class _Project {
176519
176553
  }
176520
176554
  return { ...newTypeAcquisition, include: this.removeExistingTypings(newTypeAcquisition.include) };
176521
176555
  }
176522
- getExternalFiles() {
176556
+ getExternalFiles(updateLevel) {
176523
176557
  return sort(flatMap(this.plugins, (plugin) => {
176524
176558
  if (typeof plugin.module.getExternalFiles !== "function")
176525
176559
  return;
176526
176560
  try {
176527
- return plugin.module.getExternalFiles(this);
176561
+ return plugin.module.getExternalFiles(this, updateLevel || 0 /* Update */);
176528
176562
  } catch (e) {
176529
176563
  this.projectService.logger.info(`A plugin threw an exception in getExternalFiles: ${e}`);
176530
176564
  if (e.stack) {
@@ -177259,6 +177293,7 @@ var Project3 = class _Project {
177259
177293
  }
177260
177294
  /** @internal */
177261
177295
  getChangesSinceVersion(lastKnownVersion, includeProjectReferenceRedirectInfo) {
177296
+ var _a, _b;
177262
177297
  const includeProjectReferenceRedirectInfoIfRequested = includeProjectReferenceRedirectInfo ? (files) => arrayFrom(files.entries(), ([fileName, isSourceOfProjectReferenceRedirect]) => ({
177263
177298
  fileName,
177264
177299
  isSourceOfProjectReferenceRedirect
@@ -177281,10 +177316,10 @@ var Project3 = class _Project {
177281
177316
  return { info, projectErrors: this.getGlobalProjectErrors() };
177282
177317
  }
177283
177318
  const lastReportedFileNames = this.lastReportedFileNames;
177284
- const externalFiles = this.getExternalFiles().map((f) => ({
177319
+ const externalFiles = ((_a = this.externalFiles) == null ? void 0 : _a.map((f) => ({
177285
177320
  fileName: toNormalizedPath(f),
177286
177321
  isSourceOfProjectReferenceRedirect: false
177287
- }));
177322
+ }))) || emptyArray2;
177288
177323
  const currentFiles = arrayToMap(
177289
177324
  this.getFileNamesWithRedirectInfo(!!includeProjectReferenceRedirectInfo).concat(externalFiles),
177290
177325
  (info2) => info2.fileName,
@@ -177326,10 +177361,10 @@ var Project3 = class _Project {
177326
177361
  };
177327
177362
  } else {
177328
177363
  const projectFileNames = this.getFileNamesWithRedirectInfo(!!includeProjectReferenceRedirectInfo);
177329
- const externalFiles = this.getExternalFiles().map((f) => ({
177364
+ const externalFiles = ((_b = this.externalFiles) == null ? void 0 : _b.map((f) => ({
177330
177365
  fileName: toNormalizedPath(f),
177331
177366
  isSourceOfProjectReferenceRedirect: false
177332
- }));
177367
+ }))) || emptyArray2;
177333
177368
  const allFiles = projectFileNames.concat(externalFiles);
177334
177369
  this.lastReportedFileNames = arrayToMap(
177335
177370
  allFiles,
@@ -178033,18 +178068,18 @@ var ConfiguredProject2 = class extends Project3 {
178033
178068
  updateGraph() {
178034
178069
  const isInitialLoad = this.isInitialLoadPending();
178035
178070
  this.isInitialLoadPending = returnFalse;
178036
- const reloadLevel = this.pendingReload;
178037
- this.pendingReload = 0 /* None */;
178071
+ const updateLevel = this.pendingUpdateLevel;
178072
+ this.pendingUpdateLevel = 0 /* Update */;
178038
178073
  let result;
178039
- switch (reloadLevel) {
178040
- case 1 /* Partial */:
178074
+ switch (updateLevel) {
178075
+ case 1 /* RootNamesAndUpdate */:
178041
178076
  this.openFileWatchTriggered.clear();
178042
178077
  result = this.projectService.reloadFileNamesOfConfiguredProject(this);
178043
178078
  break;
178044
178079
  case 2 /* Full */:
178045
178080
  this.openFileWatchTriggered.clear();
178046
- const reason = Debug.checkDefined(this.pendingReloadReason);
178047
- this.pendingReloadReason = void 0;
178081
+ const reason = Debug.checkDefined(this.pendingUpdateReason);
178082
+ this.pendingUpdateReason = void 0;
178048
178083
  this.projectService.reloadConfiguredProject(
178049
178084
  this,
178050
178085
  reason,
@@ -179140,28 +179175,28 @@ var _ProjectService = class _ProjectService {
179140
179175
  getScriptKind: configuredProjectForConfig ? (fileName) => configuredProjectForConfig.getScriptKind(fileName) : void 0
179141
179176
  }))
179142
179177
  return;
179143
- if (config.reloadLevel !== 2 /* Full */)
179144
- config.reloadLevel = 1 /* Partial */;
179178
+ if (config.updateLevel !== 2 /* Full */)
179179
+ config.updateLevel = 1 /* RootNamesAndUpdate */;
179145
179180
  config.projects.forEach((watchWildcardDirectories, projectCanonicalPath) => {
179146
179181
  if (!watchWildcardDirectories)
179147
179182
  return;
179148
179183
  const project = this.getConfiguredProjectByCanonicalConfigFilePath(projectCanonicalPath);
179149
179184
  if (!project)
179150
179185
  return;
179151
- const reloadLevel = configuredProjectForConfig === project ? 1 /* Partial */ : 0 /* None */;
179152
- if (project.pendingReload !== void 0 && project.pendingReload > reloadLevel)
179186
+ const updateLevel = configuredProjectForConfig === project ? 1 /* RootNamesAndUpdate */ : 0 /* Update */;
179187
+ if (project.pendingUpdateLevel !== void 0 && project.pendingUpdateLevel > updateLevel)
179153
179188
  return;
179154
179189
  if (this.openFiles.has(fileOrDirectoryPath)) {
179155
179190
  const info = Debug.checkDefined(this.getScriptInfoForPath(fileOrDirectoryPath));
179156
179191
  if (info.isAttached(project)) {
179157
- const loadLevelToSet = Math.max(reloadLevel, project.openFileWatchTriggered.get(fileOrDirectoryPath) || 0 /* None */);
179192
+ const loadLevelToSet = Math.max(updateLevel, project.openFileWatchTriggered.get(fileOrDirectoryPath) || 0 /* Update */);
179158
179193
  project.openFileWatchTriggered.set(fileOrDirectoryPath, loadLevelToSet);
179159
179194
  } else {
179160
- project.pendingReload = reloadLevel;
179195
+ project.pendingUpdateLevel = updateLevel;
179161
179196
  this.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(project);
179162
179197
  }
179163
179198
  } else {
179164
- project.pendingReload = reloadLevel;
179199
+ project.pendingUpdateLevel = updateLevel;
179165
179200
  this.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(project);
179166
179201
  }
179167
179202
  });
@@ -179173,12 +179208,12 @@ var _ProjectService = class _ProjectService {
179173
179208
  );
179174
179209
  }
179175
179210
  /** @internal */
179176
- delayUpdateProjectsFromParsedConfigOnConfigFileChange(canonicalConfigFilePath, reloadReason) {
179211
+ delayUpdateProjectsFromParsedConfigOnConfigFileChange(canonicalConfigFilePath, loadReason) {
179177
179212
  const configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath);
179178
179213
  if (!(configFileExistenceInfo == null ? void 0 : configFileExistenceInfo.config))
179179
179214
  return false;
179180
179215
  let scheduledAnyProjectUpdate = false;
179181
- configFileExistenceInfo.config.reloadLevel = 2 /* Full */;
179216
+ configFileExistenceInfo.config.updateLevel = 2 /* Full */;
179182
179217
  configFileExistenceInfo.config.projects.forEach((_watchWildcardDirectories, projectCanonicalPath) => {
179183
179218
  const project = this.getConfiguredProjectByCanonicalConfigFilePath(projectCanonicalPath);
179184
179219
  if (!project)
@@ -179187,8 +179222,8 @@ var _ProjectService = class _ProjectService {
179187
179222
  if (projectCanonicalPath === canonicalConfigFilePath) {
179188
179223
  if (project.isInitialLoadPending())
179189
179224
  return;
179190
- project.pendingReload = 2 /* Full */;
179191
- project.pendingReloadReason = reloadReason;
179225
+ project.pendingUpdateLevel = 2 /* Full */;
179226
+ project.pendingUpdateReason = loadReason;
179192
179227
  this.delayUpdateProjectGraph(project);
179193
179228
  } else {
179194
179229
  project.resolutionCache.removeResolutionsFromProjectReferenceRedirects(this.toPath(canonicalConfigFilePath));
@@ -179337,11 +179372,11 @@ var _ProjectService = class _ProjectService {
179337
179372
  if (info.hasMixedContent) {
179338
179373
  info.registerFileUpdate();
179339
179374
  }
179340
- const reloadLevel = p.openFileWatchTriggered.get(info.path);
179341
- if (reloadLevel !== void 0) {
179375
+ const updateLevel = p.openFileWatchTriggered.get(info.path);
179376
+ if (updateLevel !== void 0) {
179342
179377
  p.openFileWatchTriggered.delete(info.path);
179343
- if (p.pendingReload !== void 0 && p.pendingReload < reloadLevel) {
179344
- p.pendingReload = reloadLevel;
179378
+ if (p.pendingUpdateLevel !== void 0 && p.pendingUpdateLevel < updateLevel) {
179379
+ p.pendingUpdateLevel = updateLevel;
179345
179380
  p.markFileAsDirty(info.path);
179346
179381
  }
179347
179382
  }
@@ -179738,7 +179773,7 @@ var _ProjectService = class _ProjectService {
179738
179773
  configFileExistenceInfo.config = {
179739
179774
  cachedDirectoryStructureHost: createCachedDirectoryStructureHost(this.host, this.host.getCurrentDirectory(), this.host.useCaseSensitiveFileNames),
179740
179775
  projects: /* @__PURE__ */ new Map(),
179741
- reloadLevel: 2 /* Full */
179776
+ updateLevel: 2 /* Full */
179742
179777
  };
179743
179778
  }
179744
179779
  const project = new ConfiguredProject2(
@@ -179755,8 +179790,8 @@ var _ProjectService = class _ProjectService {
179755
179790
  /** @internal */
179756
179791
  createConfiguredProjectWithDelayLoad(configFileName, reason) {
179757
179792
  const project = this.createConfiguredProject(configFileName);
179758
- project.pendingReload = 2 /* Full */;
179759
- project.pendingReloadReason = reason;
179793
+ project.pendingUpdateLevel = 2 /* Full */;
179794
+ project.pendingUpdateReason = reason;
179760
179795
  return project;
179761
179796
  }
179762
179797
  /** @internal */
@@ -179812,7 +179847,7 @@ var _ProjectService = class _ProjectService {
179812
179847
  this.watchWildcards(configFilename, configFileExistenceInfo, project);
179813
179848
  }
179814
179849
  project.enablePluginsWithOptions(compilerOptions);
179815
- const filesToAdd = parsedCommandLine.fileNames.concat(project.getExternalFiles());
179850
+ const filesToAdd = parsedCommandLine.fileNames.concat(project.getExternalFiles(2 /* Full */));
179816
179851
  this.updateRootAndOptionsOfNonInferredProject(project, filesToAdd, fileNamePropertyReader, compilerOptions, parsedCommandLine.typeAcquisition, parsedCommandLine.compileOnSave, parsedCommandLine.watchOptions);
179817
179852
  (_b = tracing) == null ? void 0 : _b.pop();
179818
179853
  }
@@ -179820,9 +179855,9 @@ var _ProjectService = class _ProjectService {
179820
179855
  ensureParsedConfigUptoDate(configFilename, canonicalConfigFilePath, configFileExistenceInfo, forProject) {
179821
179856
  var _a, _b, _c;
179822
179857
  if (configFileExistenceInfo.config) {
179823
- if (!configFileExistenceInfo.config.reloadLevel)
179858
+ if (!configFileExistenceInfo.config.updateLevel)
179824
179859
  return configFileExistenceInfo;
179825
- if (configFileExistenceInfo.config.reloadLevel === 1 /* Partial */) {
179860
+ if (configFileExistenceInfo.config.updateLevel === 1 /* RootNamesAndUpdate */) {
179826
179861
  this.reloadFileNamesOfParsedConfig(configFilename, configFileExistenceInfo.config);
179827
179862
  return configFileExistenceInfo;
179828
179863
  }
@@ -179865,7 +179900,7 @@ var _ProjectService = class _ProjectService {
179865
179900
  } else {
179866
179901
  configFileExistenceInfo.config.parsedCommandLine = parsedCommandLine;
179867
179902
  configFileExistenceInfo.config.watchedDirectoriesStale = true;
179868
- configFileExistenceInfo.config.reloadLevel = void 0;
179903
+ configFileExistenceInfo.config.updateLevel = void 0;
179869
179904
  }
179870
179905
  if (!oldCommandLine && !isJsonEqual(
179871
179906
  // Old options
@@ -180024,14 +180059,14 @@ var _ProjectService = class _ProjectService {
180024
180059
  reloadFileNamesOfConfiguredProject(project) {
180025
180060
  const fileNames = this.reloadFileNamesOfParsedConfig(project.getConfigFilePath(), this.configFileExistenceInfoCache.get(project.canonicalConfigFilePath).config);
180026
180061
  project.updateErrorOnNoInputFiles(fileNames);
180027
- this.updateNonInferredProjectFiles(project, fileNames.concat(project.getExternalFiles()), fileNamePropertyReader);
180062
+ this.updateNonInferredProjectFiles(project, fileNames.concat(project.getExternalFiles(1 /* RootNamesAndUpdate */)), fileNamePropertyReader);
180028
180063
  return project.updateGraph();
180029
180064
  }
180030
180065
  /** @internal */
180031
180066
  reloadFileNamesOfParsedConfig(configFileName, config) {
180032
- if (config.reloadLevel === void 0)
180067
+ if (config.updateLevel === void 0)
180033
180068
  return config.parsedCommandLine.fileNames;
180034
- Debug.assert(config.reloadLevel === 1 /* Partial */);
180069
+ Debug.assert(config.updateLevel === 1 /* RootNamesAndUpdate */);
180035
180070
  const configFileSpecs = config.parsedCommandLine.options.configFile.configFileSpecs;
180036
180071
  const fileNames = getFileNamesFromConfigSpecs(
180037
180072
  configFileSpecs,
@@ -180573,7 +180608,7 @@ Dynamic files must always be opened with service's current directory or service
180573
180608
  this.hostConfiguration.preferences = { ...this.hostConfiguration.preferences, ...args.preferences };
180574
180609
  if (lazyConfiguredProjectsFromExternalProject && !this.hostConfiguration.preferences.lazyConfiguredProjectsFromExternalProject) {
180575
180610
  this.configuredProjects.forEach((project) => {
180576
- if (project.hasExternalProjectRef() && project.pendingReload === 2 /* Full */ && !this.pendingProjectUpdates.has(project.getProjectName())) {
180611
+ if (project.hasExternalProjectRef() && project.pendingUpdateLevel === 2 /* Full */ && !this.pendingProjectUpdates.has(project.getProjectName())) {
180577
180612
  project.updateGraph();
180578
180613
  }
180579
180614
  });
@@ -180628,7 +180663,7 @@ Dynamic files must always be opened with service's current directory or service
180628
180663
  this.pendingEnsureProjectForOpenFiles = false;
180629
180664
  this.configFileExistenceInfoCache.forEach((info) => {
180630
180665
  if (info.config)
180631
- info.config.reloadLevel = 2 /* Full */;
180666
+ info.config.updateLevel = 2 /* Full */;
180632
180667
  });
180633
180668
  this.reloadConfiguredProjectForFiles(
180634
180669
  this.openFiles,
@@ -180680,8 +180715,8 @@ Dynamic files must always be opened with service's current directory or service
180680
180715
  if (!updatedProjects.has(project.canonicalConfigFilePath)) {
180681
180716
  updatedProjects.set(project.canonicalConfigFilePath, true);
180682
180717
  if (delayReload) {
180683
- project.pendingReload = 2 /* Full */;
180684
- project.pendingReloadReason = reason;
180718
+ project.pendingUpdateLevel = 2 /* Full */;
180719
+ project.pendingUpdateReason = reason;
180685
180720
  if (clearSemanticCache)
180686
180721
  this.clearSemanticCache(project);
180687
180722
  this.delayUpdateProjectGraph(project);
@@ -186699,7 +186734,6 @@ start(initializeNodeSystem(), require("os").platform());
186699
186734
  CompletionInfoFlags,
186700
186735
  CompletionTriggerKind,
186701
186736
  Completions,
186702
- ConfigFileProgramReloadLevel,
186703
186737
  ContainerFlags,
186704
186738
  ContextFlags,
186705
186739
  Debug,
@@ -186786,6 +186820,7 @@ start(initializeNodeSystem(), require("os").platform());
186786
186820
  PragmaKindFlags,
186787
186821
  PrivateIdentifierKind,
186788
186822
  ProcessLevel,
186823
+ ProgramUpdateLevel,
186789
186824
  QuotePreference,
186790
186825
  RelationComparisonResult,
186791
186826
  Rename,