@typescript-deploys/pr-build 5.1.0-pr-53938-7 → 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 +44 -36
- package/lib/tsserver.js +47 -39
- package/lib/tsserverlibrary.js +47 -39
- package/lib/typescript.js +47 -39
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -42861,13 +42861,24 @@ function createTypeChecker(host) {
|
|
|
42861
42861
|
getTypeOfPropertyOfContextualType,
|
|
42862
42862
|
getFullyQualifiedName,
|
|
42863
42863
|
getResolvedSignature: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */),
|
|
42864
|
-
getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray
|
|
42865
|
-
|
|
42866
|
-
|
|
42867
|
-
|
|
42868
|
-
|
|
42869
|
-
|
|
42870
|
-
|
|
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
|
+
},
|
|
42871
42882
|
getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */)),
|
|
42872
42883
|
getExpandedParameters,
|
|
42873
42884
|
hasEffectiveRestParameter,
|
|
@@ -47865,34 +47876,32 @@ function createTypeChecker(host) {
|
|
|
47865
47876
|
const methodDeclaration = signatureToSignatureDeclarationHelper(signature, 172 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken });
|
|
47866
47877
|
typeElements.push(preserveCommentsOn(methodDeclaration));
|
|
47867
47878
|
}
|
|
47868
|
-
if (signatures.length || !optionalToken) {
|
|
47869
|
-
return;
|
|
47870
|
-
}
|
|
47871
|
-
}
|
|
47872
|
-
let propertyTypeNode;
|
|
47873
|
-
if (shouldUsePlaceholderForProperty(propertySymbol, context)) {
|
|
47874
|
-
propertyTypeNode = createElidedInformationPlaceholder(context);
|
|
47875
47879
|
} else {
|
|
47876
|
-
|
|
47877
|
-
|
|
47878
|
-
context
|
|
47880
|
+
let propertyTypeNode;
|
|
47881
|
+
if (shouldUsePlaceholderForProperty(propertySymbol, context)) {
|
|
47882
|
+
propertyTypeNode = createElidedInformationPlaceholder(context);
|
|
47883
|
+
} else {
|
|
47884
|
+
if (propertyIsReverseMapped) {
|
|
47885
|
+
context.reverseMappedStack || (context.reverseMappedStack = []);
|
|
47886
|
+
context.reverseMappedStack.push(propertySymbol);
|
|
47887
|
+
}
|
|
47888
|
+
propertyTypeNode = propertyType ? serializeTypeForDeclaration(context, propertyType, propertySymbol, saveEnclosingDeclaration) : factory.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
47889
|
+
if (propertyIsReverseMapped) {
|
|
47890
|
+
context.reverseMappedStack.pop();
|
|
47891
|
+
}
|
|
47879
47892
|
}
|
|
47880
|
-
|
|
47881
|
-
if (
|
|
47882
|
-
context.
|
|
47893
|
+
const modifiers = isReadonlySymbol(propertySymbol) ? [factory.createToken(148 /* ReadonlyKeyword */)] : void 0;
|
|
47894
|
+
if (modifiers) {
|
|
47895
|
+
context.approximateLength += 9;
|
|
47883
47896
|
}
|
|
47897
|
+
const propertySignature = factory.createPropertySignature(
|
|
47898
|
+
modifiers,
|
|
47899
|
+
propertyName,
|
|
47900
|
+
optionalToken,
|
|
47901
|
+
propertyTypeNode
|
|
47902
|
+
);
|
|
47903
|
+
typeElements.push(preserveCommentsOn(propertySignature));
|
|
47884
47904
|
}
|
|
47885
|
-
const modifiers = isReadonlySymbol(propertySymbol) ? [factory.createToken(148 /* ReadonlyKeyword */)] : void 0;
|
|
47886
|
-
if (modifiers) {
|
|
47887
|
-
context.approximateLength += 9;
|
|
47888
|
-
}
|
|
47889
|
-
const propertySignature = factory.createPropertySignature(
|
|
47890
|
-
modifiers,
|
|
47891
|
-
propertyName,
|
|
47892
|
-
optionalToken,
|
|
47893
|
-
propertyTypeNode
|
|
47894
|
-
);
|
|
47895
|
-
typeElements.push(preserveCommentsOn(propertySignature));
|
|
47896
47905
|
function preserveCommentsOn(node) {
|
|
47897
47906
|
var _a2;
|
|
47898
47907
|
if (some(propertySymbol.declarations, (d) => d.kind === 354 /* JSDocPropertyTag */)) {
|
|
@@ -63612,7 +63621,7 @@ function createTypeChecker(host) {
|
|
|
63612
63621
|
const constraint = getConstraintOfTypeParameter(inference.typeParameter);
|
|
63613
63622
|
if (constraint) {
|
|
63614
63623
|
const instantiatedConstraint = instantiateType(constraint, context.nonFixingMapper);
|
|
63615
|
-
if (!inferredType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
|
|
63624
|
+
if (!inferredType || inferredType === wildcardType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
|
|
63616
63625
|
inference.inferredType = fallbackType && context.compareTypes(fallbackType, getTypeWithThisArgument(instantiatedConstraint, fallbackType)) ? fallbackType : instantiatedConstraint;
|
|
63617
63626
|
}
|
|
63618
63627
|
}
|
|
@@ -69518,7 +69527,7 @@ function createTypeChecker(host) {
|
|
|
69518
69527
|
}
|
|
69519
69528
|
for (let i = 0; i < argCount; i++) {
|
|
69520
69529
|
const arg = args[i];
|
|
69521
|
-
if (arg.kind !== 231 /* OmittedExpression */
|
|
69530
|
+
if (arg.kind !== 231 /* OmittedExpression */) {
|
|
69522
69531
|
const paramType = getTypeAtPosition(signature, i);
|
|
69523
69532
|
if (couldContainTypeVariables(paramType)) {
|
|
69524
69533
|
const argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);
|
|
@@ -70130,7 +70139,6 @@ function createTypeChecker(host) {
|
|
|
70130
70139
|
const args = getEffectiveCallArguments(node);
|
|
70131
70140
|
const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters;
|
|
70132
70141
|
let argCheckMode = !isDecorator2 && !isSingleNonGenericCandidate && some(args, isContextSensitive) ? 4 /* SkipContextSensitive */ : 0 /* Normal */;
|
|
70133
|
-
argCheckMode |= checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
|
|
70134
70142
|
let candidatesForArgumentError;
|
|
70135
70143
|
let candidateForArgumentArityError;
|
|
70136
70144
|
let candidateForTypeArgumentError;
|
|
@@ -70354,7 +70362,7 @@ function createTypeChecker(host) {
|
|
|
70354
70362
|
continue;
|
|
70355
70363
|
}
|
|
70356
70364
|
if (argCheckMode) {
|
|
70357
|
-
argCheckMode =
|
|
70365
|
+
argCheckMode = 0 /* Normal */;
|
|
70358
70366
|
if (inferenceContext) {
|
|
70359
70367
|
const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext);
|
|
70360
70368
|
checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext.inferredTypeParameters);
|
|
@@ -74192,7 +74200,7 @@ function createTypeChecker(host) {
|
|
|
74192
74200
|
return nullWideningType;
|
|
74193
74201
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
74194
74202
|
case 11 /* StringLiteral */:
|
|
74195
|
-
return hasSkipDirectInferenceFlag(node) ?
|
|
74203
|
+
return hasSkipDirectInferenceFlag(node) ? wildcardType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
|
|
74196
74204
|
case 9 /* NumericLiteral */:
|
|
74197
74205
|
checkGrammarNumericLiteral(node);
|
|
74198
74206
|
return getFreshTypeOfLiteralType(getNumberLiteralType(+node.text));
|
package/lib/tsserver.js
CHANGED
|
@@ -47511,13 +47511,24 @@ function createTypeChecker(host) {
|
|
|
47511
47511
|
getTypeOfPropertyOfContextualType,
|
|
47512
47512
|
getFullyQualifiedName,
|
|
47513
47513
|
getResolvedSignature: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */),
|
|
47514
|
-
getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray
|
|
47515
|
-
|
|
47516
|
-
|
|
47517
|
-
|
|
47518
|
-
|
|
47519
|
-
|
|
47520
|
-
|
|
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
|
+
},
|
|
47521
47532
|
getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */)),
|
|
47522
47533
|
getExpandedParameters,
|
|
47523
47534
|
hasEffectiveRestParameter,
|
|
@@ -52515,34 +52526,32 @@ function createTypeChecker(host) {
|
|
|
52515
52526
|
const methodDeclaration = signatureToSignatureDeclarationHelper(signature, 172 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken });
|
|
52516
52527
|
typeElements.push(preserveCommentsOn(methodDeclaration));
|
|
52517
52528
|
}
|
|
52518
|
-
if (signatures.length || !optionalToken) {
|
|
52519
|
-
return;
|
|
52520
|
-
}
|
|
52521
|
-
}
|
|
52522
|
-
let propertyTypeNode;
|
|
52523
|
-
if (shouldUsePlaceholderForProperty(propertySymbol, context)) {
|
|
52524
|
-
propertyTypeNode = createElidedInformationPlaceholder(context);
|
|
52525
52529
|
} else {
|
|
52526
|
-
|
|
52527
|
-
|
|
52528
|
-
context
|
|
52530
|
+
let propertyTypeNode;
|
|
52531
|
+
if (shouldUsePlaceholderForProperty(propertySymbol, context)) {
|
|
52532
|
+
propertyTypeNode = createElidedInformationPlaceholder(context);
|
|
52533
|
+
} else {
|
|
52534
|
+
if (propertyIsReverseMapped) {
|
|
52535
|
+
context.reverseMappedStack || (context.reverseMappedStack = []);
|
|
52536
|
+
context.reverseMappedStack.push(propertySymbol);
|
|
52537
|
+
}
|
|
52538
|
+
propertyTypeNode = propertyType ? serializeTypeForDeclaration(context, propertyType, propertySymbol, saveEnclosingDeclaration) : factory.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
52539
|
+
if (propertyIsReverseMapped) {
|
|
52540
|
+
context.reverseMappedStack.pop();
|
|
52541
|
+
}
|
|
52529
52542
|
}
|
|
52530
|
-
|
|
52531
|
-
if (
|
|
52532
|
-
context.
|
|
52543
|
+
const modifiers = isReadonlySymbol(propertySymbol) ? [factory.createToken(148 /* ReadonlyKeyword */)] : void 0;
|
|
52544
|
+
if (modifiers) {
|
|
52545
|
+
context.approximateLength += 9;
|
|
52533
52546
|
}
|
|
52547
|
+
const propertySignature = factory.createPropertySignature(
|
|
52548
|
+
modifiers,
|
|
52549
|
+
propertyName,
|
|
52550
|
+
optionalToken,
|
|
52551
|
+
propertyTypeNode
|
|
52552
|
+
);
|
|
52553
|
+
typeElements.push(preserveCommentsOn(propertySignature));
|
|
52534
52554
|
}
|
|
52535
|
-
const modifiers = isReadonlySymbol(propertySymbol) ? [factory.createToken(148 /* ReadonlyKeyword */)] : void 0;
|
|
52536
|
-
if (modifiers) {
|
|
52537
|
-
context.approximateLength += 9;
|
|
52538
|
-
}
|
|
52539
|
-
const propertySignature = factory.createPropertySignature(
|
|
52540
|
-
modifiers,
|
|
52541
|
-
propertyName,
|
|
52542
|
-
optionalToken,
|
|
52543
|
-
propertyTypeNode
|
|
52544
|
-
);
|
|
52545
|
-
typeElements.push(preserveCommentsOn(propertySignature));
|
|
52546
52555
|
function preserveCommentsOn(node) {
|
|
52547
52556
|
var _a2;
|
|
52548
52557
|
if (some(propertySymbol.declarations, (d) => d.kind === 354 /* JSDocPropertyTag */)) {
|
|
@@ -68262,7 +68271,7 @@ function createTypeChecker(host) {
|
|
|
68262
68271
|
const constraint = getConstraintOfTypeParameter(inference.typeParameter);
|
|
68263
68272
|
if (constraint) {
|
|
68264
68273
|
const instantiatedConstraint = instantiateType(constraint, context.nonFixingMapper);
|
|
68265
|
-
if (!inferredType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
|
|
68274
|
+
if (!inferredType || inferredType === wildcardType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
|
|
68266
68275
|
inference.inferredType = fallbackType && context.compareTypes(fallbackType, getTypeWithThisArgument(instantiatedConstraint, fallbackType)) ? fallbackType : instantiatedConstraint;
|
|
68267
68276
|
}
|
|
68268
68277
|
}
|
|
@@ -74168,7 +74177,7 @@ function createTypeChecker(host) {
|
|
|
74168
74177
|
}
|
|
74169
74178
|
for (let i = 0; i < argCount; i++) {
|
|
74170
74179
|
const arg = args[i];
|
|
74171
|
-
if (arg.kind !== 231 /* OmittedExpression */
|
|
74180
|
+
if (arg.kind !== 231 /* OmittedExpression */) {
|
|
74172
74181
|
const paramType = getTypeAtPosition(signature, i);
|
|
74173
74182
|
if (couldContainTypeVariables(paramType)) {
|
|
74174
74183
|
const argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);
|
|
@@ -74780,7 +74789,6 @@ function createTypeChecker(host) {
|
|
|
74780
74789
|
const args = getEffectiveCallArguments(node);
|
|
74781
74790
|
const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters;
|
|
74782
74791
|
let argCheckMode = !isDecorator2 && !isSingleNonGenericCandidate && some(args, isContextSensitive) ? 4 /* SkipContextSensitive */ : 0 /* Normal */;
|
|
74783
|
-
argCheckMode |= checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
|
|
74784
74792
|
let candidatesForArgumentError;
|
|
74785
74793
|
let candidateForArgumentArityError;
|
|
74786
74794
|
let candidateForTypeArgumentError;
|
|
@@ -75004,7 +75012,7 @@ function createTypeChecker(host) {
|
|
|
75004
75012
|
continue;
|
|
75005
75013
|
}
|
|
75006
75014
|
if (argCheckMode) {
|
|
75007
|
-
argCheckMode =
|
|
75015
|
+
argCheckMode = 0 /* Normal */;
|
|
75008
75016
|
if (inferenceContext) {
|
|
75009
75017
|
const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext);
|
|
75010
75018
|
checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext.inferredTypeParameters);
|
|
@@ -78842,7 +78850,7 @@ function createTypeChecker(host) {
|
|
|
78842
78850
|
return nullWideningType;
|
|
78843
78851
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
78844
78852
|
case 11 /* StringLiteral */:
|
|
78845
|
-
return hasSkipDirectInferenceFlag(node) ?
|
|
78853
|
+
return hasSkipDirectInferenceFlag(node) ? wildcardType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
|
|
78846
78854
|
case 9 /* NumericLiteral */:
|
|
78847
78855
|
checkGrammarNumericLiteral(node);
|
|
78848
78856
|
return getFreshTypeOfLiteralType(getNumberLiteralType(+node.text));
|
|
@@ -158570,7 +158578,7 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, typeCheck
|
|
|
158570
158578
|
case 290 /* JsxAttribute */:
|
|
158571
158579
|
if (!isRequireCallArgument(node) && !isImportCall(parent2)) {
|
|
158572
158580
|
const argumentInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(parent2.kind === 290 /* JsxAttribute */ ? parent2.parent : node, position, sourceFile);
|
|
158573
|
-
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();
|
|
158574
158582
|
}
|
|
158575
158583
|
case 271 /* ImportDeclaration */:
|
|
158576
158584
|
case 277 /* ExportDeclaration */:
|
|
@@ -158639,12 +158647,12 @@ function walkUpParentheses(node) {
|
|
|
158639
158647
|
function getAlreadyUsedTypesInStringLiteralUnion(union, current) {
|
|
158640
158648
|
return mapDefined(union.types, (type) => type !== current && isLiteralTypeNode(type) && isStringLiteral(type.literal) ? type.literal.text : void 0);
|
|
158641
158649
|
}
|
|
158642
|
-
function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker) {
|
|
158650
|
+
function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker, checkMode = 32 /* IsForStringLiteralArgumentCompletions */) {
|
|
158643
158651
|
let isNewIdentifier = false;
|
|
158644
158652
|
const uniques = /* @__PURE__ */ new Map();
|
|
158645
158653
|
const candidates = [];
|
|
158646
158654
|
const editingArgument = isJsxOpeningLikeElement(call) ? Debug.checkDefined(findAncestor(arg.parent, isJsxAttribute)) : arg;
|
|
158647
|
-
checker.getResolvedSignatureForStringLiteralCompletions(call, editingArgument, candidates);
|
|
158655
|
+
checker.getResolvedSignatureForStringLiteralCompletions(call, editingArgument, candidates, checkMode);
|
|
158648
158656
|
const types = flatMap(candidates, (candidate) => {
|
|
158649
158657
|
if (!signatureHasRestParameter(candidate) && argumentInfo.argumentCount > candidate.parameters.length)
|
|
158650
158658
|
return;
|
package/lib/tsserverlibrary.js
CHANGED
|
@@ -45303,13 +45303,24 @@ ${lanes.join("\n")}
|
|
|
45303
45303
|
getTypeOfPropertyOfContextualType,
|
|
45304
45304
|
getFullyQualifiedName,
|
|
45305
45305
|
getResolvedSignature: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */),
|
|
45306
|
-
getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray
|
|
45307
|
-
|
|
45308
|
-
|
|
45309
|
-
|
|
45310
|
-
|
|
45311
|
-
|
|
45312
|
-
|
|
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
|
+
},
|
|
45313
45324
|
getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */)),
|
|
45314
45325
|
getExpandedParameters,
|
|
45315
45326
|
hasEffectiveRestParameter,
|
|
@@ -50307,34 +50318,32 @@ ${lanes.join("\n")}
|
|
|
50307
50318
|
const methodDeclaration = signatureToSignatureDeclarationHelper(signature, 172 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken });
|
|
50308
50319
|
typeElements.push(preserveCommentsOn(methodDeclaration));
|
|
50309
50320
|
}
|
|
50310
|
-
if (signatures.length || !optionalToken) {
|
|
50311
|
-
return;
|
|
50312
|
-
}
|
|
50313
|
-
}
|
|
50314
|
-
let propertyTypeNode;
|
|
50315
|
-
if (shouldUsePlaceholderForProperty(propertySymbol, context)) {
|
|
50316
|
-
propertyTypeNode = createElidedInformationPlaceholder(context);
|
|
50317
50321
|
} else {
|
|
50318
|
-
|
|
50319
|
-
|
|
50320
|
-
context
|
|
50322
|
+
let propertyTypeNode;
|
|
50323
|
+
if (shouldUsePlaceholderForProperty(propertySymbol, context)) {
|
|
50324
|
+
propertyTypeNode = createElidedInformationPlaceholder(context);
|
|
50325
|
+
} else {
|
|
50326
|
+
if (propertyIsReverseMapped) {
|
|
50327
|
+
context.reverseMappedStack || (context.reverseMappedStack = []);
|
|
50328
|
+
context.reverseMappedStack.push(propertySymbol);
|
|
50329
|
+
}
|
|
50330
|
+
propertyTypeNode = propertyType ? serializeTypeForDeclaration(context, propertyType, propertySymbol, saveEnclosingDeclaration) : factory.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
50331
|
+
if (propertyIsReverseMapped) {
|
|
50332
|
+
context.reverseMappedStack.pop();
|
|
50333
|
+
}
|
|
50321
50334
|
}
|
|
50322
|
-
|
|
50323
|
-
if (
|
|
50324
|
-
context.
|
|
50335
|
+
const modifiers = isReadonlySymbol(propertySymbol) ? [factory.createToken(148 /* ReadonlyKeyword */)] : void 0;
|
|
50336
|
+
if (modifiers) {
|
|
50337
|
+
context.approximateLength += 9;
|
|
50325
50338
|
}
|
|
50339
|
+
const propertySignature = factory.createPropertySignature(
|
|
50340
|
+
modifiers,
|
|
50341
|
+
propertyName,
|
|
50342
|
+
optionalToken,
|
|
50343
|
+
propertyTypeNode
|
|
50344
|
+
);
|
|
50345
|
+
typeElements.push(preserveCommentsOn(propertySignature));
|
|
50326
50346
|
}
|
|
50327
|
-
const modifiers = isReadonlySymbol(propertySymbol) ? [factory.createToken(148 /* ReadonlyKeyword */)] : void 0;
|
|
50328
|
-
if (modifiers) {
|
|
50329
|
-
context.approximateLength += 9;
|
|
50330
|
-
}
|
|
50331
|
-
const propertySignature = factory.createPropertySignature(
|
|
50332
|
-
modifiers,
|
|
50333
|
-
propertyName,
|
|
50334
|
-
optionalToken,
|
|
50335
|
-
propertyTypeNode
|
|
50336
|
-
);
|
|
50337
|
-
typeElements.push(preserveCommentsOn(propertySignature));
|
|
50338
50347
|
function preserveCommentsOn(node) {
|
|
50339
50348
|
var _a2;
|
|
50340
50349
|
if (some(propertySymbol.declarations, (d) => d.kind === 354 /* JSDocPropertyTag */)) {
|
|
@@ -66054,7 +66063,7 @@ ${lanes.join("\n")}
|
|
|
66054
66063
|
const constraint = getConstraintOfTypeParameter(inference.typeParameter);
|
|
66055
66064
|
if (constraint) {
|
|
66056
66065
|
const instantiatedConstraint = instantiateType(constraint, context.nonFixingMapper);
|
|
66057
|
-
if (!inferredType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
|
|
66066
|
+
if (!inferredType || inferredType === wildcardType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
|
|
66058
66067
|
inference.inferredType = fallbackType && context.compareTypes(fallbackType, getTypeWithThisArgument(instantiatedConstraint, fallbackType)) ? fallbackType : instantiatedConstraint;
|
|
66059
66068
|
}
|
|
66060
66069
|
}
|
|
@@ -71960,7 +71969,7 @@ ${lanes.join("\n")}
|
|
|
71960
71969
|
}
|
|
71961
71970
|
for (let i = 0; i < argCount; i++) {
|
|
71962
71971
|
const arg = args[i];
|
|
71963
|
-
if (arg.kind !== 231 /* OmittedExpression */
|
|
71972
|
+
if (arg.kind !== 231 /* OmittedExpression */) {
|
|
71964
71973
|
const paramType = getTypeAtPosition(signature, i);
|
|
71965
71974
|
if (couldContainTypeVariables(paramType)) {
|
|
71966
71975
|
const argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);
|
|
@@ -72572,7 +72581,6 @@ ${lanes.join("\n")}
|
|
|
72572
72581
|
const args = getEffectiveCallArguments(node);
|
|
72573
72582
|
const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters;
|
|
72574
72583
|
let argCheckMode = !isDecorator2 && !isSingleNonGenericCandidate && some(args, isContextSensitive) ? 4 /* SkipContextSensitive */ : 0 /* Normal */;
|
|
72575
|
-
argCheckMode |= checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
|
|
72576
72584
|
let candidatesForArgumentError;
|
|
72577
72585
|
let candidateForArgumentArityError;
|
|
72578
72586
|
let candidateForTypeArgumentError;
|
|
@@ -72796,7 +72804,7 @@ ${lanes.join("\n")}
|
|
|
72796
72804
|
continue;
|
|
72797
72805
|
}
|
|
72798
72806
|
if (argCheckMode) {
|
|
72799
|
-
argCheckMode =
|
|
72807
|
+
argCheckMode = 0 /* Normal */;
|
|
72800
72808
|
if (inferenceContext) {
|
|
72801
72809
|
const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext);
|
|
72802
72810
|
checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext.inferredTypeParameters);
|
|
@@ -76634,7 +76642,7 @@ ${lanes.join("\n")}
|
|
|
76634
76642
|
return nullWideningType;
|
|
76635
76643
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
76636
76644
|
case 11 /* StringLiteral */:
|
|
76637
|
-
return hasSkipDirectInferenceFlag(node) ?
|
|
76645
|
+
return hasSkipDirectInferenceFlag(node) ? wildcardType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
|
|
76638
76646
|
case 9 /* NumericLiteral */:
|
|
76639
76647
|
checkGrammarNumericLiteral(node);
|
|
76640
76648
|
return getFreshTypeOfLiteralType(getNumberLiteralType(+node.text));
|
|
@@ -157846,7 +157854,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
157846
157854
|
case 290 /* JsxAttribute */:
|
|
157847
157855
|
if (!isRequireCallArgument(node) && !isImportCall(parent2)) {
|
|
157848
157856
|
const argumentInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(parent2.kind === 290 /* JsxAttribute */ ? parent2.parent : node, position, sourceFile);
|
|
157849
|
-
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();
|
|
157850
157858
|
}
|
|
157851
157859
|
case 271 /* ImportDeclaration */:
|
|
157852
157860
|
case 277 /* ExportDeclaration */:
|
|
@@ -157915,12 +157923,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
157915
157923
|
function getAlreadyUsedTypesInStringLiteralUnion(union, current) {
|
|
157916
157924
|
return mapDefined(union.types, (type) => type !== current && isLiteralTypeNode(type) && isStringLiteral(type.literal) ? type.literal.text : void 0);
|
|
157917
157925
|
}
|
|
157918
|
-
function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker) {
|
|
157926
|
+
function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker, checkMode = 32 /* IsForStringLiteralArgumentCompletions */) {
|
|
157919
157927
|
let isNewIdentifier = false;
|
|
157920
157928
|
const uniques = /* @__PURE__ */ new Map();
|
|
157921
157929
|
const candidates = [];
|
|
157922
157930
|
const editingArgument = isJsxOpeningLikeElement(call) ? Debug.checkDefined(findAncestor(arg.parent, isJsxAttribute)) : arg;
|
|
157923
|
-
checker.getResolvedSignatureForStringLiteralCompletions(call, editingArgument, candidates);
|
|
157931
|
+
checker.getResolvedSignatureForStringLiteralCompletions(call, editingArgument, candidates, checkMode);
|
|
157924
157932
|
const types = flatMap(candidates, (candidate) => {
|
|
157925
157933
|
if (!signatureHasRestParameter(candidate) && argumentInfo.argumentCount > candidate.parameters.length)
|
|
157926
157934
|
return;
|
package/lib/typescript.js
CHANGED
|
@@ -45303,13 +45303,24 @@ ${lanes.join("\n")}
|
|
|
45303
45303
|
getTypeOfPropertyOfContextualType,
|
|
45304
45304
|
getFullyQualifiedName,
|
|
45305
45305
|
getResolvedSignature: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */),
|
|
45306
|
-
getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray
|
|
45307
|
-
|
|
45308
|
-
|
|
45309
|
-
|
|
45310
|
-
|
|
45311
|
-
|
|
45312
|
-
|
|
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
|
+
},
|
|
45313
45324
|
getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */)),
|
|
45314
45325
|
getExpandedParameters,
|
|
45315
45326
|
hasEffectiveRestParameter,
|
|
@@ -50307,34 +50318,32 @@ ${lanes.join("\n")}
|
|
|
50307
50318
|
const methodDeclaration = signatureToSignatureDeclarationHelper(signature, 172 /* MethodSignature */, context, { name: propertyName, questionToken: optionalToken });
|
|
50308
50319
|
typeElements.push(preserveCommentsOn(methodDeclaration));
|
|
50309
50320
|
}
|
|
50310
|
-
if (signatures.length || !optionalToken) {
|
|
50311
|
-
return;
|
|
50312
|
-
}
|
|
50313
|
-
}
|
|
50314
|
-
let propertyTypeNode;
|
|
50315
|
-
if (shouldUsePlaceholderForProperty(propertySymbol, context)) {
|
|
50316
|
-
propertyTypeNode = createElidedInformationPlaceholder(context);
|
|
50317
50321
|
} else {
|
|
50318
|
-
|
|
50319
|
-
|
|
50320
|
-
context
|
|
50322
|
+
let propertyTypeNode;
|
|
50323
|
+
if (shouldUsePlaceholderForProperty(propertySymbol, context)) {
|
|
50324
|
+
propertyTypeNode = createElidedInformationPlaceholder(context);
|
|
50325
|
+
} else {
|
|
50326
|
+
if (propertyIsReverseMapped) {
|
|
50327
|
+
context.reverseMappedStack || (context.reverseMappedStack = []);
|
|
50328
|
+
context.reverseMappedStack.push(propertySymbol);
|
|
50329
|
+
}
|
|
50330
|
+
propertyTypeNode = propertyType ? serializeTypeForDeclaration(context, propertyType, propertySymbol, saveEnclosingDeclaration) : factory.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
50331
|
+
if (propertyIsReverseMapped) {
|
|
50332
|
+
context.reverseMappedStack.pop();
|
|
50333
|
+
}
|
|
50321
50334
|
}
|
|
50322
|
-
|
|
50323
|
-
if (
|
|
50324
|
-
context.
|
|
50335
|
+
const modifiers = isReadonlySymbol(propertySymbol) ? [factory.createToken(148 /* ReadonlyKeyword */)] : void 0;
|
|
50336
|
+
if (modifiers) {
|
|
50337
|
+
context.approximateLength += 9;
|
|
50325
50338
|
}
|
|
50339
|
+
const propertySignature = factory.createPropertySignature(
|
|
50340
|
+
modifiers,
|
|
50341
|
+
propertyName,
|
|
50342
|
+
optionalToken,
|
|
50343
|
+
propertyTypeNode
|
|
50344
|
+
);
|
|
50345
|
+
typeElements.push(preserveCommentsOn(propertySignature));
|
|
50326
50346
|
}
|
|
50327
|
-
const modifiers = isReadonlySymbol(propertySymbol) ? [factory.createToken(148 /* ReadonlyKeyword */)] : void 0;
|
|
50328
|
-
if (modifiers) {
|
|
50329
|
-
context.approximateLength += 9;
|
|
50330
|
-
}
|
|
50331
|
-
const propertySignature = factory.createPropertySignature(
|
|
50332
|
-
modifiers,
|
|
50333
|
-
propertyName,
|
|
50334
|
-
optionalToken,
|
|
50335
|
-
propertyTypeNode
|
|
50336
|
-
);
|
|
50337
|
-
typeElements.push(preserveCommentsOn(propertySignature));
|
|
50338
50347
|
function preserveCommentsOn(node) {
|
|
50339
50348
|
var _a2;
|
|
50340
50349
|
if (some(propertySymbol.declarations, (d) => d.kind === 354 /* JSDocPropertyTag */)) {
|
|
@@ -66054,7 +66063,7 @@ ${lanes.join("\n")}
|
|
|
66054
66063
|
const constraint = getConstraintOfTypeParameter(inference.typeParameter);
|
|
66055
66064
|
if (constraint) {
|
|
66056
66065
|
const instantiatedConstraint = instantiateType(constraint, context.nonFixingMapper);
|
|
66057
|
-
if (!inferredType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
|
|
66066
|
+
if (!inferredType || inferredType === wildcardType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
|
|
66058
66067
|
inference.inferredType = fallbackType && context.compareTypes(fallbackType, getTypeWithThisArgument(instantiatedConstraint, fallbackType)) ? fallbackType : instantiatedConstraint;
|
|
66059
66068
|
}
|
|
66060
66069
|
}
|
|
@@ -71960,7 +71969,7 @@ ${lanes.join("\n")}
|
|
|
71960
71969
|
}
|
|
71961
71970
|
for (let i = 0; i < argCount; i++) {
|
|
71962
71971
|
const arg = args[i];
|
|
71963
|
-
if (arg.kind !== 231 /* OmittedExpression */
|
|
71972
|
+
if (arg.kind !== 231 /* OmittedExpression */) {
|
|
71964
71973
|
const paramType = getTypeAtPosition(signature, i);
|
|
71965
71974
|
if (couldContainTypeVariables(paramType)) {
|
|
71966
71975
|
const argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);
|
|
@@ -72572,7 +72581,6 @@ ${lanes.join("\n")}
|
|
|
72572
72581
|
const args = getEffectiveCallArguments(node);
|
|
72573
72582
|
const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters;
|
|
72574
72583
|
let argCheckMode = !isDecorator2 && !isSingleNonGenericCandidate && some(args, isContextSensitive) ? 4 /* SkipContextSensitive */ : 0 /* Normal */;
|
|
72575
|
-
argCheckMode |= checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
|
|
72576
72584
|
let candidatesForArgumentError;
|
|
72577
72585
|
let candidateForArgumentArityError;
|
|
72578
72586
|
let candidateForTypeArgumentError;
|
|
@@ -72796,7 +72804,7 @@ ${lanes.join("\n")}
|
|
|
72796
72804
|
continue;
|
|
72797
72805
|
}
|
|
72798
72806
|
if (argCheckMode) {
|
|
72799
|
-
argCheckMode =
|
|
72807
|
+
argCheckMode = 0 /* Normal */;
|
|
72800
72808
|
if (inferenceContext) {
|
|
72801
72809
|
const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext);
|
|
72802
72810
|
checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext.inferredTypeParameters);
|
|
@@ -76634,7 +76642,7 @@ ${lanes.join("\n")}
|
|
|
76634
76642
|
return nullWideningType;
|
|
76635
76643
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
76636
76644
|
case 11 /* StringLiteral */:
|
|
76637
|
-
return hasSkipDirectInferenceFlag(node) ?
|
|
76645
|
+
return hasSkipDirectInferenceFlag(node) ? wildcardType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
|
|
76638
76646
|
case 9 /* NumericLiteral */:
|
|
76639
76647
|
checkGrammarNumericLiteral(node);
|
|
76640
76648
|
return getFreshTypeOfLiteralType(getNumberLiteralType(+node.text));
|
|
@@ -157861,7 +157869,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
157861
157869
|
case 290 /* JsxAttribute */:
|
|
157862
157870
|
if (!isRequireCallArgument(node) && !isImportCall(parent2)) {
|
|
157863
157871
|
const argumentInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(parent2.kind === 290 /* JsxAttribute */ ? parent2.parent : node, position, sourceFile);
|
|
157864
|
-
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();
|
|
157865
157873
|
}
|
|
157866
157874
|
case 271 /* ImportDeclaration */:
|
|
157867
157875
|
case 277 /* ExportDeclaration */:
|
|
@@ -157930,12 +157938,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
157930
157938
|
function getAlreadyUsedTypesInStringLiteralUnion(union, current) {
|
|
157931
157939
|
return mapDefined(union.types, (type) => type !== current && isLiteralTypeNode(type) && isStringLiteral(type.literal) ? type.literal.text : void 0);
|
|
157932
157940
|
}
|
|
157933
|
-
function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker) {
|
|
157941
|
+
function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker, checkMode = 32 /* IsForStringLiteralArgumentCompletions */) {
|
|
157934
157942
|
let isNewIdentifier = false;
|
|
157935
157943
|
const uniques = /* @__PURE__ */ new Map();
|
|
157936
157944
|
const candidates = [];
|
|
157937
157945
|
const editingArgument = isJsxOpeningLikeElement(call) ? Debug.checkDefined(findAncestor(arg.parent, isJsxAttribute)) : arg;
|
|
157938
|
-
checker.getResolvedSignatureForStringLiteralCompletions(call, editingArgument, candidates);
|
|
157946
|
+
checker.getResolvedSignatureForStringLiteralCompletions(call, editingArgument, candidates, checkMode);
|
|
157939
157947
|
const types = flatMap(candidates, (candidate) => {
|
|
157940
157948
|
if (!signatureHasRestParameter(candidate) && argumentInfo.argumentCount > candidate.parameters.length)
|
|
157941
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-
|
|
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": "
|
|
119
|
+
"gitHead": "ea30ea5c580fce9e61c4fb5a04d0181b57efac3e"
|
|
120
120
|
}
|