@typescript-deploys/pr-build 5.6.0-pr-59436-2 → 5.6.0-pr-59504-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/typescript.js CHANGED
@@ -2260,7 +2260,7 @@ module.exports = __toCommonJS(typescript_exports);
2260
2260
 
2261
2261
  // src/compiler/corePublic.ts
2262
2262
  var versionMajorMinor = "5.6";
2263
- var version = `${versionMajorMinor}.0-insiders.20240726`;
2263
+ var version = `${versionMajorMinor}.0-insiders.20240801`;
2264
2264
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2265
2265
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2266
2266
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -49932,7 +49932,7 @@ function createTypeChecker(host) {
49932
49932
  var scanner2;
49933
49933
  var Symbol47 = objectAllocator.getSymbolConstructor();
49934
49934
  var Type29 = objectAllocator.getTypeConstructor();
49935
- var Signature14 = objectAllocator.getSignatureConstructor();
49935
+ var Signature13 = objectAllocator.getSignatureConstructor();
49936
49936
  var typeCount = 0;
49937
49937
  var symbolCount = 0;
49938
49938
  var totalInstantiationCount = 0;
@@ -56269,6 +56269,8 @@ function createTypeChecker(host) {
56269
56269
  }
56270
56270
  introducesError = true;
56271
56271
  return { introducesError, node, sym };
56272
+ } else {
56273
+ sym = symAtLocation;
56272
56274
  }
56273
56275
  }
