@typescript-deploys/pr-build 5.4.0-pr-57230-11 → 5.4.0-pr-57207-3
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/lib.esnext.collection.d.ts +0 -46
- package/lib/tsc.js +143 -58
- package/lib/tsserver.js +182 -81
- package/lib/typescript.d.ts +19 -9
- package/lib/typescript.js +181 -81
- package/lib/typingsInstaller.js +71 -28
- package/package.json +2 -2
package/lib/tsserver.js
CHANGED
|
@@ -1475,6 +1475,7 @@ __export(server_exports, {
|
|
|
1475
1475
|
isJSDocEnumTag: () => isJSDocEnumTag,
|
|
1476
1476
|
isJSDocFunctionType: () => isJSDocFunctionType,
|
|
1477
1477
|
isJSDocImplementsTag: () => isJSDocImplementsTag,
|
|
1478
|
+
isJSDocImportTypeTag: () => isJSDocImportTypeTag,
|
|
1478
1479
|
isJSDocIndexSignature: () => isJSDocIndexSignature,
|
|
1479
1480
|
isJSDocLikeText: () => isJSDocLikeText,
|
|
1480
1481
|
isJSDocLink: () => isJSDocLink,
|
|
@@ -6110,12 +6111,13 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind5) => {
|
|
|
6110
6111
|
SyntaxKind5[SyntaxKind5["JSDocPropertyTag"] = 355] = "JSDocPropertyTag";
|
|
6111
6112
|
SyntaxKind5[SyntaxKind5["JSDocThrowsTag"] = 356] = "JSDocThrowsTag";
|
|
6112
6113
|
SyntaxKind5[SyntaxKind5["JSDocSatisfiesTag"] = 357] = "JSDocSatisfiesTag";
|
|
6113
|
-
SyntaxKind5[SyntaxKind5["
|
|
6114
|
-
SyntaxKind5[SyntaxKind5["
|
|
6115
|
-
SyntaxKind5[SyntaxKind5["
|
|
6116
|
-
SyntaxKind5[SyntaxKind5["
|
|
6117
|
-
SyntaxKind5[SyntaxKind5["
|
|
6118
|
-
SyntaxKind5[SyntaxKind5["
|
|
6114
|
+
SyntaxKind5[SyntaxKind5["JSDocImportTypeTag"] = 358] = "JSDocImportTypeTag";
|
|
6115
|
+
SyntaxKind5[SyntaxKind5["SyntaxList"] = 359] = "SyntaxList";
|
|
6116
|
+
SyntaxKind5[SyntaxKind5["NotEmittedStatement"] = 360] = "NotEmittedStatement";
|
|
6117
|
+
SyntaxKind5[SyntaxKind5["PartiallyEmittedExpression"] = 361] = "PartiallyEmittedExpression";
|
|
6118
|
+
SyntaxKind5[SyntaxKind5["CommaListExpression"] = 362] = "CommaListExpression";
|
|
6119
|
+
SyntaxKind5[SyntaxKind5["SyntheticReferenceExpression"] = 363] = "SyntheticReferenceExpression";
|
|
6120
|
+
SyntaxKind5[SyntaxKind5["Count"] = 364] = "Count";
|
|
6119
6121
|
SyntaxKind5[SyntaxKind5["FirstAssignment"] = 64 /* EqualsToken */] = "FirstAssignment";
|
|
6120
6122
|
SyntaxKind5[SyntaxKind5["LastAssignment"] = 79 /* CaretEqualsToken */] = "LastAssignment";
|
|
6121
6123
|
SyntaxKind5[SyntaxKind5["FirstCompoundAssignment"] = 65 /* PlusEqualsToken */] = "FirstCompoundAssignment";
|
|
@@ -6144,9 +6146,9 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind5) => {
|
|
|
6144
6146
|
SyntaxKind5[SyntaxKind5["LastStatement"] = 259 /* DebuggerStatement */] = "LastStatement";
|
|
6145
6147
|
SyntaxKind5[SyntaxKind5["FirstNode"] = 166 /* QualifiedName */] = "FirstNode";
|
|
6146
6148
|
SyntaxKind5[SyntaxKind5["FirstJSDocNode"] = 316 /* JSDocTypeExpression */] = "FirstJSDocNode";
|
|
6147
|
-
SyntaxKind5[SyntaxKind5["LastJSDocNode"] =
|
|
6149
|
+
SyntaxKind5[SyntaxKind5["LastJSDocNode"] = 358 /* JSDocImportTypeTag */] = "LastJSDocNode";
|
|
6148
6150
|
SyntaxKind5[SyntaxKind5["FirstJSDocTagNode"] = 334 /* JSDocTag */] = "FirstJSDocTagNode";
|
|
6149
|
-
SyntaxKind5[SyntaxKind5["LastJSDocTagNode"] =
|
|
6151
|
+
SyntaxKind5[SyntaxKind5["LastJSDocTagNode"] = 358 /* JSDocImportTypeTag */] = "LastJSDocTagNode";
|
|
6150
6152
|
SyntaxKind5[SyntaxKind5["FirstContextualKeyword"] = 128 /* AbstractKeyword */] = "FirstContextualKeyword";
|
|
6151
6153
|
SyntaxKind5[SyntaxKind5["LastContextualKeyword"] = 165 /* OfKeyword */] = "LastContextualKeyword";
|
|
6152
6154
|
return SyntaxKind5;
|
|
@@ -14813,8 +14815,8 @@ function isExpressionKind(kind) {
|
|
|
14813
14815
|
case 230 /* SpreadElement */:
|
|
14814
14816
|
case 234 /* AsExpression */:
|
|
14815
14817
|
case 232 /* OmittedExpression */:
|
|
14816
|
-
case
|
|
14817
|
-
case
|
|
14818
|
+
case 362 /* CommaListExpression */:
|
|
14819
|
+
case 361 /* PartiallyEmittedExpression */:
|
|
14818
14820
|
case 238 /* SatisfiesExpression */:
|
|
14819
14821
|
return true;
|
|
14820
14822
|
default:
|
|
@@ -14999,7 +15001,7 @@ function isDeclarationStatementKind(kind) {
|
|
|
14999
15001
|
return kind === 262 /* FunctionDeclaration */ || kind === 282 /* MissingDeclaration */ || kind === 263 /* ClassDeclaration */ || kind === 264 /* InterfaceDeclaration */ || kind === 265 /* TypeAliasDeclaration */ || kind === 266 /* EnumDeclaration */ || kind === 267 /* ModuleDeclaration */ || kind === 272 /* ImportDeclaration */ || kind === 271 /* ImportEqualsDeclaration */ || kind === 278 /* ExportDeclaration */ || kind === 277 /* ExportAssignment */ || kind === 270 /* NamespaceExportDeclaration */;
|
|
15000
15002
|
}
|
|
15001
15003
|
function isStatementKindButNotDeclarationKind(kind) {
|
|
15002
|
-
return kind === 252 /* BreakStatement */ || kind === 251 /* ContinueStatement */ || kind === 259 /* DebuggerStatement */ || kind === 246 /* DoStatement */ || kind === 244 /* ExpressionStatement */ || kind === 242 /* EmptyStatement */ || kind === 249 /* ForInStatement */ || kind === 250 /* ForOfStatement */ || kind === 248 /* ForStatement */ || kind === 245 /* IfStatement */ || kind === 256 /* LabeledStatement */ || kind === 253 /* ReturnStatement */ || kind === 255 /* SwitchStatement */ || kind === 257 /* ThrowStatement */ || kind === 258 /* TryStatement */ || kind === 243 /* VariableStatement */ || kind === 247 /* WhileStatement */ || kind === 254 /* WithStatement */ || kind ===
|
|
15004
|
+
return kind === 252 /* BreakStatement */ || kind === 251 /* ContinueStatement */ || kind === 259 /* DebuggerStatement */ || kind === 246 /* DoStatement */ || kind === 244 /* ExpressionStatement */ || kind === 242 /* EmptyStatement */ || kind === 249 /* ForInStatement */ || kind === 250 /* ForOfStatement */ || kind === 248 /* ForStatement */ || kind === 245 /* IfStatement */ || kind === 256 /* LabeledStatement */ || kind === 253 /* ReturnStatement */ || kind === 255 /* SwitchStatement */ || kind === 257 /* ThrowStatement */ || kind === 258 /* TryStatement */ || kind === 243 /* VariableStatement */ || kind === 247 /* WhileStatement */ || kind === 254 /* WithStatement */ || kind === 360 /* NotEmittedStatement */;
|
|
15003
15005
|
}
|
|
15004
15006
|
function isDeclaration(node) {
|
|
15005
15007
|
if (node.kind === 168 /* TypeParameter */) {
|
|
@@ -15060,13 +15062,13 @@ function isCaseOrDefaultClause(node) {
|
|
|
15060
15062
|
return kind === 296 /* CaseClause */ || kind === 297 /* DefaultClause */;
|
|
15061
15063
|
}
|
|
15062
15064
|
function isJSDocNode(node) {
|
|
15063
|
-
return node.kind >= 316 /* FirstJSDocNode */ && node.kind <=
|
|
15065
|
+
return node.kind >= 316 /* FirstJSDocNode */ && node.kind <= 358 /* LastJSDocNode */;
|
|
15064
15066
|
}
|
|
15065
15067
|
function isJSDocCommentContainingNode(node) {
|
|
15066
15068
|
return node.kind === 327 /* JSDoc */ || node.kind === 326 /* JSDocNamepathType */ || node.kind === 328 /* JSDocText */ || isJSDocLinkLike(node) || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node);
|
|
15067
15069
|
}
|
|
15068
15070
|
function isJSDocTag(node) {
|
|
15069
|
-
return node.kind >= 334 /* FirstJSDocTagNode */ && node.kind <=
|
|
15071
|
+
return node.kind >= 334 /* FirstJSDocTagNode */ && node.kind <= 358 /* LastJSDocTagNode */;
|
|
15070
15072
|
}
|
|
15071
15073
|
function isSetAccessor(node) {
|
|
15072
15074
|
return node.kind === 178 /* SetAccessor */;
|
|
@@ -15564,7 +15566,7 @@ function getTokenPosOfNode(node, sourceFile, includeJsDoc) {
|
|
|
15564
15566
|
if (includeJsDoc && hasJSDocNodes(node)) {
|
|
15565
15567
|
return getTokenPosOfNode(node.jsDoc[0], sourceFile);
|
|
15566
15568
|
}
|
|
15567
|
-
if (node.kind ===
|
|
15569
|
+
if (node.kind === 359 /* SyntaxList */ && node._children.length > 0) {
|
|
15568
15570
|
return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc);
|
|
15569
15571
|
}
|
|
15570
15572
|
return skipTrivia(
|
|
@@ -17600,6 +17602,7 @@ function tryGetModuleSpecifierFromDeclaration(node) {
|
|
|
17600
17602
|
))) == null ? void 0 : _a.arguments[0];
|
|
17601
17603
|
case 272 /* ImportDeclaration */:
|
|
17602
17604
|
case 278 /* ExportDeclaration */:
|
|
17605
|
+
case 358 /* JSDocImportTypeTag */:
|
|
17603
17606
|
return tryCast(node.moduleSpecifier, isStringLiteralLike);
|
|
17604
17607
|
case 271 /* ImportEqualsDeclaration */:
|
|
17605
17608
|
return tryCast((_b = tryCast(node.moduleReference, isExternalModuleReference)) == null ? void 0 : _b.expression, isStringLiteralLike);
|
|
@@ -17624,6 +17627,7 @@ function tryGetImportFromModuleSpecifier(node) {
|
|
|
17624
17627
|
switch (node.parent.kind) {
|
|
17625
17628
|
case 272 /* ImportDeclaration */:
|
|
17626
17629
|
case 278 /* ExportDeclaration */:
|
|
17630
|
+
case 358 /* JSDocImportTypeTag */:
|
|
17627
17631
|
return node.parent;
|
|
17628
17632
|
case 283 /* ExternalModuleReference */:
|
|
17629
17633
|
return node.parent.parent;
|
|
@@ -17644,6 +17648,7 @@ function getExternalModuleName(node) {
|
|
|
17644
17648
|
switch (node.kind) {
|
|
17645
17649
|
case 272 /* ImportDeclaration */:
|
|
17646
17650
|
case 278 /* ExportDeclaration */:
|
|
17651
|
+
case 358 /* JSDocImportTypeTag */:
|
|
17647
17652
|
return node.moduleSpecifier;
|
|
17648
17653
|
case 271 /* ImportEqualsDeclaration */:
|
|
17649
17654
|
return node.moduleReference.kind === 283 /* ExternalModuleReference */ ? node.moduleReference.expression : void 0;
|
|
@@ -18560,7 +18565,7 @@ var OperatorPrecedence = /* @__PURE__ */ ((OperatorPrecedence2) => {
|
|
|
18560
18565
|
})(OperatorPrecedence || {});
|
|
18561
18566
|
function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
|
|
18562
18567
|
switch (nodeKind) {
|
|
18563
|
-
case
|
|
18568
|
+
case 362 /* CommaListExpression */:
|
|
18564
18569
|
return 0 /* Comma */;
|
|
18565
18570
|
case 230 /* SpreadElement */:
|
|
18566
18571
|
return 1 /* Spread */;
|
|
@@ -20273,7 +20278,7 @@ function getLeftmostExpression(node, stopAtCallExpressions) {
|
|
|
20273
20278
|
case 212 /* ElementAccessExpression */:
|
|
20274
20279
|
case 211 /* PropertyAccessExpression */:
|
|
20275
20280
|
case 235 /* NonNullExpression */:
|
|
20276
|
-
case
|
|
20281
|
+
case 361 /* PartiallyEmittedExpression */:
|
|
20277
20282
|
case 238 /* SatisfiesExpression */:
|
|
20278
20283
|
node = node.expression;
|
|
20279
20284
|
continue;
|
|
@@ -21713,7 +21718,7 @@ function getContainingNodeArray(node) {
|
|
|
21713
21718
|
return parent2.types;
|
|
21714
21719
|
case 189 /* TupleType */:
|
|
21715
21720
|
case 209 /* ArrayLiteralExpression */:
|
|
21716
|
-
case
|
|
21721
|
+
case 362 /* CommaListExpression */:
|
|
21717
21722
|
case 275 /* NamedImports */:
|
|
21718
21723
|
case 279 /* NamedExports */:
|
|
21719
21724
|
return parent2.elements;
|
|
@@ -22920,6 +22925,8 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22920
22925
|
updateJSDocImplementsTag,
|
|
22921
22926
|
createJSDocSeeTag,
|
|
22922
22927
|
updateJSDocSeeTag,
|
|
22928
|
+
createJSDocImportTypeTag,
|
|
22929
|
+
updateJSDocImportTypeTag,
|
|
22923
22930
|
createJSDocNameReference,
|
|
22924
22931
|
updateJSDocNameReference,
|
|
22925
22932
|
createJSDocMemberName,
|
|
@@ -25698,6 +25705,16 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
25698
25705
|
function updateJSDocEnumTag(node, tagName = getDefaultTagName(node), typeExpression, comment) {
|
|
25699
25706
|
return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocEnumTag(tagName, typeExpression, comment), node) : node;
|
|
25700
25707
|
}
|
|
25708
|
+
function createJSDocImportTypeTag(tagName, importClause, moduleSpecifier, comment) {
|
|
25709
|
+
const node = createBaseJSDocTag(358 /* JSDocImportTypeTag */, tagName ?? createIdentifier("importType"), comment);
|
|
25710
|
+
node.importClause = importClause;
|
|
25711
|
+
node.moduleSpecifier = moduleSpecifier;
|
|
25712
|
+
node.comment = comment;
|
|
25713
|
+
return node;
|
|
25714
|
+
}
|
|
25715
|
+
function updateJSDocImportTypeTag(node, tagName, importClause, moduleSpecifier, comment) {
|
|
25716
|
+
return node.tagName !== tagName || node.comment !== comment || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier ? update(createJSDocImportTypeTag(tagName, importClause, moduleSpecifier, comment), node) : node;
|
|
25717
|
+
}
|
|
25701
25718
|
function createJSDocText(text) {
|
|
25702
25719
|
const node = createBaseNode(328 /* JSDocText */);
|
|
25703
25720
|
node.text = text;
|
|
@@ -26136,18 +26153,18 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
26136
26153
|
return node;
|
|
26137
26154
|
}
|
|
26138
26155
|
function createSyntaxList3(children) {
|
|
26139
|
-
const node = createBaseNode(
|
|
26156
|
+
const node = createBaseNode(359 /* SyntaxList */);
|
|
26140
26157
|
node._children = children;
|
|
26141
26158
|
return node;
|
|
26142
26159
|
}
|
|
26143
26160
|
function createNotEmittedStatement(original) {
|
|
26144
|
-
const node = createBaseNode(
|
|
26161
|
+
const node = createBaseNode(360 /* NotEmittedStatement */);
|
|
26145
26162
|
node.original = original;
|
|
26146
26163
|
setTextRange(node, original);
|
|
26147
26164
|
return node;
|
|
26148
26165
|
}
|
|
26149
26166
|
function createPartiallyEmittedExpression(expression, original) {
|
|
26150
|
-
const node = createBaseNode(
|
|
26167
|
+
const node = createBaseNode(361 /* PartiallyEmittedExpression */);
|
|
26151
26168
|
node.expression = expression;
|
|
26152
26169
|
node.original = original;
|
|
26153
26170
|
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
|
|
@@ -26169,7 +26186,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
26169
26186
|
return node;
|
|
26170
26187
|
}
|
|
26171
26188
|
function createCommaListExpression(elements) {
|
|
26172
|
-
const node = createBaseNode(
|
|
26189
|
+
const node = createBaseNode(362 /* CommaListExpression */);
|
|
26173
26190
|
node.elements = createNodeArray(sameFlatMap(elements, flattenCommaElements));
|
|
26174
26191
|
node.transformFlags |= propagateChildrenFlags(node.elements);
|
|
26175
26192
|
return node;
|
|
@@ -26178,7 +26195,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
26178
26195
|
return node.elements !== elements ? update(createCommaListExpression(elements), node) : node;
|
|
26179
26196
|
}
|
|
26180
26197
|
function createSyntheticReferenceExpression(expression, thisArg) {
|
|
26181
|
-
const node = createBaseNode(
|
|
26198
|
+
const node = createBaseNode(363 /* SyntheticReferenceExpression */);
|
|
26182
26199
|
node.expression = expression;
|
|
26183
26200
|
node.thisArg = thisArg;
|
|
26184
26201
|
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg);
|
|
@@ -26424,7 +26441,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
26424
26441
|
return updateSatisfiesExpression(outerExpression, expression, outerExpression.type);
|
|
26425
26442
|
case 235 /* NonNullExpression */:
|
|
26426
26443
|
return updateNonNullExpression(outerExpression, expression);
|
|
26427
|
-
case
|
|
26444
|
+
case 361 /* PartiallyEmittedExpression */:
|
|
26428
26445
|
return updatePartiallyEmittedExpression(outerExpression, expression);
|
|
26429
26446
|
}
|
|
26430
26447
|
}
|
|
@@ -26834,6 +26851,8 @@ function getDefaultTagNameForKind(kind) {
|
|
|
26834
26851
|
return "augments";
|
|
26835
26852
|
case 336 /* JSDocImplementsTag */:
|
|
26836
26853
|
return "implements";
|
|
26854
|
+
case 358 /* JSDocImportTypeTag */:
|
|
26855
|
+
return "importType";
|
|
26837
26856
|
default:
|
|
26838
26857
|
return Debug.fail(`Unsupported kind: ${Debug.formatSyntaxKind(kind)}`);
|
|
26839
26858
|
}
|
|
@@ -26974,7 +26993,7 @@ function getTransformFlagsSubtreeExclusions(kind) {
|
|
|
26974
26993
|
case 216 /* TypeAssertionExpression */:
|
|
26975
26994
|
case 238 /* SatisfiesExpression */:
|
|
26976
26995
|
case 234 /* AsExpression */:
|
|
26977
|
-
case
|
|
26996
|
+
case 361 /* PartiallyEmittedExpression */:
|
|
26978
26997
|
case 217 /* ParenthesizedExpression */:
|
|
26979
26998
|
case 108 /* SuperKeyword */:
|
|
26980
26999
|
return -2147483648 /* OuterExpressionExcludes */;
|
|
@@ -28973,10 +28992,10 @@ function isSyntheticExpression(node) {
|
|
|
28973
28992
|
return node.kind === 237 /* SyntheticExpression */;
|
|
28974
28993
|
}
|
|
28975
28994
|
function isPartiallyEmittedExpression(node) {
|
|
28976
|
-
return node.kind ===
|
|
28995
|
+
return node.kind === 361 /* PartiallyEmittedExpression */;
|
|
28977
28996
|
}
|
|
28978
28997
|
function isCommaListExpression(node) {
|
|
28979
|
-
return node.kind ===
|
|
28998
|
+
return node.kind === 362 /* CommaListExpression */;
|
|
28980
28999
|
}
|
|
28981
29000
|
function isTemplateSpan(node) {
|
|
28982
29001
|
return node.kind === 239 /* TemplateSpan */;
|
|
@@ -29126,10 +29145,10 @@ function isMissingDeclaration(node) {
|
|
|
29126
29145
|
return node.kind === 282 /* MissingDeclaration */;
|
|
29127
29146
|
}
|
|
29128
29147
|
function isNotEmittedStatement(node) {
|
|
29129
|
-
return node.kind ===
|
|
29148
|
+
return node.kind === 360 /* NotEmittedStatement */;
|
|
29130
29149
|
}
|
|
29131
29150
|
function isSyntheticReference(node) {
|
|
29132
|
-
return node.kind ===
|
|
29151
|
+
return node.kind === 363 /* SyntheticReferenceExpression */;
|
|
29133
29152
|
}
|
|
29134
29153
|
function isExternalModuleReference(node) {
|
|
29135
29154
|
return node.kind === 283 /* ExternalModuleReference */;
|
|
@@ -29329,8 +29348,11 @@ function isJSDocSatisfiesTag(node) {
|
|
|
29329
29348
|
function isJSDocThrowsTag(node) {
|
|
29330
29349
|
return node.kind === 356 /* JSDocThrowsTag */;
|
|
29331
29350
|
}
|
|
29351
|
+
function isJSDocImportTypeTag(node) {
|
|
29352
|
+
return node.kind === 358 /* JSDocImportTypeTag */;
|
|
29353
|
+
}
|
|
29332
29354
|
function isSyntaxList(n) {
|
|
29333
|
-
return n.kind ===
|
|
29355
|
+
return n.kind === 359 /* SyntaxList */;
|
|
29334
29356
|
}
|
|
29335
29357
|
|
|
29336
29358
|
// src/compiler/factory/utilities.ts
|
|
@@ -29725,7 +29747,7 @@ function isOuterExpression(node, kinds = 15 /* All */) {
|
|
|
29725
29747
|
return (kinds & 2 /* TypeAssertions */) !== 0;
|
|
29726
29748
|
case 235 /* NonNullExpression */:
|
|
29727
29749
|
return (kinds & 4 /* NonNullAssertions */) !== 0;
|
|
29728
|
-
case
|
|
29750
|
+
case 361 /* PartiallyEmittedExpression */:
|
|
29729
29751
|
return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0;
|
|
29730
29752
|
}
|
|
29731
29753
|
return false;
|
|
@@ -30816,7 +30838,7 @@ var forEachChildTable = {
|
|
|
30816
30838
|
[282 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) {
|
|
30817
30839
|
return visitNodes(cbNode, cbNodes, node.modifiers);
|
|
30818
30840
|
},
|
|
30819
|
-
[
|
|
30841
|
+
[362 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
|
|
30820
30842
|
return visitNodes(cbNode, cbNodes, node.elements);
|
|
30821
30843
|
},
|
|
30822
30844
|
[284 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) {
|
|
@@ -30911,7 +30933,8 @@ var forEachChildTable = {
|
|
|
30911
30933
|
[343 /* JSDocReadonlyTag */]: forEachChildInJSDocTag,
|
|
30912
30934
|
[338 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag,
|
|
30913
30935
|
[344 /* JSDocOverrideTag */]: forEachChildInJSDocTag,
|
|
30914
|
-
[
|
|
30936
|
+
[358 /* JSDocImportTypeTag */]: forEachChildInJSDocImportTypeTag,
|
|
30937
|
+
[361 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
|
|
30915
30938
|
};
|
|
30916
30939
|
function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) {
|
|
30917
30940
|
return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
|
|
@@ -30962,6 +30985,9 @@ function forEachChildInJSDocLinkCodeOrPlain(node, cbNode, _cbNodes) {
|
|
|
30962
30985
|
function forEachChildInJSDocTag(node, cbNode, cbNodes) {
|
|
30963
30986
|
return visitNode2(cbNode, node.tagName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
|
|
30964
30987
|
}
|
|
30988
|
+
function forEachChildInJSDocImportTypeTag(node, cbNode, cbNodes) {
|
|
30989
|
+
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
|
|
30990
|
+
}
|
|
30965
30991
|
function forEachChildInPartiallyEmittedExpression(node, cbNode, _cbNodes) {
|
|
30966
30992
|
return visitNode2(cbNode, node.expression);
|
|
30967
30993
|
}
|
|
@@ -37212,6 +37238,9 @@ var Parser;
|
|
|
37212
37238
|
case "throws":
|
|
37213
37239
|
tag = parseThrowsTag(start3, tagName, margin, indentText);
|
|
37214
37240
|
break;
|
|
37241
|
+
case "importType":
|
|
37242
|
+
tag = parseImportTypeTag(start3, tagName, margin, indentText);
|
|
37243
|
+
break;
|
|
37215
37244
|
default:
|
|
37216
37245
|
tag = parseUnknownTag(start3, tagName, margin, indentText);
|
|
37217
37246
|
break;
|
|
@@ -37531,6 +37560,27 @@ var Parser;
|
|
|
37531
37560
|
const comments2 = margin !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start3, getNodePos(), margin, indentText) : void 0;
|
|
37532
37561
|
return finishNode(factory2.createJSDocSatisfiesTag(tagName, typeExpression, comments2), start3);
|
|
37533
37562
|
}
|
|
37563
|
+
function parseImportTypeTag(start3, tagName, margin, indentText) {
|
|
37564
|
+
const afterImportTypeTagPos = scanner2.getTokenFullStart();
|
|
37565
|
+
let identifier;
|
|
37566
|
+
if (isIdentifier2()) {
|
|
37567
|
+
identifier = parseIdentifier();
|
|
37568
|
+
}
|
|
37569
|
+
let importClause;
|
|
37570
|
+
if (identifier || token() === 42 /* AsteriskToken */ || token() === 19 /* OpenBraceToken */) {
|
|
37571
|
+
importClause = parseImportClause(
|
|
37572
|
+
identifier,
|
|
37573
|
+
afterImportTypeTagPos,
|
|
37574
|
+
/*isTypeOnly*/
|
|
37575
|
+
true
|
|
37576
|
+
);
|
|
37577
|
+
parseExpected(161 /* FromKeyword */);
|
|
37578
|
+
}
|
|
37579
|
+
Debug.assert(importClause);
|
|
37580
|
+
const moduleSpecifier = parseModuleSpecifier();
|
|
37581
|
+
const comments2 = margin !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start3, getNodePos(), margin, indentText) : void 0;
|
|
37582
|
+
return finishNode(factory2.createJSDocImportTypeTag(tagName, importClause, moduleSpecifier, comments2), start3);
|
|
37583
|
+
}
|
|
37534
37584
|
function parseExpressionWithTypeArgumentsForAugments() {
|
|
37535
37585
|
const usedBrace = parseOptional(19 /* OpenBraceToken */);
|
|
37536
37586
|
const pos = getNodePos();
|
|
@@ -51656,7 +51706,7 @@ function createTypeChecker(host) {
|
|
|
51656
51706
|
return ambientModule;
|
|
51657
51707
|
}
|
|
51658
51708
|
const currentSourceFile = getSourceFileOfNode(location);
|
|
51659
|
-
const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _a.name) || ((_b = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _b.argument.literal) || (isVariableDeclaration(location) && location.initializer && isRequireCall(
|
|
51709
|
+
const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _a.name) || ((_b = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _b.argument.literal) || (isInJSFile(location) && isJSDocImportTypeTag(location) ? location.moduleSpecifier : void 0) || (isVariableDeclaration(location) && location.initializer && isRequireCall(
|
|
51660
51710
|
location.initializer,
|
|
51661
51711
|
/*requireStringLiteralLikeArgument*/
|
|
51662
51712
|
true
|
|
@@ -55957,6 +56007,7 @@ function createTypeChecker(host) {
|
|
|
55957
56007
|
case 273 /* ImportClause */: {
|
|
55958
56008
|
const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context);
|
|
55959
56009
|
const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.moduleSpecifier;
|
|
56010
|
+
const attributes = isImportDeclaration(node.parent) ? node.parent.attributes : void 0;
|
|
55960
56011
|
addResult(
|
|
55961
56012
|
factory.createImportDeclaration(
|
|
55962
56013
|
/*modifiers*/
|
|
@@ -55969,7 +56020,7 @@ function createTypeChecker(host) {
|
|
|
55969
56020
|
void 0
|
|
55970
56021
|
),
|
|
55971
56022
|
specifier2,
|
|
55972
|
-
|
|
56023
|
+
attributes
|
|
55973
56024
|
),
|
|
55974
56025
|
0 /* None */
|
|
55975
56026
|
);
|
|
@@ -55978,6 +56029,7 @@ function createTypeChecker(host) {
|
|
|
55978
56029
|
case 274 /* NamespaceImport */: {
|
|
55979
56030
|
const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context);
|
|
55980
56031
|
const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.parent.moduleSpecifier;
|
|
56032
|
+
const attributes = isImportDeclaration(node.parent) ? node.parent.attributes : void 0;
|
|
55981
56033
|
addResult(
|
|
55982
56034
|
factory.createImportDeclaration(
|
|
55983
56035
|
/*modifiers*/
|
|
@@ -55990,7 +56042,7 @@ function createTypeChecker(host) {
|
|
|
55990
56042
|
factory.createNamespaceImport(factory.createIdentifier(localName))
|
|
55991
56043
|
),
|
|
55992
56044
|
specifier2,
|
|
55993
|
-
|
|
56045
|
+
attributes
|
|
55994
56046
|
),
|
|
55995
56047
|
0 /* None */
|
|
55996
56048
|
);
|
|
@@ -56012,6 +56064,7 @@ function createTypeChecker(host) {
|
|
|
56012
56064
|
case 276 /* ImportSpecifier */: {
|
|
56013
56065
|
const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context);
|
|
56014
56066
|
const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.parent.parent.moduleSpecifier;
|
|
56067
|
+
const attributes = isImportDeclaration(node.parent.parent.parent) ? node.parent.parent.parent.attributes : void 0;
|
|
56015
56068
|
addResult(
|
|
56016
56069
|
factory.createImportDeclaration(
|
|
56017
56070
|
/*modifiers*/
|
|
@@ -56031,7 +56084,7 @@ function createTypeChecker(host) {
|
|
|
56031
56084
|
])
|
|
56032
56085
|
),
|
|
56033
56086
|
specifier2,
|
|
56034
|
-
|
|
56087
|
+
attributes
|
|
56035
56088
|
),
|
|
56036
56089
|
0 /* None */
|
|
56037
56090
|
);
|
|
@@ -87292,7 +87345,7 @@ function createTypeChecker(host) {
|
|
|
87292
87345
|
return void 0;
|
|
87293
87346
|
case 11 /* StringLiteral */:
|
|
87294
87347
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
87295
|
-
if (isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node || (node.parent.kind === 272 /* ImportDeclaration */ || node.parent.kind === 278 /* ExportDeclaration */) && node.parent.moduleSpecifier === node || (isInJSFile(node) && isRequireCall(
|
|
87348
|
+
if (isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node || (node.parent.kind === 272 /* ImportDeclaration */ || node.parent.kind === 278 /* ExportDeclaration */) && node.parent.moduleSpecifier === node || isInJSFile(node) && isJSDocImportTypeTag(node.parent) && node.parent.moduleSpecifier === node || (isInJSFile(node) && isRequireCall(
|
|
87296
87349
|
node.parent,
|
|
87297
87350
|
/*requireStringLiteralLikeArgument*/
|
|
87298
87351
|
false
|
|
@@ -91527,13 +91580,13 @@ var visitEachChildTable = {
|
|
|
91527
91580
|
);
|
|
91528
91581
|
},
|
|
91529
91582
|
// Transformation nodes
|
|
91530
|
-
[
|
|
91583
|
+
[361 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
91531
91584
|
return context.factory.updatePartiallyEmittedExpression(
|
|
91532
91585
|
node,
|
|
91533
91586
|
Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression))
|
|
91534
91587
|
);
|
|
91535
91588
|
},
|
|
91536
|
-
[
|
|
91589
|
+
[362 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
91537
91590
|
return context.factory.updateCommaListExpression(
|
|
91538
91591
|
node,
|
|
91539
91592
|
nodesVisitor(node.elements, visitor, isExpression)
|
|
@@ -95357,7 +95410,7 @@ function transformClassFields(context) {
|
|
|
95357
95410
|
/*discarded*/
|
|
95358
95411
|
true
|
|
95359
95412
|
);
|
|
95360
|
-
case
|
|
95413
|
+
case 362 /* CommaListExpression */:
|
|
95361
95414
|
return visitCommaListExpression(
|
|
95362
95415
|
node,
|
|
95363
95416
|
/*discarded*/
|
|
@@ -98450,7 +98503,7 @@ function transformESDecorators(context) {
|
|
|
98450
98503
|
return visitForStatement(node);
|
|
98451
98504
|
case 244 /* ExpressionStatement */:
|
|
98452
98505
|
return visitExpressionStatement(node);
|
|
98453
|
-
case
|
|
98506
|
+
case 362 /* CommaListExpression */:
|
|
98454
98507
|
return visitCommaListExpression(
|
|
98455
98508
|
node,
|
|
98456
98509
|
/*discarded*/
|
|
@@ -98462,7 +98515,7 @@ function transformESDecorators(context) {
|
|
|
98462
98515
|
/*discarded*/
|
|
98463
98516
|
false
|
|
98464
98517
|
);
|
|
98465
|
-
case
|
|
98518
|
+
case 361 /* PartiallyEmittedExpression */:
|
|
98466
98519
|
return visitPartiallyEmittedExpression(
|
|
98467
98520
|
node,
|
|
98468
98521
|
/*discarded*/
|
|
@@ -98548,7 +98601,7 @@ function transformESDecorators(context) {
|
|
|
98548
98601
|
/*discarded*/
|
|
98549
98602
|
true
|
|
98550
98603
|
);
|
|
98551
|
-
case
|
|
98604
|
+
case 362 /* CommaListExpression */:
|
|
98552
98605
|
return visitCommaListExpression(
|
|
98553
98606
|
node,
|
|
98554
98607
|
/*discarded*/
|
|
@@ -101139,7 +101192,7 @@ function transformES2018(context) {
|
|
|
101139
101192
|
return visitObjectLiteralExpression(node);
|
|
101140
101193
|
case 226 /* BinaryExpression */:
|
|
101141
101194
|
return visitBinaryExpression(node, expressionResultIsUnused2);
|
|
101142
|
-
case
|
|
101195
|
+
case 362 /* CommaListExpression */:
|
|
101143
101196
|
return visitCommaListExpression(node, expressionResultIsUnused2);
|
|
101144
101197
|
case 299 /* CatchClause */:
|
|
101145
101198
|
return visitCatchClause(node);
|
|
@@ -104362,7 +104415,7 @@ function transformES2015(context) {
|
|
|
104362
104415
|
return visitParenthesizedExpression(node, expressionResultIsUnused2);
|
|
104363
104416
|
case 226 /* BinaryExpression */:
|
|
104364
104417
|
return visitBinaryExpression(node, expressionResultIsUnused2);
|
|
104365
|
-
case
|
|
104418
|
+
case 362 /* CommaListExpression */:
|
|
104366
104419
|
return visitCommaListExpression(node, expressionResultIsUnused2);
|
|
104367
104420
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
104368
104421
|
case 16 /* TemplateHead */:
|
|
@@ -107728,7 +107781,7 @@ function transformGenerators(context) {
|
|
|
107728
107781
|
switch (node.kind) {
|
|
107729
107782
|
case 226 /* BinaryExpression */:
|
|
107730
107783
|
return visitBinaryExpression(node);
|
|
107731
|
-
case
|
|
107784
|
+
case 362 /* CommaListExpression */:
|
|
107732
107785
|
return visitCommaListExpression(node);
|
|
107733
107786
|
case 227 /* ConditionalExpression */:
|
|
107734
107787
|
return visitConditionalExpression(node);
|
|
@@ -110108,7 +110161,7 @@ function transformModule(context) {
|
|
|
110108
110161
|
return visitExpressionStatement(node);
|
|
110109
110162
|
case 217 /* ParenthesizedExpression */:
|
|
110110
110163
|
return visitParenthesizedExpression(node, valueIsDiscarded);
|
|
110111
|
-
case
|
|
110164
|
+
case 361 /* PartiallyEmittedExpression */:
|
|
110112
110165
|
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
|
|
110113
110166
|
case 213 /* CallExpression */:
|
|
110114
110167
|
if (isImportCall(node) && currentSourceFile.impliedNodeFormat === void 0) {
|
|
@@ -112512,7 +112565,7 @@ function transformSystemModule(context) {
|
|
|
112512
112565
|
return visitExpressionStatement(node);
|
|
112513
112566
|
case 217 /* ParenthesizedExpression */:
|
|
112514
112567
|
return visitParenthesizedExpression(node, valueIsDiscarded);
|
|
112515
|
-
case
|
|
112568
|
+
case 361 /* PartiallyEmittedExpression */:
|
|
112516
112569
|
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
|
|
112517
112570
|
case 226 /* BinaryExpression */:
|
|
112518
112571
|
if (isDestructuringAssignment(node)) {
|
|
@@ -114628,6 +114681,8 @@ function transformDeclarations(context) {
|
|
|
114628
114681
|
}
|
|
114629
114682
|
if (isDeclaration(input) && isDeclarationAndNotVisible(input))
|
|
114630
114683
|
return;
|
|
114684
|
+
if (isJSDocImportTypeTag(input))
|
|
114685
|
+
return;
|
|
114631
114686
|
if (isFunctionLike(input) && resolver.isImplementationOfOverload(input))
|
|
114632
114687
|
return;
|
|
114633
114688
|
let previousEnclosingDeclaration;
|
|
@@ -115278,7 +115333,7 @@ function noEmitNotification(hint, node, callback) {
|
|
|
115278
115333
|
}
|
|
115279
115334
|
function transformNodes(resolver, host, factory2, options, nodes, transformers, allowDtsFiles) {
|
|
115280
115335
|
var _a, _b;
|
|
115281
|
-
const enabledSyntaxKindFeatures = new Array(
|
|
115336
|
+
const enabledSyntaxKindFeatures = new Array(364 /* Count */);
|
|
115282
115337
|
let lexicalEnvironmentVariableDeclarations;
|
|
115283
115338
|
let lexicalEnvironmentFunctionDeclarations;
|
|
115284
115339
|
let lexicalEnvironmentStatements;
|
|
@@ -117180,7 +117235,9 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
117180
117235
|
return emitJSDocTypedefTag(node);
|
|
117181
117236
|
case 354 /* JSDocSeeTag */:
|
|
117182
117237
|
return emitJSDocSeeTag(node);
|
|
117183
|
-
case
|
|
117238
|
+
case 358 /* JSDocImportTypeTag */:
|
|
117239
|
+
return emitJSDocImportTypeTag(node);
|
|
117240
|
+
case 360 /* NotEmittedStatement */:
|
|
117184
117241
|
return;
|
|
117185
117242
|
}
|
|
117186
117243
|
if (isExpression(node)) {
|
|
@@ -117281,15 +117338,15 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
117281
117338
|
return emitJsxSelfClosingElement(node);
|
|
117282
117339
|
case 288 /* JsxFragment */:
|
|
117283
117340
|
return emitJsxFragment(node);
|
|
117284
|
-
case
|
|
117341
|
+
case 359 /* SyntaxList */:
|
|
117285
117342
|
return Debug.fail("SyntaxList should not be printed");
|
|
117286
|
-
case
|
|
117343
|
+
case 360 /* NotEmittedStatement */:
|
|
117287
117344
|
return;
|
|
117288
|
-
case
|
|
117345
|
+
case 361 /* PartiallyEmittedExpression */:
|
|
117289
117346
|
return emitPartiallyEmittedExpression(node);
|
|
117290
|
-
case
|
|
117347
|
+
case 362 /* CommaListExpression */:
|
|
117291
117348
|
return emitCommaList(node);
|
|
117292
|
-
case
|
|
117349
|
+
case 363 /* SyntheticReferenceExpression */:
|
|
117293
117350
|
return Debug.fail("SyntheticReferenceExpression should not be printed");
|
|
117294
117351
|
}
|
|
117295
117352
|
}
|
|
@@ -119187,6 +119244,16 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
119187
119244
|
emit(tag.name);
|
|
119188
119245
|
emitJSDocComment(tag.comment);
|
|
119189
119246
|
}
|
|
119247
|
+
function emitJSDocImportTypeTag(tag) {
|
|
119248
|
+
emitJSDocTagName(tag.tagName);
|
|
119249
|
+
writeSpace();
|
|
119250
|
+
emit(tag.importClause);
|
|
119251
|
+
writeSpace();
|
|
119252
|
+
emitTokenWithComment(161 /* FromKeyword */, tag.importClause.end, writeKeyword, tag);
|
|
119253
|
+
writeSpace();
|
|
119254
|
+
emitExpression(tag.moduleSpecifier);
|
|
119255
|
+
emitJSDocComment(tag.comment);
|
|
119256
|
+
}
|
|
119190
119257
|
function emitJSDocNameReference(node) {
|
|
119191
119258
|
writeSpace();
|
|
119192
119259
|
writePunctuation("{");
|
|
@@ -120686,7 +120753,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
120686
120753
|
emitLeadingComments(
|
|
120687
120754
|
pos,
|
|
120688
120755
|
/*isEmittedNode*/
|
|
120689
|
-
node.kind !==
|
|
120756
|
+
node.kind !== 360 /* NotEmittedStatement */
|
|
120690
120757
|
);
|
|
120691
120758
|
}
|
|
120692
120759
|
if (!skipLeadingComments || pos >= 0 && (emitFlags & 1024 /* NoLeadingComments */) !== 0) {
|
|
@@ -120710,7 +120777,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
120710
120777
|
containerPos = savedContainerPos;
|
|
120711
120778
|
containerEnd = savedContainerEnd;
|
|
120712
120779
|
declarationListContainerEnd = savedDeclarationListContainerEnd;
|
|
120713
|
-
if (!skipTrailingComments && node.kind !==
|
|
120780
|
+
if (!skipTrailingComments && node.kind !== 360 /* NotEmittedStatement */) {
|
|
120714
120781
|
emitTrailingComments(end);
|
|
120715
120782
|
}
|
|
120716
120783
|
}
|
|
@@ -120982,7 +121049,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
120982
121049
|
}
|
|
120983
121050
|
} else {
|
|
120984
121051
|
const source = sourceMapRange.source || sourceMapSource;
|
|
120985
|
-
if (node.kind !==
|
|
121052
|
+
if (node.kind !== 360 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) {
|
|
120986
121053
|
emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos));
|
|
120987
121054
|
}
|
|
120988
121055
|
if (emitFlags & 128 /* NoNestedSourceMaps */) {
|
|
@@ -120997,7 +121064,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
120997
121064
|
if (emitFlags & 128 /* NoNestedSourceMaps */) {
|
|
120998
121065
|
sourceMapsDisabled = false;
|
|
120999
121066
|
}
|
|
121000
|
-
if (node.kind !==
|
|
121067
|
+
if (node.kind !== 360 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) {
|
|
121001
121068
|
emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end);
|
|
121002
121069
|
}
|
|
121003
121070
|
}
|
|
@@ -123941,6 +124008,9 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
123941
124008
|
if (file.flags & 4194304 /* PossiblyContainsDynamicImport */ || isJavaScriptFile) {
|
|
123942
124009
|
collectDynamicImportOrRequireCalls(file);
|
|
123943
124010
|
}
|
|
124011
|
+
if (isJavaScriptFile) {
|
|
124012
|
+
collectJsDocImportTypeReferences(file);
|
|
124013
|
+
}
|
|
123944
124014
|
file.imports = imports || emptyArray;
|
|
123945
124015
|
file.moduleAugmentations = moduleAugmentations || emptyArray;
|
|
123946
124016
|
file.ambientModuleNames = ambientModules || emptyArray;
|
|
@@ -124015,6 +124085,23 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
124015
124085
|
}
|
|
124016
124086
|
}
|
|
124017
124087
|
}
|
|
124088
|
+
function collectJsDocImportTypeReferences(file2) {
|
|
124089
|
+
const r = /@importType/g;
|
|
124090
|
+
while (r.exec(file2.text) !== null) {
|
|
124091
|
+
const node = getNodeAtPosition(file2, r.lastIndex);
|
|
124092
|
+
if (isJSDocImportTypeTag(node)) {
|
|
124093
|
+
const moduleNameExpr = getExternalModuleName(node);
|
|
124094
|
+
if (moduleNameExpr && isStringLiteral(moduleNameExpr) && moduleNameExpr.text) {
|
|
124095
|
+
setParentRecursive(
|
|
124096
|
+
node,
|
|
124097
|
+
/*incremental*/
|
|
124098
|
+
false
|
|
124099
|
+
);
|
|
124100
|
+
imports = append(imports, moduleNameExpr);
|
|
124101
|
+
}
|
|
124102
|
+
}
|
|
124103
|
+
}
|
|
124104
|
+
}
|
|
124018
124105
|
function getNodeAtPosition(sourceFile, position) {
|
|
124019
124106
|
let current = sourceFile;
|
|
124020
124107
|
const getContainingChild = (child) => {
|
|
@@ -134163,7 +134250,7 @@ function symbolEscapedNameNoDefault(symbol) {
|
|
|
134163
134250
|
});
|
|
134164
134251
|
}
|
|
134165
134252
|
function isModuleSpecifierLike(node) {
|
|
134166
|
-
return isStringLiteralLike(node) && (isExternalModuleReference(node.parent) || isImportDeclaration(node.parent) || isRequireCall(
|
|
134253
|
+
return isStringLiteralLike(node) && (isExternalModuleReference(node.parent) || isImportDeclaration(node.parent) || isJSDocImportTypeTag(node.parent) || isRequireCall(
|
|
134167
134254
|
node.parent,
|
|
134168
134255
|
/*requireStringLiteralLikeArgument*/
|
|
134169
134256
|
false
|
|
@@ -140028,7 +140115,8 @@ function doChangeNamespaceToNamed(sourceFile, checker, changes, toConvert, allow
|
|
|
140028
140115
|
factory.createIdentifier(name)
|
|
140029
140116
|
));
|
|
140030
140117
|
});
|
|
140031
|
-
const importDecl = toConvert.parent.parent;
|
|
140118
|
+
const importDecl = tryCast(toConvert.parent.parent, isImportDeclaration);
|
|
140119
|
+
Debug.assert(importDecl, "Unexpected declaration");
|
|
140032
140120
|
if (usedAsNamespaceOrDefault && !allowSyntheticDefaultImports) {
|
|
140033
140121
|
changes.insertNodeAfter(sourceFile, importDecl, updateImport(
|
|
140034
140122
|
importDecl,
|
|
@@ -140048,7 +140136,10 @@ function getLeftOfPropertyAccessOrQualifiedName(propertyAccessOrQualifiedName) {
|
|
|
140048
140136
|
}
|
|
140049
140137
|
function doChangeNamedToNamespaceOrDefault(sourceFile, program, changes, toConvert, shouldUseDefault = getShouldUseDefault(program, toConvert.parent)) {
|
|
140050
140138
|
const checker = program.getTypeChecker();
|
|
140051
|
-
const importDecl = toConvert.parent.parent;
|
|
140139
|
+
const importDecl = tryCast(toConvert.parent.parent, isImportDeclaration);
|
|
140140
|
+
if (importDecl === void 0) {
|
|
140141
|
+
Debug.assert(importDecl, "Unexpected declaration");
|
|
140142
|
+
}
|
|
140052
140143
|
const { moduleSpecifier } = importDecl;
|
|
140053
140144
|
const toConvertSymbols = /* @__PURE__ */ new Set();
|
|
140054
140145
|
toConvert.elements.forEach((namedImport) => {
|
|
@@ -145325,7 +145416,7 @@ var NodeObject = class {
|
|
|
145325
145416
|
if (!children.length) {
|
|
145326
145417
|
return void 0;
|
|
145327
145418
|
}
|
|
145328
|
-
const child = find(children, (kid) => kid.kind < 316 /* FirstJSDocNode */ || kid.kind >
|
|
145419
|
+
const child = find(children, (kid) => kid.kind < 316 /* FirstJSDocNode */ || kid.kind > 358 /* LastJSDocNode */);
|
|
145329
145420
|
return child.kind < 166 /* FirstNode */ ? child : child.getFirstToken(sourceFile);
|
|
145330
145421
|
}
|
|
145331
145422
|
getLastToken(sourceFile) {
|
|
@@ -145392,7 +145483,7 @@ function addSyntheticNodes(nodes, pos, end, parent2) {
|
|
|
145392
145483
|
}
|
|
145393
145484
|
}
|
|
145394
145485
|
function createSyntaxList(nodes, parent2) {
|
|
145395
|
-
const list = createNode(
|
|
145486
|
+
const list = createNode(359 /* SyntaxList */, nodes.pos, nodes.end, parent2);
|
|
145396
145487
|
list._children = [];
|
|
145397
145488
|
let pos = nodes.pos;
|
|
145398
145489
|
for (const node of nodes) {
|
|
@@ -150992,7 +151083,7 @@ registerCodeFix({
|
|
|
150992
151083
|
const declaration = getDeclaration2(context.sourceFile, context.span.start);
|
|
150993
151084
|
if (declaration) {
|
|
150994
151085
|
const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange11(t, context.sourceFile, declaration));
|
|
150995
|
-
const importDeclarationChanges = declaration.kind === 276 /* ImportSpecifier */ && canConvertImportDeclarationForSpecifier(declaration, context.sourceFile, context.program) ? ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange11(t, context.sourceFile, declaration.parent.parent.parent)) : void 0;
|
|
151086
|
+
const importDeclarationChanges = declaration.kind === 276 /* ImportSpecifier */ && isImportDeclaration(declaration.parent.parent.parent) && canConvertImportDeclarationForSpecifier(declaration, context.sourceFile, context.program) ? ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange11(t, context.sourceFile, declaration.parent.parent.parent)) : void 0;
|
|
150996
151087
|
const mainAction = createCodeFixAction(
|
|
150997
151088
|
fixId13,
|
|
150998
151089
|
changes,
|
|
@@ -151018,7 +151109,7 @@ registerCodeFix({
|
|
|
151018
151109
|
if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 272 /* ImportDeclaration */ && !fixedImportDeclarations.has(errorDeclaration)) {
|
|
151019
151110
|
doChange11(changes, diag2.file, errorDeclaration);
|
|
151020
151111
|
fixedImportDeclarations.add(errorDeclaration);
|
|
151021
|
-
} else if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 276 /* ImportSpecifier */ && !fixedImportDeclarations.has(errorDeclaration.parent.parent.parent) && canConvertImportDeclarationForSpecifier(errorDeclaration, diag2.file, context.program)) {
|
|
151112
|
+
} else if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 276 /* ImportSpecifier */ && isImportDeclaration(errorDeclaration.parent.parent.parent) && !fixedImportDeclarations.has(errorDeclaration.parent.parent.parent) && canConvertImportDeclarationForSpecifier(errorDeclaration, diag2.file, context.program)) {
|
|
151022
151113
|
doChange11(changes, diag2.file, errorDeclaration.parent.parent.parent);
|
|
151023
151114
|
fixedImportDeclarations.add(errorDeclaration.parent.parent.parent);
|
|
151024
151115
|
} else if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 276 /* ImportSpecifier */) {
|
|
@@ -158226,7 +158317,7 @@ function getInfo19(sourceFile, pos) {
|
|
|
158226
158317
|
const { parent: parent2 } = name;
|
|
158227
158318
|
if (isImportEqualsDeclaration(parent2) && isExternalModuleReference(parent2.moduleReference)) {
|
|
158228
158319
|
return { importNode: parent2, name, moduleSpecifier: parent2.moduleReference.expression };
|
|
158229
|
-
} else if (isNamespaceImport(parent2)) {
|
|
158320
|
+
} else if (isNamespaceImport(parent2) && isImportDeclaration(parent2.parent.parent)) {
|
|
158230
158321
|
const importNode = parent2.parent.parent;
|
|
158231
158322
|
return { importNode, name, moduleSpecifier: importNode.moduleSpecifier };
|
|
158232
158323
|
}
|
|
@@ -160702,6 +160793,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
160702
160793
|
const insideComment = isInComment(sourceFile, position, currentToken);
|
|
160703
160794
|
log("getCompletionData: Is inside comment: " + (timestamp() - start2));
|
|
160704
160795
|
let insideJsDocTagTypeExpression = false;
|
|
160796
|
+
let insideJsDocImportTypeTag = false;
|
|
160705
160797
|
let isInSnippetScope = false;
|
|
160706
160798
|
if (insideComment) {
|
|
160707
160799
|
if (hasDocComment(sourceFile, position)) {
|
|
@@ -160719,24 +160811,28 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
160719
160811
|
if (tag.tagName.pos <= position && position <= tag.tagName.end) {
|
|
160720
160812
|
return { kind: 1 /* JsDocTagName */ };
|
|
160721
160813
|
}
|
|
160722
|
-
|
|
160723
|
-
|
|
160724
|
-
|
|
160725
|
-
|
|
160726
|
-
|
|
160814
|
+
if (isJSDocImportTypeTag(tag)) {
|
|
160815
|
+
insideJsDocImportTypeTag = true;
|
|
160816
|
+
} else {
|
|
160817
|
+
const typeExpression = tryGetTypeExpressionFromTag(tag);
|
|
160818
|
+
if (typeExpression) {
|
|
160819
|
+
currentToken = getTokenAtPosition(sourceFile, position);
|
|
160820
|
+
if (!currentToken || !isDeclarationName(currentToken) && (currentToken.parent.kind !== 355 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken)) {
|
|
160821
|
+
insideJsDocTagTypeExpression = isCurrentlyEditingNode(typeExpression);
|
|
160822
|
+
}
|
|
160823
|
+
}
|
|
160824
|
+
if (!insideJsDocTagTypeExpression && isJSDocParameterTag(tag) && (nodeIsMissing(tag.name) || tag.name.pos <= position && position <= tag.name.end)) {
|
|
160825
|
+
return { kind: 3 /* JsDocParameterName */, tag };
|
|
160727
160826
|
}
|
|
160728
|
-
}
|
|
160729
|
-
if (!insideJsDocTagTypeExpression && isJSDocParameterTag(tag) && (nodeIsMissing(tag.name) || tag.name.pos <= position && position <= tag.name.end)) {
|
|
160730
|
-
return { kind: 3 /* JsDocParameterName */, tag };
|
|
160731
160827
|
}
|
|
160732
160828
|
}
|
|
160733
|
-
if (!insideJsDocTagTypeExpression) {
|
|
160829
|
+
if (!insideJsDocTagTypeExpression && !insideJsDocImportTypeTag) {
|
|
160734
160830
|
log("Returning an empty list because completion was inside a regular comment or plain text part of a JsDoc comment.");
|
|
160735
160831
|
return void 0;
|
|
160736
160832
|
}
|
|
160737
160833
|
}
|
|
160738
160834
|
start2 = timestamp();
|
|
160739
|
-
const isJsOnlyLocation = !insideJsDocTagTypeExpression && isSourceFileJS(sourceFile);
|
|
160835
|
+
const isJsOnlyLocation = !insideJsDocTagTypeExpression && !insideJsDocImportTypeTag && isSourceFileJS(sourceFile);
|
|
160740
160836
|
const tokens = getRelevantTokens(position, sourceFile);
|
|
160741
160837
|
const previousToken = tokens.previousToken;
|
|
160742
160838
|
let contextToken = tokens.contextToken;
|
|
@@ -161249,7 +161345,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
161249
161345
|
}
|
|
161250
161346
|
}
|
|
161251
161347
|
function isTypeOnlyCompletion() {
|
|
161252
|
-
return insideJsDocTagTypeExpression || !!importStatementCompletion && isTypeOnlyImportOrExportDeclaration(location.parent) || !isContextTokenValueLocation(contextToken) && (isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker) || isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken));
|
|
161348
|
+
return insideJsDocTagTypeExpression || insideJsDocImportTypeTag || !!importStatementCompletion && isTypeOnlyImportOrExportDeclaration(location.parent) || !isContextTokenValueLocation(contextToken) && (isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker) || isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken));
|
|
161253
161349
|
}
|
|
161254
161350
|
function isContextTokenValueLocation(contextToken2) {
|
|
161255
161351
|
return contextToken2 && (contextToken2.kind === 114 /* TypeOfKeyword */ && (contextToken2.parent.kind === 186 /* TypeQuery */ || isTypeOfExpression(contextToken2.parent)) || contextToken2.kind === 131 /* AssertsKeyword */ && contextToken2.parent.kind === 182 /* TypePredicate */);
|
|
@@ -162271,7 +162367,7 @@ function getPropertiesForCompletion(type, checker) {
|
|
|
162271
162367
|
}
|
|
162272
162368
|
function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location, position) {
|
|
162273
162369
|
switch (location.kind) {
|
|
162274
|
-
case
|
|
162370
|
+
case 359 /* SyntaxList */:
|
|
162275
162371
|
return tryCast(location.parent, isObjectTypeDeclaration);
|
|
162276
162372
|
case 1 /* EndOfFileToken */:
|
|
162277
162373
|
const cls = tryCast(lastOrUndefined(cast(location.parent, isSourceFile).statements), isObjectTypeDeclaration);
|
|
@@ -162502,13 +162598,13 @@ function getSingleLineReplacementSpanForImportCompletionNode(node) {
|
|
|
162502
162598
|
var _a;
|
|
162503
162599
|
if (!node)
|
|
162504
162600
|
return void 0;
|
|
162505
|
-
const top = findAncestor(node, or(isImportDeclaration, isImportEqualsDeclaration)) ?? node;
|
|
162601
|
+
const top = findAncestor(node, or(isImportDeclaration, isImportEqualsDeclaration, isJSDocImportTypeTag)) ?? node;
|
|
162506
162602
|
const sourceFile = top.getSourceFile();
|
|
162507
162603
|
if (rangeIsOnSingleLine(top, sourceFile)) {
|
|
162508
162604
|
return createTextSpanFromNode(top, sourceFile);
|
|
162509
162605
|
}
|
|
162510
162606
|
Debug.assert(top.kind !== 102 /* ImportKeyword */ && top.kind !== 276 /* ImportSpecifier */);
|
|
162511
|
-
const potentialSplitPoint = top.kind === 272 /* ImportDeclaration */ ? getPotentiallyInvalidImportSpecifier((_a = top.importClause) == null ? void 0 : _a.namedBindings) ?? top.moduleSpecifier : top.moduleReference;
|
|
162607
|
+
const potentialSplitPoint = top.kind === 272 /* ImportDeclaration */ || top.kind === 358 /* JSDocImportTypeTag */ ? getPotentiallyInvalidImportSpecifier((_a = top.importClause) == null ? void 0 : _a.namedBindings) ?? top.moduleSpecifier : top.moduleReference;
|
|
162512
162608
|
const withoutModuleSpecifier = {
|
|
162513
162609
|
pos: top.getFirstToken().getStart(),
|
|
162514
162610
|
end: potentialSplitPoint.pos
|
|
@@ -162804,6 +162900,7 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, program,
|
|
|
162804
162900
|
case 272 /* ImportDeclaration */:
|
|
162805
162901
|
case 278 /* ExportDeclaration */:
|
|
162806
162902
|
case 283 /* ExternalModuleReference */:
|
|
162903
|
+
case 358 /* JSDocImportTypeTag */:
|
|
162807
162904
|
return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, program, host, preferences) };
|
|
162808
162905
|
case 296 /* CaseClause */:
|
|
162809
162906
|
const tracker = newCaseClauseTracker(typeChecker, parent2.parent.clauses);
|
|
@@ -163571,6 +163668,7 @@ function getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, {
|
|
|
163571
163668
|
);
|
|
163572
163669
|
break;
|
|
163573
163670
|
case 272 /* ImportDeclaration */:
|
|
163671
|
+
case 358 /* JSDocImportTypeTag */:
|
|
163574
163672
|
directImports.push(direct);
|
|
163575
163673
|
const namedBindings = direct.importClause && direct.importClause.namedBindings;
|
|
163576
163674
|
if (namedBindings && namedBindings.kind === 274 /* NamespaceImport */) {
|
|
@@ -167304,6 +167402,7 @@ var jsDocTagNames = [
|
|
|
167304
167402
|
"host",
|
|
167305
167403
|
"ignore",
|
|
167306
167404
|
"implements",
|
|
167405
|
+
"importType",
|
|
167307
167406
|
"inheritdoc",
|
|
167308
167407
|
"inner",
|
|
167309
167408
|
"instance",
|
|
@@ -175789,6 +175888,7 @@ __export(ts_exports2, {
|
|
|
175789
175888
|
isJSDocEnumTag: () => isJSDocEnumTag,
|
|
175790
175889
|
isJSDocFunctionType: () => isJSDocFunctionType,
|
|
175791
175890
|
isJSDocImplementsTag: () => isJSDocImplementsTag,
|
|
175891
|
+
isJSDocImportTypeTag: () => isJSDocImportTypeTag,
|
|
175792
175892
|
isJSDocIndexSignature: () => isJSDocIndexSignature,
|
|
175793
175893
|
isJSDocLikeText: () => isJSDocLikeText,
|
|
175794
175894
|
isJSDocLink: () => isJSDocLink,
|
|
@@ -190596,6 +190696,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
190596
190696
|
isJSDocEnumTag,
|
|
190597
190697
|
isJSDocFunctionType,
|
|
190598
190698
|
isJSDocImplementsTag,
|
|
190699
|
+
isJSDocImportTypeTag,
|
|
190599
190700
|
isJSDocIndexSignature,
|
|
190600
190701
|
isJSDocLikeText,
|
|
190601
190702
|
isJSDocLink,
|