@typescript-deploys/pr-build 5.1.0-pr-53996-2 → 5.1.0-pr-54112-28
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 +51 -35
- package/lib/tsserver.js +54 -38
- package/lib/tsserverlibrary.js +54 -38
- package/lib/typescript.js +54 -38
- package/lib/typingsInstaller.js +38 -12
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.1";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20230505`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -7450,6 +7450,7 @@ var Diagnostics = {
|
|
|
7450
7450
|
You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder: diag(8036, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036", "You cannot rename elements that are defined in another 'node_modules' folder."),
|
|
7451
7451
|
Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files: diag(8037, 1 /* Error */, "Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files_8037", "Type satisfaction expressions can only be used in TypeScript files."),
|
|
7452
7452
|
Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export: diag(8038, 1 /* Error */, "Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export_8038", "Decorators may not appear after 'export' or 'export default' if they also appear before 'export'."),
|
|
7453
|
+
A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag: diag(8039, 1 /* Error */, "A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag_8039", "A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag"),
|
|
7453
7454
|
Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9005, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005", "Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."),
|
|
7454
7455
|
Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9006, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006", "Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."),
|
|
7455
7456
|
JSX_attributes_must_only_be_assigned_a_non_empty_expression: diag(17e3, 1 /* Error */, "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", "JSX attributes must only be assigned a non-empty 'expression'."),
|
|
@@ -27168,8 +27169,13 @@ var Parser;
|
|
|
27168
27169
|
return tokenIsIdentifierOrKeyword(token()) || token() === 19 /* OpenBraceToken */;
|
|
27169
27170
|
case 14 /* JsxChildren */:
|
|
27170
27171
|
return true;
|
|
27172
|
+
case 25 /* JSDocComment */:
|
|
27173
|
+
return true;
|
|
27174
|
+
case 26 /* Count */:
|
|
27175
|
+
return Debug.fail("ParsingContext.Count used as a context");
|
|
27176
|
+
default:
|
|
27177
|
+
Debug.assertNever(parsingContext2, "Non-exhaustive case in 'isListElement'.");
|
|
27171
27178
|
}
|
|
27172
|
-
return Debug.fail("Non-exhaustive case in 'isListElement'.");
|
|
27173
27179
|
}
|
|
27174
27180
|
function isValidHeritageClauseObjectLiteral() {
|
|
27175
27181
|
Debug.assert(token() === 19 /* OpenBraceToken */);
|
|
@@ -27263,7 +27269,8 @@ var Parser;
|
|
|
27263
27269
|
return false;
|
|
27264
27270
|
}
|
|
27265
27271
|
function isInSomeParsingContext() {
|
|
27266
|
-
|
|
27272
|
+
Debug.assert(parsingContext, "Missing parsing context");
|
|
27273
|
+
for (let kind = 0; kind < 26 /* Count */; kind++) {
|
|
27267
27274
|
if (parsingContext & 1 << kind) {
|
|
27268
27275
|
if (isListElement(
|
|
27269
27276
|
kind,
|
|
@@ -27522,7 +27529,9 @@ var Parser;
|
|
|
27522
27529
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
27523
27530
|
case 24 /* AssertEntries */:
|
|
27524
27531
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_or_string_literal_expected);
|
|
27525
|
-
case 25 /*
|
|
27532
|
+
case 25 /* JSDocComment */:
|
|
27533
|
+
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
27534
|
+
case 26 /* Count */:
|
|
27526
27535
|
return Debug.fail("ParsingContext.Count used as a context");
|
|
27527
27536
|
default:
|
|
27528
27537
|
Debug.assertNever(context);
|
|
@@ -31654,7 +31663,8 @@ var Parser;
|
|
|
31654
31663
|
ParsingContext2[ParsingContext2["HeritageClauses"] = 22] = "HeritageClauses";
|
|
31655
31664
|
ParsingContext2[ParsingContext2["ImportOrExportSpecifiers"] = 23] = "ImportOrExportSpecifiers";
|
|
31656
31665
|
ParsingContext2[ParsingContext2["AssertEntries"] = 24] = "AssertEntries";
|
|
31657
|
-
ParsingContext2[ParsingContext2["
|
|
31666
|
+
ParsingContext2[ParsingContext2["JSDocComment"] = 25] = "JSDocComment";
|
|
31667
|
+
ParsingContext2[ParsingContext2["Count"] = 26] = "Count";
|
|
31658
31668
|
})(ParsingContext || (ParsingContext = {}));
|
|
31659
31669
|
let Tristate;
|
|
31660
31670
|
((Tristate2) => {
|
|
@@ -31776,6 +31786,8 @@ var Parser;
|
|
|
31776
31786
|
PropertyLikeParse2[PropertyLikeParse2["CallbackParameter"] = 4] = "CallbackParameter";
|
|
31777
31787
|
})(PropertyLikeParse || (PropertyLikeParse = {}));
|
|
31778
31788
|
function parseJSDocCommentWorker(start = 0, length2) {
|
|
31789
|
+
const saveParsingContext = parsingContext;
|
|
31790
|
+
parsingContext |= 1 << 25 /* JSDocComment */;
|
|
31779
31791
|
const content = sourceText;
|
|
31780
31792
|
const end = length2 === void 0 ? content.length : start + length2;
|
|
31781
31793
|
length2 = end - start;
|
|
@@ -31792,7 +31804,10 @@ var Parser;
|
|
|
31792
31804
|
let commentsPos;
|
|
31793
31805
|
let comments = [];
|
|
31794
31806
|
const parts = [];
|
|
31795
|
-
|
|
31807
|
+
const result = scanner.scanRange(start + 3, length2 - 5, doJSDocScan);
|
|
31808
|
+
parsingContext = saveParsingContext;
|
|
31809
|
+
return result;
|
|
31810
|
+
function doJSDocScan() {
|
|
31796
31811
|
let state = 1 /* SawAsterisk */;
|
|
31797
31812
|
let margin;
|
|
31798
31813
|
let indent2 = start - (content.lastIndexOf("\n", start) + 1) + 4;
|
|
@@ -31888,7 +31903,7 @@ var Parser;
|
|
|
31888
31903
|
Debug.assertIsDefined(commentsPos, "having parsed tags implies that the end of the comment span should be set");
|
|
31889
31904
|
const tagsArray = tags && createNodeArray(tags, tagsPos, tagsEnd);
|
|
31890
31905
|
return finishNode(factory2.createJSDocComment(parts.length ? createNodeArray(parts, start, commentsPos) : trimmedComments.length ? trimmedComments : void 0, tagsArray), start, end);
|
|
31891
|
-
}
|
|
31906
|
+
}
|
|
31892
31907
|
function removeLeadingNewlines(comments2) {
|
|
31893
31908
|
while (comments2.length && (comments2[0] === "\n" || comments2[0] === "\r")) {
|
|
31894
31909
|
comments2.shift();
|
|
@@ -32247,8 +32262,8 @@ var Parser;
|
|
|
32247
32262
|
typeExpression = nestedTypeLiteral;
|
|
32248
32263
|
isNameFirst = true;
|
|
32249
32264
|
}
|
|
32250
|
-
const
|
|
32251
|
-
return finishNode(
|
|
32265
|
+
const result2 = target === 1 /* Property */ ? factory2.createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) : factory2.createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment);
|
|
32266
|
+
return finishNode(result2, start2);
|
|
32252
32267
|
}
|
|
32253
32268
|
function parseNestedTypeLiteral(typeExpression, name, target, indent2) {
|
|
32254
32269
|
if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) {
|
|
@@ -32258,6 +32273,8 @@ var Parser;
|
|
|
32258
32273
|
while (child = tryParse(() => parseChildParameterOrPropertyTag(target, indent2, name))) {
|
|
32259
32274
|
if (child.kind === 347 /* JSDocParameterTag */ || child.kind === 354 /* JSDocPropertyTag */) {
|
|
32260
32275
|
children = append(children, child);
|
|
32276
|
+
} else if (child.kind === 351 /* JSDocTemplateTag */) {
|
|
32277
|
+
parseErrorAtRange(child.tagName, Diagnostics.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag);
|
|
32261
32278
|
}
|
|
32262
32279
|
}
|
|
32263
32280
|
if (children) {
|
|
@@ -32396,6 +32413,9 @@ var Parser;
|
|
|
32396
32413
|
let jsDocPropertyTags;
|
|
32397
32414
|
let hasChildren = false;
|
|
32398
32415
|
while (child = tryParse(() => parseChildPropertyTag(indent2))) {
|
|
32416
|
+
if (child.kind === 351 /* JSDocTemplateTag */) {
|
|
32417
|
+
break;
|
|
32418
|
+
}
|
|
32399
32419
|
hasChildren = true;
|
|
32400
32420
|
if (child.kind === 350 /* JSDocTypeTag */) {
|
|
32401
32421
|
if (childTypeTag) {
|
|
@@ -32455,6 +32475,10 @@ var Parser;
|
|
|
32455
32475
|
let child;
|
|
32456
32476
|
let parameters;
|
|
32457
32477
|
while (child = tryParse(() => parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent2))) {
|
|
32478
|
+
if (child.kind === 351 /* JSDocTemplateTag */) {
|
|
32479
|
+
parseErrorAtRange(child.tagName, Diagnostics.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag);
|
|
32480
|
+
break;
|
|
32481
|
+
}
|
|
32458
32482
|
parameters = append(parameters, child);
|
|
32459
32483
|
}
|
|
32460
32484
|
return createNodeArray(parameters || [], pos);
|
|
@@ -32549,7 +32573,7 @@ var Parser;
|
|
|
32549
32573
|
const start2 = scanner.getTokenFullStart();
|
|
32550
32574
|
nextTokenJSDoc();
|
|
32551
32575
|
const tagName = parseJSDocIdentifierName();
|
|
32552
|
-
|
|
32576
|
+
const indentText = skipWhitespaceOrAsterisk();
|
|
32553
32577
|
let t;
|
|
32554
32578
|
switch (tagName.escapedText) {
|
|
32555
32579
|
case "type":
|
|
@@ -32563,6 +32587,8 @@ var Parser;
|
|
|
32563
32587
|
case "param":
|
|
32564
32588
|
t = 2 /* Parameter */ | 4 /* CallbackParameter */;
|
|
32565
32589
|
break;
|
|
32590
|
+
case "template":
|
|
32591
|
+
return parseTemplateTag(start2, tagName, indent2, indentText);
|
|
32566
32592
|
default:
|
|
32567
32593
|
return false;
|
|
32568
32594
|
}
|
|
@@ -32650,9 +32676,9 @@ var Parser;
|
|
|
32650
32676
|
const end2 = scanner.getTokenEnd();
|
|
32651
32677
|
const originalKeywordKind = token();
|
|
32652
32678
|
const text = internIdentifier(scanner.getTokenValue());
|
|
32653
|
-
const
|
|
32679
|
+
const result2 = finishNode(factoryCreateIdentifier(text, originalKeywordKind), start2, end2);
|
|
32654
32680
|
nextTokenJSDoc();
|
|
32655
|
-
return
|
|
32681
|
+
return result2;
|
|
32656
32682
|
}
|
|
32657
32683
|
}
|
|
32658
32684
|
})(JSDocParser = Parser2.JSDocParser || (Parser2.JSDocParser = {}));
|
|
@@ -42861,24 +42887,13 @@ function createTypeChecker(host) {
|
|
|
42861
42887
|
getTypeOfPropertyOfContextualType,
|
|
42862
42888
|
getFullyQualifiedName,
|
|
42863
42889
|
getResolvedSignature: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */),
|
|
42864
|
-
getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray
|
|
42865
|
-
|
|
42866
|
-
|
|
42867
|
-
|
|
42868
|
-
|
|
42869
|
-
|
|
42870
|
-
|
|
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
|
-
},
|
|
42890
|
+
getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray) => runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker(
|
|
42891
|
+
call,
|
|
42892
|
+
candidatesOutArray,
|
|
42893
|
+
/*argumentCount*/
|
|
42894
|
+
void 0,
|
|
42895
|
+
32 /* IsForStringLiteralArgumentCompletions */
|
|
42896
|
+
)),
|
|
42882
42897
|
getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */)),
|
|
42883
42898
|
getExpandedParameters,
|
|
42884
42899
|
hasEffectiveRestParameter,
|
|
@@ -53964,7 +53979,7 @@ function createTypeChecker(host) {
|
|
|
53964
53979
|
} else if (type !== firstType) {
|
|
53965
53980
|
checkFlags |= 64 /* HasNonUniformType */;
|
|
53966
53981
|
}
|
|
53967
|
-
if (isLiteralType(type) || isPatternLiteralType(type)
|
|
53982
|
+
if (isLiteralType(type) || isPatternLiteralType(type)) {
|
|
53968
53983
|
checkFlags |= 128 /* HasLiteralType */;
|
|
53969
53984
|
}
|
|
53970
53985
|
if (type.flags & 131072 /* Never */ && type !== uniqueLiteralType) {
|
|
@@ -63621,7 +63636,7 @@ function createTypeChecker(host) {
|
|
|
63621
63636
|
const constraint = getConstraintOfTypeParameter(inference.typeParameter);
|
|
63622
63637
|
if (constraint) {
|
|
63623
63638
|
const instantiatedConstraint = instantiateType(constraint, context.nonFixingMapper);
|
|
63624
|
-
if (!inferredType ||
|
|
63639
|
+
if (!inferredType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
|
|
63625
63640
|
inference.inferredType = fallbackType && context.compareTypes(fallbackType, getTypeWithThisArgument(instantiatedConstraint, fallbackType)) ? fallbackType : instantiatedConstraint;
|
|
63626
63641
|
}
|
|
63627
63642
|
}
|
|
@@ -69527,7 +69542,7 @@ function createTypeChecker(host) {
|
|
|
69527
69542
|
}
|
|
69528
69543
|
for (let i = 0; i < argCount; i++) {
|
|
69529
69544
|
const arg = args[i];
|
|
69530
|
-
if (arg.kind !== 231 /* OmittedExpression */) {
|
|
69545
|
+
if (arg.kind !== 231 /* OmittedExpression */ && !(checkMode & 32 /* IsForStringLiteralArgumentCompletions */ && hasSkipDirectInferenceFlag(arg))) {
|
|
69531
69546
|
const paramType = getTypeAtPosition(signature, i);
|
|
69532
69547
|
if (couldContainTypeVariables(paramType)) {
|
|
69533
69548
|
const argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);
|
|
@@ -70139,6 +70154,7 @@ function createTypeChecker(host) {
|
|
|
70139
70154
|
const args = getEffectiveCallArguments(node);
|
|
70140
70155
|
const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters;
|
|
70141
70156
|
let argCheckMode = !isDecorator2 && !isSingleNonGenericCandidate && some(args, isContextSensitive) ? 4 /* SkipContextSensitive */ : 0 /* Normal */;
|
|
70157
|
+
argCheckMode |= checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
|
|
70142
70158
|
let candidatesForArgumentError;
|
|
70143
70159
|
let candidateForArgumentArityError;
|
|
70144
70160
|
let candidateForTypeArgumentError;
|
|
@@ -70362,7 +70378,7 @@ function createTypeChecker(host) {
|
|
|
70362
70378
|
continue;
|
|
70363
70379
|
}
|
|
70364
70380
|
if (argCheckMode) {
|
|
70365
|
-
argCheckMode =
|
|
70381
|
+
argCheckMode = checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
|
|
70366
70382
|
if (inferenceContext) {
|
|
70367
70383
|
const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext);
|
|
70368
70384
|
checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext.inferredTypeParameters);
|
|
@@ -74200,7 +74216,7 @@ function createTypeChecker(host) {
|
|
|
74200
74216
|
return nullWideningType;
|
|
74201
74217
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
74202
74218
|
case 11 /* StringLiteral */:
|
|
74203
|
-
return hasSkipDirectInferenceFlag(node) ?
|
|
74219
|
+
return hasSkipDirectInferenceFlag(node) ? anyType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
|
|
74204
74220
|
case 9 /* NumericLiteral */:
|
|
74205
74221
|
checkGrammarNumericLiteral(node);
|
|
74206
74222
|
return getFreshTypeOfLiteralType(getNumberLiteralType(+node.text));
|
package/lib/tsserver.js
CHANGED
|
@@ -2303,7 +2303,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2303
2303
|
|
|
2304
2304
|
// src/compiler/corePublic.ts
|
|
2305
2305
|
var versionMajorMinor = "5.1";
|
|
2306
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2306
|
+
var version = `${versionMajorMinor}.0-insiders.20230505`;
|
|
2307
2307
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2308
2308
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2309
2309
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -10957,6 +10957,7 @@ var Diagnostics = {
|
|
|
10957
10957
|
You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder: diag(8036, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036", "You cannot rename elements that are defined in another 'node_modules' folder."),
|
|
10958
10958
|
Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files: diag(8037, 1 /* Error */, "Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files_8037", "Type satisfaction expressions can only be used in TypeScript files."),
|
|
10959
10959
|
Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export: diag(8038, 1 /* Error */, "Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export_8038", "Decorators may not appear after 'export' or 'export default' if they also appear before 'export'."),
|
|
10960
|
+
A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag: diag(8039, 1 /* Error */, "A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag_8039", "A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag"),
|
|
10960
10961
|
Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9005, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005", "Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."),
|
|
10961
10962
|
Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9006, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006", "Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."),
|
|
10962
10963
|
JSX_attributes_must_only_be_assigned_a_non_empty_expression: diag(17e3, 1 /* Error */, "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", "JSX attributes must only be assigned a non-empty 'expression'."),
|
|
@@ -31552,8 +31553,13 @@ var Parser;
|
|
|
31552
31553
|
return tokenIsIdentifierOrKeyword(token()) || token() === 19 /* OpenBraceToken */;
|
|
31553
31554
|
case 14 /* JsxChildren */:
|
|
31554
31555
|
return true;
|
|
31556
|
+
case 25 /* JSDocComment */:
|
|
31557
|
+
return true;
|
|
31558
|
+
case 26 /* Count */:
|
|
31559
|
+
return Debug.fail("ParsingContext.Count used as a context");
|
|
31560
|
+
default:
|
|
31561
|
+
Debug.assertNever(parsingContext2, "Non-exhaustive case in 'isListElement'.");
|
|
31555
31562
|
}
|
|
31556
|
-
return Debug.fail("Non-exhaustive case in 'isListElement'.");
|
|
31557
31563
|
}
|
|
31558
31564
|
function isValidHeritageClauseObjectLiteral() {
|
|
31559
31565
|
Debug.assert(token() === 19 /* OpenBraceToken */);
|
|
@@ -31647,7 +31653,8 @@ var Parser;
|
|
|
31647
31653
|
return false;
|
|
31648
31654
|
}
|
|
31649
31655
|
function isInSomeParsingContext() {
|
|
31650
|
-
|
|
31656
|
+
Debug.assert(parsingContext, "Missing parsing context");
|
|
31657
|
+
for (let kind = 0; kind < 26 /* Count */; kind++) {
|
|
31651
31658
|
if (parsingContext & 1 << kind) {
|
|
31652
31659
|
if (isListElement2(
|
|
31653
31660
|
kind,
|
|
@@ -31906,7 +31913,9 @@ var Parser;
|
|
|
31906
31913
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
31907
31914
|
case 24 /* AssertEntries */:
|
|
31908
31915
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_or_string_literal_expected);
|
|
31909
|
-
case 25 /*
|
|
31916
|
+
case 25 /* JSDocComment */:
|
|
31917
|
+
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
31918
|
+
case 26 /* Count */:
|
|
31910
31919
|
return Debug.fail("ParsingContext.Count used as a context");
|
|
31911
31920
|
default:
|
|
31912
31921
|
Debug.assertNever(context);
|
|
@@ -36038,7 +36047,8 @@ var Parser;
|
|
|
36038
36047
|
ParsingContext2[ParsingContext2["HeritageClauses"] = 22] = "HeritageClauses";
|
|
36039
36048
|
ParsingContext2[ParsingContext2["ImportOrExportSpecifiers"] = 23] = "ImportOrExportSpecifiers";
|
|
36040
36049
|
ParsingContext2[ParsingContext2["AssertEntries"] = 24] = "AssertEntries";
|
|
36041
|
-
ParsingContext2[ParsingContext2["
|
|
36050
|
+
ParsingContext2[ParsingContext2["JSDocComment"] = 25] = "JSDocComment";
|
|
36051
|
+
ParsingContext2[ParsingContext2["Count"] = 26] = "Count";
|
|
36042
36052
|
})(ParsingContext || (ParsingContext = {}));
|
|
36043
36053
|
let Tristate;
|
|
36044
36054
|
((Tristate2) => {
|
|
@@ -36160,6 +36170,8 @@ var Parser;
|
|
|
36160
36170
|
PropertyLikeParse2[PropertyLikeParse2["CallbackParameter"] = 4] = "CallbackParameter";
|
|
36161
36171
|
})(PropertyLikeParse || (PropertyLikeParse = {}));
|
|
36162
36172
|
function parseJSDocCommentWorker(start2 = 0, length2) {
|
|
36173
|
+
const saveParsingContext = parsingContext;
|
|
36174
|
+
parsingContext |= 1 << 25 /* JSDocComment */;
|
|
36163
36175
|
const content = sourceText;
|
|
36164
36176
|
const end = length2 === void 0 ? content.length : start2 + length2;
|
|
36165
36177
|
length2 = end - start2;
|
|
@@ -36176,7 +36188,10 @@ var Parser;
|
|
|
36176
36188
|
let commentsPos;
|
|
36177
36189
|
let comments = [];
|
|
36178
36190
|
const parts = [];
|
|
36179
|
-
|
|
36191
|
+
const result = scanner2.scanRange(start2 + 3, length2 - 5, doJSDocScan);
|
|
36192
|
+
parsingContext = saveParsingContext;
|
|
36193
|
+
return result;
|
|
36194
|
+
function doJSDocScan() {
|
|
36180
36195
|
let state = 1 /* SawAsterisk */;
|
|
36181
36196
|
let margin;
|
|
36182
36197
|
let indent3 = start2 - (content.lastIndexOf("\n", start2) + 1) + 4;
|
|
@@ -36272,7 +36287,7 @@ var Parser;
|
|
|
36272
36287
|
Debug.assertIsDefined(commentsPos, "having parsed tags implies that the end of the comment span should be set");
|
|
36273
36288
|
const tagsArray = tags && createNodeArray(tags, tagsPos, tagsEnd);
|
|
36274
36289
|
return finishNode(factory2.createJSDocComment(parts.length ? createNodeArray(parts, start2, commentsPos) : trimmedComments.length ? trimmedComments : void 0, tagsArray), start2, end);
|
|
36275
|
-
}
|
|
36290
|
+
}
|
|
36276
36291
|
function removeLeadingNewlines(comments2) {
|
|
36277
36292
|
while (comments2.length && (comments2[0] === "\n" || comments2[0] === "\r")) {
|
|
36278
36293
|
comments2.shift();
|
|
@@ -36631,8 +36646,8 @@ var Parser;
|
|
|
36631
36646
|
typeExpression = nestedTypeLiteral;
|
|
36632
36647
|
isNameFirst = true;
|
|
36633
36648
|
}
|
|
36634
|
-
const
|
|
36635
|
-
return finishNode(
|
|
36649
|
+
const result2 = target === 1 /* Property */ ? factory2.createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) : factory2.createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment);
|
|
36650
|
+
return finishNode(result2, start3);
|
|
36636
36651
|
}
|
|
36637
36652
|
function parseNestedTypeLiteral(typeExpression, name, target, indent3) {
|
|
36638
36653
|
if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) {
|
|
@@ -36642,6 +36657,8 @@ var Parser;
|
|
|
36642
36657
|
while (child = tryParse(() => parseChildParameterOrPropertyTag(target, indent3, name))) {
|
|
36643
36658
|
if (child.kind === 347 /* JSDocParameterTag */ || child.kind === 354 /* JSDocPropertyTag */) {
|
|
36644
36659
|
children = append(children, child);
|
|
36660
|
+
} else if (child.kind === 351 /* JSDocTemplateTag */) {
|
|
36661
|
+
parseErrorAtRange(child.tagName, Diagnostics.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag);
|
|
36645
36662
|
}
|
|
36646
36663
|
}
|
|
36647
36664
|
if (children) {
|
|
@@ -36780,6 +36797,9 @@ var Parser;
|
|
|
36780
36797
|
let jsDocPropertyTags;
|
|
36781
36798
|
let hasChildren = false;
|
|
36782
36799
|
while (child = tryParse(() => parseChildPropertyTag(indent3))) {
|
|
36800
|
+
if (child.kind === 351 /* JSDocTemplateTag */) {
|
|
36801
|
+
break;
|
|
36802
|
+
}
|
|
36783
36803
|
hasChildren = true;
|
|
36784
36804
|
if (child.kind === 350 /* JSDocTypeTag */) {
|
|
36785
36805
|
if (childTypeTag) {
|
|
@@ -36839,6 +36859,10 @@ var Parser;
|
|
|
36839
36859
|
let child;
|
|
36840
36860
|
let parameters;
|
|
36841
36861
|
while (child = tryParse(() => parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent3))) {
|
|
36862
|
+
if (child.kind === 351 /* JSDocTemplateTag */) {
|
|
36863
|
+
parseErrorAtRange(child.tagName, Diagnostics.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag);
|
|
36864
|
+
break;
|
|
36865
|
+
}
|
|
36842
36866
|
parameters = append(parameters, child);
|
|
36843
36867
|
}
|
|
36844
36868
|
return createNodeArray(parameters || [], pos);
|
|
@@ -36933,7 +36957,7 @@ var Parser;
|
|
|
36933
36957
|
const start3 = scanner2.getTokenFullStart();
|
|
36934
36958
|
nextTokenJSDoc();
|
|
36935
36959
|
const tagName = parseJSDocIdentifierName();
|
|
36936
|
-
|
|
36960
|
+
const indentText = skipWhitespaceOrAsterisk();
|
|
36937
36961
|
let t;
|
|
36938
36962
|
switch (tagName.escapedText) {
|
|
36939
36963
|
case "type":
|
|
@@ -36947,6 +36971,8 @@ var Parser;
|
|
|
36947
36971
|
case "param":
|
|
36948
36972
|
t = 2 /* Parameter */ | 4 /* CallbackParameter */;
|
|
36949
36973
|
break;
|
|
36974
|
+
case "template":
|
|
36975
|
+
return parseTemplateTag(start3, tagName, indent3, indentText);
|
|
36950
36976
|
default:
|
|
36951
36977
|
return false;
|
|
36952
36978
|
}
|
|
@@ -37034,9 +37060,9 @@ var Parser;
|
|
|
37034
37060
|
const end2 = scanner2.getTokenEnd();
|
|
37035
37061
|
const originalKeywordKind = token();
|
|
37036
37062
|
const text = internIdentifier(scanner2.getTokenValue());
|
|
37037
|
-
const
|
|
37063
|
+
const result2 = finishNode(factoryCreateIdentifier(text, originalKeywordKind), start3, end2);
|
|
37038
37064
|
nextTokenJSDoc();
|
|
37039
|
-
return
|
|
37065
|
+
return result2;
|
|
37040
37066
|
}
|
|
37041
37067
|
}
|
|
37042
37068
|
})(JSDocParser = Parser2.JSDocParser || (Parser2.JSDocParser = {}));
|
|
@@ -47511,24 +47537,13 @@ function createTypeChecker(host) {
|
|
|
47511
47537
|
getTypeOfPropertyOfContextualType,
|
|
47512
47538
|
getFullyQualifiedName,
|
|
47513
47539
|
getResolvedSignature: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */),
|
|
47514
|
-
getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray
|
|
47515
|
-
|
|
47516
|
-
|
|
47517
|
-
|
|
47518
|
-
|
|
47519
|
-
|
|
47520
|
-
|
|
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
|
-
},
|
|
47540
|
+
getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray) => runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker(
|
|
47541
|
+
call,
|
|
47542
|
+
candidatesOutArray,
|
|
47543
|
+
/*argumentCount*/
|
|
47544
|
+
void 0,
|
|
47545
|
+
32 /* IsForStringLiteralArgumentCompletions */
|
|
47546
|
+
)),
|
|
47532
47547
|
getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */)),
|
|
47533
47548
|
getExpandedParameters,
|
|
47534
47549
|
hasEffectiveRestParameter,
|
|
@@ -58614,7 +58629,7 @@ function createTypeChecker(host) {
|
|
|
58614
58629
|
} else if (type !== firstType) {
|
|
58615
58630
|
checkFlags |= 64 /* HasNonUniformType */;
|
|
58616
58631
|
}
|
|
58617
|
-
if (isLiteralType(type) || isPatternLiteralType(type)
|
|
58632
|
+
if (isLiteralType(type) || isPatternLiteralType(type)) {
|
|
58618
58633
|
checkFlags |= 128 /* HasLiteralType */;
|
|
58619
58634
|
}
|
|
58620
58635
|
if (type.flags & 131072 /* Never */ && type !== uniqueLiteralType) {
|
|
@@ -68271,7 +68286,7 @@ function createTypeChecker(host) {
|
|
|
68271
68286
|
const constraint = getConstraintOfTypeParameter(inference.typeParameter);
|
|
68272
68287
|
if (constraint) {
|
|
68273
68288
|
const instantiatedConstraint = instantiateType(constraint, context.nonFixingMapper);
|
|
68274
|
-
if (!inferredType ||
|
|
68289
|
+
if (!inferredType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
|
|
68275
68290
|
inference.inferredType = fallbackType && context.compareTypes(fallbackType, getTypeWithThisArgument(instantiatedConstraint, fallbackType)) ? fallbackType : instantiatedConstraint;
|
|
68276
68291
|
}
|
|
68277
68292
|
}
|
|
@@ -74177,7 +74192,7 @@ function createTypeChecker(host) {
|
|
|
74177
74192
|
}
|
|
74178
74193
|
for (let i = 0; i < argCount; i++) {
|
|
74179
74194
|
const arg = args[i];
|
|
74180
|
-
if (arg.kind !== 231 /* OmittedExpression */) {
|
|
74195
|
+
if (arg.kind !== 231 /* OmittedExpression */ && !(checkMode & 32 /* IsForStringLiteralArgumentCompletions */ && hasSkipDirectInferenceFlag(arg))) {
|
|
74181
74196
|
const paramType = getTypeAtPosition(signature, i);
|
|
74182
74197
|
if (couldContainTypeVariables(paramType)) {
|
|
74183
74198
|
const argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);
|
|
@@ -74789,6 +74804,7 @@ function createTypeChecker(host) {
|
|
|
74789
74804
|
const args = getEffectiveCallArguments(node);
|
|
74790
74805
|
const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters;
|
|
74791
74806
|
let argCheckMode = !isDecorator2 && !isSingleNonGenericCandidate && some(args, isContextSensitive) ? 4 /* SkipContextSensitive */ : 0 /* Normal */;
|
|
74807
|
+
argCheckMode |= checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
|
|
74792
74808
|
let candidatesForArgumentError;
|
|
74793
74809
|
let candidateForArgumentArityError;
|
|
74794
74810
|
let candidateForTypeArgumentError;
|
|
@@ -75012,7 +75028,7 @@ function createTypeChecker(host) {
|
|
|
75012
75028
|
continue;
|
|
75013
75029
|
}
|
|
75014
75030
|
if (argCheckMode) {
|
|
75015
|
-
argCheckMode =
|
|
75031
|
+
argCheckMode = checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
|
|
75016
75032
|
if (inferenceContext) {
|
|
75017
75033
|
const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext);
|
|
75018
75034
|
checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext.inferredTypeParameters);
|
|
@@ -78850,7 +78866,7 @@ function createTypeChecker(host) {
|
|
|
78850
78866
|
return nullWideningType;
|
|
78851
78867
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
78852
78868
|
case 11 /* StringLiteral */:
|
|
78853
|
-
return hasSkipDirectInferenceFlag(node) ?
|
|
78869
|
+
return hasSkipDirectInferenceFlag(node) ? anyType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
|
|
78854
78870
|
case 9 /* NumericLiteral */:
|
|
78855
78871
|
checkGrammarNumericLiteral(node);
|
|
78856
78872
|
return getFreshTypeOfLiteralType(getNumberLiteralType(+node.text));
|
|
@@ -158578,7 +158594,7 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, typeCheck
|
|
|
158578
158594
|
case 290 /* JsxAttribute */:
|
|
158579
158595
|
if (!isRequireCallArgument(node) && !isImportCall(parent2)) {
|
|
158580
158596
|
const argumentInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(parent2.kind === 290 /* JsxAttribute */ ? parent2.parent : node, position, sourceFile);
|
|
158581
|
-
return argumentInfo &&
|
|
158597
|
+
return argumentInfo && getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker) || fromContextualType();
|
|
158582
158598
|
}
|
|
158583
158599
|
case 271 /* ImportDeclaration */:
|
|
158584
158600
|
case 277 /* ExportDeclaration */:
|
|
@@ -158647,12 +158663,12 @@ function walkUpParentheses(node) {
|
|
|
158647
158663
|
function getAlreadyUsedTypesInStringLiteralUnion(union, current) {
|
|
158648
158664
|
return mapDefined(union.types, (type) => type !== current && isLiteralTypeNode(type) && isStringLiteral(type.literal) ? type.literal.text : void 0);
|
|
158649
158665
|
}
|
|
158650
|
-
function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker
|
|
158666
|
+
function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker) {
|
|
158651
158667
|
let isNewIdentifier = false;
|
|
158652
158668
|
const uniques = /* @__PURE__ */ new Map();
|
|
158653
158669
|
const candidates = [];
|
|
158654
158670
|
const editingArgument = isJsxOpeningLikeElement(call) ? Debug.checkDefined(findAncestor(arg.parent, isJsxAttribute)) : arg;
|
|
158655
|
-
checker.getResolvedSignatureForStringLiteralCompletions(call, editingArgument, candidates
|
|
158671
|
+
checker.getResolvedSignatureForStringLiteralCompletions(call, editingArgument, candidates);
|
|
158656
158672
|
const types = flatMap(candidates, (candidate) => {
|
|
158657
158673
|
if (!signatureHasRestParameter(candidate) && argumentInfo.argumentCount > candidate.parameters.length)
|
|
158658
158674
|
return;
|
package/lib/tsserverlibrary.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.1";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20230505`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -8764,6 +8764,7 @@ ${lanes.join("\n")}
|
|
|
8764
8764
|
You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder: diag(8036, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036", "You cannot rename elements that are defined in another 'node_modules' folder."),
|
|
8765
8765
|
Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files: diag(8037, 1 /* Error */, "Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files_8037", "Type satisfaction expressions can only be used in TypeScript files."),
|
|
8766
8766
|
Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export: diag(8038, 1 /* Error */, "Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export_8038", "Decorators may not appear after 'export' or 'export default' if they also appear before 'export'."),
|
|
8767
|
+
A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag: diag(8039, 1 /* Error */, "A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag_8039", "A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag"),
|
|
8767
8768
|
Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9005, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005", "Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."),
|
|
8768
8769
|
Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9006, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006", "Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."),
|
|
8769
8770
|
JSX_attributes_must_only_be_assigned_a_non_empty_expression: diag(17e3, 1 /* Error */, "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", "JSX attributes must only be assigned a non-empty 'expression'."),
|
|
@@ -29649,8 +29650,13 @@ ${lanes.join("\n")}
|
|
|
29649
29650
|
return tokenIsIdentifierOrKeyword(token()) || token() === 19 /* OpenBraceToken */;
|
|
29650
29651
|
case 14 /* JsxChildren */:
|
|
29651
29652
|
return true;
|
|
29653
|
+
case 25 /* JSDocComment */:
|
|
29654
|
+
return true;
|
|
29655
|
+
case 26 /* Count */:
|
|
29656
|
+
return Debug.fail("ParsingContext.Count used as a context");
|
|
29657
|
+
default:
|
|
29658
|
+
Debug.assertNever(parsingContext2, "Non-exhaustive case in 'isListElement'.");
|
|
29652
29659
|
}
|
|
29653
|
-
return Debug.fail("Non-exhaustive case in 'isListElement'.");
|
|
29654
29660
|
}
|
|
29655
29661
|
function isValidHeritageClauseObjectLiteral() {
|
|
29656
29662
|
Debug.assert(token() === 19 /* OpenBraceToken */);
|
|
@@ -29744,7 +29750,8 @@ ${lanes.join("\n")}
|
|
|
29744
29750
|
return false;
|
|
29745
29751
|
}
|
|
29746
29752
|
function isInSomeParsingContext() {
|
|
29747
|
-
|
|
29753
|
+
Debug.assert(parsingContext, "Missing parsing context");
|
|
29754
|
+
for (let kind = 0; kind < 26 /* Count */; kind++) {
|
|
29748
29755
|
if (parsingContext & 1 << kind) {
|
|
29749
29756
|
if (isListElement2(
|
|
29750
29757
|
kind,
|
|
@@ -30003,7 +30010,9 @@ ${lanes.join("\n")}
|
|
|
30003
30010
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
30004
30011
|
case 24 /* AssertEntries */:
|
|
30005
30012
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_or_string_literal_expected);
|
|
30006
|
-
case 25 /*
|
|
30013
|
+
case 25 /* JSDocComment */:
|
|
30014
|
+
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
30015
|
+
case 26 /* Count */:
|
|
30007
30016
|
return Debug.fail("ParsingContext.Count used as a context");
|
|
30008
30017
|
default:
|
|
30009
30018
|
Debug.assertNever(context);
|
|
@@ -34135,7 +34144,8 @@ ${lanes.join("\n")}
|
|
|
34135
34144
|
ParsingContext2[ParsingContext2["HeritageClauses"] = 22] = "HeritageClauses";
|
|
34136
34145
|
ParsingContext2[ParsingContext2["ImportOrExportSpecifiers"] = 23] = "ImportOrExportSpecifiers";
|
|
34137
34146
|
ParsingContext2[ParsingContext2["AssertEntries"] = 24] = "AssertEntries";
|
|
34138
|
-
ParsingContext2[ParsingContext2["
|
|
34147
|
+
ParsingContext2[ParsingContext2["JSDocComment"] = 25] = "JSDocComment";
|
|
34148
|
+
ParsingContext2[ParsingContext2["Count"] = 26] = "Count";
|
|
34139
34149
|
})(ParsingContext || (ParsingContext = {}));
|
|
34140
34150
|
let Tristate;
|
|
34141
34151
|
((Tristate2) => {
|
|
@@ -34257,6 +34267,8 @@ ${lanes.join("\n")}
|
|
|
34257
34267
|
PropertyLikeParse2[PropertyLikeParse2["CallbackParameter"] = 4] = "CallbackParameter";
|
|
34258
34268
|
})(PropertyLikeParse || (PropertyLikeParse = {}));
|
|
34259
34269
|
function parseJSDocCommentWorker(start = 0, length2) {
|
|
34270
|
+
const saveParsingContext = parsingContext;
|
|
34271
|
+
parsingContext |= 1 << 25 /* JSDocComment */;
|
|
34260
34272
|
const content = sourceText;
|
|
34261
34273
|
const end = length2 === void 0 ? content.length : start + length2;
|
|
34262
34274
|
length2 = end - start;
|
|
@@ -34273,7 +34285,10 @@ ${lanes.join("\n")}
|
|
|
34273
34285
|
let commentsPos;
|
|
34274
34286
|
let comments = [];
|
|
34275
34287
|
const parts = [];
|
|
34276
|
-
|
|
34288
|
+
const result = scanner2.scanRange(start + 3, length2 - 5, doJSDocScan);
|
|
34289
|
+
parsingContext = saveParsingContext;
|
|
34290
|
+
return result;
|
|
34291
|
+
function doJSDocScan() {
|
|
34277
34292
|
let state = 1 /* SawAsterisk */;
|
|
34278
34293
|
let margin;
|
|
34279
34294
|
let indent3 = start - (content.lastIndexOf("\n", start) + 1) + 4;
|
|
@@ -34369,7 +34384,7 @@ ${lanes.join("\n")}
|
|
|
34369
34384
|
Debug.assertIsDefined(commentsPos, "having parsed tags implies that the end of the comment span should be set");
|
|
34370
34385
|
const tagsArray = tags && createNodeArray(tags, tagsPos, tagsEnd);
|
|
34371
34386
|
return finishNode(factory2.createJSDocComment(parts.length ? createNodeArray(parts, start, commentsPos) : trimmedComments.length ? trimmedComments : void 0, tagsArray), start, end);
|
|
34372
|
-
}
|
|
34387
|
+
}
|
|
34373
34388
|
function removeLeadingNewlines(comments2) {
|
|
34374
34389
|
while (comments2.length && (comments2[0] === "\n" || comments2[0] === "\r")) {
|
|
34375
34390
|
comments2.shift();
|
|
@@ -34728,8 +34743,8 @@ ${lanes.join("\n")}
|
|
|
34728
34743
|
typeExpression = nestedTypeLiteral;
|
|
34729
34744
|
isNameFirst = true;
|
|
34730
34745
|
}
|
|
34731
|
-
const
|
|
34732
|
-
return finishNode(
|
|
34746
|
+
const result2 = target === 1 /* Property */ ? factory2.createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) : factory2.createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment);
|
|
34747
|
+
return finishNode(result2, start2);
|
|
34733
34748
|
}
|
|
34734
34749
|
function parseNestedTypeLiteral(typeExpression, name, target, indent3) {
|
|
34735
34750
|
if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) {
|
|
@@ -34739,6 +34754,8 @@ ${lanes.join("\n")}
|
|
|
34739
34754
|
while (child = tryParse(() => parseChildParameterOrPropertyTag(target, indent3, name))) {
|
|
34740
34755
|
if (child.kind === 347 /* JSDocParameterTag */ || child.kind === 354 /* JSDocPropertyTag */) {
|
|
34741
34756
|
children = append(children, child);
|
|
34757
|
+
} else if (child.kind === 351 /* JSDocTemplateTag */) {
|
|
34758
|
+
parseErrorAtRange(child.tagName, Diagnostics.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag);
|
|
34742
34759
|
}
|
|
34743
34760
|
}
|
|
34744
34761
|
if (children) {
|
|
@@ -34877,6 +34894,9 @@ ${lanes.join("\n")}
|
|
|
34877
34894
|
let jsDocPropertyTags;
|
|
34878
34895
|
let hasChildren = false;
|
|
34879
34896
|
while (child = tryParse(() => parseChildPropertyTag(indent3))) {
|
|
34897
|
+
if (child.kind === 351 /* JSDocTemplateTag */) {
|
|
34898
|
+
break;
|
|
34899
|
+
}
|
|
34880
34900
|
hasChildren = true;
|
|
34881
34901
|
if (child.kind === 350 /* JSDocTypeTag */) {
|
|
34882
34902
|
if (childTypeTag) {
|
|
@@ -34936,6 +34956,10 @@ ${lanes.join("\n")}
|
|
|
34936
34956
|
let child;
|
|
34937
34957
|
let parameters;
|
|
34938
34958
|
while (child = tryParse(() => parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent3))) {
|
|
34959
|
+
if (child.kind === 351 /* JSDocTemplateTag */) {
|
|
34960
|
+
parseErrorAtRange(child.tagName, Diagnostics.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag);
|
|
34961
|
+
break;
|
|
34962
|
+
}
|
|
34939
34963
|
parameters = append(parameters, child);
|
|
34940
34964
|
}
|
|
34941
34965
|
return createNodeArray(parameters || [], pos);
|
|
@@ -35030,7 +35054,7 @@ ${lanes.join("\n")}
|
|
|
35030
35054
|
const start2 = scanner2.getTokenFullStart();
|
|
35031
35055
|
nextTokenJSDoc();
|
|
35032
35056
|
const tagName = parseJSDocIdentifierName();
|
|
35033
|
-
|
|
35057
|
+
const indentText = skipWhitespaceOrAsterisk();
|
|
35034
35058
|
let t;
|
|
35035
35059
|
switch (tagName.escapedText) {
|
|
35036
35060
|
case "type":
|
|
@@ -35044,6 +35068,8 @@ ${lanes.join("\n")}
|
|
|
35044
35068
|
case "param":
|
|
35045
35069
|
t = 2 /* Parameter */ | 4 /* CallbackParameter */;
|
|
35046
35070
|
break;
|
|
35071
|
+
case "template":
|
|
35072
|
+
return parseTemplateTag(start2, tagName, indent3, indentText);
|
|
35047
35073
|
default:
|
|
35048
35074
|
return false;
|
|
35049
35075
|
}
|
|
@@ -35131,9 +35157,9 @@ ${lanes.join("\n")}
|
|
|
35131
35157
|
const end2 = scanner2.getTokenEnd();
|
|
35132
35158
|
const originalKeywordKind = token();
|
|
35133
35159
|
const text = internIdentifier(scanner2.getTokenValue());
|
|
35134
|
-
const
|
|
35160
|
+
const result2 = finishNode(factoryCreateIdentifier(text, originalKeywordKind), start2, end2);
|
|
35135
35161
|
nextTokenJSDoc();
|
|
35136
|
-
return
|
|
35162
|
+
return result2;
|
|
35137
35163
|
}
|
|
35138
35164
|
}
|
|
35139
35165
|
})(JSDocParser = Parser2.JSDocParser || (Parser2.JSDocParser = {}));
|
|
@@ -45303,24 +45329,13 @@ ${lanes.join("\n")}
|
|
|
45303
45329
|
getTypeOfPropertyOfContextualType,
|
|
45304
45330
|
getFullyQualifiedName,
|
|
45305
45331
|
getResolvedSignature: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */),
|
|
45306
|
-
getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray
|
|
45307
|
-
|
|
45308
|
-
|
|
45309
|
-
|
|
45310
|
-
|
|
45311
|
-
|
|
45312
|
-
|
|
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
|
-
},
|
|
45332
|
+
getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray) => runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker(
|
|
45333
|
+
call,
|
|
45334
|
+
candidatesOutArray,
|
|
45335
|
+
/*argumentCount*/
|
|
45336
|
+
void 0,
|
|
45337
|
+
32 /* IsForStringLiteralArgumentCompletions */
|
|
45338
|
+
)),
|
|
45324
45339
|
getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */)),
|
|
45325
45340
|
getExpandedParameters,
|
|
45326
45341
|
hasEffectiveRestParameter,
|
|
@@ -56406,7 +56421,7 @@ ${lanes.join("\n")}
|
|
|
56406
56421
|
} else if (type !== firstType) {
|
|
56407
56422
|
checkFlags |= 64 /* HasNonUniformType */;
|
|
56408
56423
|
}
|
|
56409
|
-
if (isLiteralType(type) || isPatternLiteralType(type)
|
|
56424
|
+
if (isLiteralType(type) || isPatternLiteralType(type)) {
|
|
56410
56425
|
checkFlags |= 128 /* HasLiteralType */;
|
|
56411
56426
|
}
|
|
56412
56427
|
if (type.flags & 131072 /* Never */ && type !== uniqueLiteralType) {
|
|
@@ -66063,7 +66078,7 @@ ${lanes.join("\n")}
|
|
|
66063
66078
|
const constraint = getConstraintOfTypeParameter(inference.typeParameter);
|
|
66064
66079
|
if (constraint) {
|
|
66065
66080
|
const instantiatedConstraint = instantiateType(constraint, context.nonFixingMapper);
|
|
66066
|
-
if (!inferredType ||
|
|
66081
|
+
if (!inferredType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
|
|
66067
66082
|
inference.inferredType = fallbackType && context.compareTypes(fallbackType, getTypeWithThisArgument(instantiatedConstraint, fallbackType)) ? fallbackType : instantiatedConstraint;
|
|
66068
66083
|
}
|
|
66069
66084
|
}
|
|
@@ -71969,7 +71984,7 @@ ${lanes.join("\n")}
|
|
|
71969
71984
|
}
|
|
71970
71985
|
for (let i = 0; i < argCount; i++) {
|
|
71971
71986
|
const arg = args[i];
|
|
71972
|
-
if (arg.kind !== 231 /* OmittedExpression */) {
|
|
71987
|
+
if (arg.kind !== 231 /* OmittedExpression */ && !(checkMode & 32 /* IsForStringLiteralArgumentCompletions */ && hasSkipDirectInferenceFlag(arg))) {
|
|
71973
71988
|
const paramType = getTypeAtPosition(signature, i);
|
|
71974
71989
|
if (couldContainTypeVariables(paramType)) {
|
|
71975
71990
|
const argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);
|
|
@@ -72581,6 +72596,7 @@ ${lanes.join("\n")}
|
|
|
72581
72596
|
const args = getEffectiveCallArguments(node);
|
|
72582
72597
|
const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters;
|
|
72583
72598
|
let argCheckMode = !isDecorator2 && !isSingleNonGenericCandidate && some(args, isContextSensitive) ? 4 /* SkipContextSensitive */ : 0 /* Normal */;
|
|
72599
|
+
argCheckMode |= checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
|
|
72584
72600
|
let candidatesForArgumentError;
|
|
72585
72601
|
let candidateForArgumentArityError;
|
|
72586
72602
|
let candidateForTypeArgumentError;
|
|
@@ -72804,7 +72820,7 @@ ${lanes.join("\n")}
|
|
|
72804
72820
|
continue;
|
|
72805
72821
|
}
|
|
72806
72822
|
if (argCheckMode) {
|
|
72807
|
-
argCheckMode =
|
|
72823
|
+
argCheckMode = checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
|
|
72808
72824
|
if (inferenceContext) {
|
|
72809
72825
|
const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext);
|
|
72810
72826
|
checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext.inferredTypeParameters);
|
|
@@ -76642,7 +76658,7 @@ ${lanes.join("\n")}
|
|
|
76642
76658
|
return nullWideningType;
|
|
76643
76659
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
76644
76660
|
case 11 /* StringLiteral */:
|
|
76645
|
-
return hasSkipDirectInferenceFlag(node) ?
|
|
76661
|
+
return hasSkipDirectInferenceFlag(node) ? anyType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
|
|
76646
76662
|
case 9 /* NumericLiteral */:
|
|
76647
76663
|
checkGrammarNumericLiteral(node);
|
|
76648
76664
|
return getFreshTypeOfLiteralType(getNumberLiteralType(+node.text));
|
|
@@ -157854,7 +157870,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
157854
157870
|
case 290 /* JsxAttribute */:
|
|
157855
157871
|
if (!isRequireCallArgument(node) && !isImportCall(parent2)) {
|
|
157856
157872
|
const argumentInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(parent2.kind === 290 /* JsxAttribute */ ? parent2.parent : node, position, sourceFile);
|
|
157857
|
-
return argumentInfo &&
|
|
157873
|
+
return argumentInfo && getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker) || fromContextualType();
|
|
157858
157874
|
}
|
|
157859
157875
|
case 271 /* ImportDeclaration */:
|
|
157860
157876
|
case 277 /* ExportDeclaration */:
|
|
@@ -157923,12 +157939,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
157923
157939
|
function getAlreadyUsedTypesInStringLiteralUnion(union, current) {
|
|
157924
157940
|
return mapDefined(union.types, (type) => type !== current && isLiteralTypeNode(type) && isStringLiteral(type.literal) ? type.literal.text : void 0);
|
|
157925
157941
|
}
|
|
157926
|
-
function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker
|
|
157942
|
+
function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker) {
|
|
157927
157943
|
let isNewIdentifier = false;
|
|
157928
157944
|
const uniques = /* @__PURE__ */ new Map();
|
|
157929
157945
|
const candidates = [];
|
|
157930
157946
|
const editingArgument = isJsxOpeningLikeElement(call) ? Debug.checkDefined(findAncestor(arg.parent, isJsxAttribute)) : arg;
|
|
157931
|
-
checker.getResolvedSignatureForStringLiteralCompletions(call, editingArgument, candidates
|
|
157947
|
+
checker.getResolvedSignatureForStringLiteralCompletions(call, editingArgument, candidates);
|
|
157932
157948
|
const types = flatMap(candidates, (candidate) => {
|
|
157933
157949
|
if (!signatureHasRestParameter(candidate) && argumentInfo.argumentCount > candidate.parameters.length)
|
|
157934
157950
|
return;
|
package/lib/typescript.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.1";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20230505`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -8764,6 +8764,7 @@ ${lanes.join("\n")}
|
|
|
8764
8764
|
You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder: diag(8036, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036", "You cannot rename elements that are defined in another 'node_modules' folder."),
|
|
8765
8765
|
Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files: diag(8037, 1 /* Error */, "Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files_8037", "Type satisfaction expressions can only be used in TypeScript files."),
|
|
8766
8766
|
Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export: diag(8038, 1 /* Error */, "Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export_8038", "Decorators may not appear after 'export' or 'export default' if they also appear before 'export'."),
|
|
8767
|
+
A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag: diag(8039, 1 /* Error */, "A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag_8039", "A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag"),
|
|
8767
8768
|
Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9005, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005", "Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."),
|
|
8768
8769
|
Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9006, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006", "Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."),
|
|
8769
8770
|
JSX_attributes_must_only_be_assigned_a_non_empty_expression: diag(17e3, 1 /* Error */, "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", "JSX attributes must only be assigned a non-empty 'expression'."),
|
|
@@ -29649,8 +29650,13 @@ ${lanes.join("\n")}
|
|
|
29649
29650
|
return tokenIsIdentifierOrKeyword(token()) || token() === 19 /* OpenBraceToken */;
|
|
29650
29651
|
case 14 /* JsxChildren */:
|
|
29651
29652
|
return true;
|
|
29653
|
+
case 25 /* JSDocComment */:
|
|
29654
|
+
return true;
|
|
29655
|
+
case 26 /* Count */:
|
|
29656
|
+
return Debug.fail("ParsingContext.Count used as a context");
|
|
29657
|
+
default:
|
|
29658
|
+
Debug.assertNever(parsingContext2, "Non-exhaustive case in 'isListElement'.");
|
|
29652
29659
|
}
|
|
29653
|
-
return Debug.fail("Non-exhaustive case in 'isListElement'.");
|
|
29654
29660
|
}
|
|
29655
29661
|
function isValidHeritageClauseObjectLiteral() {
|
|
29656
29662
|
Debug.assert(token() === 19 /* OpenBraceToken */);
|
|
@@ -29744,7 +29750,8 @@ ${lanes.join("\n")}
|
|
|
29744
29750
|
return false;
|
|
29745
29751
|
}
|
|
29746
29752
|
function isInSomeParsingContext() {
|
|
29747
|
-
|
|
29753
|
+
Debug.assert(parsingContext, "Missing parsing context");
|
|
29754
|
+
for (let kind = 0; kind < 26 /* Count */; kind++) {
|
|
29748
29755
|
if (parsingContext & 1 << kind) {
|
|
29749
29756
|
if (isListElement2(
|
|
29750
29757
|
kind,
|
|
@@ -30003,7 +30010,9 @@ ${lanes.join("\n")}
|
|
|
30003
30010
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
30004
30011
|
case 24 /* AssertEntries */:
|
|
30005
30012
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_or_string_literal_expected);
|
|
30006
|
-
case 25 /*
|
|
30013
|
+
case 25 /* JSDocComment */:
|
|
30014
|
+
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
30015
|
+
case 26 /* Count */:
|
|
30007
30016
|
return Debug.fail("ParsingContext.Count used as a context");
|
|
30008
30017
|
default:
|
|
30009
30018
|
Debug.assertNever(context);
|
|
@@ -34135,7 +34144,8 @@ ${lanes.join("\n")}
|
|
|
34135
34144
|
ParsingContext2[ParsingContext2["HeritageClauses"] = 22] = "HeritageClauses";
|
|
34136
34145
|
ParsingContext2[ParsingContext2["ImportOrExportSpecifiers"] = 23] = "ImportOrExportSpecifiers";
|
|
34137
34146
|
ParsingContext2[ParsingContext2["AssertEntries"] = 24] = "AssertEntries";
|
|
34138
|
-
ParsingContext2[ParsingContext2["
|
|
34147
|
+
ParsingContext2[ParsingContext2["JSDocComment"] = 25] = "JSDocComment";
|
|
34148
|
+
ParsingContext2[ParsingContext2["Count"] = 26] = "Count";
|
|
34139
34149
|
})(ParsingContext || (ParsingContext = {}));
|
|
34140
34150
|
let Tristate;
|
|
34141
34151
|
((Tristate2) => {
|
|
@@ -34257,6 +34267,8 @@ ${lanes.join("\n")}
|
|
|
34257
34267
|
PropertyLikeParse2[PropertyLikeParse2["CallbackParameter"] = 4] = "CallbackParameter";
|
|
34258
34268
|
})(PropertyLikeParse || (PropertyLikeParse = {}));
|
|
34259
34269
|
function parseJSDocCommentWorker(start = 0, length2) {
|
|
34270
|
+
const saveParsingContext = parsingContext;
|
|
34271
|
+
parsingContext |= 1 << 25 /* JSDocComment */;
|
|
34260
34272
|
const content = sourceText;
|
|
34261
34273
|
const end = length2 === void 0 ? content.length : start + length2;
|
|
34262
34274
|
length2 = end - start;
|
|
@@ -34273,7 +34285,10 @@ ${lanes.join("\n")}
|
|
|
34273
34285
|
let commentsPos;
|
|
34274
34286
|
let comments = [];
|
|
34275
34287
|
const parts = [];
|
|
34276
|
-
|
|
34288
|
+
const result = scanner2.scanRange(start + 3, length2 - 5, doJSDocScan);
|
|
34289
|
+
parsingContext = saveParsingContext;
|
|
34290
|
+
return result;
|
|
34291
|
+
function doJSDocScan() {
|
|
34277
34292
|
let state = 1 /* SawAsterisk */;
|
|
34278
34293
|
let margin;
|
|
34279
34294
|
let indent2 = start - (content.lastIndexOf("\n", start) + 1) + 4;
|
|
@@ -34369,7 +34384,7 @@ ${lanes.join("\n")}
|
|
|
34369
34384
|
Debug.assertIsDefined(commentsPos, "having parsed tags implies that the end of the comment span should be set");
|
|
34370
34385
|
const tagsArray = tags && createNodeArray(tags, tagsPos, tagsEnd);
|
|
34371
34386
|
return finishNode(factory2.createJSDocComment(parts.length ? createNodeArray(parts, start, commentsPos) : trimmedComments.length ? trimmedComments : void 0, tagsArray), start, end);
|
|
34372
|
-
}
|
|
34387
|
+
}
|
|
34373
34388
|
function removeLeadingNewlines(comments2) {
|
|
34374
34389
|
while (comments2.length && (comments2[0] === "\n" || comments2[0] === "\r")) {
|
|
34375
34390
|
comments2.shift();
|
|
@@ -34728,8 +34743,8 @@ ${lanes.join("\n")}
|
|
|
34728
34743
|
typeExpression = nestedTypeLiteral;
|
|
34729
34744
|
isNameFirst = true;
|
|
34730
34745
|
}
|
|
34731
|
-
const
|
|
34732
|
-
return finishNode(
|
|
34746
|
+
const result2 = target === 1 /* Property */ ? factory2.createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) : factory2.createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment);
|
|
34747
|
+
return finishNode(result2, start2);
|
|
34733
34748
|
}
|
|
34734
34749
|
function parseNestedTypeLiteral(typeExpression, name, target, indent2) {
|
|
34735
34750
|
if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) {
|
|
@@ -34739,6 +34754,8 @@ ${lanes.join("\n")}
|
|
|
34739
34754
|
while (child = tryParse(() => parseChildParameterOrPropertyTag(target, indent2, name))) {
|
|
34740
34755
|
if (child.kind === 347 /* JSDocParameterTag */ || child.kind === 354 /* JSDocPropertyTag */) {
|
|
34741
34756
|
children = append(children, child);
|
|
34757
|
+
} else if (child.kind === 351 /* JSDocTemplateTag */) {
|
|
34758
|
+
parseErrorAtRange(child.tagName, Diagnostics.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag);
|
|
34742
34759
|
}
|
|
34743
34760
|
}
|
|
34744
34761
|
if (children) {
|
|
@@ -34877,6 +34894,9 @@ ${lanes.join("\n")}
|
|
|
34877
34894
|
let jsDocPropertyTags;
|
|
34878
34895
|
let hasChildren = false;
|
|
34879
34896
|
while (child = tryParse(() => parseChildPropertyTag(indent2))) {
|
|
34897
|
+
if (child.kind === 351 /* JSDocTemplateTag */) {
|
|
34898
|
+
break;
|
|
34899
|
+
}
|
|
34880
34900
|
hasChildren = true;
|
|
34881
34901
|
if (child.kind === 350 /* JSDocTypeTag */) {
|
|
34882
34902
|
if (childTypeTag) {
|
|
@@ -34936,6 +34956,10 @@ ${lanes.join("\n")}
|
|
|
34936
34956
|
let child;
|
|
34937
34957
|
let parameters;
|
|
34938
34958
|
while (child = tryParse(() => parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent2))) {
|
|
34959
|
+
if (child.kind === 351 /* JSDocTemplateTag */) {
|
|
34960
|
+
parseErrorAtRange(child.tagName, Diagnostics.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag);
|
|
34961
|
+
break;
|
|
34962
|
+
}
|
|
34939
34963
|
parameters = append(parameters, child);
|
|
34940
34964
|
}
|
|
34941
34965
|
return createNodeArray(parameters || [], pos);
|
|
@@ -35030,7 +35054,7 @@ ${lanes.join("\n")}
|
|
|
35030
35054
|
const start2 = scanner2.getTokenFullStart();
|
|
35031
35055
|
nextTokenJSDoc();
|
|
35032
35056
|
const tagName = parseJSDocIdentifierName();
|
|
35033
|
-
|
|
35057
|
+
const indentText = skipWhitespaceOrAsterisk();
|
|
35034
35058
|
let t;
|
|
35035
35059
|
switch (tagName.escapedText) {
|
|
35036
35060
|
case "type":
|
|
@@ -35044,6 +35068,8 @@ ${lanes.join("\n")}
|
|
|
35044
35068
|
case "param":
|
|
35045
35069
|
t = 2 /* Parameter */ | 4 /* CallbackParameter */;
|
|
35046
35070
|
break;
|
|
35071
|
+
case "template":
|
|
35072
|
+
return parseTemplateTag(start2, tagName, indent2, indentText);
|
|
35047
35073
|
default:
|
|
35048
35074
|
return false;
|
|
35049
35075
|
}
|
|
@@ -35131,9 +35157,9 @@ ${lanes.join("\n")}
|
|
|
35131
35157
|
const end2 = scanner2.getTokenEnd();
|
|
35132
35158
|
const originalKeywordKind = token();
|
|
35133
35159
|
const text = internIdentifier(scanner2.getTokenValue());
|
|
35134
|
-
const
|
|
35160
|
+
const result2 = finishNode(factoryCreateIdentifier(text, originalKeywordKind), start2, end2);
|
|
35135
35161
|
nextTokenJSDoc();
|
|
35136
|
-
return
|
|
35162
|
+
return result2;
|
|
35137
35163
|
}
|
|
35138
35164
|
}
|
|
35139
35165
|
})(JSDocParser = Parser2.JSDocParser || (Parser2.JSDocParser = {}));
|
|
@@ -45303,24 +45329,13 @@ ${lanes.join("\n")}
|
|
|
45303
45329
|
getTypeOfPropertyOfContextualType,
|
|
45304
45330
|
getFullyQualifiedName,
|
|
45305
45331
|
getResolvedSignature: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */),
|
|
45306
|
-
getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray
|
|
45307
|
-
|
|
45308
|
-
|
|
45309
|
-
|
|
45310
|
-
|
|
45311
|
-
|
|
45312
|
-
|
|
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
|
-
},
|
|
45332
|
+
getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray) => runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker(
|
|
45333
|
+
call,
|
|
45334
|
+
candidatesOutArray,
|
|
45335
|
+
/*argumentCount*/
|
|
45336
|
+
void 0,
|
|
45337
|
+
32 /* IsForStringLiteralArgumentCompletions */
|
|
45338
|
+
)),
|
|
45324
45339
|
getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */)),
|
|
45325
45340
|
getExpandedParameters,
|
|
45326
45341
|
hasEffectiveRestParameter,
|
|
@@ -56406,7 +56421,7 @@ ${lanes.join("\n")}
|
|
|
56406
56421
|
} else if (type !== firstType) {
|
|
56407
56422
|
checkFlags |= 64 /* HasNonUniformType */;
|
|
56408
56423
|
}
|
|
56409
|
-
if (isLiteralType(type) || isPatternLiteralType(type)
|
|
56424
|
+
if (isLiteralType(type) || isPatternLiteralType(type)) {
|
|
56410
56425
|
checkFlags |= 128 /* HasLiteralType */;
|
|
56411
56426
|
}
|
|
56412
56427
|
if (type.flags & 131072 /* Never */ && type !== uniqueLiteralType) {
|
|
@@ -66063,7 +66078,7 @@ ${lanes.join("\n")}
|
|
|
66063
66078
|
const constraint = getConstraintOfTypeParameter(inference.typeParameter);
|
|
66064
66079
|
if (constraint) {
|
|
66065
66080
|
const instantiatedConstraint = instantiateType(constraint, context.nonFixingMapper);
|
|
66066
|
-
if (!inferredType ||
|
|
66081
|
+
if (!inferredType || !context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
|
|
66067
66082
|
inference.inferredType = fallbackType && context.compareTypes(fallbackType, getTypeWithThisArgument(instantiatedConstraint, fallbackType)) ? fallbackType : instantiatedConstraint;
|
|
66068
66083
|
}
|
|
66069
66084
|
}
|
|
@@ -71969,7 +71984,7 @@ ${lanes.join("\n")}
|
|
|
71969
71984
|
}
|
|
71970
71985
|
for (let i = 0; i < argCount; i++) {
|
|
71971
71986
|
const arg = args[i];
|
|
71972
|
-
if (arg.kind !== 231 /* OmittedExpression */) {
|
|
71987
|
+
if (arg.kind !== 231 /* OmittedExpression */ && !(checkMode & 32 /* IsForStringLiteralArgumentCompletions */ && hasSkipDirectInferenceFlag(arg))) {
|
|
71973
71988
|
const paramType = getTypeAtPosition(signature, i);
|
|
71974
71989
|
if (couldContainTypeVariables(paramType)) {
|
|
71975
71990
|
const argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);
|
|
@@ -72581,6 +72596,7 @@ ${lanes.join("\n")}
|
|
|
72581
72596
|
const args = getEffectiveCallArguments(node);
|
|
72582
72597
|
const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters;
|
|
72583
72598
|
let argCheckMode = !isDecorator2 && !isSingleNonGenericCandidate && some(args, isContextSensitive) ? 4 /* SkipContextSensitive */ : 0 /* Normal */;
|
|
72599
|
+
argCheckMode |= checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
|
|
72584
72600
|
let candidatesForArgumentError;
|
|
72585
72601
|
let candidateForArgumentArityError;
|
|
72586
72602
|
let candidateForTypeArgumentError;
|
|
@@ -72804,7 +72820,7 @@ ${lanes.join("\n")}
|
|
|
72804
72820
|
continue;
|
|
72805
72821
|
}
|
|
72806
72822
|
if (argCheckMode) {
|
|
72807
|
-
argCheckMode =
|
|
72823
|
+
argCheckMode = checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
|
|
72808
72824
|
if (inferenceContext) {
|
|
72809
72825
|
const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext);
|
|
72810
72826
|
checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext.inferredTypeParameters);
|
|
@@ -76642,7 +76658,7 @@ ${lanes.join("\n")}
|
|
|
76642
76658
|
return nullWideningType;
|
|
76643
76659
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
76644
76660
|
case 11 /* StringLiteral */:
|
|
76645
|
-
return hasSkipDirectInferenceFlag(node) ?
|
|
76661
|
+
return hasSkipDirectInferenceFlag(node) ? anyType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
|
|
76646
76662
|
case 9 /* NumericLiteral */:
|
|
76647
76663
|
checkGrammarNumericLiteral(node);
|
|
76648
76664
|
return getFreshTypeOfLiteralType(getNumberLiteralType(+node.text));
|
|
@@ -157869,7 +157885,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
157869
157885
|
case 290 /* JsxAttribute */:
|
|
157870
157886
|
if (!isRequireCallArgument(node) && !isImportCall(parent2)) {
|
|
157871
157887
|
const argumentInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(parent2.kind === 290 /* JsxAttribute */ ? parent2.parent : node, position, sourceFile);
|
|
157872
|
-
return argumentInfo &&
|
|
157888
|
+
return argumentInfo && getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker) || fromContextualType();
|
|
157873
157889
|
}
|
|
157874
157890
|
case 271 /* ImportDeclaration */:
|
|
157875
157891
|
case 277 /* ExportDeclaration */:
|
|
@@ -157938,12 +157954,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
157938
157954
|
function getAlreadyUsedTypesInStringLiteralUnion(union, current) {
|
|
157939
157955
|
return mapDefined(union.types, (type) => type !== current && isLiteralTypeNode(type) && isStringLiteral(type.literal) ? type.literal.text : void 0);
|
|
157940
157956
|
}
|
|
157941
|
-
function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker
|
|
157957
|
+
function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker) {
|
|
157942
157958
|
let isNewIdentifier = false;
|
|
157943
157959
|
const uniques = /* @__PURE__ */ new Map();
|
|
157944
157960
|
const candidates = [];
|
|
157945
157961
|
const editingArgument = isJsxOpeningLikeElement(call) ? Debug.checkDefined(findAncestor(arg.parent, isJsxAttribute)) : arg;
|
|
157946
|
-
checker.getResolvedSignatureForStringLiteralCompletions(call, editingArgument, candidates
|
|
157962
|
+
checker.getResolvedSignatureForStringLiteralCompletions(call, editingArgument, candidates);
|
|
157947
157963
|
const types = flatMap(candidates, (candidate) => {
|
|
157948
157964
|
if (!signatureHasRestParameter(candidate) && argumentInfo.argumentCount > candidate.parameters.length)
|
|
157949
157965
|
return;
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
|
|
|
54
54
|
|
|
55
55
|
// src/compiler/corePublic.ts
|
|
56
56
|
var versionMajorMinor = "5.1";
|
|
57
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
57
|
+
var version = `${versionMajorMinor}.0-insiders.20230505`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -6824,6 +6824,7 @@ var Diagnostics = {
|
|
|
6824
6824
|
You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder: diag(8036, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036", "You cannot rename elements that are defined in another 'node_modules' folder."),
|
|
6825
6825
|
Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files: diag(8037, 1 /* Error */, "Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files_8037", "Type satisfaction expressions can only be used in TypeScript files."),
|
|
6826
6826
|
Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export: diag(8038, 1 /* Error */, "Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export_8038", "Decorators may not appear after 'export' or 'export default' if they also appear before 'export'."),
|
|
6827
|
+
A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag: diag(8039, 1 /* Error */, "A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag_8039", "A JSDoc '@template' tag may not follow a '@typedef', '@callback', or '@overload' tag"),
|
|
6827
6828
|
Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9005, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005", "Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."),
|
|
6828
6829
|
Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9006, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006", "Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."),
|
|
6829
6830
|
JSX_attributes_must_only_be_assigned_a_non_empty_expression: diag(17e3, 1 /* Error */, "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", "JSX attributes must only be assigned a non-empty 'expression'."),
|
|
@@ -19204,8 +19205,13 @@ var Parser;
|
|
|
19204
19205
|
return tokenIsIdentifierOrKeyword(token()) || token() === 19 /* OpenBraceToken */;
|
|
19205
19206
|
case 14 /* JsxChildren */:
|
|
19206
19207
|
return true;
|
|
19208
|
+
case 25 /* JSDocComment */:
|
|
19209
|
+
return true;
|
|
19210
|
+
case 26 /* Count */:
|
|
19211
|
+
return Debug.fail("ParsingContext.Count used as a context");
|
|
19212
|
+
default:
|
|
19213
|
+
Debug.assertNever(parsingContext2, "Non-exhaustive case in 'isListElement'.");
|
|
19207
19214
|
}
|
|
19208
|
-
return Debug.fail("Non-exhaustive case in 'isListElement'.");
|
|
19209
19215
|
}
|
|
19210
19216
|
function isValidHeritageClauseObjectLiteral() {
|
|
19211
19217
|
Debug.assert(token() === 19 /* OpenBraceToken */);
|
|
@@ -19299,7 +19305,8 @@ var Parser;
|
|
|
19299
19305
|
return false;
|
|
19300
19306
|
}
|
|
19301
19307
|
function isInSomeParsingContext() {
|
|
19302
|
-
|
|
19308
|
+
Debug.assert(parsingContext, "Missing parsing context");
|
|
19309
|
+
for (let kind = 0; kind < 26 /* Count */; kind++) {
|
|
19303
19310
|
if (parsingContext & 1 << kind) {
|
|
19304
19311
|
if (isListElement(
|
|
19305
19312
|
kind,
|
|
@@ -19558,7 +19565,9 @@ var Parser;
|
|
|
19558
19565
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
19559
19566
|
case 24 /* AssertEntries */:
|
|
19560
19567
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_or_string_literal_expected);
|
|
19561
|
-
case 25 /*
|
|
19568
|
+
case 25 /* JSDocComment */:
|
|
19569
|
+
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
19570
|
+
case 26 /* Count */:
|
|
19562
19571
|
return Debug.fail("ParsingContext.Count used as a context");
|
|
19563
19572
|
default:
|
|
19564
19573
|
Debug.assertNever(context);
|
|
@@ -23690,7 +23699,8 @@ var Parser;
|
|
|
23690
23699
|
ParsingContext2[ParsingContext2["HeritageClauses"] = 22] = "HeritageClauses";
|
|
23691
23700
|
ParsingContext2[ParsingContext2["ImportOrExportSpecifiers"] = 23] = "ImportOrExportSpecifiers";
|
|
23692
23701
|
ParsingContext2[ParsingContext2["AssertEntries"] = 24] = "AssertEntries";
|
|
23693
|
-
ParsingContext2[ParsingContext2["
|
|
23702
|
+
ParsingContext2[ParsingContext2["JSDocComment"] = 25] = "JSDocComment";
|
|
23703
|
+
ParsingContext2[ParsingContext2["Count"] = 26] = "Count";
|
|
23694
23704
|
})(ParsingContext || (ParsingContext = {}));
|
|
23695
23705
|
let Tristate;
|
|
23696
23706
|
((Tristate2) => {
|
|
@@ -23812,6 +23822,8 @@ var Parser;
|
|
|
23812
23822
|
PropertyLikeParse2[PropertyLikeParse2["CallbackParameter"] = 4] = "CallbackParameter";
|
|
23813
23823
|
})(PropertyLikeParse || (PropertyLikeParse = {}));
|
|
23814
23824
|
function parseJSDocCommentWorker(start = 0, length2) {
|
|
23825
|
+
const saveParsingContext = parsingContext;
|
|
23826
|
+
parsingContext |= 1 << 25 /* JSDocComment */;
|
|
23815
23827
|
const content = sourceText;
|
|
23816
23828
|
const end = length2 === void 0 ? content.length : start + length2;
|
|
23817
23829
|
length2 = end - start;
|
|
@@ -23828,7 +23840,10 @@ var Parser;
|
|
|
23828
23840
|
let commentsPos;
|
|
23829
23841
|
let comments = [];
|
|
23830
23842
|
const parts = [];
|
|
23831
|
-
|
|
23843
|
+
const result = scanner.scanRange(start + 3, length2 - 5, doJSDocScan);
|
|
23844
|
+
parsingContext = saveParsingContext;
|
|
23845
|
+
return result;
|
|
23846
|
+
function doJSDocScan() {
|
|
23832
23847
|
let state = 1 /* SawAsterisk */;
|
|
23833
23848
|
let margin;
|
|
23834
23849
|
let indent2 = start - (content.lastIndexOf("\n", start) + 1) + 4;
|
|
@@ -23924,7 +23939,7 @@ var Parser;
|
|
|
23924
23939
|
Debug.assertIsDefined(commentsPos, "having parsed tags implies that the end of the comment span should be set");
|
|
23925
23940
|
const tagsArray = tags && createNodeArray(tags, tagsPos, tagsEnd);
|
|
23926
23941
|
return finishNode(factory2.createJSDocComment(parts.length ? createNodeArray(parts, start, commentsPos) : trimmedComments.length ? trimmedComments : void 0, tagsArray), start, end);
|
|
23927
|
-
}
|
|
23942
|
+
}
|
|
23928
23943
|
function removeLeadingNewlines(comments2) {
|
|
23929
23944
|
while (comments2.length && (comments2[0] === "\n" || comments2[0] === "\r")) {
|
|
23930
23945
|
comments2.shift();
|
|
@@ -24283,8 +24298,8 @@ var Parser;
|
|
|
24283
24298
|
typeExpression = nestedTypeLiteral;
|
|
24284
24299
|
isNameFirst = true;
|
|
24285
24300
|
}
|
|
24286
|
-
const
|
|
24287
|
-
return finishNode(
|
|
24301
|
+
const result2 = target === 1 /* Property */ ? factory2.createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) : factory2.createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment);
|
|
24302
|
+
return finishNode(result2, start2);
|
|
24288
24303
|
}
|
|
24289
24304
|
function parseNestedTypeLiteral(typeExpression, name, target, indent2) {
|
|
24290
24305
|
if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) {
|
|
@@ -24294,6 +24309,8 @@ var Parser;
|
|
|
24294
24309
|
while (child = tryParse(() => parseChildParameterOrPropertyTag(target, indent2, name))) {
|
|
24295
24310
|
if (child.kind === 347 /* JSDocParameterTag */ || child.kind === 354 /* JSDocPropertyTag */) {
|
|
24296
24311
|
children = append(children, child);
|
|
24312
|
+
} else if (child.kind === 351 /* JSDocTemplateTag */) {
|
|
24313
|
+
parseErrorAtRange(child.tagName, Diagnostics.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag);
|
|
24297
24314
|
}
|
|
24298
24315
|
}
|
|
24299
24316
|
if (children) {
|
|
@@ -24432,6 +24449,9 @@ var Parser;
|
|
|
24432
24449
|
let jsDocPropertyTags;
|
|
24433
24450
|
let hasChildren = false;
|
|
24434
24451
|
while (child = tryParse(() => parseChildPropertyTag(indent2))) {
|
|
24452
|
+
if (child.kind === 351 /* JSDocTemplateTag */) {
|
|
24453
|
+
break;
|
|
24454
|
+
}
|
|
24435
24455
|
hasChildren = true;
|
|
24436
24456
|
if (child.kind === 350 /* JSDocTypeTag */) {
|
|
24437
24457
|
if (childTypeTag) {
|
|
@@ -24491,6 +24511,10 @@ var Parser;
|
|
|
24491
24511
|
let child;
|
|
24492
24512
|
let parameters;
|
|
24493
24513
|
while (child = tryParse(() => parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent2))) {
|
|
24514
|
+
if (child.kind === 351 /* JSDocTemplateTag */) {
|
|
24515
|
+
parseErrorAtRange(child.tagName, Diagnostics.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag);
|
|
24516
|
+
break;
|
|
24517
|
+
}
|
|
24494
24518
|
parameters = append(parameters, child);
|
|
24495
24519
|
}
|
|
24496
24520
|
return createNodeArray(parameters || [], pos);
|
|
@@ -24585,7 +24609,7 @@ var Parser;
|
|
|
24585
24609
|
const start2 = scanner.getTokenFullStart();
|
|
24586
24610
|
nextTokenJSDoc();
|
|
24587
24611
|
const tagName = parseJSDocIdentifierName();
|
|
24588
|
-
|
|
24612
|
+
const indentText = skipWhitespaceOrAsterisk();
|
|
24589
24613
|
let t;
|
|
24590
24614
|
switch (tagName.escapedText) {
|
|
24591
24615
|
case "type":
|
|
@@ -24599,6 +24623,8 @@ var Parser;
|
|
|
24599
24623
|
case "param":
|
|
24600
24624
|
t = 2 /* Parameter */ | 4 /* CallbackParameter */;
|
|
24601
24625
|
break;
|
|
24626
|
+
case "template":
|
|
24627
|
+
return parseTemplateTag(start2, tagName, indent2, indentText);
|
|
24602
24628
|
default:
|
|
24603
24629
|
return false;
|
|
24604
24630
|
}
|
|
@@ -24686,9 +24712,9 @@ var Parser;
|
|
|
24686
24712
|
const end2 = scanner.getTokenEnd();
|
|
24687
24713
|
const originalKeywordKind = token();
|
|
24688
24714
|
const text = internIdentifier(scanner.getTokenValue());
|
|
24689
|
-
const
|
|
24715
|
+
const result2 = finishNode(factoryCreateIdentifier(text, originalKeywordKind), start2, end2);
|
|
24690
24716
|
nextTokenJSDoc();
|
|
24691
|
-
return
|
|
24717
|
+
return result2;
|
|
24692
24718
|
}
|
|
24693
24719
|
}
|
|
24694
24720
|
})(JSDocParser = Parser2.JSDocParser || (Parser2.JSDocParser = {}));
|
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-54112-28",
|
|
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": "407cd798b1bc232d5fc9c0da289dea07741c9a51"
|
|
120
120
|
}
|