@typescript-deploys/pr-build 5.1.0-pr-54121-5 → 5.1.0-pr-53996-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/tsc.js CHANGED
@@ -42861,7 +42861,24 @@ function createTypeChecker(host) {
42861
42861
  getTypeOfPropertyOfContextualType,
42862
42862
  getFullyQualifiedName,
42863
42863
  getResolvedSignature: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */),
42864
- getCandidateSignaturesForStringLiteralCompletions,
42864
+ getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray, checkMode = 32 /* IsForStringLiteralArgumentCompletions */) => {
42865
+ if (checkMode & 32 /* IsForStringLiteralArgumentCompletions */) {
42866
+ return runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker(
42867
+ call,
42868
+ candidatesOutArray,
42869
+ /*argumentCount*/
42870
+ void 0,
42871
+ checkMode & ~32 /* IsForStringLiteralArgumentCompletions */
42872
+ ));
42873
+ }
42874
+ return runWithoutResolvedSignatureCaching(editingArgument, () => getResolvedSignatureWorker(
42875
+ call,
42876
+ candidatesOutArray,
42877
+ /*argumentCount*/
42878
+ void 0,
42879
+ checkMode & ~32 /* IsForStringLiteralArgumentCompletions */
42880
+ ));
42881
+ },
42865
42882
  getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */)),
42866
42883
  getExpandedParameters,
42867
42884
  hasEffectiveRestParameter,
@@ -43060,44 +43077,17 @@ function createTypeChecker(host) {
43060
43077
  isTypeParameterPossiblyReferenced,
43061
43078
  typeHasCallOrConstructSignatures
43062
43079
  };
43063
- function getCandidateSignaturesForStringLiteralCompletions(call, editingArgument) {
43064
- const candidatesSet = /* @__PURE__ */ new Set();
43065
- const candidates = [];
43066
- runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker(
43067
- call,
43068
- candidates,
43069
- /*argumentCount*/
43070
- void 0,
43071
- 32 /* IsForStringLiteralArgumentCompletions */
43072
- ));
43073
- for (const candidate of candidates) {
43074
- candidatesSet.add(candidate);
43075
- }
43076
- candidates.length = 0;
43077
- runWithoutResolvedSignatureCaching(editingArgument, () => getResolvedSignatureWorker(
43078
- call,
43079
- candidates,
43080
- /*argumentCount*/
43081
- void 0,
43082
- 32 /* IsForStringLiteralArgumentCompletions */
43083
- ));
43084
- for (const candidate of candidates) {
43085
- candidatesSet.add(candidate);
43086
- }
43087
- return arrayFrom(candidatesSet);
43088
- }
43089
43080
  function runWithoutResolvedSignatureCaching(node, fn) {
43090
43081
  const containingCall = findAncestor(node, isCallLikeExpression);
43082
+ const containingCallResolvedSignature = containingCall && getNodeLinks(containingCall).resolvedSignature;
43091
43083
  if (containingCall) {
43092
- const links = getNodeLinks(containingCall);
43093
- const containingCallResolvedSignature = links.resolvedSignature;
43094
- links.resolvedSignature = void 0;
43095
- const result = fn();
43096
- links.resolvedSignature = containingCallResolvedSignature;
43097
- return result;
43098
- } else {
43099
- return fn();
43084
+ getNodeLinks(containingCall).resolvedSignature = void 0;
43100
43085
  }
43086
+ const result = fn();
43087
+ if (containingCall) {
43088
+ getNodeLinks(containingCall).resolvedSignature = containingCallResolvedSignature;
43089
+ }
43090
+ return result;
43101
43091
  }
