@typescript-deploys/pr-build 5.0.0-pr-52403-9 → 5.0.0-pr-52434-2

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
@@ -429,6 +429,10 @@ __export(server_exports, {
429
429
  createPatternMatcher: () => createPatternMatcher,
430
430
  createPrependNodes: () => createPrependNodes,
431
431
  createPrinter: () => createPrinter,
432
+ createPrinterWithDefaults: () => createPrinterWithDefaults,
433
+ createPrinterWithRemoveComments: () => createPrinterWithRemoveComments,
434
+ createPrinterWithRemoveCommentsNeverAsciiEscape: () => createPrinterWithRemoveCommentsNeverAsciiEscape,
435
+ createPrinterWithRemoveCommentsOmitTrailingSemicolon: () => createPrinterWithRemoveCommentsOmitTrailingSemicolon,
432
436
  createProgram: () => createProgram,
433
437
  createProgramHost: () => createProgramHost,
434
438
  createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral,
@@ -665,6 +669,7 @@ __export(server_exports, {
665
669
  getCommonSourceDirectoryOfConfig: () => getCommonSourceDirectoryOfConfig,
666
670
  getCompilerOptionValue: () => getCompilerOptionValue,
667
671
  getCompilerOptionsDiffValue: () => getCompilerOptionsDiffValue,
672
+ getConditions: () => getConditions,
668
673
  getConfigFileParsingDiagnostics: () => getConfigFileParsingDiagnostics,
669
674
  getConstantValue: () => getConstantValue,
670
675
  getContainerNode: () => getContainerNode,
@@ -2373,7 +2378,7 @@ __export(ts_server_exports3, {
2373
2378
 
2374
2379
  // src/compiler/corePublic.ts
2375
2380
  var versionMajorMinor = "5.0";
2376
- var version = `${versionMajorMinor}.0-insiders.20230125`;
2381
+ var version = `${versionMajorMinor}.0-insiders.20230127`;
2377
2382
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2378
2383
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2379
2384
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -10820,6 +10825,7 @@ var Diagnostics = {
10820
10825
  Use_the_package_json_imports_field_when_resolving_imports: diag(6409, 3 /* Message */, "Use_the_package_json_imports_field_when_resolving_imports_6409", "Use the package.json 'imports' field when resolving imports."),
10821
10826
  Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports: diag(6410, 3 /* Message */, "Conditions_to_set_in_addition_to_the_resolver_specific_defaults_when_resolving_imports_6410", "Conditions to set in addition to the resolver-specific defaults when resolving imports."),
10822
10827
  true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false: diag(6411, 3 /* Message */, "true_when_moduleResolution_is_node16_nodenext_or_bundler_otherwise_false_6411", "`true` when 'moduleResolution' is 'node16', 'nodenext', or 'bundler'; otherwise `false`."),
10828
+ Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_but_not_any_more: diag(6412, 3 /* Message */, "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_6412", "Project '{0}' is out of date because buildinfo file '{1}' indicates that file '{2}' was root file of compilation but not any more."),
10823
10829
  The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, 3 /* Message */, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"),
10824
10830
  The_expected_type_comes_from_this_index_signature: diag(6501, 3 /* Message */, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."),
10825
10831
  The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, 3 /* Message */, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."),
@@ -15492,6 +15498,20 @@ function getScriptTargetFeatures() {
15492
15498
  BigUint64Array: ["at"],
15493
15499
  ObjectConstructor: ["hasOwn"],
15494
15500
  Error: ["cause"]
15501
+ },
15502
+ es2023: {
15503
+ Array: ["findLastIndex", "findLast"],
15504
+ Int8Array: ["findLastIndex", "findLast"],
15505
+ Uint8Array: ["findLastIndex", "findLast"],
15506
+ Uint8ClampedArray: ["findLastIndex", "findLast"],
15507
+ Int16Array: ["findLastIndex", "findLast"],
15508
+ Uint16Array: ["findLastIndex", "findLast"],
15509
+ Int32Array: ["findLastIndex", "findLast"],
15510
+ Uint32Array: ["findLastIndex", "findLast"],
15511
+ Float32Array: ["findLastIndex", "findLast"],
15512
+ Float64Array: ["findLastIndex", "findLast"],
15513
+ BigInt64Array: ["findLastIndex", "findLast"],
15514
+ BigUint64Array: ["findLastIndex", "findLast"]
15495
15515
  }
15496
15516
  };
15497
15517
  }
@@ -38152,7 +38172,7 @@ var commandOptionsWithoutBuild = [
38152
38172
  {
38153
38173
  name: "allowArbitraryExtensions",
38154
38174
  type: "boolean",
38155
- affectsModuleResolution: true,
38175
+ affectsProgramStructure: true,
38156
38176
  category: Diagnostics.Modules,
38157
38177
  description: Diagnostics.Enable_importing_files_with_any_extension_provided_a_declaration_file_is_present,
38158
38178
  defaultValueDescription: false
@@ -46465,8 +46485,8 @@ function tryGetModuleNameAsNodeModule({ path, isRedirect }, { getCanonicalFileNa
46465
46485
  if (typeof cachedPackageJson === "object" || cachedPackageJson === void 0 && host.fileExists(packageJsonPath)) {
46466
46486
  const packageJsonContent = (cachedPackageJson == null ? void 0 : cachedPackageJson.contents.packageJsonContent) || JSON.parse(host.readFile(packageJsonPath));
46467
46487
  const importMode = overrideMode || importingSourceFile.impliedNodeFormat;
46468
- if (getEmitModuleResolutionKind(options) === 3 /* Node16 */ || getEmitModuleResolutionKind(options) === 99 /* NodeNext */) {
46469
- const conditions = ["node", importMode === 99 /* ESNext */ ? "import" : "require", "types"];
46488
+ if (getResolvePackageJsonExports(options)) {
46489
+ const conditions = getConditions(options, importMode === 99 /* ESNext */);
46470
46490
  const fromExports = packageJsonContent.exports && typeof packageJsonContent.name === "string" ? tryGetModuleNameFromExports(options, path, packageRootPath, getPackageNameFromTypesPackageName(packageJsonContent.name), packageJsonContent.exports, conditions) : void 0;
46471
46491
  if (fromExports) {
46472
46492
  const withJsExtension = !hasTSFileExtension(fromExports.moduleFileToTry) ? fromExports : { moduleFileToTry: removeFileExtension(fromExports.moduleFileToTry) + tryGetJSExtensionForFile(fromExports.moduleFileToTry, options) };
@@ -50977,7 +50997,7 @@ function createTypeChecker(host) {
50977
50997
  return writer ? symbolToStringWorker(writer).getText() : usingSingleLineStringWriter(symbolToStringWorker);
50978
50998
  function symbolToStringWorker(writer2) {
50979
50999
  const entity = builder(symbol, meaning, enclosingDeclaration, nodeFlags);
50980
- const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 308 /* SourceFile */ ? createPrinter({ removeComments: true, neverAsciiEscape: true }) : createPrinter({ removeComments: true });
51000
+ const printer = (enclosingDeclaration == null ? void 0 : enclosingDeclaration.kind) === 308 /* SourceFile */ ? createPrinterWithRemoveCommentsNeverAsciiEscape() : createPrinterWithRemoveComments();
50981
51001
  const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
50982
51002
  printer.writeNode(
50983
51003
  4 /* Unspecified */,
@@ -50999,7 +51019,7 @@ function createTypeChecker(host) {
50999
51019
  sigOutput = kind === 1 /* Construct */ ? 177 /* ConstructSignature */ : 176 /* CallSignature */;
51000
51020
  }
51001
51021
  const sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */);
51002
- const printer = createPrinter({ removeComments: true, omitTrailingSemicolon: true });
51022
+ const printer = createPrinterWithRemoveCommentsOmitTrailingSemicolon();
51003
51023
  const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
51004
51024
  printer.writeNode(
51005
51025
  4 /* Unspecified */,
@@ -51016,8 +51036,7 @@ function createTypeChecker(host) {
51016
51036
  const typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | (noTruncation ? 1 /* NoTruncation */ : 0));
51017
51037
  if (typeNode === void 0)
51018
51038
  return Debug.fail("should always get typenode");
51019
- const options = { removeComments: type !== unresolvedType };
51020
- const printer = createPrinter(options);
51039
+ const printer = type !== unresolvedType ? createPrinterWithRemoveComments() : createPrinterWithDefaults();
51021
51040
  const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
51022
51041
  printer.writeNode(
51023
51042
  4 /* Unspecified */,
@@ -54368,7 +54387,7 @@ function createTypeChecker(host) {
54368
54387
  typePredicate.type && nodeBuilder.typeToTypeNode(typePredicate.type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */)
54369
54388
  // TODO: GH#18217
54370
54389
  );
54371
- const printer = createPrinter({ removeComments: true });
54390
+ const printer = createPrinterWithRemoveComments();
54372
54391
  const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
54373
54392
  printer.writeNode(
54374
54393
  4 /* Unspecified */,
@@ -82923,10 +82942,10 @@ function createTypeChecker(host) {
82923
82942
  if (typeAnnotationNode) {
82924
82943
  checkTypeAssignableTo(checkExpressionCached(node.expression), getTypeFromTypeNode(typeAnnotationNode), node.expression);
82925
82944
  }
82926
- const isIllegalExportDefaultInCJS = !node.isExportEquals && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */);
82945
+ const isIllegalExportDefaultInCJS = !node.isExportEquals && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */);
82927
82946
  if (node.expression.kind === 79 /* Identifier */) {
82928
82947
  const id = node.expression;
82929
- const sym = resolveEntityName(
82948
+ const sym = getExportSymbolOfValueSymbolIfExported(resolveEntityName(
82930
82949
  id,
82931
82950
  67108863 /* All */,
82932
82951
  /*ignoreErrors*/
@@ -82934,7 +82953,7 @@ function createTypeChecker(host) {
82934
82953
  /*dontResolveAlias*/
82935
82954
  true,
82936
82955
  node
82937
- );
82956
+ ));
82938
82957
  if (sym) {
82939
82958
  markAliasReferenced(sym, id);
82940
82959
  if (getAllSymbolFlags(sym) & 111551 /* Value */) {
@@ -111124,6 +111143,10 @@ function emitUsingBuildInfoWorker(config, host, getCommandLine, customTransforme
111124
111143
  );
111125
111144
  return outputFiles;
111126
111145
  }
111146
+ var createPrinterWithDefaults = /* @__PURE__ */ memoize(() => createPrinter({}));
111147
+ var createPrinterWithRemoveComments = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true }));
111148
+ var createPrinterWithRemoveCommentsNeverAsciiEscape = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true, neverAsciiEscape: true }));
111149
+ var createPrinterWithRemoveCommentsOmitTrailingSemicolon = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true, omitTrailingSemicolon: true }));
111127
111150
  function createPrinter(printerOptions = {}, handlers = {}) {
111128
111151
  const {
111129
111152
  hasGlobalName,
@@ -121141,14 +121164,17 @@ function getBuildInfo2(state, bundle) {
121141
121164
  const latestChangedDtsFile = state.latestChangedDtsFile ? relativeToBuildInfoEnsuringAbsolutePath(state.latestChangedDtsFile) : void 0;
121142
121165
  const fileNames = [];
121143
121166
  const fileNameToFileId = /* @__PURE__ */ new Map();
121167
+ const root = [];
121144
121168
  if (outFile(state.compilerOptions)) {
121145
121169
  const fileInfos2 = arrayFrom(state.fileInfos.entries(), ([key, value]) => {
121146
- toFileId(key);
121170
+ const fileId = toFileId(key);
121171
+ tryAddRoot(key, fileId);
121147
121172
  return value.impliedFormat ? { version: value.version, impliedFormat: value.impliedFormat, signature: void 0, affectsGlobalScope: void 0 } : value.version;
121148
121173
  });
121149
121174
  const program2 = {
121150
121175
  fileNames,
121151
121176
  fileInfos: fileInfos2,
121177
+ root,
121152
121178
  options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions),
121153
121179
  outSignature: state.outSignature,
121154
121180
  latestChangedDtsFile,
@@ -121176,6 +121202,7 @@ function getBuildInfo2(state, bundle) {
121176
121202
  const fileInfos = arrayFrom(state.fileInfos.entries(), ([key, value]) => {
121177
121203
  var _a3, _b2;
121178
121204
  const fileId = toFileId(key);
121205
+ tryAddRoot(key, fileId);
121179
121206
  Debug.assert(fileNames[fileId - 1] === relativeToBuildInfo(key));
121180
121207
  const oldSignature = (_a3 = state.oldSignatures) == null ? void 0 : _a3.get(key);
121181
121208
  const actualSignature = oldSignature !== void 0 ? oldSignature || void 0 : value.signature;
@@ -121275,6 +121302,7 @@ function getBuildInfo2(state, bundle) {
121275
121302
  const program = {
121276
121303
  fileNames,
121277
121304
  fileInfos,
121305
+ root,
121278
121306
  options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions),
121279
121307
  fileIdsList,
121280
121308
  referencedMap,
@@ -121310,6 +121338,24 @@ function getBuildInfo2(state, bundle) {
121310
121338
  }
121311
121339
  return fileIdListId;
121312
121340
  }
121341
+ function tryAddRoot(path, fileId) {
121342
+ const file = state.program.getSourceFile(path);
121343
+ if (!state.program.getFileIncludeReasons().get(file.path).some((r) => r.kind === 0 /* RootFile */))
121344
+ return;
121345
+ if (!root.length)
121346
+ return root.push(fileId);
121347
+ const last2 = root[root.length - 1];
121348
+ const isLastStartEnd = isArray(last2);
121349
+ if (isLastStartEnd && last2[1] === fileId - 1)
121350
+ return last2[1] = fileId;
121351
+ if (isLastStartEnd || root.length === 1 || last2 !== fileId - 1)
121352
+ return root.push(fileId);
121353
+ const lastButOne = root[root.length - 2];
121354
+ if (!isNumber(lastButOne) || lastButOne !== last2 - 1)
121355
+ return root.push(fileId);
121356
+ root[root.length - 2] = [lastButOne, fileId];
121357
+ return root.length = root.length - 1;
121358
+ }
121313
121359
  function convertToProgramBuildInfoCompilerOptions(options) {
121314
121360
  let result;
121315
121361
  const { optionsNameMap } = getOptionsNameMap();
@@ -121822,12 +121868,28 @@ function getBuildInfoFileVersionMap(program, buildInfoPath, host) {
121822
121868
  const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
121823
121869
  const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames());
121824
121870
  const fileInfos = /* @__PURE__ */ new Map();
121871
+ let rootIndex = 0;
121872
+ const roots = [];
121825
121873
  program.fileInfos.forEach((fileInfo, index) => {
121826
121874
  const path = toPath(program.fileNames[index], buildInfoDirectory, getCanonicalFileName);
121827
121875
  const version2 = isString(fileInfo) ? fileInfo : fileInfo.version;
121828
121876
  fileInfos.set(path, version2);
121877
+ if (rootIndex < program.root.length) {
121878
+ const current = program.root[rootIndex];
121879
+ const fileId = index + 1;
121880
+ if (isArray(current)) {
121881
+ if (current[0] <= fileId && fileId <= current[1]) {
121882
+ roots.push(path);
121883
+ if (current[1] === fileId)
121884
+ rootIndex++;
121885
+ }
121886
+ } else if (current === fileId) {
121887
+ roots.push(path);
121888
+ rootIndex++;
121889
+ }
121890
+ }
121829
121891
  });
121830
- return fileInfos;
121892
+ return { fileInfos, roots };
121831
121893
  }
121832
121894
  function createRedirectedBuilderProgram(getState, configFileParsingDiagnostics) {
121833
121895
  return {
@@ -124097,13 +124159,14 @@ var UpToDateStatusType = /* @__PURE__ */ ((UpToDateStatusType2) => {
124097
124159
  UpToDateStatusType2[UpToDateStatusType2["OutOfDateWithUpstream"] = 7] = "OutOfDateWithUpstream";
124098
124160
  UpToDateStatusType2[UpToDateStatusType2["OutOfDateBuildInfo"] = 8] = "OutOfDateBuildInfo";
124099
124161
  UpToDateStatusType2[UpToDateStatusType2["OutOfDateOptions"] = 9] = "OutOfDateOptions";
124100
- UpToDateStatusType2[UpToDateStatusType2["UpstreamOutOfDate"] = 10] = "UpstreamOutOfDate";
124101
- UpToDateStatusType2[UpToDateStatusType2["UpstreamBlocked"] = 11] = "UpstreamBlocked";
124102
- UpToDateStatusType2[UpToDateStatusType2["ComputingUpstream"] = 12] = "ComputingUpstream";
124103
- UpToDateStatusType2[UpToDateStatusType2["TsVersionOutputOfDate"] = 13] = "TsVersionOutputOfDate";
124104
- UpToDateStatusType2[UpToDateStatusType2["UpToDateWithInputFileText"] = 14] = "UpToDateWithInputFileText";
124105
- UpToDateStatusType2[UpToDateStatusType2["ContainerOnly"] = 15] = "ContainerOnly";
124106
- UpToDateStatusType2[UpToDateStatusType2["ForceBuild"] = 16] = "ForceBuild";
124162
+ UpToDateStatusType2[UpToDateStatusType2["OutOfDateRoots"] = 10] = "OutOfDateRoots";
124163
+ UpToDateStatusType2[UpToDateStatusType2["UpstreamOutOfDate"] = 11] = "UpstreamOutOfDate";
124164
+ UpToDateStatusType2[UpToDateStatusType2["UpstreamBlocked"] = 12] = "UpstreamBlocked";
124165
+ UpToDateStatusType2[UpToDateStatusType2["ComputingUpstream"] = 13] = "ComputingUpstream";
124166
+ UpToDateStatusType2[UpToDateStatusType2["TsVersionOutputOfDate"] = 14] = "TsVersionOutputOfDate";
124167
+ UpToDateStatusType2[UpToDateStatusType2["UpToDateWithInputFileText"] = 15] = "UpToDateWithInputFileText";
124168
+ UpToDateStatusType2[UpToDateStatusType2["ContainerOnly"] = 16] = "ContainerOnly";
124169
+ UpToDateStatusType2[UpToDateStatusType2["ForceBuild"] = 17] = "ForceBuild";
124107
124170
  return UpToDateStatusType2;
124108
124171
  })(UpToDateStatusType || {});
124109
124172
  function resolveConfigFileProjectName(project) {
@@ -124997,7 +125060,7 @@ function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) {
124997
125060
  }
124998
125061
  continue;
124999
125062
  }
125000
- if (status.type === 2 /* UpToDateWithUpstreamTypes */ || status.type === 14 /* UpToDateWithInputFileText */) {
125063
+ if (status.type === 2 /* UpToDateWithUpstreamTypes */ || status.type === 15 /* UpToDateWithInputFileText */) {
125001
125064
  reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config));
125002
125065
  return {
125003
125066
  kind: 2 /* UpdateOutputFileStamps */,
@@ -125009,7 +125072,7 @@ function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) {
125009
125072
  };
125010
125073
  }
125011
125074
  }
125012
- if (status.type === 11 /* UpstreamBlocked */) {
125075
+ if (status.type === 12 /* UpstreamBlocked */) {
125013
125076
  verboseReportProjectStatus(state, project, status);
125014
125077
  reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config));
125015
125078
  projectPendingBuild.delete(projectPath);
@@ -125023,7 +125086,7 @@ function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) {
125023
125086
  }
125024
125087
  continue;
125025
125088
  }
125026
- if (status.type === 15 /* ContainerOnly */) {
125089
+ if (status.type === 16 /* ContainerOnly */) {
125027
125090
  verboseReportProjectStatus(state, project, status);
125028
125091
  reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config));
125029
125092
  projectPendingBuild.delete(projectPath);
@@ -125210,31 +125273,31 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
125210
125273
  var _a2, _b;
125211
125274
  if (!project.fileNames.length && !canJsonReportNoInputFiles(project.raw)) {
125212
125275
  return {
125213
- type: 15 /* ContainerOnly */
125276
+ type: 16 /* ContainerOnly */
125214
125277
  };
125215
125278
  }
125216
125279
  let referenceStatuses;
125217
125280
  const force = !!state.options.force;
125218
125281
  if (project.projectReferences) {
125219
- state.projectStatus.set(resolvedPath, { type: 12 /* ComputingUpstream */ });
125282
+ state.projectStatus.set(resolvedPath, { type: 13 /* ComputingUpstream */ });
125220
125283
  for (const ref of project.projectReferences) {
125221
125284
  const resolvedRef = resolveProjectReferencePath(ref);
125222
125285
  const resolvedRefPath = toResolvedConfigFilePath(state, resolvedRef);
125223
125286
  const resolvedConfig = parseConfigFile(state, resolvedRef, resolvedRefPath);
125224
125287
  const refStatus = getUpToDateStatus(state, resolvedConfig, resolvedRefPath);
125225
- if (refStatus.type === 12 /* ComputingUpstream */ || refStatus.type === 15 /* ContainerOnly */) {
125288
+ if (refStatus.type === 13 /* ComputingUpstream */ || refStatus.type === 16 /* ContainerOnly */) {
125226
125289
  continue;
125227
125290
  }
125228
- if (refStatus.type === 0 /* Unbuildable */ || refStatus.type === 11 /* UpstreamBlocked */) {
125291
+ if (refStatus.type === 0 /* Unbuildable */ || refStatus.type === 12 /* UpstreamBlocked */) {
125229
125292
  return {
125230
- type: 11 /* UpstreamBlocked */,
125293
+ type: 12 /* UpstreamBlocked */,
125231
125294
  upstreamProjectName: ref.path,
125232
- upstreamProjectBlocked: refStatus.type === 11 /* UpstreamBlocked */
125295
+ upstreamProjectBlocked: refStatus.type === 12 /* UpstreamBlocked */
125233
125296
  };
125234
125297
  }
125235
125298
  if (refStatus.type !== 1 /* UpToDate */) {
125236
125299
  return {
125237
- type: 10 /* UpstreamOutOfDate */,
125300
+ type: 11 /* UpstreamOutOfDate */,
125238
125301
  upstreamProjectName: ref.path
125239
125302
  };
125240
125303
  }
@@ -125243,7 +125306,7 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
125243
125306
  }
125244
125307
  }
125245
125308
  if (force)
125246
- return { type: 16 /* ForceBuild */ };
125309
+ return { type: 17 /* ForceBuild */ };
125247
125310
  const { host } = state;
125248
125311
  const buildInfoPath = getTsBuildInfoEmitOutputFilePath(project.options);
125249
125312
  let oldestOutputFileName;
@@ -125276,7 +125339,7 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
125276
125339
  }
125277
125340
  if ((buildInfo.bundle || buildInfo.program) && buildInfo.version !== version) {
125278
125341
  return {
125279
- type: 13 /* TsVersionOutputOfDate */,
125342
+ type: 14 /* TsVersionOutputOfDate */,
125280
125343
  version: buildInfo.version
125281
125344
  };
125282
125345
  }
@@ -125301,6 +125364,7 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
125301
125364
  let newestInputFileName = void 0;
125302
125365
  let newestInputFileTime = minimumDate;
125303
125366
  let pseudoInputUpToDate = false;
125367
+ const seenRoots = /* @__PURE__ */ new Set();
125304
125368
  for (const inputFile of project.fileNames) {
125305
125369
  const inputTime = getModifiedTime2(state, inputFile);
125306
125370
  if (inputTime === missingFileModifiedTime) {
@@ -125315,7 +125379,7 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
125315
125379
  if (buildInfoProgram) {
125316
125380
  if (!buildInfoVersionMap)
125317
125381
  buildInfoVersionMap = getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host);
125318
- version2 = buildInfoVersionMap.get(toPath2(state, inputFile));
125382
+ version2 = buildInfoVersionMap.fileInfos.get(toPath2(state, inputFile));
125319
125383
  const text = version2 ? state.readFileWithCache(inputFile) : void 0;
125320
125384
  currentVersion = text !== void 0 ? getSourceFileVersionAsHashFromText(host, text) : void 0;
125321
125385
  if (version2 && version2 === currentVersion)
@@ -125333,6 +125397,21 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
125333
125397
  newestInputFileName = inputFile;
125334
125398
  newestInputFileTime = inputTime;
125335
125399
  }
125400
+ if (buildInfoProgram)
125401
+ seenRoots.add(toPath2(state, inputFile));
125402
+ }
125403
+ if (buildInfoProgram) {
125404
+ if (!buildInfoVersionMap)
125405
+ buildInfoVersionMap = getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host);
125406
+ for (const existingRoot of buildInfoVersionMap.roots) {
125407
+ if (!seenRoots.has(existingRoot)) {
125408
+ return {
125409
+ type: 10 /* OutOfDateRoots */,
125410
+ buildInfoFile: buildInfoPath,
125411
+ inputFile: existingRoot
125412
+ };
125413
+ }
125414
+ }
125336
125415
  }
125337
125416
  if (!buildInfoPath) {
125338
125417
  const outputs = getAllProjectOutputs(project, !host.useCaseSensitiveFileNames());
@@ -125414,7 +125493,7 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
125414
125493
  };
125415
125494
  }
125416
125495
  return {
125417
- type: pseudoUpToDate ? 2 /* UpToDateWithUpstreamTypes */ : pseudoInputUpToDate ? 14 /* UpToDateWithInputFileText */ : 1 /* UpToDate */,
125496
+ type: pseudoUpToDate ? 2 /* UpToDateWithUpstreamTypes */ : pseudoInputUpToDate ? 15 /* UpToDateWithInputFileText */ : 1 /* UpToDate */,
125418
125497
  newestInputFileTime,
125419
125498
  newestInputFileName,
125420
125499
  oldestOutputFileName
@@ -125533,7 +125612,7 @@ function queueReferencingProjects(state, project, projectPath, projectIndex, con
125533
125612
  }
125534
125613
  break;
125535
125614
  }
125536
- case 14 /* UpToDateWithInputFileText */:
125615
+ case 15 /* UpToDateWithInputFileText */:
125537
125616
  case 2 /* UpToDateWithUpstreamTypes */:
125538
125617
  case 3 /* OutOfDateWithPrepend */:
125539
125618
  if (!(buildResult & 2 /* DeclarationOutputUnchanged */)) {
@@ -125544,7 +125623,7 @@ function queueReferencingProjects(state, project, projectPath, projectIndex, con
125544
125623
  });
125545
125624
  }
125546
125625
  break;
125547
- case 11 /* UpstreamBlocked */:
125626
+ case 12 /* UpstreamBlocked */:
125548
125627
  if (toResolvedConfigFilePath(state, resolveProjectName(state, status.upstreamProjectName)) === projectPath) {
125549
125628
  clearProjectStatus(state, nextProjectPath);
125550
125629
  }
@@ -125995,6 +126074,14 @@ function reportUpToDateStatus(state, configFileName, status) {
125995
126074
  relName(state, configFileName),
125996
126075
  relName(state, status.buildInfoFile)
125997
126076
  );
126077
+ case 10 /* OutOfDateRoots */:
126078
+ return reportStatus(
126079
+ state,
126080
+ Diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_but_not_any_more,
126081
+ relName(state, configFileName),
126082
+ relName(state, status.buildInfoFile),
126083
+ relName(state, status.inputFile)
126084
+ );
125998
126085
  case 1 /* UpToDate */:
125999
126086
  if (status.newestInputFileTime !== void 0) {
126000
126087
  return reportStatus(
@@ -126019,20 +126106,20 @@ function reportUpToDateStatus(state, configFileName, status) {
126019
126106
  Diagnostics.Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies,
126020
126107
  relName(state, configFileName)
126021
126108
  );
126022
- case 14 /* UpToDateWithInputFileText */:
126109
+ case 15 /* UpToDateWithInputFileText */:
126023
126110
  return reportStatus(
126024
126111
  state,
126025
126112
  Diagnostics.Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files,
126026
126113
  relName(state, configFileName)
126027
126114
  );
126028
- case 10 /* UpstreamOutOfDate */:
126115
+ case 11 /* UpstreamOutOfDate */:
126029
126116
  return reportStatus(
126030
126117
  state,
126031
126118
  Diagnostics.Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date,
126032
126119
  relName(state, configFileName),
126033
126120
  relName(state, status.upstreamProjectName)
126034
126121
  );
126035
- case 11 /* UpstreamBlocked */:
126122
+ case 12 /* UpstreamBlocked */:
126036
126123
  return reportStatus(
126037
126124
  state,
126038
126125
  status.upstreamProjectBlocked ? Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_was_not_built : Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_has_errors,
@@ -126046,7 +126133,7 @@ function reportUpToDateStatus(state, configFileName, status) {
126046
126133
  relName(state, configFileName),
126047
126134
  status.reason
126048
126135
  );
126049
- case 13 /* TsVersionOutputOfDate */:
126136
+ case 14 /* TsVersionOutputOfDate */:
126050
126137
  return reportStatus(
126051
126138
  state,
126052
126139
  Diagnostics.Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2,
@@ -126054,14 +126141,14 @@ function reportUpToDateStatus(state, configFileName, status) {
126054
126141
  status.version,
126055
126142
  version
126056
126143
  );
126057
- case 16 /* ForceBuild */:
126144
+ case 17 /* ForceBuild */:
126058
126145
  return reportStatus(
126059
126146
  state,
126060
126147
  Diagnostics.Project_0_is_being_forcibly_rebuilt,
126061
126148
  relName(state, configFileName)
126062
126149
  );
126063
- case 15 /* ContainerOnly */:
126064
- case 12 /* ComputingUpstream */:
126150
+ case 16 /* ContainerOnly */:
126151
+ case 13 /* ComputingUpstream */:
126065
126152
  break;
126066
126153
  default:
126067
126154
  assertType(status);
@@ -126911,6 +126998,10 @@ __export(ts_exports3, {
126911
126998
  createPatternMatcher: () => createPatternMatcher,
126912
126999
  createPrependNodes: () => createPrependNodes,
126913
127000
  createPrinter: () => createPrinter,
127001
+ createPrinterWithDefaults: () => createPrinterWithDefaults,
127002
+ createPrinterWithRemoveComments: () => createPrinterWithRemoveComments,
127003
+ createPrinterWithRemoveCommentsNeverAsciiEscape: () => createPrinterWithRemoveCommentsNeverAsciiEscape,
127004
+ createPrinterWithRemoveCommentsOmitTrailingSemicolon: () => createPrinterWithRemoveCommentsOmitTrailingSemicolon,
126914
127005
  createProgram: () => createProgram,
126915
127006
  createProgramHost: () => createProgramHost,
126916
127007
  createPropertyNameNodeForIdentifierOrLiteral: () => createPropertyNameNodeForIdentifierOrLiteral,
@@ -127147,6 +127238,7 @@ __export(ts_exports3, {
127147
127238
  getCommonSourceDirectoryOfConfig: () => getCommonSourceDirectoryOfConfig,
127148
127239
  getCompilerOptionValue: () => getCompilerOptionValue,
127149
127240
  getCompilerOptionsDiffValue: () => getCompilerOptionsDiffValue,
127241
+ getConditions: () => getConditions,
127150
127242
  getConfigFileParsingDiagnostics: () => getConfigFileParsingDiagnostics,
127151
127243
  getConstantValue: () => getConstantValue,
127152
127244
  getContainerNode: () => getContainerNode,
@@ -131003,7 +131095,7 @@ function signatureToDisplayParts(typechecker, signature, enclosingDeclaration, f
131003
131095
  function nodeToDisplayParts(node, enclosingDeclaration) {
131004
131096
  const file = enclosingDeclaration.getSourceFile();
131005
131097
  return mapToDisplayParts((writer) => {
131006
- const printer = createPrinter({ removeComments: true, omitTrailingSemicolon: true });
131098
+ const printer = createPrinterWithRemoveCommentsOmitTrailingSemicolon();
131007
131099
  printer.writeNode(4 /* Unspecified */, node, file, writer);
131008
131100
  });
131009
131101
  }
@@ -139466,7 +139558,7 @@ function getCallHierarchyItemName(program, node) {
139466
139558
  }
139467
139559
  }
139468
139560
  if (text === void 0) {
139469
- const printer = createPrinter({ removeComments: true, omitTrailingSemicolon: true });
139561
+ const printer = createPrinterWithRemoveCommentsOmitTrailingSemicolon();
139470
139562
  text = usingSingleLineStringWriter((writer) => printer.writeNode(4 /* Unspecified */, node, node.getSourceFile(), writer));
139471
139563
  }
139472
139564
  return { text, pos: declName.getStart(), end: declName.getEnd() };
@@ -146188,7 +146280,7 @@ function getDeleteAction(context, { name, jsDocHost, jsDocParameterTag }) {
146188
146280
  Diagnostics.Delete_all_unused_param_tags
146189
146281
  );
146190
146282
  }
146191
- function getRenameAction(context, { name, signature, jsDocParameterTag }) {
146283
+ function getRenameAction(context, { name, jsDocHost, signature, jsDocParameterTag }) {
146192
146284
  if (!length(signature.parameters))
146193
146285
  return void 0;
146194
146286
  const sourceFile = context.sourceFile;
@@ -146211,7 +146303,7 @@ function getRenameAction(context, { name, signature, jsDocParameterTag }) {
146211
146303
  jsDocParameterTag.isNameFirst,
146212
146304
  jsDocParameterTag.comment
146213
146305
  );
146214
- const changes = ts_textChanges_exports.ChangeTracker.with(context, (changeTracker) => changeTracker.replaceJSDocComment(sourceFile, signature, map(tags, (t) => t === jsDocParameterTag ? newJSDocParameterTag : t)));
146306
+ const changes = ts_textChanges_exports.ChangeTracker.with(context, (changeTracker) => changeTracker.replaceJSDocComment(sourceFile, jsDocHost, map(tags, (t) => t === jsDocParameterTag ? newJSDocParameterTag : t)));
146215
146307
  return createCodeFixActionWithoutFixAll(renameUnmatchedParameter, changes, [Diagnostics.Rename_param_tag_name_0_to_1, name.getText(sourceFile), parameterName]);
146216
146308
  }
146217
146309
  function getInfo10(sourceFile, pos) {
@@ -157236,8 +157328,7 @@ function provideInlayHints(context) {
157236
157328
  }
157237
157329
  function printTypeInSingleLine(type) {
157238
157330
  const flags = 70221824 /* IgnoreErrors */ | 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */;
157239
- const options = { removeComments: true };
157240
- const printer = createPrinter(options);
157331
+ const printer = createPrinterWithRemoveComments();
157241
157332
  return usingSingleLineStringWriter((writer) => {
157242
157333
  const typeNode = checker.typeToTypeNode(
157243
157334
  type,
@@ -160763,6 +160854,7 @@ function convertToBlock(body) {
160763
160854
  if (isExpression(body)) {
160764
160855
  const returnStatement = factory.createReturnStatement(body);
160765
160856
  const file = body.getSourceFile();
160857
+ setTextRange(returnStatement, body);
160766
160858
  suppressLeadingAndTrailingTrivia(returnStatement);
160767
160859
  copyTrailingAsLeadingComments(
160768
160860
  body,
@@ -164168,7 +164260,7 @@ function createTypeHelpItems(symbol, { argumentCount, argumentsSpan: applicableS
164168
164260
  }
164169
164261
  function getTypeHelpItem(symbol, typeParameters, checker, enclosingDeclaration, sourceFile) {
164170
164262
  const typeSymbolDisplay = symbolToDisplayParts(checker, symbol);
164171
- const printer = createPrinter({ removeComments: true });
164263
+ const printer = createPrinterWithRemoveComments();
164172
164264
  const parameters = typeParameters.map((t) => createSignatureHelpParameterForTypeParameter(t, checker, enclosingDeclaration, sourceFile, printer));
164173
164265
  const documentation = symbol.getDocumentationComment(checker);
164174
164266
  const tags = symbol.getJsDocTags(checker);
@@ -164212,7 +164304,7 @@ function returnTypeToDisplayParts(candidateSignature, enclosingDeclaration, chec
164212
164304
  }
164213
164305
  function itemInfoForTypeParameters(candidateSignature, checker, enclosingDeclaration, sourceFile) {
164214
164306
  const typeParameters = (candidateSignature.target || candidateSignature).typeParameters;
164215
- const printer = createPrinter({ removeComments: true });
164307
+ const printer = createPrinterWithRemoveComments();
164216
164308
  const parameters = (typeParameters || emptyArray).map((t) => createSignatureHelpParameterForTypeParameter(t, checker, enclosingDeclaration, sourceFile, printer));
164217
164309
  const thisParameter = candidateSignature.thisParameter ? [checker.symbolToParameterDeclaration(candidateSignature.thisParameter, enclosingDeclaration, signatureHelpNodeBuilderFlags)] : [];
164218
164310
  return checker.getExpandedParameters(candidateSignature).map((paramList) => {
@@ -164224,7 +164316,7 @@ function itemInfoForTypeParameters(candidateSignature, checker, enclosingDeclara
164224
164316
  });
164225
164317
  }
164226
164318
  function itemInfoForParameters(candidateSignature, checker, enclosingDeclaration, sourceFile) {
164227
- const printer = createPrinter({ removeComments: true });
164319
+ const printer = createPrinterWithRemoveComments();
164228
164320
  const typeParameterParts = mapToDisplayParts((writer) => {
164229
164321
  if (candidateSignature.typeParameters && candidateSignature.typeParameters.length) {
164230
164322
  const args = factory.createNodeArray(candidateSignature.typeParameters.map((p) => checker.typeParameterToDeclaration(p, enclosingDeclaration, signatureHelpNodeBuilderFlags)));
@@ -164599,7 +164691,6 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, so
164599
164691
  let hasAddedSymbolInfo = false;
164600
164692
  const isThisExpression = location.kind === 108 /* ThisKeyword */ && isInExpressionContext(location) || isThisInTypeQuery(location);
164601
164693
  let type;
164602
- let printer;
164603
164694
  let documentationFromAlias;
164604
164695
  let tagsFromAlias;
164605
164696
  let hasMultipleSignatures = false;
@@ -164992,10 +165083,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, so
164992
165083
  }
164993
165084
  return { displayParts, documentation, symbolKind, tags: tags.length === 0 ? void 0 : tags };
164994
165085
  function getPrinter() {
164995
- if (!printer) {
164996
- printer = createPrinter({ removeComments: true });
164997
- }
164998
- return printer;
165086
+ return createPrinterWithRemoveComments();
164999
165087
  }
165000
165088
  function prefixNextMeaning() {
165001
165089
  if (displayParts.length) {
@@ -181075,6 +181163,10 @@ start(initializeNodeSystem(), require("os").platform());
181075
181163
  createPatternMatcher,
181076
181164
  createPrependNodes,
181077
181165
  createPrinter,
181166
+ createPrinterWithDefaults,
181167
+ createPrinterWithRemoveComments,
181168
+ createPrinterWithRemoveCommentsNeverAsciiEscape,
181169
+ createPrinterWithRemoveCommentsOmitTrailingSemicolon,
181078
181170
  createProgram,
181079
181171
  createProgramHost,
181080
181172
  createPropertyNameNodeForIdentifierOrLiteral,
@@ -181311,6 +181403,7 @@ start(initializeNodeSystem(), require("os").platform());
181311
181403
  getCommonSourceDirectoryOfConfig,
181312
181404
  getCompilerOptionValue,
181313
181405
  getCompilerOptionsDiffValue,
181406
+ getConditions,
181314
181407
  getConfigFileParsingDiagnostics,
181315
181408
  getConstantValue,
181316
181409
  getContainerNode,