@typescript-deploys/pr-build 5.1.0-pr-54121-5 → 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 +53 -48
- package/lib/tsserver.js +57 -51
- package/lib/tsserverlibrary.js +57 -51
- package/lib/typescript.js +57 -51
- 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,7 +42887,13 @@ function createTypeChecker(host) {
|
|
|
42861
42887
|
getTypeOfPropertyOfContextualType,
|
|
42862
42888
|
getFullyQualifiedName,
|
|
42863
42889
|
getResolvedSignature: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */),
|
|
42864
|
-
|
|
42890
|
+
getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray) => runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker(
|
|
42891
|
+
call,
|
|
42892
|
+
candidatesOutArray,
|
|
42893
|
+
/*argumentCount*/
|
|
42894
|
+
void 0,
|
|
42895
|
+
32 /* IsForStringLiteralArgumentCompletions */
|
|
42896
|
+
)),
|
|
42865
42897
|
getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */)),
|
|
42866
42898
|
getExpandedParameters,
|
|
42867
42899
|
hasEffectiveRestParameter,
|
|
@@ -43060,44 +43092,17 @@ function createTypeChecker(host) {
|
|
|
43060
43092
|
isTypeParameterPossiblyReferenced,
|
|
43061
43093
|
typeHasCallOrConstructSignatures
|
|
43062
43094
|
};
|
|
43063
|
-
function getCandidateSignaturesForStringLiteralCompletions(call, editingArgument) {
|
|
43064
|
-
const candidatesSet = /* @__PURE__ */ new Set();
|
|
43065
|
-
const candidates = [];
|
|
43066
|
-
runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker(
|
|
43067
|
-
call,
|
|
43068
|
-
candidates,
|
|
43069
|
-
/*argumentCount*/
|
|
43070
|
-
void 0,
|
|
43071
|
-
32 /* IsForStringLiteralArgumentCompletions */
|
|
43072
|
-
));
|
|
43073
|
-
for (const candidate of candidates) {
|
|
43074
|
-
candidatesSet.add(candidate);
|
|
43075
|
-
}
|
|
43076
|
-
candidates.length = 0;
|
|
43077
|
-
runWithoutResolvedSignatureCaching(editingArgument, () => getResolvedSignatureWorker(
|
|
43078
|
-
call,
|
|
43079
|
-
candidates,
|
|
43080
|
-
/*argumentCount*/
|
|
43081
|
-
void 0,
|
|
43082
|
-
32 /* IsForStringLiteralArgumentCompletions */
|
|
43083
|
-
));
|
|
43084
|
-
for (const candidate of candidates) {
|
|
43085
|
-
candidatesSet.add(candidate);
|
|
43086
|
-
}
|
|
43087
|
-
return arrayFrom(candidatesSet);
|
|
43088
|
-
}
|
|
43089
43095
|
function runWithoutResolvedSignatureCaching(node, fn) {
|
|
43090
43096
|
const containingCall = findAncestor(node, isCallLikeExpression);
|
|
43097
|
+
const containingCallResolvedSignature = containingCall && getNodeLinks(containingCall).resolvedSignature;
|
|
43091
43098
|
if (containingCall) {
|
|
43092
|
-
|
|
43093
|
-
|
|
43094
|
-
|
|
43095
|
-
|
|
43096
|
-
|
|
43097
|
-
return result;
|
|
43098
|
-
} else {
|
|
43099
|
-
return fn();
|
|
43099
|
+
getNodeLinks(containingCall).resolvedSignature = void 0;
|
|
43100
|
+
}
|
|
43101
|
+
const result = fn();
|
|
43102
|
+
if (containingCall) {
|
|
43103
|
+
getNodeLinks(containingCall).resolvedSignature = containingCallResolvedSignature;
|
|
43100
43104
|
}
|
|
43105
|
+
return result;
|
|
43101
43106
|
}
|
|
43102
43107
|
function runWithInferenceBlockedFromSourceNode(node, fn) {
|
|
43103
43108
|
const containingCall = findAncestor(node, isCallLikeExpression);
|
|
@@ -53974,7 +53979,7 @@ function createTypeChecker(host) {
|
|
|
53974
53979
|
} else if (type !== firstType) {
|
|
53975
53980
|
checkFlags |= 64 /* HasNonUniformType */;
|
|
53976
53981
|
}
|
|
53977
|
-
if (isLiteralType(type) || isPatternLiteralType(type)
|
|
53982
|
+
if (isLiteralType(type) || isPatternLiteralType(type)) {
|
|
53978
53983
|
checkFlags |= 128 /* HasLiteralType */;
|
|
53979
53984
|
}
|
|
53980
53985
|
if (type.flags & 131072 /* Never */ && type !== uniqueLiteralType) {
|
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 = {}));
|
|
@@ -47290,7 +47316,7 @@ function createTypeChecker(host) {
|
|
|
47290
47316
|
var externalHelpersModule;
|
|
47291
47317
|
var Symbol47 = objectAllocator.getSymbolConstructor();
|
|
47292
47318
|
var Type27 = objectAllocator.getTypeConstructor();
|
|
47293
|
-
var
|
|
47319
|
+
var Signature15 = objectAllocator.getSignatureConstructor();
|
|
47294
47320
|
var typeCount = 0;
|
|
47295
47321
|
var symbolCount = 0;
|
|
47296
47322
|
var totalInstantiationCount = 0;
|
|
@@ -47511,7 +47537,13 @@ function createTypeChecker(host) {
|
|
|
47511
47537
|
getTypeOfPropertyOfContextualType,
|
|
47512
47538
|
getFullyQualifiedName,
|
|
47513
47539
|
getResolvedSignature: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */),
|
|
47514
|
-
|
|
47540
|
+
getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray) => runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker(
|
|
47541
|
+
call,
|
|
47542
|
+
candidatesOutArray,
|
|
47543
|
+
/*argumentCount*/
|
|
47544
|
+
void 0,
|
|
47545
|
+
32 /* IsForStringLiteralArgumentCompletions */
|
|
47546
|
+
)),
|
|
47515
47547
|
getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */)),
|
|
47516
47548
|
getExpandedParameters,
|
|
47517
47549
|
hasEffectiveRestParameter,
|
|
@@ -47710,44 +47742,17 @@ function createTypeChecker(host) {
|
|
|
47710
47742
|
isTypeParameterPossiblyReferenced,
|
|
47711
47743
|
typeHasCallOrConstructSignatures
|
|
47712
47744
|
};
|
|
47713
|
-
function getCandidateSignaturesForStringLiteralCompletions(call, editingArgument) {
|
|
47714
|
-
const candidatesSet = /* @__PURE__ */ new Set();
|
|
47715
|
-
const candidates = [];
|
|
47716
|
-
runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker(
|
|
47717
|
-
call,
|
|
47718
|
-
candidates,
|
|
47719
|
-
/*argumentCount*/
|
|
47720
|
-
void 0,
|
|
47721
|
-
32 /* IsForStringLiteralArgumentCompletions */
|
|
47722
|
-
));
|
|
47723
|
-
for (const candidate of candidates) {
|
|
47724
|
-
candidatesSet.add(candidate);
|
|
47725
|
-
}
|
|
47726
|
-
candidates.length = 0;
|
|
47727
|
-
runWithoutResolvedSignatureCaching(editingArgument, () => getResolvedSignatureWorker(
|
|
47728
|
-
call,
|
|
47729
|
-
candidates,
|
|
47730
|
-
/*argumentCount*/
|
|
47731
|
-
void 0,
|
|
47732
|
-
32 /* IsForStringLiteralArgumentCompletions */
|
|
47733
|
-
));
|
|
47734
|
-
for (const candidate of candidates) {
|
|
47735
|
-
candidatesSet.add(candidate);
|
|
47736
|
-
}
|
|
47737
|
-
return arrayFrom(candidatesSet);
|
|
47738
|
-
}
|
|
47739
47745
|
function runWithoutResolvedSignatureCaching(node, fn) {
|
|
47740
47746
|
const containingCall = findAncestor(node, isCallLikeExpression);
|
|
47747
|
+
const containingCallResolvedSignature = containingCall && getNodeLinks(containingCall).resolvedSignature;
|
|
47741
47748
|
if (containingCall) {
|
|
47742
|
-
|
|
47743
|
-
const containingCallResolvedSignature = links.resolvedSignature;
|
|
47744
|
-
links.resolvedSignature = void 0;
|
|
47745
|
-
const result = fn();
|
|
47746
|
-
links.resolvedSignature = containingCallResolvedSignature;
|
|
47747
|
-
return result;
|
|
47748
|
-
} else {
|
|
47749
|
-
return fn();
|
|
47749
|
+
getNodeLinks(containingCall).resolvedSignature = void 0;
|
|
47750
47750
|
}
|
|
47751
|
+
const result = fn();
|
|
47752
|
+
if (containingCall) {
|
|
47753
|
+
getNodeLinks(containingCall).resolvedSignature = containingCallResolvedSignature;
|
|
47754
|
+
}
|
|
47755
|
+
return result;
|
|
47751
47756
|
}
|
|
47752
47757
|
function runWithInferenceBlockedFromSourceNode(node, fn) {
|
|
47753
47758
|
const containingCall = findAncestor(node, isCallLikeExpression);
|
|
@@ -57351,7 +57356,7 @@ function createTypeChecker(host) {
|
|
|
57351
57356
|
resolveObjectTypeMembers(type, source, typeParameters, paddedTypeArguments);
|
|
57352
57357
|
}
|
|
57353
57358
|
function createSignature(declaration, typeParameters, thisParameter, parameters, resolvedReturnType, resolvedTypePredicate, minArgumentCount, flags) {
|
|
57354
|
-
const sig = new
|
|
57359
|
+
const sig = new Signature15(checker, flags);
|
|
57355
57360
|
sig.declaration = declaration;
|
|
57356
57361
|
sig.typeParameters = typeParameters;
|
|
57357
57362
|
sig.parameters = parameters;
|
|
@@ -58624,7 +58629,7 @@ function createTypeChecker(host) {
|
|
|
58624
58629
|
} else if (type !== firstType) {
|
|
58625
58630
|
checkFlags |= 64 /* HasNonUniformType */;
|
|
58626
58631
|
}
|
|
58627
|
-
if (isLiteralType(type) || isPatternLiteralType(type)
|
|
58632
|
+
if (isLiteralType(type) || isPatternLiteralType(type)) {
|
|
58628
58633
|
checkFlags |= 128 /* HasLiteralType */;
|
|
58629
58634
|
}
|
|
58630
58635
|
if (type.flags & 131072 /* Never */ && type !== uniqueLiteralType) {
|
|
@@ -158661,8 +158666,9 @@ function getAlreadyUsedTypesInStringLiteralUnion(union, current) {
|
|
|
158661
158666
|
function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker) {
|
|
158662
158667
|
let isNewIdentifier = false;
|
|
158663
158668
|
const uniques = /* @__PURE__ */ new Map();
|
|
158669
|
+
const candidates = [];
|
|
158664
158670
|
const editingArgument = isJsxOpeningLikeElement(call) ? Debug.checkDefined(findAncestor(arg.parent, isJsxAttribute)) : arg;
|
|
158665
|
-
|
|
158671
|
+
checker.getResolvedSignatureForStringLiteralCompletions(call, editingArgument, candidates);
|
|
158666
158672
|
const types = flatMap(candidates, (candidate) => {
|
|
158667
158673
|
if (!signatureHasRestParameter(candidate) && argumentInfo.argumentCount > candidate.parameters.length)
|
|
158668
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 = {}));
|
|
@@ -45082,7 +45108,7 @@ ${lanes.join("\n")}
|
|
|
45082
45108
|
var externalHelpersModule;
|
|
45083
45109
|
var Symbol47 = objectAllocator.getSymbolConstructor();
|
|
45084
45110
|
var Type27 = objectAllocator.getTypeConstructor();
|
|
45085
|
-
var
|
|
45111
|
+
var Signature15 = objectAllocator.getSignatureConstructor();
|
|
45086
45112
|
var typeCount = 0;
|
|
45087
45113
|
var symbolCount = 0;
|
|
45088
45114
|
var totalInstantiationCount = 0;
|
|
@@ -45303,7 +45329,13 @@ ${lanes.join("\n")}
|
|
|
45303
45329
|
getTypeOfPropertyOfContextualType,
|
|
45304
45330
|
getFullyQualifiedName,
|
|
45305
45331
|
getResolvedSignature: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */),
|
|
45306
|
-
|
|
45332
|
+
getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray) => runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker(
|
|
45333
|
+
call,
|
|
45334
|
+
candidatesOutArray,
|
|
45335
|
+
/*argumentCount*/
|
|
45336
|
+
void 0,
|
|
45337
|
+
32 /* IsForStringLiteralArgumentCompletions */
|
|
45338
|
+
)),
|
|
45307
45339
|
getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */)),
|
|
45308
45340
|
getExpandedParameters,
|
|
45309
45341
|
hasEffectiveRestParameter,
|
|
@@ -45502,44 +45534,17 @@ ${lanes.join("\n")}
|
|
|
45502
45534
|
isTypeParameterPossiblyReferenced,
|
|
45503
45535
|
typeHasCallOrConstructSignatures
|
|
45504
45536
|
};
|
|
45505
|
-
function getCandidateSignaturesForStringLiteralCompletions(call, editingArgument) {
|
|
45506
|
-
const candidatesSet = /* @__PURE__ */ new Set();
|
|
45507
|
-
const candidates = [];
|
|
45508
|
-
runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker(
|
|
45509
|
-
call,
|
|
45510
|
-
candidates,
|
|
45511
|
-
/*argumentCount*/
|
|
45512
|
-
void 0,
|
|
45513
|
-
32 /* IsForStringLiteralArgumentCompletions */
|
|
45514
|
-
));
|
|
45515
|
-
for (const candidate of candidates) {
|
|
45516
|
-
candidatesSet.add(candidate);
|
|
45517
|
-
}
|
|
45518
|
-
candidates.length = 0;
|
|
45519
|
-
runWithoutResolvedSignatureCaching(editingArgument, () => getResolvedSignatureWorker(
|
|
45520
|
-
call,
|
|
45521
|
-
candidates,
|
|
45522
|
-
/*argumentCount*/
|
|
45523
|
-
void 0,
|
|
45524
|
-
32 /* IsForStringLiteralArgumentCompletions */
|
|
45525
|
-
));
|
|
45526
|
-
for (const candidate of candidates) {
|
|
45527
|
-
candidatesSet.add(candidate);
|
|
45528
|
-
}
|
|
45529
|
-
return arrayFrom(candidatesSet);
|
|
45530
|
-
}
|
|
45531
45537
|
function runWithoutResolvedSignatureCaching(node, fn) {
|
|
45532
45538
|
const containingCall = findAncestor(node, isCallLikeExpression);
|
|
45539
|
+
const containingCallResolvedSignature = containingCall && getNodeLinks(containingCall).resolvedSignature;
|
|
45533
45540
|
if (containingCall) {
|
|
45534
|
-
|
|
45535
|
-
const containingCallResolvedSignature = links.resolvedSignature;
|
|
45536
|
-
links.resolvedSignature = void 0;
|
|
45537
|
-
const result = fn();
|
|
45538
|
-
links.resolvedSignature = containingCallResolvedSignature;
|
|
45539
|
-
return result;
|
|
45540
|
-
} else {
|
|
45541
|
-
return fn();
|
|
45541
|
+
getNodeLinks(containingCall).resolvedSignature = void 0;
|
|
45542
45542
|
}
|
|
45543
|
+
const result = fn();
|
|
45544
|
+
if (containingCall) {
|
|
45545
|
+
getNodeLinks(containingCall).resolvedSignature = containingCallResolvedSignature;
|
|
45546
|
+
}
|
|
45547
|
+
return result;
|
|
45543
45548
|
}
|
|
45544
45549
|
function runWithInferenceBlockedFromSourceNode(node, fn) {
|
|
45545
45550
|
const containingCall = findAncestor(node, isCallLikeExpression);
|
|
@@ -55143,7 +55148,7 @@ ${lanes.join("\n")}
|
|
|
55143
55148
|
resolveObjectTypeMembers(type, source, typeParameters, paddedTypeArguments);
|
|
55144
55149
|
}
|
|
55145
55150
|
function createSignature(declaration, typeParameters, thisParameter, parameters, resolvedReturnType, resolvedTypePredicate, minArgumentCount, flags) {
|
|
55146
|
-
const sig = new
|
|
55151
|
+
const sig = new Signature15(checker, flags);
|
|
55147
55152
|
sig.declaration = declaration;
|
|
55148
55153
|
sig.typeParameters = typeParameters;
|
|
55149
55154
|
sig.parameters = parameters;
|
|
@@ -56416,7 +56421,7 @@ ${lanes.join("\n")}
|
|
|
56416
56421
|
} else if (type !== firstType) {
|
|
56417
56422
|
checkFlags |= 64 /* HasNonUniformType */;
|
|
56418
56423
|
}
|
|
56419
|
-
if (isLiteralType(type) || isPatternLiteralType(type)
|
|
56424
|
+
if (isLiteralType(type) || isPatternLiteralType(type)) {
|
|
56420
56425
|
checkFlags |= 128 /* HasLiteralType */;
|
|
56421
56426
|
}
|
|
56422
56427
|
if (type.flags & 131072 /* Never */ && type !== uniqueLiteralType) {
|
|
@@ -157937,8 +157942,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
157937
157942
|
function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker) {
|
|
157938
157943
|
let isNewIdentifier = false;
|
|
157939
157944
|
const uniques = /* @__PURE__ */ new Map();
|
|
157945
|
+
const candidates = [];
|
|
157940
157946
|
const editingArgument = isJsxOpeningLikeElement(call) ? Debug.checkDefined(findAncestor(arg.parent, isJsxAttribute)) : arg;
|
|
157941
|
-
|
|
157947
|
+
checker.getResolvedSignatureForStringLiteralCompletions(call, editingArgument, candidates);
|
|
157942
157948
|
const types = flatMap(candidates, (candidate) => {
|
|
157943
157949
|
if (!signatureHasRestParameter(candidate) && argumentInfo.argumentCount > candidate.parameters.length)
|
|
157944
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 = {}));
|
|
@@ -45082,7 +45108,7 @@ ${lanes.join("\n")}
|
|
|
45082
45108
|
var externalHelpersModule;
|
|
45083
45109
|
var Symbol47 = objectAllocator.getSymbolConstructor();
|
|
45084
45110
|
var Type27 = objectAllocator.getTypeConstructor();
|
|
45085
|
-
var
|
|
45111
|
+
var Signature15 = objectAllocator.getSignatureConstructor();
|
|
45086
45112
|
var typeCount = 0;
|
|
45087
45113
|
var symbolCount = 0;
|
|
45088
45114
|
var totalInstantiationCount = 0;
|
|
@@ -45303,7 +45329,13 @@ ${lanes.join("\n")}
|
|
|
45303
45329
|
getTypeOfPropertyOfContextualType,
|
|
45304
45330
|
getFullyQualifiedName,
|
|
45305
45331
|
getResolvedSignature: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */),
|
|
45306
|
-
|
|
45332
|
+
getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray) => runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker(
|
|
45333
|
+
call,
|
|
45334
|
+
candidatesOutArray,
|
|
45335
|
+
/*argumentCount*/
|
|
45336
|
+
void 0,
|
|
45337
|
+
32 /* IsForStringLiteralArgumentCompletions */
|
|
45338
|
+
)),
|
|
45307
45339
|
getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */)),
|
|
45308
45340
|
getExpandedParameters,
|
|
45309
45341
|
hasEffectiveRestParameter,
|
|
@@ -45502,44 +45534,17 @@ ${lanes.join("\n")}
|
|
|
45502
45534
|
isTypeParameterPossiblyReferenced,
|
|
45503
45535
|
typeHasCallOrConstructSignatures
|
|
45504
45536
|
};
|
|
45505
|
-
function getCandidateSignaturesForStringLiteralCompletions(call, editingArgument) {
|
|
45506
|
-
const candidatesSet = /* @__PURE__ */ new Set();
|
|
45507
|
-
const candidates = [];
|
|
45508
|
-
runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker(
|
|
45509
|
-
call,
|
|
45510
|
-
candidates,
|
|
45511
|
-
/*argumentCount*/
|
|
45512
|
-
void 0,
|
|
45513
|
-
32 /* IsForStringLiteralArgumentCompletions */
|
|
45514
|
-
));
|
|
45515
|
-
for (const candidate of candidates) {
|
|
45516
|
-
candidatesSet.add(candidate);
|
|
45517
|
-
}
|
|
45518
|
-
candidates.length = 0;
|
|
45519
|
-
runWithoutResolvedSignatureCaching(editingArgument, () => getResolvedSignatureWorker(
|
|
45520
|
-
call,
|
|
45521
|
-
candidates,
|
|
45522
|
-
/*argumentCount*/
|
|
45523
|
-
void 0,
|
|
45524
|
-
32 /* IsForStringLiteralArgumentCompletions */
|
|
45525
|
-
));
|
|
45526
|
-
for (const candidate of candidates) {
|
|
45527
|
-
candidatesSet.add(candidate);
|
|
45528
|
-
}
|
|
45529
|
-
return arrayFrom(candidatesSet);
|
|
45530
|
-
}
|
|
45531
45537
|
function runWithoutResolvedSignatureCaching(node, fn) {
|
|
45532
45538
|
const containingCall = findAncestor(node, isCallLikeExpression);
|
|
45539
|
+
const containingCallResolvedSignature = containingCall && getNodeLinks(containingCall).resolvedSignature;
|
|
45533
45540
|
if (containingCall) {
|
|
45534
|
-
|
|
45535
|
-
const containingCallResolvedSignature = links.resolvedSignature;
|
|
45536
|
-
links.resolvedSignature = void 0;
|
|
45537
|
-
const result = fn();
|
|
45538
|
-
links.resolvedSignature = containingCallResolvedSignature;
|
|
45539
|
-
return result;
|
|
45540
|
-
} else {
|
|
45541
|
-
return fn();
|
|
45541
|
+
getNodeLinks(containingCall).resolvedSignature = void 0;
|
|
45542
45542
|
}
|
|
45543
|
+
const result = fn();
|
|
45544
|
+
if (containingCall) {
|
|
45545
|
+
getNodeLinks(containingCall).resolvedSignature = containingCallResolvedSignature;
|
|
45546
|
+
}
|
|
45547
|
+
return result;
|
|
45543
45548
|
}
|
|
45544
45549
|
function runWithInferenceBlockedFromSourceNode(node, fn) {
|
|
45545
45550
|
const containingCall = findAncestor(node, isCallLikeExpression);
|
|
@@ -55143,7 +55148,7 @@ ${lanes.join("\n")}
|
|
|
55143
55148
|
resolveObjectTypeMembers(type, source, typeParameters, paddedTypeArguments);
|
|
55144
55149
|
}
|
|
55145
55150
|
function createSignature(declaration, typeParameters, thisParameter, parameters, resolvedReturnType, resolvedTypePredicate, minArgumentCount, flags) {
|
|
55146
|
-
const sig = new
|
|
55151
|
+
const sig = new Signature15(checker, flags);
|
|
55147
55152
|
sig.declaration = declaration;
|
|
55148
55153
|
sig.typeParameters = typeParameters;
|
|
55149
55154
|
sig.parameters = parameters;
|
|
@@ -56416,7 +56421,7 @@ ${lanes.join("\n")}
|
|
|
56416
56421
|
} else if (type !== firstType) {
|
|
56417
56422
|
checkFlags |= 64 /* HasNonUniformType */;
|
|
56418
56423
|
}
|
|
56419
|
-
if (isLiteralType(type) || isPatternLiteralType(type)
|
|
56424
|
+
if (isLiteralType(type) || isPatternLiteralType(type)) {
|
|
56420
56425
|
checkFlags |= 128 /* HasLiteralType */;
|
|
56421
56426
|
}
|
|
56422
56427
|
if (type.flags & 131072 /* Never */ && type !== uniqueLiteralType) {
|
|
@@ -157952,8 +157957,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
157952
157957
|
function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker) {
|
|
157953
157958
|
let isNewIdentifier = false;
|
|
157954
157959
|
const uniques = /* @__PURE__ */ new Map();
|
|
157960
|
+
const candidates = [];
|
|
157955
157961
|
const editingArgument = isJsxOpeningLikeElement(call) ? Debug.checkDefined(findAncestor(arg.parent, isJsxAttribute)) : arg;
|
|
157956
|
-
|
|
157962
|
+
checker.getResolvedSignatureForStringLiteralCompletions(call, editingArgument, candidates);
|
|
157957
157963
|
const types = flatMap(candidates, (candidate) => {
|
|
157958
157964
|
if (!signatureHasRestParameter(candidate) && argumentInfo.argumentCount > candidate.parameters.length)
|
|
157959
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
|
}
|