56274
56276
  if (sym) {
@@ -60743,7 +60745,7 @@ function createTypeChecker(host) {
60743
60745
  resolveObjectTypeMembers(type, source, typeParameters, paddedTypeArguments);
60744
60746
  }
60745
60747
  function createSignature(declaration, typeParameters, thisParameter, parameters, resolvedReturnType, resolvedTypePredicate, minArgumentCount, flags) {
60746
- const sig = new Signature14(checker, flags);
60748
+ const sig = new Signature13(checker, flags);
60747
60749
  sig.declaration = declaration;
60748
60750
  sig.typeParameters = typeParameters;
60749
60751
  sig.parameters = parameters;
@@ -83424,7 +83426,17 @@ function createTypeChecker(host) {
83424
83426
  if (!ok) {
83425
83427
  error2(node, Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query);
83426
83428
  }
83427
- if (getIsolatedModules(compilerOptions)) {
83429
+ if (compilerOptions.isolatedModules || compilerOptions.verbatimModuleSyntax && ok && !resolveName(
83430
+ node,
83431
+ getFirstIdentifier(node),
83432
+ 2097152 /* Alias */,
83433
+ /*nameNotFoundMessage*/
83434
+ void 0,
83435
+ /*isUse*/
83436
+ false,
83437
+ /*excludeGlobals*/
83438
+ true
83439
+ )) {
83428
83440
  Debug.assert(!!(type.symbol.flags & 128 /* ConstEnum */));
83429
83441
  const constEnumDeclaration = type.symbol.valueDeclaration;
83430
83442
  const redirect = host.getRedirectReferenceForResolutionFromSourceOfProject(getSourceFileOfNode(constEnumDeclaration).resolvedPath);
@@ -84385,16 +84397,20 @@ function createTypeChecker(host) {
84385
84397
  const someButNotAllOverloadFlags = someOverloadFlags ^ allOverloadFlags;
84386
84398
  if (someButNotAllOverloadFlags !== 0) {
84387
84399
  const canonicalFlags = getEffectiveDeclarationFlags(getCanonicalOverload(overloads, implementation), flagsToCheck2);
84388
- forEach(overloads, (o) => {
84389
- const deviation = getEffectiveDeclarationFlags(o, flagsToCheck2) ^ canonicalFlags;
84390
- if (deviation & 32 /* Export */) {
84391
- error2(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_exported_or_non_exported);
84392
- } else if (deviation & 128 /* Ambient */) {
84393
- error2(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient);
84394
- } else if (deviation & (2 /* Private */ | 4 /* Protected */)) {
84395
- error2(getNameOfDeclaration(o) || o, Diagnostics.Overload_signatures_must_all_be_public_private_or_protected);
84396
- } else if (deviation & 64 /* Abstract */) {
84397
- error2(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_abstract_or_non_abstract);
84400
+ group(overloads, (o) => getSourceFileOfNode(o).fileName).forEach((overloadsInFile) => {
84401
+ const canonicalFlagsForFile = getEffectiveDeclarationFlags(getCanonicalOverload(overloadsInFile, implementation), flagsToCheck2);
84402
+ for (const o of overloadsInFile) {
84403
+ const deviation = getEffectiveDeclarationFlags(o, flagsToCheck2) ^ canonicalFlags;
84404
+ const deviationInFile = getEffectiveDeclarationFlags(o, flagsToCheck2) ^ canonicalFlagsForFile;
84405
+ if (deviationInFile & 32 /* Export */) {
84406
+ error2(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_exported_or_non_exported);
84407
+ } else if (deviationInFile & 128 /* Ambient */) {
84408
+ error2(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient);
84409
+ } else if (deviation & (2 /* Private */ | 4 /* Protected */)) {
84410
+ error2(getNameOfDeclaration(o) || o, Diagnostics.Overload_signatures_must_all_be_public_private_or_protected);
84411
+ } else if (deviation & 64 /* Abstract */) {
84412
+ error2(getNameOfDeclaration(o), Diagnostics.Overload_signatures_must_all_be_abstract_or_non_abstract);
84413
+ }
84398
84414
  }
84399
84415
  });
84400
84416
  }
@@ -85529,7 +85545,7 @@ function createTypeChecker(host) {
85529
85545
  if (!wrappingDeclaration.type) {
85530
85546
  addRelatedInfo(
85531
85547
  diagnostic,
85532
- createFileDiagnostic(getSourceFileOfNode(wrappingDeclaration), wrappingDeclaration.end, 1, Diagnostics.We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here, declarationNameToString(node.propertyName))
85548
+ createFileDiagnostic(getSourceFileOfNode(wrappingDeclaration), wrappingDeclaration.end, 0, Diagnostics.We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here, declarationNameToString(node.propertyName))
85533
85549
  );
85534
85550
  }
85535
85551
  diagnostics.add(diagnostic);
@@ -88372,6 +88388,13 @@ function createTypeChecker(host) {
88372
88388
  } else if (moduleKind === 200 /* Preserve */ && node.kind !== 271 /* ImportEqualsDeclaration */ && node.kind !== 260 /* VariableDeclaration */ && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) === 1 /* CommonJS */) {
88373
88389
  error2(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve);
88374
88390
  }
88391
+ if (compilerOptions.verbatimModuleSyntax && !isTypeOnlyImportOrExportDeclaration(node) && !(node.flags & 33554432 /* Ambient */) && targetFlags & 128 /* ConstEnum */) {
88392
+ const constEnumDeclaration = target.valueDeclaration;
88393
+ const redirect = host.getRedirectReferenceForResolutionFromSourceOfProject(getSourceFileOfNode(constEnumDeclaration).resolvedPath);
88394
+ if (constEnumDeclaration.flags & 33554432 /* Ambient */ && (!redirect || !shouldPreserveConstEnums(redirect.commandLine.options))) {
88395
+ error2(node, Diagnostics.Cannot_access_ambient_const_enums_when_0_is_enabled, isolatedModulesLikeFlagName);
88396
+ }
88397
+ }
88375
88398
  }
88376
88399
  if (isImportSpecifier(node)) {
88377
88400
  const targetSymbol = resolveAliasWithDeprecationCheck(symbol, node);
@@ -108412,7 +108435,7 @@ function transformES2015(context) {
108412
108435
  statement,
108413
108436
  /*outermostLabeledStatement*/
108414
108437
  node
108415
- ) : factory2.restoreEnclosingLabel(Debug.checkDefined(visitNode(statement, visitor, isStatement, factory2.liftToBlock)), node, convertedLoopState && resetLabel);
108438
+ ) : factory2.restoreEnclosingLabel(visitNode(statement, visitor, isStatement, factory2.liftToBlock) ?? setTextRange(factory2.createEmptyStatement(), statement), node, convertedLoopState && resetLabel);
108416
108439
  }
108417
108440
  function visitIterationStatement(node, outermostLabeledStatement) {
108418
108441
  switch (node.kind) {
@@ -112718,7 +112741,7 @@ function transformModule(context) {
112718
112741
  return factory2.updateLabeledStatement(
112719
112742
  node,
112720
112743
  node.label,
112721
- visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) ?? factory2.createExpressionStatement(factory2.createIdentifier(""))
112744
+ visitNode(node.statement, topLevelNestedVisitor, isStatement, factory2.liftToBlock) ?? setTextRange(factory2.createEmptyStatement(), node.statement)
112722
112745
  );
112723
112746
  }
112724
112747
  function visitWithStatement(node) {
@@ -124281,13 +124304,9 @@ function getImpliedNodeFormatForFile(fileName, packageJsonInfoCache, host, optio
124281
124304
  return typeof result === "object" ? result.impliedNodeFormat : result;
124282
124305
  }
124283
124306
  function getImpliedNodeFormatForFileWorker(fileName, packageJsonInfoCache, host, options) {
124284
- switch (getEmitModuleResolutionKind(options)) {
124285
- case 3 /* Node16 */:
124286
- case 99 /* NodeNext */:
124287
- return fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".mjs" /* Mjs */]) ? 99 /* ESNext */ : fileExtensionIsOneOf(fileName, [".d.cts" /* Dcts */, ".cts" /* Cts */, ".cjs" /* Cjs */]) ? 1 /* CommonJS */ : fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */, ".ts" /* Ts */, ".tsx" /* Tsx */, ".js" /* Js */, ".jsx" /* Jsx */]) ? lookupFromPackageJson() : void 0;
124288
- default:
124289
- return void 0;
124290
- }
124307
+ const moduleResolution = getEmitModuleResolutionKind(options);
124308
+ const shouldLookupFromPackageJson = 3 /* Node16 */ <= moduleResolution && moduleResolution <= 99 /* NodeNext */ || pathContainsNodeModules(fileName);
124309
+ return fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".mjs" /* Mjs */]) ? 99 /* ESNext */ : fileExtensionIsOneOf(fileName, [".d.cts" /* Dcts */, ".cts" /* Cts */, ".cjs" /* Cjs */]) ? 1 /* CommonJS */ : shouldLookupFromPackageJson && fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */, ".ts" /* Ts */, ".tsx" /* Tsx */, ".js" /* Js */, ".jsx" /* Jsx */]) ? lookupFromPackageJson() : void 0;
124291
124310
  function lookupFromPackageJson() {
124292
124311
  const state = getTemporaryModuleResolutionState(packageJsonInfoCache, host, options);
124293
124312
  const packageJsonLocations = [];
@@ -171096,11 +171115,8 @@ function provideInlayHints(context) {
171096
171115
  if (!args || !args.length) {
171097
171116
  return;
171098
171117
  }
171099
- const candidates = [];
171100
- const signature = checker.getResolvedSignatureForSignatureHelp(expr, candidates);
171101
- if (!signature || !candidates.length) {
171102
- return;
171103
- }
171118
+ const signature = checker.getResolvedSignature(expr);
171119
+ if (signature === void 0) return;
171104
171120
  let signatureParamPos = 0;
171105
171121
  for (const originalArg of args) {
171106
171122
  const arg = skipParentheses(originalArg);
@@ -171192,6 +171208,14 @@ function provideInlayHints(context) {
171192
171208
  if (!signature) {
171193
171209
  return;
171194
171210
  }
171211
+ const typePredicate = checker.getTypePredicateOfSignature(signature);
171212
+ if (typePredicate == null ? void 0 : typePredicate.type) {
171213
+ const hintParts2 = typePredicateToInlayHintParts(typePredicate);
171214
+ if (hintParts2) {
171215
+ addTypeHints(hintParts2, getTypeAnnotationPosition(decl));
171216
+ return;
171217
+ }
171218
+ }
171195
171219
  const returnType = checker.getReturnTypeOfSignature(signature);
171196
171220
  if (isModuleReferenceType(returnType)) {
171197
171221
  return;
@@ -171260,6 +171284,26 @@ function provideInlayHints(context) {
171260
171284
  );
171261
171285
  });
171262
171286
  }
171287
+ function printTypePredicateInSingleLine(typePredicate) {
171288
+ const flags = 70221824 /* IgnoreErrors */ | 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */;
171289
+ const printer = createPrinterWithRemoveComments();
171290
+ return usingSingleLineStringWriter((writer) => {
171291
+ const typePredicateNode = checker.typePredicateToTypePredicateNode(
171292
+ typePredicate,
171293
+ /*enclosingDeclaration*/
171294
+ void 0,
171295
+ flags
171296
+ );
171297
+ Debug.assertIsDefined(typePredicateNode, "should always get typePredicateNode");
171298
+ printer.writeNode(
171299
+ 4 /* Unspecified */,
171300
+ typePredicateNode,
171301
+ /*sourceFile*/
171302
+ file,
171303
+ writer
171304
+ );
171305
+ });
171306
+ }
171263
171307
  function typeToInlayHintParts(type) {
171264
171308
  if (!shouldUseInteractiveInlayHints(preferences)) {
171265
171309
  return printTypeInSingleLine(type);
@@ -171271,29 +171315,46 @@ function provideInlayHints(context) {
171271
171315
  void 0,
171272
171316
  flags
171273
171317
  );
171318
+ Debug.assertIsDefined(typeNode, "should always get typeNode");
171319
+ return getInlayHintDisplayParts(typeNode);
171320
+ }
171321
+ function typePredicateToInlayHintParts(typePredicate) {
171322
+ if (!shouldUseInteractiveInlayHints(preferences)) {
171323
+ return printTypePredicateInSingleLine(typePredicate);
171324
+ }
171325
+ const flags = 70221824 /* IgnoreErrors */ | 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */;
171326
+ const typeNode = checker.typePredicateToTypePredicateNode(
171327
+ typePredicate,
171328
+ /*enclosingDeclaration*/
171329
+ void 0,
171330
+ flags
171331
+ );
171274
171332
  Debug.assertIsDefined(typeNode, "should always get typenode");
171333
+ return getInlayHintDisplayParts(typeNode);
171334
+ }
171335
+ function getInlayHintDisplayParts(node) {
171275
171336
  const parts = [];
171276
- visitForDisplayParts(typeNode);
171337
+ visitForDisplayParts(node);
171277
171338
  return parts;
171278
- function visitForDisplayParts(node) {
171339
+ function visitForDisplayParts(node2) {
171279
171340
  var _a, _b;
171280
- if (!node) {
171341
+ if (!node2) {
171281
171342
  return;
171282
171343
  }
171283
- const tokenString = tokenToString(node.kind);
171344
+ const tokenString = tokenToString(node2.kind);
171284
171345
  if (tokenString) {
171285
171346
  parts.push({ text: tokenString });
171286
171347
  return;
171287
171348
  }
171288
- if (isLiteralExpression(node)) {
171289
- parts.push({ text: getLiteralText2(node) });
171349
+ if (isLiteralExpression(node2)) {
171350
+ parts.push({ text: getLiteralText2(node2) });
171290
171351
  return;
171291
171352
  }
171292
- switch (node.kind) {
171353
+ switch (node2.kind) {
171293
171354
  case 80 /* Identifier */:
171294
- Debug.assertNode(node, isIdentifier);
171295
- const identifierText = idText(node);
171296
- const name = node.symbol && node.symbol.declarations && node.symbol.declarations.length && getNameOfDeclaration(node.symbol.declarations[0]);
171355
+ Debug.assertNode(node2, isIdentifier);
171356
+ const identifierText = idText(node2);
171357
+ const name = node2.symbol && node2.symbol.declarations && node2.symbol.declarations.length && getNameOfDeclaration(node2.symbol.declarations[0]);
171297
171358
  if (name) {
171298
171359
  parts.push(getNodeDisplayPart(identifierText, name));
171299
171360
  } else {
@@ -171301,331 +171362,331 @@ function provideInlayHints(context) {
171301
171362
  }
171302
171363
  break;
171303
171364
  case 166 /* QualifiedName */:
171304
- Debug.assertNode(node, isQualifiedName);
171305
- visitForDisplayParts(node.left);
171365
+ Debug.assertNode(node2, isQualifiedName);
171366
+ visitForDisplayParts(node2.left);
171306
171367
  parts.push({ text: "." });
171307
- visitForDisplayParts(node.right);
171368
+ visitForDisplayParts(node2.right);
171308
171369
  break;
171309
171370
  case 182 /* TypePredicate */:
171310
- Debug.assertNode(node, isTypePredicateNode);
171311
- if (node.assertsModifier) {
171371
+ Debug.assertNode(node2, isTypePredicateNode);
171372
+ if (node2.assertsModifier) {
171312
171373
  parts.push({ text: "asserts " });
171313
171374
  }
171314
- visitForDisplayParts(node.parameterName);
171315
- if (node.type) {
171375
+ visitForDisplayParts(node2.parameterName);
171376
+ if (node2.type) {
171316
171377
  parts.push({ text: " is " });
171317
- visitForDisplayParts(node.type);
171378
+ visitForDisplayParts(node2.type);
171318
171379
  }
171319
171380
  break;
171320
171381
  case 183 /* TypeReference */:
171321
- Debug.assertNode(node, isTypeReferenceNode);
171322
- visitForDisplayParts(node.typeName);
171323
- if (node.typeArguments) {
171382
+ Debug.assertNode(node2, isTypeReferenceNode);
171383
+ visitForDisplayParts(node2.typeName);
171384
+ if (node2.typeArguments) {
171324
171385
  parts.push({ text: "<" });
171325
- visitDisplayPartList(node.typeArguments, ", ");
171386
+ visitDisplayPartList(node2.typeArguments, ", ");
171326
171387
  parts.push({ text: ">" });
171327
171388
  }
171328
171389
  break;
171329
171390
  case 168 /* TypeParameter */:
171330
- Debug.assertNode(node, isTypeParameterDeclaration);
171331
- if (node.modifiers) {
171332
- visitDisplayPartList(node.modifiers, " ");
171391
+ Debug.assertNode(node2, isTypeParameterDeclaration);
171392
+ if (node2.modifiers) {
171393
+ visitDisplayPartList(node2.modifiers, " ");
171333
171394
  }
171334
- visitForDisplayParts(node.name);
171335
- if (node.constraint) {
171395
+ visitForDisplayParts(node2.name);
171396
+ if (node2.constraint) {
171336
171397
  parts.push({ text: " extends " });
171337
- visitForDisplayParts(node.constraint);
171398
+ visitForDisplayParts(node2.constraint);
171338
171399
  }
171339
- if (node.default) {
171400
+ if (node2.default) {
171340
171401
  parts.push({ text: " = " });
171341
- visitForDisplayParts(node.default);
171402
+ visitForDisplayParts(node2.default);
171342
171403
  }
171343
171404
  break;
171344
171405
  case 169 /* Parameter */:
171345
- Debug.assertNode(node, isParameter);
171346
- if (node.modifiers) {
171347
- visitDisplayPartList(node.modifiers, " ");
171406
+ Debug.assertNode(node2, isParameter);
171407
+ if (node2.modifiers) {
171408
+ visitDisplayPartList(node2.modifiers, " ");
171348
171409
  }
171349
- if (node.dotDotDotToken) {
171410
+ if (node2.dotDotDotToken) {
171350
171411
  parts.push({ text: "..." });
171351
171412
  }
171352
- visitForDisplayParts(node.name);
171353
- if (node.questionToken) {
171413
+ visitForDisplayParts(node2.name);
171414
+ if (node2.questionToken) {
171354
171415
  parts.push({ text: "?" });
171355
171416
  }
171356
- if (node.type) {
171417
+ if (node2.type) {
171357
171418
  parts.push({ text: ": " });
171358
- visitForDisplayParts(node.type);
171419
+ visitForDisplayParts(node2.type);
171359
171420
  }
171360
171421
  break;
171361
171422
  case 185 /* ConstructorType */:
171362
- Debug.assertNode(node, isConstructorTypeNode);
171423
+ Debug.assertNode(node2, isConstructorTypeNode);
171363
171424
  parts.push({ text: "new " });
171364
- visitParametersAndTypeParameters(node);
171425
+ visitParametersAndTypeParameters(node2);
171365
171426
  parts.push({ text: " => " });
171366
- visitForDisplayParts(node.type);
171427
+ visitForDisplayParts(node2.type);
171367
171428
  break;
171368
171429
  case 186 /* TypeQuery */:
171369
- Debug.assertNode(node, isTypeQueryNode);
171430
+ Debug.assertNode(node2, isTypeQueryNode);
171370
171431
  parts.push({ text: "typeof " });
171371
- visitForDisplayParts(node.exprName);
171372
- if (node.typeArguments) {
171432
+ visitForDisplayParts(node2.exprName);
171433
+ if (node2.typeArguments) {
171373
171434
  parts.push({ text: "<" });
171374
- visitDisplayPartList(node.typeArguments, ", ");
171435
+ visitDisplayPartList(node2.typeArguments, ", ");
171375
171436
  parts.push({ text: ">" });
171376
171437
  }
171377
171438
  break;
171378
171439
  case 187 /* TypeLiteral */:
171379
- Debug.assertNode(node, isTypeLiteralNode);
171440
+ Debug.assertNode(node2, isTypeLiteralNode);
171380
171441
  parts.push({ text: "{" });
171381
- if (node.members.length) {
171442
+ if (node2.members.length) {
171382
171443
  parts.push({ text: " " });
171383
- visitDisplayPartList(node.members, "; ");
171444
+ visitDisplayPartList(node2.members, "; ");
171384
171445
  parts.push({ text: " " });
171385
171446
  }
171386
171447
  parts.push({ text: "}" });
171387
171448
  break;
171388
171449
  case 188 /* ArrayType */:
171389
- Debug.assertNode(node, isArrayTypeNode);
171390
- visitForDisplayParts(node.elementType);
171450
+ Debug.assertNode(node2, isArrayTypeNode);
171451
+ visitForDisplayParts(node2.elementType);
171391
171452
  parts.push({ text: "[]" });
171392
171453
  break;
171393
171454
  case 189 /* TupleType */:
171394
- Debug.assertNode(node, isTupleTypeNode);
171455
+ Debug.assertNode(node2, isTupleTypeNode);
171395
171456
  parts.push({ text: "[" });
171396
- visitDisplayPartList(node.elements, ", ");
171457
+ visitDisplayPartList(node2.elements, ", ");
171397
171458
  parts.push({ text: "]" });
171398
171459
  break;
171399
171460
  case 202 /* NamedTupleMember */:
171400
- Debug.assertNode(node, isNamedTupleMember);
171401
- if (node.dotDotDotToken) {
171461
+ Debug.assertNode(node2, isNamedTupleMember);
171462
+ if (node2.dotDotDotToken) {
171402
171463
  parts.push({ text: "..." });
171403
171464
  }
171404
- visitForDisplayParts(node.name);
171405
- if (node.questionToken) {
171465
+ visitForDisplayParts(node2.name);
171466
+ if (node2.questionToken) {
171406
171467
  parts.push({ text: "?" });
171407
171468
  }
171408
171469
  parts.push({ text: ": " });
171409
- visitForDisplayParts(node.type);
171470
+ visitForDisplayParts(node2.type);
171410
171471
  break;
171411
171472
  case 190 /* OptionalType */:
171412
- Debug.assertNode(node, isOptionalTypeNode);
171413
- visitForDisplayParts(node.type);
171473
+ Debug.assertNode(node2, isOptionalTypeNode);
171474
+ visitForDisplayParts(node2.type);
171414
171475
  parts.push({ text: "?" });
171415
171476
  break;
171416
171477
  case 191 /* RestType */:
171417
- Debug.assertNode(node, isRestTypeNode);
171478
+ Debug.assertNode(node2, isRestTypeNode);
171418
171479
  parts.push({ text: "..." });
171419
- visitForDisplayParts(node.type);
171480
+ visitForDisplayParts(node2.type);
171420
171481
  break;
171421
171482
  case 192 /* UnionType */:
171422
- Debug.assertNode(node, isUnionTypeNode);
171423
- visitDisplayPartList(node.types, " | ");
171483
+ Debug.assertNode(node2, isUnionTypeNode);
171484
+ visitDisplayPartList(node2.types, " | ");
171424
171485
  break;
171425
171486
  case 193 /* IntersectionType */:
171426
- Debug.assertNode(node, isIntersectionTypeNode);
171427
- visitDisplayPartList(node.types, " & ");
171487
+ Debug.assertNode(node2, isIntersectionTypeNode);
171488
+ visitDisplayPartList(node2.types, " & ");
171428
171489
  break;
171429
171490
  case 194 /* ConditionalType */:
171430
- Debug.assertNode(node, isConditionalTypeNode);
171431
- visitForDisplayParts(node.checkType);
171491
+ Debug.assertNode(node2, isConditionalTypeNode);
171492
+ visitForDisplayParts(node2.checkType);
171432
171493
  parts.push({ text: " extends " });
171433
- visitForDisplayParts(node.extendsType);
171494
+ visitForDisplayParts(node2.extendsType);
171434
171495
  parts.push({ text: " ? " });
171435
- visitForDisplayParts(node.trueType);
171496
+ visitForDisplayParts(node2.trueType);
171436
171497
  parts.push({ text: " : " });
171437
- visitForDisplayParts(node.falseType);
171498
+ visitForDisplayParts(node2.falseType);
171438
171499
  break;
171439
171500
  case 195 /* InferType */:
171440
- Debug.assertNode(node, isInferTypeNode);
171501
+ Debug.assertNode(node2, isInferTypeNode);
171441
171502
  parts.push({ text: "infer " });
171442
- visitForDisplayParts(node.typeParameter);
171503
+ visitForDisplayParts(node2.typeParameter);
171443
171504
  break;
171444
171505
  case 196 /* ParenthesizedType */:
171445
- Debug.assertNode(node, isParenthesizedTypeNode);
171506
+ Debug.assertNode(node2, isParenthesizedTypeNode);
171446
171507
  parts.push({ text: "(" });
171447
- visitForDisplayParts(node.type);
171508
+ visitForDisplayParts(node2.type);
171448
171509
  parts.push({ text: ")" });
171449
171510
  break;
171450
171511
  case 198 /* TypeOperator */:
171451
- Debug.assertNode(node, isTypeOperatorNode);
171452
- parts.push({ text: `${tokenToString(node.operator)} ` });
171453
- visitForDisplayParts(node.type);
171512
+ Debug.assertNode(node2, isTypeOperatorNode);
171513
+ parts.push({ text: `${tokenToString(node2.operator)} ` });
171514
+ visitForDisplayParts(node2.type);
171454
171515
  break;
171455
171516
  case 199 /* IndexedAccessType */:
171456
- Debug.assertNode(node, isIndexedAccessTypeNode);
171457
- visitForDisplayParts(node.objectType);
171517
+ Debug.assertNode(node2, isIndexedAccessTypeNode);
171518
+ visitForDisplayParts(node2.objectType);
171458
171519
  parts.push({ text: "[" });
171459
- visitForDisplayParts(node.indexType);
171520
+ visitForDisplayParts(node2.indexType);
171460
171521
  parts.push({ text: "]" });
171461
171522
  break;
171462
171523
  case 200 /* MappedType */:
171463
- Debug.assertNode(node, isMappedTypeNode);
171524
+ Debug.assertNode(node2, isMappedTypeNode);
171464
171525
  parts.push({ text: "{ " });
171465
- if (node.readonlyToken) {
171466
- if (node.readonlyToken.kind === 40 /* PlusToken */) {
171526
+ if (node2.readonlyToken) {
171527
+ if (node2.readonlyToken.kind === 40 /* PlusToken */) {
171467
171528
  parts.push({ text: "+" });
171468
- } else if (node.readonlyToken.kind === 41 /* MinusToken */) {
171529
+ } else if (node2.readonlyToken.kind === 41 /* MinusToken */) {
171469
171530
  parts.push({ text: "-" });
171470
171531
  }
171471
171532
  parts.push({ text: "readonly " });
171472
171533
  }
171473
171534
  parts.push({ text: "[" });
171474
- visitForDisplayParts(node.typeParameter);
171475
- if (node.nameType) {
171535
+ visitForDisplayParts(node2.typeParameter);
171536
+ if (node2.nameType) {
171476
171537
  parts.push({ text: " as " });
171477
- visitForDisplayParts(node.nameType);
171538
+ visitForDisplayParts(node2.nameType);
171478
171539
  }
171479
171540
  parts.push({ text: "]" });
171480
- if (node.questionToken) {
171481
- if (node.questionToken.kind === 40 /* PlusToken */) {
171541
+ if (node2.questionToken) {
171542
+ if (node2.questionToken.kind === 40 /* PlusToken */) {
171482
171543
  parts.push({ text: "+" });
171483
- } else if (node.questionToken.kind === 41 /* MinusToken */) {
171544
+ } else if (node2.questionToken.kind === 41 /* MinusToken */) {
171484
171545
  parts.push({ text: "-" });
171485
171546
  }
171486
171547
  parts.push({ text: "?" });
171487
171548
  }
171488
171549
  parts.push({ text: ": " });
171489
- if (node.type) {
171490
- visitForDisplayParts(node.type);
171550
+ if (node2.type) {
171551
+ visitForDisplayParts(node2.type);
171491
171552
  }
171492
171553
  parts.push({ text: "; }" });
171493
171554
  break;
171494
171555
  case 201 /* LiteralType */:
171495
- Debug.assertNode(node, isLiteralTypeNode);
171496
- visitForDisplayParts(node.literal);
171556
+ Debug.assertNode(node2, isLiteralTypeNode);
171557
+ visitForDisplayParts(node2.literal);
171497
171558
  break;
171498
171559
  case 184 /* FunctionType */:
171499
- Debug.assertNode(node, isFunctionTypeNode);
171500
- visitParametersAndTypeParameters(node);
171560
+ Debug.assertNode(node2, isFunctionTypeNode);
171561
+ visitParametersAndTypeParameters(node2);
171501
171562
  parts.push({ text: " => " });
171502
- visitForDisplayParts(node.type);
171563
+ visitForDisplayParts(node2.type);
171503
171564
  break;
171504
171565
  case 205 /* ImportType */:
171505
- Debug.assertNode(node, isImportTypeNode);
171506
- if (node.isTypeOf) {
171566
+ Debug.assertNode(node2, isImportTypeNode);
171567
+ if (node2.isTypeOf) {
171507
171568
  parts.push({ text: "typeof " });
171508
171569
  }
171509
171570
  parts.push({ text: "import(" });
171510
- visitForDisplayParts(node.argument);
171511
- if (node.assertions) {
171571
+ visitForDisplayParts(node2.argument);
171572
+ if (node2.assertions) {
171512
171573
  parts.push({ text: ", { assert: " });
171513
- visitDisplayPartList(node.assertions.assertClause.elements, ", ");
171574
+ visitDisplayPartList(node2.assertions.assertClause.elements, ", ");
171514
171575
  parts.push({ text: " }" });
171515
171576
  }
171516
171577
  parts.push({ text: ")" });
171517
- if (node.qualifier) {
171578
+ if (node2.qualifier) {
171518
171579
  parts.push({ text: "." });
171519
- visitForDisplayParts(node.qualifier);
171580
+ visitForDisplayParts(node2.qualifier);
171520
171581
  }
171521
- if (node.typeArguments) {
171582
+ if (node2.typeArguments) {
171522
171583
  parts.push({ text: "<" });
171523
- visitDisplayPartList(node.typeArguments, ", ");
171584
+ visitDisplayPartList(node2.typeArguments, ", ");
171524
171585
  parts.push({ text: ">" });
171525
171586
  }
171526
171587
  break;
171527
171588
  case 171 /* PropertySignature */:
171528
- Debug.assertNode(node, isPropertySignature);
171529
- if ((_a = node.modifiers) == null ? void 0 : _a.length) {
171530
- visitDisplayPartList(node.modifiers, " ");
171589
+ Debug.assertNode(node2, isPropertySignature);
171590
+ if ((_a = node2.modifiers) == null ? void 0 : _a.length) {
171591
+ visitDisplayPartList(node2.modifiers, " ");
171531
171592
  parts.push({ text: " " });
171532
171593
  }
171533
- visitForDisplayParts(node.name);
171534
- if (node.questionToken) {
171594
+ visitForDisplayParts(node2.name);
171595
+ if (node2.questionToken) {
171535
171596
  parts.push({ text: "?" });
171536
171597
  }
171537
- if (node.type) {
171598
+ if (node2.type) {
171538
171599
  parts.push({ text: ": " });
171539
- visitForDisplayParts(node.type);
171600
+ visitForDisplayParts(node2.type);
171540
171601
  }
171541
171602
  break;
171542
171603
  case 181 /* IndexSignature */:
171543
- Debug.assertNode(node, isIndexSignatureDeclaration);
171604
+ Debug.assertNode(node2, isIndexSignatureDeclaration);
171544
171605
  parts.push({ text: "[" });
171545
- visitDisplayPartList(node.parameters, ", ");
171606
+ visitDisplayPartList(node2.parameters, ", ");
171546
171607
  parts.push({ text: "]" });
171547
- if (node.type) {
171608
+ if (node2.type) {
171548
171609
  parts.push({ text: ": " });
171549
- visitForDisplayParts(node.type);
171610
+ visitForDisplayParts(node2.type);
171550
171611
  }
171551
171612
  break;
171552
171613
  case 173 /* MethodSignature */:
171553
- Debug.assertNode(node, isMethodSignature);
171554
- if ((_b = node.modifiers) == null ? void 0 : _b.length) {
171555
- visitDisplayPartList(node.modifiers, " ");
171614
+ Debug.assertNode(node2, isMethodSignature);
171615
+ if ((_b = node2.modifiers) == null ? void 0 : _b.length) {
171616
+ visitDisplayPartList(node2.modifiers, " ");
171556
171617
  parts.push({ text: " " });
171557
171618
  }
171558
- visitForDisplayParts(node.name);
171559
- if (node.questionToken) {
171619
+ visitForDisplayParts(node2.name);
171620
+ if (node2.questionToken) {
171560
171621
  parts.push({ text: "?" });
171561
171622
  }
171562
- visitParametersAndTypeParameters(node);
171563
- if (node.type) {
171623
+ visitParametersAndTypeParameters(node2);
171624
+ if (node2.type) {
171564
171625
  parts.push({ text: ": " });
171565
- visitForDisplayParts(node.type);
171626
+ visitForDisplayParts(node2.type);
171566
171627
  }
171567
171628
  break;
171568
171629
  case 179 /* CallSignature */:
171569
- Debug.assertNode(node, isCallSignatureDeclaration);
171570
- visitParametersAndTypeParameters(node);
171571
- if (node.type) {
171630
+ Debug.assertNode(node2, isCallSignatureDeclaration);
171631
+ visitParametersAndTypeParameters(node2);
171632
+ if (node2.type) {
171572
171633
  parts.push({ text: ": " });
171573
- visitForDisplayParts(node.type);
171634
+ visitForDisplayParts(node2.type);
171574
171635
  }
171575
171636
  break;
171576
171637
  case 207 /* ArrayBindingPattern */:
171577
- Debug.assertNode(node, isArrayBindingPattern);
171638
+ Debug.assertNode(node2, isArrayBindingPattern);
171578
171639
  parts.push({ text: "[" });
171579
- visitDisplayPartList(node.elements, ", ");
171640
+ visitDisplayPartList(node2.elements, ", ");
171580
171641
  parts.push({ text: "]" });
171581
171642
  break;
171582
171643
  case 206 /* ObjectBindingPattern */:
171583
- Debug.assertNode(node, isObjectBindingPattern);
171644
+ Debug.assertNode(node2, isObjectBindingPattern);
171584
171645
  parts.push({ text: "{" });
171585
- if (node.elements.length) {
171646
+ if (node2.elements.length) {
171586
171647
  parts.push({ text: " " });
171587
- visitDisplayPartList(node.elements, ", ");
171648
+ visitDisplayPartList(node2.elements, ", ");
171588
171649
  parts.push({ text: " " });
171589
171650
  }
171590
171651
  parts.push({ text: "}" });
171591
171652
  break;
171592
171653
  case 208 /* BindingElement */:
171593
- Debug.assertNode(node, isBindingElement);
171594
- visitForDisplayParts(node.name);
171654
+ Debug.assertNode(node2, isBindingElement);
171655
+ visitForDisplayParts(node2.name);
171595
171656
  break;
171596
171657
  case 224 /* PrefixUnaryExpression */:
171597
- Debug.assertNode(node, isPrefixUnaryExpression);
171598
- parts.push({ text: tokenToString(node.operator) });
171599
- visitForDisplayParts(node.operand);
171658
+ Debug.assertNode(node2, isPrefixUnaryExpression);
171659
+ parts.push({ text: tokenToString(node2.operator) });
171660
+ visitForDisplayParts(node2.operand);
171600
171661
  break;
171601
171662
  case 203 /* TemplateLiteralType */:
171602
- Debug.assertNode(node, isTemplateLiteralTypeNode);
171603
- visitForDisplayParts(node.head);
171604
- node.templateSpans.forEach(visitForDisplayParts);
171663
+ Debug.assertNode(node2, isTemplateLiteralTypeNode);
171664
+ visitForDisplayParts(node2.head);
171665
+ node2.templateSpans.forEach(visitForDisplayParts);
171605
171666
  break;
171606
171667
  case 16 /* TemplateHead */:
171607
- Debug.assertNode(node, isTemplateHead);
171608
- parts.push({ text: getLiteralText2(node) });
171668
+ Debug.assertNode(node2, isTemplateHead);
171669
+ parts.push({ text: getLiteralText2(node2) });
171609
171670
  break;
171610
171671
  case 204 /* TemplateLiteralTypeSpan */:
171611
- Debug.assertNode(node, isTemplateLiteralTypeSpan);
171612
- visitForDisplayParts(node.type);
171613
- visitForDisplayParts(node.literal);
171672
+ Debug.assertNode(node2, isTemplateLiteralTypeSpan);
171673
+ visitForDisplayParts(node2.type);
171674
+ visitForDisplayParts(node2.literal);
171614
171675
  break;
171615
171676
  case 17 /* TemplateMiddle */:
171616
- Debug.assertNode(node, isTemplateMiddle);
171617
- parts.push({ text: getLiteralText2(node) });
171677
+ Debug.assertNode(node2, isTemplateMiddle);
171678
+ parts.push({ text: getLiteralText2(node2) });
171618
171679
  break;
171619
171680
  case 18 /* TemplateTail */:
171620
- Debug.assertNode(node, isTemplateTail);
171621
- parts.push({ text: getLiteralText2(node) });
171681
+ Debug.assertNode(node2, isTemplateTail);
171682
+ parts.push({ text: getLiteralText2(node2) });
171622
171683
  break;
171623
171684
  case 197 /* ThisType */:
171624
- Debug.assertNode(node, isThisTypeNode);
171685
+ Debug.assertNode(node2, isThisTypeNode);
171625
171686
  parts.push({ text: "this" });
171626
171687
  break;
171627
171688
  default:
171628
- Debug.failBadSyntaxKind(node);
171689
+ Debug.failBadSyntaxKind(node2);
171629
171690
  }
171630
171691
  }
171631
171692
  function visitParametersAndTypeParameters(signatureDeclaration) {
@@ -171639,22 +171700,22 @@ function provideInlayHints(context) {
171639
171700
  parts.push({ text: ")" });
171640
171701
  }
171641
171702
  function visitDisplayPartList(nodes, separator) {
171642
- nodes.forEach((node, index) => {
171703
+ nodes.forEach((node2, index) => {
171643
171704
  if (index > 0) {
171644
171705
  parts.push({ text: separator });
171645
171706
  }
171646
- visitForDisplayParts(node);
171707
+ visitForDisplayParts(node2);
171647
171708
  });
171648
171709
  }
171649
- function getLiteralText2(node) {
171650
- switch (node.kind) {
171710
+ function getLiteralText2(node2) {
171711
+ switch (node2.kind) {
171651
171712
  case 11 /* StringLiteral */:
171652
- return quotePreference === 0 /* Single */ ? `'${escapeString(node.text, 39 /* singleQuote */)}'` : `"${escapeString(node.text, 34 /* doubleQuote */)}"`;
171713
+ return quotePreference === 0 /* Single */ ? `'${escapeString(node2.text, 39 /* singleQuote */)}'` : `"${escapeString(node2.text, 34 /* doubleQuote */)}"`;
171653
171714
  case 16 /* TemplateHead */:
171654
171715
  case 17 /* TemplateMiddle */:
171655
171716
  case 18 /* TemplateTail */: {
171656
- const rawText = node.rawText ?? escapeTemplateSubstitution(escapeString(node.text, 96 /* backtick */));
171657
- switch (node.kind) {
171717
+ const rawText = node2.rawText ?? escapeTemplateSubstitution(escapeString(node2.text, 96 /* backtick */));
171718
+ switch (node2.kind) {
171658
171719
  case 16 /* TemplateHead */:
171659
171720
  return "`" + rawText + "${";
171660
171721
  case 17 /* TemplateMiddle */:
@@ -171664,7 +171725,7 @@ function provideInlayHints(context) {
171664
171725
  }
171665
171726
  }
171666
171727
  }
171667
- return node.text;
171728
+ return node2.text;
171668
171729
  }
171669
171730
  }
171670
171731
  function isUndefined(name) {