43102
43092
  function runWithInferenceBlockedFromSourceNode(node, fn) {
43103
43093
  const containingCall = findAncestor(node, isCallLikeExpression);
@@ -63631,7 +63621,7 @@ function createTypeChecker(host) {
63631
63621
  const constraint = getConstraintOfTypeParameter(inference.typeParameter);
63632
63622
  if (constraint) {
63633
63623
  const instantiatedConstraint = instantiateType(constraint, context.nonFixingMapper);
63634
- if (!inferredType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
63624
+ if (!inferredType || inferredType === wildcardType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
63635
63625
  inference.inferredType = fallbackType && context.compareTypes(fallbackType, getTypeWithThisArgument(instantiatedConstraint, fallbackType)) ? fallbackType : instantiatedConstraint;
63636
63626
  }
63637
63627
  }
@@ -69537,7 +69527,7 @@ function createTypeChecker(host) {
69537
69527
  }
69538
69528
  for (let i = 0; i < argCount; i++) {
69539
69529
  const arg = args[i];
69540
- if (arg.kind !== 231 /* OmittedExpression */ && !(checkMode & 32 /* IsForStringLiteralArgumentCompletions */ && hasSkipDirectInferenceFlag(arg))) {
69530
+ if (arg.kind !== 231 /* OmittedExpression */) {
69541
69531
  const paramType = getTypeAtPosition(signature, i);
69542
69532
  if (couldContainTypeVariables(paramType)) {
69543
69533
  const argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);
@@ -70149,7 +70139,6 @@ function createTypeChecker(host) {
70149
70139
  const args = getEffectiveCallArguments(node);
70150
70140
  const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters;
70151
70141
  let argCheckMode = !isDecorator2 && !isSingleNonGenericCandidate && some(args, isContextSensitive) ? 4 /* SkipContextSensitive */ : 0 /* Normal */;
70152
- argCheckMode |= checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
70153
70142
  let candidatesForArgumentError;
70154
70143
  let candidateForArgumentArityError;
70155
70144
  let candidateForTypeArgumentError;
@@ -70373,7 +70362,7 @@ function createTypeChecker(host) {
70373
70362
  continue;
70374
70363
  }
70375
70364
  if (argCheckMode) {
70376
- argCheckMode = checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
70365
+ argCheckMode = 0 /* Normal */;
70377
70366
  if (inferenceContext) {
70378
70367
  const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext);
70379
70368
  checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext.inferredTypeParameters);
@@ -74211,7 +74200,7 @@ function createTypeChecker(host) {
74211
74200
  return nullWideningType;
74212
74201
  case 15 /* NoSubstitutionTemplateLiteral */:
74213
74202
  case 11 /* StringLiteral */:
74214
- return hasSkipDirectInferenceFlag(node) ? anyType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
74203
+ return hasSkipDirectInferenceFlag(node) ? wildcardType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
74215
74204
  case 9 /* NumericLiteral */:
74216
74205
  checkGrammarNumericLiteral(node);
74217
74206
  return getFreshTypeOfLiteralType(getNumberLiteralType(+node.text));
package/lib/tsserver.js CHANGED
@@ -47290,7 +47290,7 @@ function createTypeChecker(host) {
47290
47290
  var externalHelpersModule;
47291
47291
  var Symbol47 = objectAllocator.getSymbolConstructor();
47292
47292
  var Type27 = objectAllocator.getTypeConstructor();
47293
- var Signature14 = objectAllocator.getSignatureConstructor();
47293
+ var Signature15 = objectAllocator.getSignatureConstructor();
47294
47294
  var typeCount = 0;
47295
47295
  var symbolCount = 0;
47296
47296
  var totalInstantiationCount = 0;
@@ -47511,7 +47511,24 @@ function createTypeChecker(host) {
47511
47511
  getTypeOfPropertyOfContextualType,
47512
47512
  getFullyQualifiedName,
47513
47513
  getResolvedSignature: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */),
47514
- getCandidateSignaturesForStringLiteralCompletions,
47514
+ getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray, checkMode = 32 /* IsForStringLiteralArgumentCompletions */) => {
47515
+ if (checkMode & 32 /* IsForStringLiteralArgumentCompletions */) {
47516
+ return runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker(
47517
+ call,
47518
+ candidatesOutArray,
47519
+ /*argumentCount*/
47520
+ void 0,
47521
+ checkMode & ~32 /* IsForStringLiteralArgumentCompletions */
47522
+ ));
47523
+ }
47524
+ return runWithoutResolvedSignatureCaching(editingArgument, () => getResolvedSignatureWorker(
47525
+ call,
47526
+ candidatesOutArray,
47527
+ /*argumentCount*/
47528
+ void 0,
47529
+ checkMode & ~32 /* IsForStringLiteralArgumentCompletions */
47530
+ ));
47531
+ },
47515
47532
  getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */)),
47516
47533
  getExpandedParameters,
47517
47534
  hasEffectiveRestParameter,
@@ -47710,44 +47727,17 @@ function createTypeChecker(host) {
47710
47727
  isTypeParameterPossiblyReferenced,
47711
47728
  typeHasCallOrConstructSignatures
47712
47729
  };
47713
- function getCandidateSignaturesForStringLiteralCompletions(call, editingArgument) {
47714
- const candidatesSet = /* @__PURE__ */ new Set();
47715
- const candidates = [];
47716
- runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker(
47717
- call,
47718
- candidates,
47719
- /*argumentCount*/
47720
- void 0,
47721
- 32 /* IsForStringLiteralArgumentCompletions */
47722
- ));
47723
- for (const candidate of candidates) {
47724
- candidatesSet.add(candidate);
47725
- }
47726
- candidates.length = 0;
47727
- runWithoutResolvedSignatureCaching(editingArgument, () => getResolvedSignatureWorker(
47728
- call,
47729
- candidates,
47730
- /*argumentCount*/
47731
- void 0,
47732
- 32 /* IsForStringLiteralArgumentCompletions */
47733
- ));
47734
- for (const candidate of candidates) {
47735
- candidatesSet.add(candidate);
47736
- }
47737
- return arrayFrom(candidatesSet);
47738
- }
47739
47730
  function runWithoutResolvedSignatureCaching(node, fn) {
47740
47731
  const containingCall = findAncestor(node, isCallLikeExpression);
47732
+ const containingCallResolvedSignature = containingCall && getNodeLinks(containingCall).resolvedSignature;
47741
47733
  if (containingCall) {
47742
- const links = getNodeLinks(containingCall);
47743
- const containingCallResolvedSignature = links.resolvedSignature;
47744
- links.resolvedSignature = void 0;
47745
- const result = fn();
47746
- links.resolvedSignature = containingCallResolvedSignature;
47747
- return result;
47748
- } else {
47749
- return fn();
47734
+ getNodeLinks(containingCall).resolvedSignature = void 0;
47750
47735
  }
47736
+ const result = fn();
47737
+ if (containingCall) {
47738
+ getNodeLinks(containingCall).resolvedSignature = containingCallResolvedSignature;
47739
+ }
47740
+ return result;
47751
47741
  }
47752
47742
  function runWithInferenceBlockedFromSourceNode(node, fn) {
47753
47743
  const containingCall = findAncestor(node, isCallLikeExpression);
@@ -57351,7 +57341,7 @@ function createTypeChecker(host) {
57351
57341
  resolveObjectTypeMembers(type, source, typeParameters, paddedTypeArguments);
57352
57342
  }
57353
57343
  function createSignature(declaration, typeParameters, thisParameter, parameters, resolvedReturnType, resolvedTypePredicate, minArgumentCount, flags) {
57354
- const sig = new Signature14(checker, flags);
57344
+ const sig = new Signature15(checker, flags);
57355
57345
  sig.declaration = declaration;
57356
57346
  sig.typeParameters = typeParameters;
57357
57347
  sig.parameters = parameters;
@@ -68281,7 +68271,7 @@ function createTypeChecker(host) {
68281
68271
  const constraint = getConstraintOfTypeParameter(inference.typeParameter);
68282
68272
  if (constraint) {
68283
68273
  const instantiatedConstraint = instantiateType(constraint, context.nonFixingMapper);
68284
- if (!inferredType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
68274
+ if (!inferredType || inferredType === wildcardType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
68285
68275
  inference.inferredType = fallbackType && context.compareTypes(fallbackType, getTypeWithThisArgument(instantiatedConstraint, fallbackType)) ? fallbackType : instantiatedConstraint;
68286
68276
  }
68287
68277
  }
@@ -74187,7 +74177,7 @@ function createTypeChecker(host) {
74187
74177
  }
74188
74178
  for (let i = 0; i < argCount; i++) {
74189
74179
  const arg = args[i];
74190
- if (arg.kind !== 231 /* OmittedExpression */ && !(checkMode & 32 /* IsForStringLiteralArgumentCompletions */ && hasSkipDirectInferenceFlag(arg))) {
74180
+ if (arg.kind !== 231 /* OmittedExpression */) {
74191
74181
  const paramType = getTypeAtPosition(signature, i);
74192
74182
  if (couldContainTypeVariables(paramType)) {
74193
74183
  const argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);
@@ -74799,7 +74789,6 @@ function createTypeChecker(host) {
74799
74789
  const args = getEffectiveCallArguments(node);
74800
74790
  const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters;
74801
74791
  let argCheckMode = !isDecorator2 && !isSingleNonGenericCandidate && some(args, isContextSensitive) ? 4 /* SkipContextSensitive */ : 0 /* Normal */;
74802
- argCheckMode |= checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
74803
74792
  let candidatesForArgumentError;
74804
74793
  let candidateForArgumentArityError;
74805
74794
  let candidateForTypeArgumentError;
@@ -75023,7 +75012,7 @@ function createTypeChecker(host) {
75023
75012
  continue;
75024
75013
  }
75025
75014
  if (argCheckMode) {
75026
- argCheckMode = checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
75015
+ argCheckMode = 0 /* Normal */;
75027
75016
  if (inferenceContext) {
75028
75017
  const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext);
75029
75018
  checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext.inferredTypeParameters);
@@ -78861,7 +78850,7 @@ function createTypeChecker(host) {
78861
78850
  return nullWideningType;
78862
78851
  case 15 /* NoSubstitutionTemplateLiteral */:
78863
78852
  case 11 /* StringLiteral */:
78864
- return hasSkipDirectInferenceFlag(node) ? anyType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
78853
+ return hasSkipDirectInferenceFlag(node) ? wildcardType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
78865
78854
  case 9 /* NumericLiteral */:
78866
78855
  checkGrammarNumericLiteral(node);
78867
78856
  return getFreshTypeOfLiteralType(getNumberLiteralType(+node.text));
@@ -158589,7 +158578,7 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, typeCheck
158589
158578
  case 290 /* JsxAttribute */:
158590
158579
  if (!isRequireCallArgument(node) && !isImportCall(parent2)) {
158591
158580
  const argumentInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(parent2.kind === 290 /* JsxAttribute */ ? parent2.parent : node, position, sourceFile);
158592
- return argumentInfo && getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker) || fromContextualType();
158581
+ return argumentInfo && (getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker) || getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker, 0 /* Normal */)) || fromContextualType();
158593
158582
  }
158594
158583
  case 271 /* ImportDeclaration */:
158595
158584
  case 277 /* ExportDeclaration */:
@@ -158658,11 +158647,12 @@ function walkUpParentheses(node) {
158658
158647
  function getAlreadyUsedTypesInStringLiteralUnion(union, current) {
158659
158648
  return mapDefined(union.types, (type) => type !== current && isLiteralTypeNode(type) && isStringLiteral(type.literal) ? type.literal.text : void 0);
158660
158649
  }
158661
- function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker) {
158650
+ function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker, checkMode = 32 /* IsForStringLiteralArgumentCompletions */) {
158662
158651
  let isNewIdentifier = false;
158663
158652
  const uniques = /* @__PURE__ */ new Map();
158653
+ const candidates = [];
158664
158654
  const editingArgument = isJsxOpeningLikeElement(call) ? Debug.checkDefined(findAncestor(arg.parent, isJsxAttribute)) : arg;
158665
- const candidates = checker.getCandidateSignaturesForStringLiteralCompletions(call, editingArgument);
158655
+ checker.getResolvedSignatureForStringLiteralCompletions(call, editingArgument, candidates, checkMode);
158666
158656
  const types = flatMap(candidates, (candidate) => {
158667
158657
  if (!signatureHasRestParameter(candidate) && argumentInfo.argumentCount > candidate.parameters.length)
158668
158658
  return;
@@ -45082,7 +45082,7 @@ ${lanes.join("\n")}
45082
45082
  var externalHelpersModule;
45083
45083
  var Symbol47 = objectAllocator.getSymbolConstructor();
45084
45084
  var Type27 = objectAllocator.getTypeConstructor();
45085
- var Signature14 = objectAllocator.getSignatureConstructor();
45085
+ var Signature15 = objectAllocator.getSignatureConstructor();
45086
45086
  var typeCount = 0;
45087
45087
  var symbolCount = 0;
45088
45088
  var totalInstantiationCount = 0;
@@ -45303,7 +45303,24 @@ ${lanes.join("\n")}
45303
45303
  getTypeOfPropertyOfContextualType,
45304
45304
  getFullyQualifiedName,
45305
45305
  getResolvedSignature: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */),
45306
- getCandidateSignaturesForStringLiteralCompletions,
45306
+ getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray, checkMode = 32 /* IsForStringLiteralArgumentCompletions */) => {
45307
+ if (checkMode & 32 /* IsForStringLiteralArgumentCompletions */) {
45308
+ return runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker(
45309
+ call,
45310
+ candidatesOutArray,
45311
+ /*argumentCount*/
45312
+ void 0,
45313
+ checkMode & ~32 /* IsForStringLiteralArgumentCompletions */
45314
+ ));
45315
+ }
45316
+ return runWithoutResolvedSignatureCaching(editingArgument, () => getResolvedSignatureWorker(
45317
+ call,
45318
+ candidatesOutArray,
45319
+ /*argumentCount*/
45320
+ void 0,
45321
+ checkMode & ~32 /* IsForStringLiteralArgumentCompletions */
45322
+ ));
45323
+ },
45307
45324
  getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */)),
45308
45325
  getExpandedParameters,
45309
45326
  hasEffectiveRestParameter,
@@ -45502,44 +45519,17 @@ ${lanes.join("\n")}
45502
45519
  isTypeParameterPossiblyReferenced,
45503
45520
  typeHasCallOrConstructSignatures
45504
45521
  };
45505
- function getCandidateSignaturesForStringLiteralCompletions(call, editingArgument) {
45506
- const candidatesSet = /* @__PURE__ */ new Set();
45507
- const candidates = [];
45508
- runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker(
45509
- call,
45510
- candidates,
45511
- /*argumentCount*/
45512
- void 0,
45513
- 32 /* IsForStringLiteralArgumentCompletions */
45514
- ));
45515
- for (const candidate of candidates) {
45516
- candidatesSet.add(candidate);
45517
- }
45518
- candidates.length = 0;
45519
- runWithoutResolvedSignatureCaching(editingArgument, () => getResolvedSignatureWorker(
45520
- call,
45521
- candidates,
45522
- /*argumentCount*/
45523
- void 0,
45524
- 32 /* IsForStringLiteralArgumentCompletions */
45525
- ));
45526
- for (const candidate of candidates) {
45527
- candidatesSet.add(candidate);
45528
- }
45529
- return arrayFrom(candidatesSet);
45530
- }
45531
45522
  function runWithoutResolvedSignatureCaching(node, fn) {
45532
45523
  const containingCall = findAncestor(node, isCallLikeExpression);
45524
+ const containingCallResolvedSignature = containingCall && getNodeLinks(containingCall).resolvedSignature;
45533
45525
  if (containingCall) {
45534
- const links = getNodeLinks(containingCall);
45535
- const containingCallResolvedSignature = links.resolvedSignature;
45536
- links.resolvedSignature = void 0;
45537
- const result = fn();
45538
- links.resolvedSignature = containingCallResolvedSignature;
45539
- return result;
45540
- } else {
45541
- return fn();
45526
+ getNodeLinks(containingCall).resolvedSignature = void 0;
45542
45527
  }
45528
+ const result = fn();
45529
+ if (containingCall) {
45530
+ getNodeLinks(containingCall).resolvedSignature = containingCallResolvedSignature;
45531
+ }
45532
+ return result;
45543
45533
  }
45544
45534
  function runWithInferenceBlockedFromSourceNode(node, fn) {
45545
45535
  const containingCall = findAncestor(node, isCallLikeExpression);
@@ -55143,7 +55133,7 @@ ${lanes.join("\n")}
55143
55133
  resolveObjectTypeMembers(type, source, typeParameters, paddedTypeArguments);
55144
55134
  }
55145
55135
  function createSignature(declaration, typeParameters, thisParameter, parameters, resolvedReturnType, resolvedTypePredicate, minArgumentCount, flags) {
55146
- const sig = new Signature14(checker, flags);
55136
+ const sig = new Signature15(checker, flags);
55147
55137
  sig.declaration = declaration;
55148
55138
  sig.typeParameters = typeParameters;
55149
55139
  sig.parameters = parameters;
@@ -66073,7 +66063,7 @@ ${lanes.join("\n")}
66073
66063
  const constraint = getConstraintOfTypeParameter(inference.typeParameter);
66074
66064
  if (constraint) {
66075
66065
  const instantiatedConstraint = instantiateType(constraint, context.nonFixingMapper);
66076
- if (!inferredType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
66066
+ if (!inferredType || inferredType === wildcardType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
66077
66067
  inference.inferredType = fallbackType && context.compareTypes(fallbackType, getTypeWithThisArgument(instantiatedConstraint, fallbackType)) ? fallbackType : instantiatedConstraint;
66078
66068
  }
66079
66069
  }
@@ -71979,7 +71969,7 @@ ${lanes.join("\n")}
71979
71969
  }
71980
71970
  for (let i = 0; i < argCount; i++) {
71981
71971
  const arg = args[i];
71982
- if (arg.kind !== 231 /* OmittedExpression */ && !(checkMode & 32 /* IsForStringLiteralArgumentCompletions */ && hasSkipDirectInferenceFlag(arg))) {
71972
+ if (arg.kind !== 231 /* OmittedExpression */) {
71983
71973
  const paramType = getTypeAtPosition(signature, i);
71984
71974
  if (couldContainTypeVariables(paramType)) {
71985
71975
  const argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);
@@ -72591,7 +72581,6 @@ ${lanes.join("\n")}
72591
72581
  const args = getEffectiveCallArguments(node);
72592
72582
  const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters;
72593
72583
  let argCheckMode = !isDecorator2 && !isSingleNonGenericCandidate && some(args, isContextSensitive) ? 4 /* SkipContextSensitive */ : 0 /* Normal */;
72594
- argCheckMode |= checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
72595
72584
  let candidatesForArgumentError;
72596
72585
  let candidateForArgumentArityError;
72597
72586
  let candidateForTypeArgumentError;
@@ -72815,7 +72804,7 @@ ${lanes.join("\n")}
72815
72804
  continue;
72816
72805
  }
72817
72806
  if (argCheckMode) {
72818
- argCheckMode = checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
72807
+ argCheckMode = 0 /* Normal */;
72819
72808
  if (inferenceContext) {
72820
72809
  const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext);
72821
72810
  checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext.inferredTypeParameters);
@@ -76653,7 +76642,7 @@ ${lanes.join("\n")}
76653
76642
  return nullWideningType;
76654
76643
  case 15 /* NoSubstitutionTemplateLiteral */:
76655
76644
  case 11 /* StringLiteral */:
76656
- return hasSkipDirectInferenceFlag(node) ? anyType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
76645
+ return hasSkipDirectInferenceFlag(node) ? wildcardType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
76657
76646
  case 9 /* NumericLiteral */:
76658
76647
  checkGrammarNumericLiteral(node);
76659
76648
  return getFreshTypeOfLiteralType(getNumberLiteralType(+node.text));
@@ -157865,7 +157854,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
157865
157854
  case 290 /* JsxAttribute */:
157866
157855
  if (!isRequireCallArgument(node) && !isImportCall(parent2)) {
157867
157856
  const argumentInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(parent2.kind === 290 /* JsxAttribute */ ? parent2.parent : node, position, sourceFile);
157868
- return argumentInfo && getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker) || fromContextualType();
157857
+ return argumentInfo && (getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker) || getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker, 0 /* Normal */)) || fromContextualType();
157869
157858
  }
157870
157859
  case 271 /* ImportDeclaration */:
157871
157860
  case 277 /* ExportDeclaration */:
@@ -157934,11 +157923,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
157934
157923
  function getAlreadyUsedTypesInStringLiteralUnion(union, current) {
157935
157924
  return mapDefined(union.types, (type) => type !== current && isLiteralTypeNode(type) && isStringLiteral(type.literal) ? type.literal.text : void 0);
157936
157925
  }
157937
- function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker) {
157926
+ function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker, checkMode = 32 /* IsForStringLiteralArgumentCompletions */) {
157938
157927
  let isNewIdentifier = false;
157939
157928
  const uniques = /* @__PURE__ */ new Map();
157929
+ const candidates = [];
157940
157930
  const editingArgument = isJsxOpeningLikeElement(call) ? Debug.checkDefined(findAncestor(arg.parent, isJsxAttribute)) : arg;
157941
- const candidates = checker.getCandidateSignaturesForStringLiteralCompletions(call, editingArgument);
157931
+ checker.getResolvedSignatureForStringLiteralCompletions(call, editingArgument, candidates, checkMode);
157942
157932
  const types = flatMap(candidates, (candidate) => {
157943
157933
  if (!signatureHasRestParameter(candidate) && argumentInfo.argumentCount > candidate.parameters.length)
157944
157934
  return;
package/lib/typescript.js CHANGED
@@ -45082,7 +45082,7 @@ ${lanes.join("\n")}
45082
45082
  var externalHelpersModule;
45083
45083
  var Symbol47 = objectAllocator.getSymbolConstructor();
45084
45084
  var Type27 = objectAllocator.getTypeConstructor();
45085
- var Signature14 = objectAllocator.getSignatureConstructor();
45085
+ var Signature15 = objectAllocator.getSignatureConstructor();
45086
45086
  var typeCount = 0;
45087
45087
  var symbolCount = 0;
45088
45088
  var totalInstantiationCount = 0;
@@ -45303,7 +45303,24 @@ ${lanes.join("\n")}
45303
45303
  getTypeOfPropertyOfContextualType,
45304
45304
  getFullyQualifiedName,
45305
45305
  getResolvedSignature: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */),
45306
- getCandidateSignaturesForStringLiteralCompletions,
45306
+ getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray, checkMode = 32 /* IsForStringLiteralArgumentCompletions */) => {
45307
+ if (checkMode & 32 /* IsForStringLiteralArgumentCompletions */) {
45308
+ return runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker(
45309
+ call,
45310
+ candidatesOutArray,
45311
+ /*argumentCount*/
45312
+ void 0,
45313
+ checkMode & ~32 /* IsForStringLiteralArgumentCompletions */
45314
+ ));
45315
+ }
45316
+ return runWithoutResolvedSignatureCaching(editingArgument, () => getResolvedSignatureWorker(
45317
+ call,
45318
+ candidatesOutArray,
45319
+ /*argumentCount*/
45320
+ void 0,
45321
+ checkMode & ~32 /* IsForStringLiteralArgumentCompletions */
45322
+ ));
45323
+ },
45307
45324
  getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */)),
45308
45325
  getExpandedParameters,
45309
45326
  hasEffectiveRestParameter,
@@ -45502,44 +45519,17 @@ ${lanes.join("\n")}
45502
45519
  isTypeParameterPossiblyReferenced,
45503
45520
  typeHasCallOrConstructSignatures
45504
45521
  };
45505
- function getCandidateSignaturesForStringLiteralCompletions(call, editingArgument) {
45506
- const candidatesSet = /* @__PURE__ */ new Set();
45507
- const candidates = [];
45508
- runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker(
45509
- call,
45510
- candidates,
45511
- /*argumentCount*/
45512
- void 0,
45513
- 32 /* IsForStringLiteralArgumentCompletions */
45514
- ));
45515
- for (const candidate of candidates) {
45516
- candidatesSet.add(candidate);
45517
- }
45518
- candidates.length = 0;
45519
- runWithoutResolvedSignatureCaching(editingArgument, () => getResolvedSignatureWorker(
45520
- call,
45521
- candidates,
45522
- /*argumentCount*/
45523
- void 0,
45524
- 32 /* IsForStringLiteralArgumentCompletions */
45525
- ));
45526
- for (const candidate of candidates) {
45527
- candidatesSet.add(candidate);
45528
- }
45529
- return arrayFrom(candidatesSet);
45530
- }
45531
45522
  function runWithoutResolvedSignatureCaching(node, fn) {
45532
45523
  const containingCall = findAncestor(node, isCallLikeExpression);
45524
+ const containingCallResolvedSignature = containingCall && getNodeLinks(containingCall).resolvedSignature;
45533
45525
  if (containingCall) {
45534
- const links = getNodeLinks(containingCall);
45535
- const containingCallResolvedSignature = links.resolvedSignature;
45536
- links.resolvedSignature = void 0;
45537
- const result = fn();
45538
- links.resolvedSignature = containingCallResolvedSignature;
45539
- return result;
45540
- } else {
45541
- return fn();
45526
+ getNodeLinks(containingCall).resolvedSignature = void 0;
45542
45527
  }
45528
+ const result = fn();
45529
+ if (containingCall) {
45530
+ getNodeLinks(containingCall).resolvedSignature = containingCallResolvedSignature;
45531
+ }
45532
+ return result;
45543
45533
  }
45544
45534
  function runWithInferenceBlockedFromSourceNode(node, fn) {
45545
45535
  const containingCall = findAncestor(node, isCallLikeExpression);
@@ -55143,7 +55133,7 @@ ${lanes.join("\n")}
55143
55133
  resolveObjectTypeMembers(type, source, typeParameters, paddedTypeArguments);
55144
55134
  }
55145
55135
  function createSignature(declaration, typeParameters, thisParameter, parameters, resolvedReturnType, resolvedTypePredicate, minArgumentCount, flags) {
55146
- const sig = new Signature14(checker, flags);
55136
+ const sig = new Signature15(checker, flags);
55147
55137
  sig.declaration = declaration;
55148
55138
  sig.typeParameters = typeParameters;
55149
55139
  sig.parameters = parameters;
@@ -66073,7 +66063,7 @@ ${lanes.join("\n")}
66073
66063
  const constraint = getConstraintOfTypeParameter(inference.typeParameter);
66074
66064
  if (constraint) {
66075
66065
  const instantiatedConstraint = instantiateType(constraint, context.nonFixingMapper);
66076
- if (!inferredType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
66066
+ if (!inferredType || inferredType === wildcardType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
66077
66067
  inference.inferredType = fallbackType && context.compareTypes(fallbackType, getTypeWithThisArgument(instantiatedConstraint, fallbackType)) ? fallbackType : instantiatedConstraint;
66078
66068
  }
66079
66069
  }
@@ -71979,7 +71969,7 @@ ${lanes.join("\n")}
71979
71969
  }
71980
71970
  for (let i = 0; i < argCount; i++) {
71981
71971
  const arg = args[i];
71982
- if (arg.kind !== 231 /* OmittedExpression */ && !(checkMode & 32 /* IsForStringLiteralArgumentCompletions */ && hasSkipDirectInferenceFlag(arg))) {
71972
+ if (arg.kind !== 231 /* OmittedExpression */) {
71983
71973
  const paramType = getTypeAtPosition(signature, i);
71984
71974
  if (couldContainTypeVariables(paramType)) {
71985
71975
  const argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);
@@ -72591,7 +72581,6 @@ ${lanes.join("\n")}
72591
72581
  const args = getEffectiveCallArguments(node);
72592
72582
  const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters;
72593
72583
  let argCheckMode = !isDecorator2 && !isSingleNonGenericCandidate && some(args, isContextSensitive) ? 4 /* SkipContextSensitive */ : 0 /* Normal */;
72594
- argCheckMode |= checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
72595
72584
  let candidatesForArgumentError;
72596
72585
  let candidateForArgumentArityError;
72597
72586
  let candidateForTypeArgumentError;
@@ -72815,7 +72804,7 @@ ${lanes.join("\n")}
72815
72804
  continue;
72816
72805
  }
72817
72806
  if (argCheckMode) {
72818
- argCheckMode = checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
72807
+ argCheckMode = 0 /* Normal */;
72819
72808
  if (inferenceContext) {
72820
72809
  const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext);
72821
72810
  checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext.inferredTypeParameters);
@@ -76653,7 +76642,7 @@ ${lanes.join("\n")}
76653
76642
  return nullWideningType;
76654
76643
  case 15 /* NoSubstitutionTemplateLiteral */:
76655
76644
  case 11 /* StringLiteral */:
76656
- return hasSkipDirectInferenceFlag(node) ? anyType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
76645
+ return hasSkipDirectInferenceFlag(node) ? wildcardType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
76657
76646
  case 9 /* NumericLiteral */:
76658
76647
  checkGrammarNumericLiteral(node);
76659
76648
  return getFreshTypeOfLiteralType(getNumberLiteralType(+node.text));
@@ -157880,7 +157869,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
157880
157869
  case 290 /* JsxAttribute */:
157881
157870
  if (!isRequireCallArgument(node) && !isImportCall(parent2)) {
157882
157871
  const argumentInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(parent2.kind === 290 /* JsxAttribute */ ? parent2.parent : node, position, sourceFile);
157883
- return argumentInfo && getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker) || fromContextualType();
157872
+ return argumentInfo && (getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker) || getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker, 0 /* Normal */)) || fromContextualType();
157884
157873
  }
157885
157874
  case 271 /* ImportDeclaration */:
157886
157875
  case 277 /* ExportDeclaration */:
@@ -157949,11 +157938,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
157949
157938
  function getAlreadyUsedTypesInStringLiteralUnion(union, current) {
157950
157939
  return mapDefined(union.types, (type) => type !== current && isLiteralTypeNode(type) && isStringLiteral(type.literal) ? type.literal.text : void 0);
157951
157940
  }
157952
- function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker) {
157941
+ function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker, checkMode = 32 /* IsForStringLiteralArgumentCompletions */) {
157953
157942
  let isNewIdentifier = false;
157954
157943
  const uniques = /* @__PURE__ */ new Map();
157944
+ const candidates = [];
157955
157945
  const editingArgument = isJsxOpeningLikeElement(call) ? Debug.checkDefined(findAncestor(arg.parent, isJsxAttribute)) : arg;
157956
- const candidates = checker.getCandidateSignaturesForStringLiteralCompletions(call, editingArgument);
157946
+ checker.getResolvedSignatureForStringLiteralCompletions(call, editingArgument, candidates, checkMode);
157957
157947
  const types = flatMap(candidates, (candidate) => {
157958
157948
  if (!signatureHasRestParameter(candidate) && argumentInfo.argumentCount > candidate.parameters.length)
157959
157949
  return;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@typescript-deploys/pr-build",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.1.0-pr-54121-5",
5
+ "version": "5.1.0-pr-53996-2",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -116,5 +116,5 @@
116
116
  "node": "14.21.1",
117
117
  "npm": "8.19.3"
118
118
  },
119
- "gitHead": "6fb2754a018b2bb92b34162d004fa87c6818f514"
119
+ "gitHead": "ea30ea5c580fce9e61c4fb5a04d0181b57efac3e"
120
120
  }