@typescript-deploys/pr-build 5.0.0-pr-51753-3 → 5.0.0-pr-50403-6
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 +388 -303
- package/lib/tsserver.js +424 -342
- package/lib/tsserverlibrary.d.ts +28 -24
- package/lib/tsserverlibrary.js +425 -339
- package/lib/typescript.d.ts +28 -24
- package/lib/typescript.js +425 -335
- package/lib/typingsInstaller.js +109 -123
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -23,7 +23,7 @@ var __export = (target, all) => {
|
|
|
23
23
|
|
|
24
24
|
// src/compiler/corePublic.ts
|
|
25
25
|
var versionMajorMinor = "5.0";
|
|
26
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
26
|
+
var version = `${versionMajorMinor}.0-insiders.20221207`;
|
|
27
27
|
|
|
28
28
|
// src/compiler/core.ts
|
|
29
29
|
var emptyArray = [];
|
|
@@ -3340,15 +3340,14 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind4) => {
|
|
|
3340
3340
|
SyntaxKind4[SyntaxKind4["JSDocTypedefTag"] = 348] = "JSDocTypedefTag";
|
|
3341
3341
|
SyntaxKind4[SyntaxKind4["JSDocSeeTag"] = 349] = "JSDocSeeTag";
|
|
3342
3342
|
SyntaxKind4[SyntaxKind4["JSDocPropertyTag"] = 350] = "JSDocPropertyTag";
|
|
3343
|
-
SyntaxKind4[SyntaxKind4["
|
|
3344
|
-
SyntaxKind4[SyntaxKind4["
|
|
3345
|
-
SyntaxKind4[SyntaxKind4["
|
|
3346
|
-
SyntaxKind4[SyntaxKind4["
|
|
3347
|
-
SyntaxKind4[SyntaxKind4["
|
|
3348
|
-
SyntaxKind4[SyntaxKind4["
|
|
3349
|
-
SyntaxKind4[SyntaxKind4["
|
|
3350
|
-
SyntaxKind4[SyntaxKind4["
|
|
3351
|
-
SyntaxKind4[SyntaxKind4["Count"] = 359] = "Count";
|
|
3343
|
+
SyntaxKind4[SyntaxKind4["SyntaxList"] = 351] = "SyntaxList";
|
|
3344
|
+
SyntaxKind4[SyntaxKind4["NotEmittedStatement"] = 352] = "NotEmittedStatement";
|
|
3345
|
+
SyntaxKind4[SyntaxKind4["PartiallyEmittedExpression"] = 353] = "PartiallyEmittedExpression";
|
|
3346
|
+
SyntaxKind4[SyntaxKind4["CommaListExpression"] = 354] = "CommaListExpression";
|
|
3347
|
+
SyntaxKind4[SyntaxKind4["MergeDeclarationMarker"] = 355] = "MergeDeclarationMarker";
|
|
3348
|
+
SyntaxKind4[SyntaxKind4["EndOfDeclarationMarker"] = 356] = "EndOfDeclarationMarker";
|
|
3349
|
+
SyntaxKind4[SyntaxKind4["SyntheticReferenceExpression"] = 357] = "SyntheticReferenceExpression";
|
|
3350
|
+
SyntaxKind4[SyntaxKind4["Count"] = 358] = "Count";
|
|
3352
3351
|
SyntaxKind4[SyntaxKind4["FirstAssignment"] = 63 /* EqualsToken */] = "FirstAssignment";
|
|
3353
3352
|
SyntaxKind4[SyntaxKind4["LastAssignment"] = 78 /* CaretEqualsToken */] = "LastAssignment";
|
|
3354
3353
|
SyntaxKind4[SyntaxKind4["FirstCompoundAssignment"] = 64 /* PlusEqualsToken */] = "FirstCompoundAssignment";
|
|
@@ -9876,9 +9875,6 @@ function getJSDocThisTag(node) {
|
|
|
9876
9875
|
function getJSDocReturnTag(node) {
|
|
9877
9876
|
return getFirstJSDocTag(node, isJSDocReturnTag);
|
|
9878
9877
|
}
|
|
9879
|
-
function getJSDocSatisfiesTag(node) {
|
|
9880
|
-
return getFirstJSDocTag(node, isJSDocSatisfiesTag);
|
|
9881
|
-
}
|
|
9882
9878
|
function getJSDocTypeTag(node) {
|
|
9883
9879
|
const tag = getFirstJSDocTag(node, isJSDocTypeTag);
|
|
9884
9880
|
if (tag && tag.typeExpression && tag.typeExpression.type) {
|
|
@@ -10369,8 +10365,8 @@ function isExpressionKind(kind) {
|
|
|
10369
10365
|
case 227 /* SpreadElement */:
|
|
10370
10366
|
case 231 /* AsExpression */:
|
|
10371
10367
|
case 229 /* OmittedExpression */:
|
|
10372
|
-
case
|
|
10373
|
-
case
|
|
10368
|
+
case 354 /* CommaListExpression */:
|
|
10369
|
+
case 353 /* PartiallyEmittedExpression */:
|
|
10374
10370
|
case 235 /* SatisfiesExpression */:
|
|
10375
10371
|
return true;
|
|
10376
10372
|
default:
|
|
@@ -10433,7 +10429,7 @@ function isDeclarationStatementKind(kind) {
|
|
|
10433
10429
|
return kind === 259 /* FunctionDeclaration */ || kind === 279 /* MissingDeclaration */ || kind === 260 /* ClassDeclaration */ || kind === 261 /* InterfaceDeclaration */ || kind === 262 /* TypeAliasDeclaration */ || kind === 263 /* EnumDeclaration */ || kind === 264 /* ModuleDeclaration */ || kind === 269 /* ImportDeclaration */ || kind === 268 /* ImportEqualsDeclaration */ || kind === 275 /* ExportDeclaration */ || kind === 274 /* ExportAssignment */ || kind === 267 /* NamespaceExportDeclaration */;
|
|
10434
10430
|
}
|
|
10435
10431
|
function isStatementKindButNotDeclarationKind(kind) {
|
|
10436
|
-
return kind === 249 /* BreakStatement */ || kind === 248 /* ContinueStatement */ || kind === 256 /* DebuggerStatement */ || kind === 243 /* DoStatement */ || kind === 241 /* ExpressionStatement */ || kind === 239 /* EmptyStatement */ || kind === 246 /* ForInStatement */ || kind === 247 /* ForOfStatement */ || kind === 245 /* ForStatement */ || kind === 242 /* IfStatement */ || kind === 253 /* LabeledStatement */ || kind === 250 /* ReturnStatement */ || kind === 252 /* SwitchStatement */ || kind === 254 /* ThrowStatement */ || kind === 255 /* TryStatement */ || kind === 240 /* VariableStatement */ || kind === 244 /* WhileStatement */ || kind === 251 /* WithStatement */ || kind ===
|
|
10432
|
+
return kind === 249 /* BreakStatement */ || kind === 248 /* ContinueStatement */ || kind === 256 /* DebuggerStatement */ || kind === 243 /* DoStatement */ || kind === 241 /* ExpressionStatement */ || kind === 239 /* EmptyStatement */ || kind === 246 /* ForInStatement */ || kind === 247 /* ForOfStatement */ || kind === 245 /* ForStatement */ || kind === 242 /* IfStatement */ || kind === 253 /* LabeledStatement */ || kind === 250 /* ReturnStatement */ || kind === 252 /* SwitchStatement */ || kind === 254 /* ThrowStatement */ || kind === 255 /* TryStatement */ || kind === 240 /* VariableStatement */ || kind === 244 /* WhileStatement */ || kind === 251 /* WithStatement */ || kind === 352 /* NotEmittedStatement */ || kind === 356 /* EndOfDeclarationMarker */ || kind === 355 /* MergeDeclarationMarker */;
|
|
10437
10433
|
}
|
|
10438
10434
|
function isDeclaration(node) {
|
|
10439
10435
|
if (node.kind === 165 /* TypeParameter */) {
|
|
@@ -10879,7 +10875,7 @@ function getTokenPosOfNode(node, sourceFile, includeJsDoc) {
|
|
|
10879
10875
|
if (includeJsDoc && hasJSDocNodes(node)) {
|
|
10880
10876
|
return getTokenPosOfNode(node.jsDoc[0], sourceFile);
|
|
10881
10877
|
}
|
|
10882
|
-
if (node.kind ===
|
|
10878
|
+
if (node.kind === 351 /* SyntaxList */ && node._children.length > 0) {
|
|
10883
10879
|
return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc);
|
|
10884
10880
|
}
|
|
10885
10881
|
return skipTrivia(
|
|
@@ -12940,7 +12936,7 @@ function getOperator(expression) {
|
|
|
12940
12936
|
}
|
|
12941
12937
|
function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
|
|
12942
12938
|
switch (nodeKind) {
|
|
12943
|
-
case
|
|
12939
|
+
case 354 /* CommaListExpression */:
|
|
12944
12940
|
return 0 /* Comma */;
|
|
12945
12941
|
case 227 /* SpreadElement */:
|
|
12946
12942
|
return 1 /* Spread */;
|
|
@@ -14362,7 +14358,7 @@ function getLeftmostExpression(node, stopAtCallExpressions) {
|
|
|
14362
14358
|
case 209 /* ElementAccessExpression */:
|
|
14363
14359
|
case 208 /* PropertyAccessExpression */:
|
|
14364
14360
|
case 232 /* NonNullExpression */:
|
|
14365
|
-
case
|
|
14361
|
+
case 353 /* PartiallyEmittedExpression */:
|
|
14366
14362
|
case 235 /* SatisfiesExpression */:
|
|
14367
14363
|
node = node.expression;
|
|
14368
14364
|
continue;
|
|
@@ -15487,7 +15483,7 @@ function getContainingNodeArray(node) {
|
|
|
15487
15483
|
return parent.types;
|
|
15488
15484
|
case 186 /* TupleType */:
|
|
15489
15485
|
case 206 /* ArrayLiteralExpression */:
|
|
15490
|
-
case
|
|
15486
|
+
case 354 /* CommaListExpression */:
|
|
15491
15487
|
case 272 /* NamedImports */:
|
|
15492
15488
|
case 276 /* NamedExports */:
|
|
15493
15489
|
return parent.elements;
|
|
@@ -15639,15 +15635,6 @@ function canUsePropertyAccess(name, languageVersion) {
|
|
|
15639
15635
|
const firstChar = name.charCodeAt(0);
|
|
15640
15636
|
return firstChar === 35 /* hash */ ? name.length > 1 && isIdentifierStart(name.charCodeAt(1), languageVersion) : isIdentifierStart(firstChar, languageVersion);
|
|
15641
15637
|
}
|
|
15642
|
-
function isJSDocSatisfiesExpression(node) {
|
|
15643
|
-
return isInJSFile(node) && isParenthesizedExpression(node) && !!getJSDocSatisfiesTag(node);
|
|
15644
|
-
}
|
|
15645
|
-
function getJSDocSatisfiesExpressionType(node) {
|
|
15646
|
-
const tag = getJSDocSatisfiesTag(node);
|
|
15647
|
-
const type = tag && tag.typeExpression && tag.typeExpression.type;
|
|
15648
|
-
Debug.assertIsDefined(type);
|
|
15649
|
-
return type;
|
|
15650
|
-
}
|
|
15651
15638
|
|
|
15652
15639
|
// src/compiler/factory/baseNodeFactory.ts
|
|
15653
15640
|
function createBaseNodeFactory() {
|
|
@@ -16592,12 +16579,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
16592
16579
|
get updateJSDocDeprecatedTag() {
|
|
16593
16580
|
return getJSDocSimpleTagUpdateFunction(334 /* JSDocDeprecatedTag */);
|
|
16594
16581
|
},
|
|
16595
|
-
get createJSDocSatisfiesTag() {
|
|
16596
|
-
return getJSDocTypeLikeTagCreateFunction(351 /* JSDocSatisfiesTag */);
|
|
16597
|
-
},
|
|
16598
|
-
get updateJSDocSatisfiesTag() {
|
|
16599
|
-
return getJSDocTypeLikeTagUpdateFunction(351 /* JSDocSatisfiesTag */);
|
|
16600
|
-
},
|
|
16601
16582
|
createJSDocUnknownTag,
|
|
16602
16583
|
updateJSDocUnknownTag,
|
|
16603
16584
|
createJSDocText,
|
|
@@ -19547,18 +19528,18 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
19547
19528
|
return node;
|
|
19548
19529
|
}
|
|
19549
19530
|
function createSyntaxList(children) {
|
|
19550
|
-
const node = createBaseNode(
|
|
19531
|
+
const node = createBaseNode(351 /* SyntaxList */);
|
|
19551
19532
|
node._children = children;
|
|
19552
19533
|
return node;
|
|
19553
19534
|
}
|
|
19554
19535
|
function createNotEmittedStatement(original) {
|
|
19555
|
-
const node = createBaseNode(
|
|
19536
|
+
const node = createBaseNode(352 /* NotEmittedStatement */);
|
|
19556
19537
|
node.original = original;
|
|
19557
19538
|
setTextRange(node, original);
|
|
19558
19539
|
return node;
|
|
19559
19540
|
}
|
|
19560
19541
|
function createPartiallyEmittedExpression(expression, original) {
|
|
19561
|
-
const node = createBaseNode(
|
|
19542
|
+
const node = createBaseNode(353 /* PartiallyEmittedExpression */);
|
|
19562
19543
|
node.expression = expression;
|
|
19563
19544
|
node.original = original;
|
|
19564
19545
|
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
|
|
@@ -19580,7 +19561,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
19580
19561
|
return node;
|
|
19581
19562
|
}
|
|
19582
19563
|
function createCommaListExpression(elements) {
|
|
19583
|
-
const node = createBaseNode(
|
|
19564
|
+
const node = createBaseNode(354 /* CommaListExpression */);
|
|
19584
19565
|
node.elements = createNodeArray(sameFlatMap(elements, flattenCommaElements));
|
|
19585
19566
|
node.transformFlags |= propagateChildrenFlags(node.elements);
|
|
19586
19567
|
return node;
|
|
@@ -19589,19 +19570,19 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
19589
19570
|
return node.elements !== elements ? update(createCommaListExpression(elements), node) : node;
|
|
19590
19571
|
}
|
|
19591
19572
|
function createEndOfDeclarationMarker(original) {
|
|
19592
|
-
const node = createBaseNode(
|
|
19573
|
+
const node = createBaseNode(356 /* EndOfDeclarationMarker */);
|
|
19593
19574
|
node.emitNode = {};
|
|
19594
19575
|
node.original = original;
|
|
19595
19576
|
return node;
|
|
19596
19577
|
}
|
|
19597
19578
|
function createMergeDeclarationMarker(original) {
|
|
19598
|
-
const node = createBaseNode(
|
|
19579
|
+
const node = createBaseNode(355 /* MergeDeclarationMarker */);
|
|
19599
19580
|
node.emitNode = {};
|
|
19600
19581
|
node.original = original;
|
|
19601
19582
|
return node;
|
|
19602
19583
|
}
|
|
19603
19584
|
function createSyntheticReferenceExpression(expression, thisArg) {
|
|
19604
|
-
const node = createBaseNode(
|
|
19585
|
+
const node = createBaseNode(357 /* SyntheticReferenceExpression */);
|
|
19605
19586
|
node.expression = expression;
|
|
19606
19587
|
node.thisArg = thisArg;
|
|
19607
19588
|
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg);
|
|
@@ -19749,7 +19730,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
19749
19730
|
return updateSatisfiesExpression(outerExpression, expression, outerExpression.type);
|
|
19750
19731
|
case 232 /* NonNullExpression */:
|
|
19751
19732
|
return updateNonNullExpression(outerExpression, expression);
|
|
19752
|
-
case
|
|
19733
|
+
case 353 /* PartiallyEmittedExpression */:
|
|
19753
19734
|
return updatePartiallyEmittedExpression(outerExpression, expression);
|
|
19754
19735
|
}
|
|
19755
19736
|
}
|
|
@@ -20240,7 +20221,7 @@ function getTransformFlagsSubtreeExclusions(kind) {
|
|
|
20240
20221
|
case 213 /* TypeAssertionExpression */:
|
|
20241
20222
|
case 235 /* SatisfiesExpression */:
|
|
20242
20223
|
case 231 /* AsExpression */:
|
|
20243
|
-
case
|
|
20224
|
+
case 353 /* PartiallyEmittedExpression */:
|
|
20244
20225
|
case 214 /* ParenthesizedExpression */:
|
|
20245
20226
|
case 106 /* SuperKeyword */:
|
|
20246
20227
|
return -2147483648 /* OuterExpressionExcludes */;
|
|
@@ -21692,10 +21673,10 @@ function isMetaProperty(node) {
|
|
|
21692
21673
|
return node.kind === 233 /* MetaProperty */;
|
|
21693
21674
|
}
|
|
21694
21675
|
function isPartiallyEmittedExpression(node) {
|
|
21695
|
-
return node.kind ===
|
|
21676
|
+
return node.kind === 353 /* PartiallyEmittedExpression */;
|
|
21696
21677
|
}
|
|
21697
21678
|
function isCommaListExpression(node) {
|
|
21698
|
-
return node.kind ===
|
|
21679
|
+
return node.kind === 354 /* CommaListExpression */;
|
|
21699
21680
|
}
|
|
21700
21681
|
function isTemplateSpan(node) {
|
|
21701
21682
|
return node.kind === 236 /* TemplateSpan */;
|
|
@@ -21818,10 +21799,10 @@ function isExportSpecifier(node) {
|
|
|
21818
21799
|
return node.kind === 278 /* ExportSpecifier */;
|
|
21819
21800
|
}
|
|
21820
21801
|
function isNotEmittedStatement(node) {
|
|
21821
|
-
return node.kind ===
|
|
21802
|
+
return node.kind === 352 /* NotEmittedStatement */;
|
|
21822
21803
|
}
|
|
21823
21804
|
function isSyntheticReference(node) {
|
|
21824
|
-
return node.kind ===
|
|
21805
|
+
return node.kind === 357 /* SyntheticReferenceExpression */;
|
|
21825
21806
|
}
|
|
21826
21807
|
function isExternalModuleReference(node) {
|
|
21827
21808
|
return node.kind === 280 /* ExternalModuleReference */;
|
|
@@ -21982,9 +21963,6 @@ function isJSDocTypedefTag(node) {
|
|
|
21982
21963
|
function isJSDocImplementsTag(node) {
|
|
21983
21964
|
return node.kind === 332 /* JSDocImplementsTag */;
|
|
21984
21965
|
}
|
|
21985
|
-
function isJSDocSatisfiesTag(node) {
|
|
21986
|
-
return node.kind === 351 /* JSDocSatisfiesTag */;
|
|
21987
|
-
}
|
|
21988
21966
|
|
|
21989
21967
|
// src/compiler/factory/utilities.ts
|
|
21990
21968
|
function createEmptyExports(factory2) {
|
|
@@ -22280,7 +22258,7 @@ function startsWithUseStrict(statements) {
|
|
|
22280
22258
|
return firstStatement !== void 0 && isPrologueDirective(firstStatement) && isUseStrictPrologue(firstStatement);
|
|
22281
22259
|
}
|
|
22282
22260
|
function isCommaSequence(node) {
|
|
22283
|
-
return node.kind === 223 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind ===
|
|
22261
|
+
return node.kind === 223 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind === 354 /* CommaListExpression */;
|
|
22284
22262
|
}
|
|
22285
22263
|
function isJSDocTypeAssertion(node) {
|
|
22286
22264
|
return isParenthesizedExpression(node) && isInJSFile(node) && !!getJSDocTypeTag(node);
|
|
@@ -22303,7 +22281,7 @@ function isOuterExpression(node, kinds = 15 /* All */) {
|
|
|
22303
22281
|
return (kinds & 2 /* TypeAssertions */) !== 0;
|
|
22304
22282
|
case 232 /* NonNullExpression */:
|
|
22305
22283
|
return (kinds & 4 /* NonNullAssertions */) !== 0;
|
|
22306
|
-
case
|
|
22284
|
+
case 353 /* PartiallyEmittedExpression */:
|
|
22307
22285
|
return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0;
|
|
22308
22286
|
}
|
|
22309
22287
|
return false;
|
|
@@ -23230,7 +23208,7 @@ var forEachChildTable = {
|
|
|
23230
23208
|
[279 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) {
|
|
23231
23209
|
return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers);
|
|
23232
23210
|
},
|
|
23233
|
-
[
|
|
23211
|
+
[354 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
|
|
23234
23212
|
return visitNodes(cbNode, cbNodes, node.elements);
|
|
23235
23213
|
},
|
|
23236
23214
|
[281 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) {
|
|
@@ -23298,11 +23276,10 @@ var forEachChildTable = {
|
|
|
23298
23276
|
[341 /* JSDocCallbackTag */]: function forEachChildInJSDocCallbackTag(node, cbNode, cbNodes) {
|
|
23299
23277
|
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.fullName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
|
|
23300
23278
|
},
|
|
23301
|
-
[344 /* JSDocReturnTag */]:
|
|
23302
|
-
[346 /* JSDocTypeTag */]:
|
|
23303
|
-
[345 /* JSDocThisTag */]:
|
|
23304
|
-
[342 /* JSDocEnumTag */]:
|
|
23305
|
-
[351 /* JSDocSatisfiesTag */]: forEachChildInJSDocTypeLikeTag,
|
|
23279
|
+
[344 /* JSDocReturnTag */]: forEachChildInJSDocReturnTag,
|
|
23280
|
+
[346 /* JSDocTypeTag */]: forEachChildInJSDocReturnTag,
|
|
23281
|
+
[345 /* JSDocThisTag */]: forEachChildInJSDocReturnTag,
|
|
23282
|
+
[342 /* JSDocEnumTag */]: forEachChildInJSDocReturnTag,
|
|
23306
23283
|
[326 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) {
|
|
23307
23284
|
return forEach(node.typeParameters, cbNode) || forEach(node.parameters, cbNode) || visitNode2(cbNode, node.type);
|
|
23308
23285
|
},
|
|
@@ -23320,7 +23297,7 @@ var forEachChildTable = {
|
|
|
23320
23297
|
[339 /* JSDocReadonlyTag */]: forEachChildInJSDocTag,
|
|
23321
23298
|
[334 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag,
|
|
23322
23299
|
[340 /* JSDocOverrideTag */]: forEachChildInJSDocTag,
|
|
23323
|
-
[
|
|
23300
|
+
[353 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
|
|
23324
23301
|
};
|
|
23325
23302
|
function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) {
|
|
23326
23303
|
return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
|
|
@@ -23361,7 +23338,7 @@ function forEachChildInOptionalRestOrJSDocParameterModifier(node, cbNode, _cbNod
|
|
|
23361
23338
|
function forEachChildInJSDocParameterOrPropertyTag(node, cbNode, cbNodes) {
|
|
23362
23339
|
return visitNode2(cbNode, node.tagName) || (node.isNameFirst ? visitNode2(cbNode, node.name) || visitNode2(cbNode, node.typeExpression) : visitNode2(cbNode, node.typeExpression) || visitNode2(cbNode, node.name)) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
|
|
23363
23340
|
}
|
|
23364
|
-
function
|
|
23341
|
+
function forEachChildInJSDocReturnTag(node, cbNode, cbNodes) {
|
|
23365
23342
|
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
|
|
23366
23343
|
}
|
|
23367
23344
|
function forEachChildInJSDocLinkCodeOrPlain(node, cbNode, _cbNodes) {
|
|
@@ -28641,9 +28618,6 @@ var Parser;
|
|
|
28641
28618
|
case "callback":
|
|
28642
28619
|
tag = parseCallbackTag(start2, tagName, margin, indentText);
|
|
28643
28620
|
break;
|
|
28644
|
-
case "satisfies":
|
|
28645
|
-
tag = parseSatisfiesTag(start2, tagName, margin, indentText);
|
|
28646
|
-
break;
|
|
28647
28621
|
case "see":
|
|
28648
28622
|
tag = parseSeeTag(start2, tagName, margin, indentText);
|
|
28649
28623
|
break;
|
|
@@ -28937,14 +28911,6 @@ var Parser;
|
|
|
28937
28911
|
const className = parseExpressionWithTypeArgumentsForAugments();
|
|
28938
28912
|
return finishNode(factory2.createJSDocAugmentsTag(tagName, className, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2);
|
|
28939
28913
|
}
|
|
28940
|
-
function parseSatisfiesTag(start2, tagName, margin, indentText) {
|
|
28941
|
-
if (some(tags, isJSDocSatisfiesTag)) {
|
|
28942
|
-
parseErrorAt(tagName.pos, scanner.getTokenPos(), Diagnostics._0_tag_already_specified, tagName.escapedText);
|
|
28943
|
-
}
|
|
28944
|
-
const typeExpression = parseJSDocTypeExpression(true);
|
|
28945
|
-
const comments2 = margin !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), margin, indentText) : void 0;
|
|
28946
|
-
return finishNode(factory2.createJSDocSatisfiesTag(tagName, typeExpression, comments2), start2);
|
|
28947
|
-
}
|
|
28948
28914
|
function parseExpressionWithTypeArgumentsForAugments() {
|
|
28949
28915
|
const usedBrace = parseOptional(18 /* OpenBraceToken */);
|
|
28950
28916
|
const pos = getNodePos();
|
|
@@ -31175,6 +31141,9 @@ function parseListTypeOption(opt, value = "", errors) {
|
|
|
31175
31141
|
if (startsWith(value, "-")) {
|
|
31176
31142
|
return void 0;
|
|
31177
31143
|
}
|
|
31144
|
+
if (opt.type === "listOrElement" && !stringContains(value, ",")) {
|
|
31145
|
+
return validateJsonOptionValue(opt, value, errors);
|
|
31146
|
+
}
|
|
31178
31147
|
if (value === "") {
|
|
31179
31148
|
return [];
|
|
31180
31149
|
}
|
|
@@ -31184,6 +31153,10 @@ function parseListTypeOption(opt, value = "", errors) {
|
|
|
31184
31153
|
return mapDefined(values, (v) => validateJsonOptionValue(opt.element, parseInt(v), errors));
|
|
31185
31154
|
case "string":
|
|
31186
31155
|
return mapDefined(values, (v) => validateJsonOptionValue(opt.element, v || "", errors));
|
|
31156
|
+
case "boolean":
|
|
31157
|
+
case "object":
|
|
31158
|
+
case "listOrElement":
|
|
31159
|
+
return Debug.fail(`List of ${opt.element.type} is not yet supported.`);
|
|
31187
31160
|
default:
|
|
31188
31161
|
return mapDefined(values, (v) => parseCustomTypeOption(opt.element, v, errors));
|
|
31189
31162
|
}
|
|
@@ -31317,6 +31290,9 @@ function parseOptionValue(args, i, diagnostics, opt, options, errors) {
|
|
|
31317
31290
|
i++;
|
|
31318
31291
|
}
|
|
31319
31292
|
break;
|
|
31293
|
+
case "listOrElement":
|
|
31294
|
+
Debug.fail("listOrElement not supported here");
|
|
31295
|
+
break;
|
|
31320
31296
|
default:
|
|
31321
31297
|
options[opt.name] = parseCustomTypeOption(opt, args[i], errors);
|
|
31322
31298
|
i++;
|
|
@@ -31468,6 +31444,15 @@ var commandLineTypeAcquisitionMapCache;
|
|
|
31468
31444
|
function getCommandLineTypeAcquisitionMap() {
|
|
31469
31445
|
return commandLineTypeAcquisitionMapCache || (commandLineTypeAcquisitionMapCache = commandLineOptionsToMap(typeAcquisitionDeclarations));
|
|
31470
31446
|
}
|
|
31447
|
+
var extendsOptionDeclaration = {
|
|
31448
|
+
name: "extends",
|
|
31449
|
+
type: "listOrElement",
|
|
31450
|
+
element: {
|
|
31451
|
+
name: "extends",
|
|
31452
|
+
type: "string"
|
|
31453
|
+
},
|
|
31454
|
+
category: Diagnostics.File_Management
|
|
31455
|
+
};
|
|
31471
31456
|
var _tsconfigRootOptions;
|
|
31472
31457
|
function getTsconfigRootOptionsMap() {
|
|
31473
31458
|
if (_tsconfigRootOptions === void 0) {
|
|
@@ -31499,11 +31484,7 @@ function getTsconfigRootOptionsMap() {
|
|
|
31499
31484
|
elementOptions: getCommandLineTypeAcquisitionMap(),
|
|
31500
31485
|
extraKeyDiagnostics: typeAcquisitionDidYouMeanDiagnostics
|
|
31501
31486
|
},
|
|
31502
|
-
|
|
31503
|
-
name: "extends",
|
|
31504
|
-
type: "string",
|
|
31505
|
-
category: Diagnostics.File_Management
|
|
31506
|
-
},
|
|
31487
|
+
extendsOptionDeclaration,
|
|
31507
31488
|
{
|
|
31508
31489
|
name: "references",
|
|
31509
31490
|
type: "list",
|
|
@@ -31642,10 +31623,10 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
|
|
|
31642
31623
|
let invalidReported;
|
|
31643
31624
|
switch (valueExpression.kind) {
|
|
31644
31625
|
case 110 /* TrueKeyword */:
|
|
31645
|
-
reportInvalidOptionValue(option && option.type !== "boolean");
|
|
31626
|
+
reportInvalidOptionValue(option && option.type !== "boolean" && (option.type !== "listOrElement" || option.element.type !== "boolean"));
|
|
31646
31627
|
return validateValue(true);
|
|
31647
31628
|
case 95 /* FalseKeyword */:
|
|
31648
|
-
reportInvalidOptionValue(option && option.type !== "boolean");
|
|
31629
|
+
reportInvalidOptionValue(option && option.type !== "boolean" && (option.type !== "listOrElement" || option.element.type !== "boolean"));
|
|
31649
31630
|
return validateValue(false);
|
|
31650
31631
|
case 104 /* NullKeyword */:
|
|
31651
31632
|
reportInvalidOptionValue(option && option.name === "extends");
|
|
@@ -31654,8 +31635,11 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
|
|
|
31654
31635
|
if (!isDoubleQuotedString(valueExpression)) {
|
|
31655
31636
|
errors.push(createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, Diagnostics.String_literal_with_double_quotes_expected));
|
|
31656
31637
|
}
|
|
31657
|
-
reportInvalidOptionValue(option && (isString(option.type) && option.type !== "string"));
|
|
31638
|
+
reportInvalidOptionValue(option && isString(option.type) && option.type !== "string" && (option.type !== "listOrElement" || isString(option.element.type) && option.element.type !== "string"));
|
|
31658
31639
|
const text = valueExpression.text;
|
|
31640
|
+
if (option) {
|
|
31641
|
+
Debug.assert(option.type !== "listOrElement" || option.element.type === "string", "Only string or array of string is handled for now");
|
|
31642
|
+
}
|
|
31659
31643
|
if (option && !isString(option.type)) {
|
|
31660
31644
|
const customOption = option;
|
|
31661
31645
|
if (!customOption.type.has(text.toLowerCase())) {
|
|
@@ -31670,16 +31654,16 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
|
|
|
31670
31654
|
}
|
|
31671
31655
|
return validateValue(text);
|
|
31672
31656
|
case 8 /* NumericLiteral */:
|
|
31673
|
-
reportInvalidOptionValue(option && option.type !== "number");
|
|
31657
|
+
reportInvalidOptionValue(option && option.type !== "number" && (option.type !== "listOrElement" || option.element.type !== "number"));
|
|
31674
31658
|
return validateValue(Number(valueExpression.text));
|
|
31675
31659
|
case 221 /* PrefixUnaryExpression */:
|
|
31676
31660
|
if (valueExpression.operator !== 40 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) {
|
|
31677
31661
|
break;
|
|
31678
31662
|
}
|
|
31679
|
-
reportInvalidOptionValue(option && option.type !== "number");
|
|
31663
|
+
reportInvalidOptionValue(option && option.type !== "number" && (option.type !== "listOrElement" || option.element.type !== "number"));
|
|
31680
31664
|
return validateValue(-Number(valueExpression.operand.text));
|
|
31681
31665
|
case 207 /* ObjectLiteralExpression */:
|
|
31682
|
-
reportInvalidOptionValue(option && option.type !== "object");
|
|
31666
|
+
reportInvalidOptionValue(option && option.type !== "object" && (option.type !== "listOrElement" || option.element.type !== "object"));
|
|
31683
31667
|
const objectLiteralExpression = valueExpression;
|
|
31684
31668
|
if (option) {
|
|
31685
31669
|
const { elementOptions, extraKeyDiagnostics, name: optionName } = option;
|
|
@@ -31698,7 +31682,7 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
|
|
|
31698
31682
|
));
|
|
31699
31683
|
}
|
|
31700
31684
|
case 206 /* ArrayLiteralExpression */:
|
|
31701
|
-
reportInvalidOptionValue(option && option.type !== "list");
|
|
31685
|
+
reportInvalidOptionValue(option && option.type !== "list" && option.type !== "listOrElement");
|
|
31702
31686
|
return validateValue(convertArrayLiteralExpressionToJson(
|
|
31703
31687
|
valueExpression.elements,
|
|
31704
31688
|
option && option.element
|
|
@@ -31733,7 +31717,7 @@ function convertToObjectWorker(sourceFile, rootExpression, errors, returnValue,
|
|
|
31733
31717
|
}
|
|
31734
31718
|
}
|
|
31735
31719
|
function getCompilerOptionValueTypeString(option) {
|
|
31736
|
-
return option.type === "list" ? "Array" : isString(option.type) ? option.type : "string";
|
|
31720
|
+
return option.type === "listOrElement" ? `${getCompilerOptionValueTypeString(option.element)} or Array` : option.type === "list" ? "Array" : isString(option.type) ? option.type : "string";
|
|
31737
31721
|
}
|
|
31738
31722
|
function isCompilerOptionsValue(option, value) {
|
|
31739
31723
|
if (option) {
|
|
@@ -31742,6 +31726,9 @@ function isCompilerOptionsValue(option, value) {
|
|
|
31742
31726
|
if (option.type === "list") {
|
|
31743
31727
|
return isArray(value);
|
|
31744
31728
|
}
|
|
31729
|
+
if (option.type === "listOrElement") {
|
|
31730
|
+
return isArray(value) || isCompilerOptionsValue(option.element, value);
|
|
31731
|
+
}
|
|
31745
31732
|
const expectedType = isString(option.type) ? option.type : "string";
|
|
31746
31733
|
return typeof value === expectedType;
|
|
31747
31734
|
}
|
|
@@ -31821,12 +31808,17 @@ function matchesSpecs(path, includeSpecs, excludeSpecs, host) {
|
|
|
31821
31808
|
return returnTrue;
|
|
31822
31809
|
}
|
|
31823
31810
|
function getCustomTypeMapOfCommandLineOption(optionDefinition) {
|
|
31824
|
-
|
|
31825
|
-
|
|
31826
|
-
|
|
31827
|
-
|
|
31828
|
-
|
|
31829
|
-
|
|
31811
|
+
switch (optionDefinition.type) {
|
|
31812
|
+
case "string":
|
|
31813
|
+
case "number":
|
|
31814
|
+
case "boolean":
|
|
31815
|
+
case "object":
|
|
31816
|
+
return void 0;
|
|
31817
|
+
case "list":
|
|
31818
|
+
case "listOrElement":
|
|
31819
|
+
return getCustomTypeMapOfCommandLineOption(optionDefinition.element);
|
|
31820
|
+
default:
|
|
31821
|
+
return optionDefinition.type;
|
|
31830
31822
|
}
|
|
31831
31823
|
}
|
|
31832
31824
|
function getNameOfCompilerOptionValue(value, customTypeMap) {
|
|
@@ -31853,6 +31845,7 @@ function serializeOptionBaseObject(options, { optionsNameMap }, pathOptions) {
|
|
|
31853
31845
|
const value = options[name];
|
|
31854
31846
|
const optionDefinition = optionsNameMap.get(name.toLowerCase());
|
|
31855
31847
|
if (optionDefinition) {
|
|
31848
|
+
Debug.assert(optionDefinition.type !== "listOrElement");
|
|
31856
31849
|
const customTypeMap = getCustomTypeMapOfCommandLineOption(optionDefinition);
|
|
31857
31850
|
if (!customTypeMap) {
|
|
31858
31851
|
if (pathOptions && optionDefinition.isFilePath) {
|
|
@@ -32001,6 +31994,7 @@ function convertToOptionValueWithAbsolutePaths(option, value, toAbsolutePath) {
|
|
|
32001
31994
|
} else if (option.isFilePath) {
|
|
32002
31995
|
return toAbsolutePath(value);
|
|
32003
31996
|
}
|
|
31997
|
+
Debug.assert(option.type !== "listOrElement");
|
|
32004
31998
|
}
|
|
32005
31999
|
return value;
|
|
32006
32000
|
}
|
|
@@ -32194,30 +32188,49 @@ function parseConfig(json, sourceFile, host, basePath, configFileName, resolutio
|
|
|
32194
32188
|
}
|
|
32195
32189
|
if (ownConfig.extendedConfigPath) {
|
|
32196
32190
|
resolutionStack = resolutionStack.concat([resolvedPath]);
|
|
32197
|
-
const
|
|
32191
|
+
const result = { options: {} };
|
|
32192
|
+
if (isString(ownConfig.extendedConfigPath)) {
|
|
32193
|
+
applyExtendedConfig(result, ownConfig.extendedConfigPath);
|
|
32194
|
+
} else {
|
|
32195
|
+
ownConfig.extendedConfigPath.forEach((extendedConfigPath) => applyExtendedConfig(result, extendedConfigPath));
|
|
32196
|
+
}
|
|
32197
|
+
if (!ownConfig.raw.include && result.include)
|
|
32198
|
+
ownConfig.raw.include = result.include;
|
|
32199
|
+
if (!ownConfig.raw.exclude && result.exclude)
|
|
32200
|
+
ownConfig.raw.exclude = result.exclude;
|
|
32201
|
+
if (!ownConfig.raw.files && result.files)
|
|
32202
|
+
ownConfig.raw.files = result.files;
|
|
32203
|
+
if (ownConfig.raw.compileOnSave === void 0 && result.compileOnSave)
|
|
32204
|
+
ownConfig.raw.compileOnSave = result.compileOnSave;
|
|
32205
|
+
if (sourceFile && result.extendedSourceFiles)
|
|
32206
|
+
sourceFile.extendedSourceFiles = arrayFrom(result.extendedSourceFiles.keys());
|
|
32207
|
+
ownConfig.options = assign(result.options, ownConfig.options);
|
|
32208
|
+
ownConfig.watchOptions = ownConfig.watchOptions && result.watchOptions ? assign(result.watchOptions, ownConfig.watchOptions) : ownConfig.watchOptions || result.watchOptions;
|
|
32209
|
+
}
|
|
32210
|
+
return ownConfig;
|
|
32211
|
+
function applyExtendedConfig(result, extendedConfigPath) {
|
|
32212
|
+
const extendedConfig = getExtendedConfig(sourceFile, extendedConfigPath, host, resolutionStack, errors, extendedConfigCache, result);
|
|
32198
32213
|
if (extendedConfig && isSuccessfulParsedTsconfig(extendedConfig)) {
|
|
32199
|
-
const
|
|
32200
|
-
const raw = ownConfig.raw;
|
|
32214
|
+
const extendsRaw = extendedConfig.raw;
|
|
32201
32215
|
let relativeDifference;
|
|
32202
|
-
const
|
|
32203
|
-
if (
|
|
32204
|
-
|
|
32205
|
-
relativeDifference || (relativeDifference = convertToRelativePath(getDirectoryPath(
|
|
32216
|
+
const setPropertyInResultIfNotUndefined = (propertyName) => {
|
|
32217
|
+
if (extendsRaw[propertyName]) {
|
|
32218
|
+
result[propertyName] = map(extendsRaw[propertyName], (path) => isRootedDiskPath(path) ? path : combinePaths(
|
|
32219
|
+
relativeDifference || (relativeDifference = convertToRelativePath(getDirectoryPath(extendedConfigPath), basePath, createGetCanonicalFileName(host.useCaseSensitiveFileNames))),
|
|
32206
32220
|
path
|
|
32207
32221
|
));
|
|
32208
32222
|
}
|
|
32209
32223
|
};
|
|
32210
|
-
|
|
32211
|
-
|
|
32212
|
-
|
|
32213
|
-
if (
|
|
32214
|
-
|
|
32224
|
+
setPropertyInResultIfNotUndefined("include");
|
|
32225
|
+
setPropertyInResultIfNotUndefined("exclude");
|
|
32226
|
+
setPropertyInResultIfNotUndefined("files");
|
|
32227
|
+
if (extendsRaw.compileOnSave !== void 0) {
|
|
32228
|
+
result.compileOnSave = extendsRaw.compileOnSave;
|
|
32215
32229
|
}
|
|
32216
|
-
|
|
32217
|
-
|
|
32230
|
+
assign(result.options, extendedConfig.options);
|
|
32231
|
+
result.watchOptions = result.watchOptions && extendedConfig.watchOptions ? assign({}, result.watchOptions, extendedConfig.watchOptions) : result.watchOptions || extendedConfig.watchOptions;
|
|
32218
32232
|
}
|
|
32219
32233
|
}
|
|
32220
|
-
return ownConfig;
|
|
32221
32234
|
}
|
|
32222
32235
|
function parseOwnConfigOfJson(json, host, basePath, configFileName, errors) {
|
|
32223
32236
|
if (hasProperty(json, "excludes")) {
|
|
@@ -32229,11 +32242,22 @@ function parseOwnConfigOfJson(json, host, basePath, configFileName, errors) {
|
|
|
32229
32242
|
json.compileOnSave = convertCompileOnSaveOptionFromJson(json, basePath, errors);
|
|
32230
32243
|
let extendedConfigPath;
|
|
32231
32244
|
if (json.extends) {
|
|
32232
|
-
if (!
|
|
32233
|
-
errors.push(createCompilerDiagnostic(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "extends",
|
|
32245
|
+
if (!isCompilerOptionsValue(extendsOptionDeclaration, json.extends)) {
|
|
32246
|
+
errors.push(createCompilerDiagnostic(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "extends", getCompilerOptionValueTypeString(extendsOptionDeclaration)));
|
|
32234
32247
|
} else {
|
|
32235
32248
|
const newBase = configFileName ? directoryOfCombinedPath(configFileName, basePath) : basePath;
|
|
32236
|
-
|
|
32249
|
+
if (isString(json.extends)) {
|
|
32250
|
+
extendedConfigPath = getExtendsConfigPath(json.extends, host, newBase, errors, createCompilerDiagnostic);
|
|
32251
|
+
} else {
|
|
32252
|
+
extendedConfigPath = [];
|
|
32253
|
+
for (const fileName of json.extends) {
|
|
32254
|
+
if (isString(fileName)) {
|
|
32255
|
+
extendedConfigPath = append(extendedConfigPath, getExtendsConfigPath(fileName, host, newBase, errors, createCompilerDiagnostic));
|
|
32256
|
+
} else {
|
|
32257
|
+
errors.push(createCompilerDiagnostic(Diagnostics.Compiler_option_0_requires_a_value_of_type_1, "extends", getCompilerOptionValueTypeString(extendsOptionDeclaration.element)));
|
|
32258
|
+
}
|
|
32259
|
+
}
|
|
32260
|
+
}
|
|
32237
32261
|
}
|
|
32238
32262
|
}
|
|
32239
32263
|
return { raw: json, options, watchOptions, typeAcquisition, extendedConfigPath };
|
|
@@ -32269,13 +32293,29 @@ function parseOwnConfigOfJsonSourceFile(sourceFile, host, basePath, configFileNa
|
|
|
32269
32293
|
switch (key) {
|
|
32270
32294
|
case "extends":
|
|
32271
32295
|
const newBase = configFileName ? directoryOfCombinedPath(configFileName, basePath) : basePath;
|
|
32272
|
-
|
|
32273
|
-
|
|
32274
|
-
|
|
32275
|
-
|
|
32276
|
-
|
|
32277
|
-
|
|
32278
|
-
|
|
32296
|
+
if (isString(value)) {
|
|
32297
|
+
extendedConfigPath = getExtendsConfigPath(
|
|
32298
|
+
value,
|
|
32299
|
+
host,
|
|
32300
|
+
newBase,
|
|
32301
|
+
errors,
|
|
32302
|
+
(message, arg0) => createDiagnosticForNodeInSourceFile(sourceFile, valueNode, message, arg0)
|
|
32303
|
+
);
|
|
32304
|
+
} else {
|
|
32305
|
+
extendedConfigPath = [];
|
|
32306
|
+
for (let index = 0; index < value.length; index++) {
|
|
32307
|
+
const fileName = value[index];
|
|
32308
|
+
if (isString(fileName)) {
|
|
32309
|
+
extendedConfigPath = append(extendedConfigPath, getExtendsConfigPath(
|
|
32310
|
+
fileName,
|
|
32311
|
+
host,
|
|
32312
|
+
newBase,
|
|
32313
|
+
errors,
|
|
32314
|
+
(message, arg0) => createDiagnosticForNodeInSourceFile(sourceFile, valueNode.elements[index], message, arg0)
|
|
32315
|
+
));
|
|
32316
|
+
}
|
|
32317
|
+
}
|
|
32318
|
+
}
|
|
32279
32319
|
return;
|
|
32280
32320
|
}
|
|
32281
32321
|
},
|
|
@@ -32325,7 +32365,8 @@ function getExtendsConfigPath(extendedConfig, host, basePath, errors, createDiag
|
|
|
32325
32365
|
errors.push(createDiagnostic(Diagnostics.File_0_not_found, extendedConfig));
|
|
32326
32366
|
return void 0;
|
|
32327
32367
|
}
|
|
32328
|
-
function getExtendedConfig(sourceFile, extendedConfigPath, host, resolutionStack, errors, extendedConfigCache) {
|
|
32368
|
+
function getExtendedConfig(sourceFile, extendedConfigPath, host, resolutionStack, errors, extendedConfigCache, result) {
|
|
32369
|
+
var _a2;
|
|
32329
32370
|
const path = host.useCaseSensitiveFileNames ? extendedConfigPath : toFileNameLowerCase(extendedConfigPath);
|
|
32330
32371
|
let value;
|
|
32331
32372
|
let extendedResult;
|
|
@@ -32351,9 +32392,11 @@ function getExtendedConfig(sourceFile, extendedConfigPath, host, resolutionStack
|
|
|
32351
32392
|
}
|
|
32352
32393
|
}
|
|
32353
32394
|
if (sourceFile) {
|
|
32354
|
-
|
|
32395
|
+
((_a2 = result.extendedSourceFiles) != null ? _a2 : result.extendedSourceFiles = /* @__PURE__ */ new Set()).add(extendedResult.fileName);
|
|
32355
32396
|
if (extendedResult.extendedSourceFiles) {
|
|
32356
|
-
|
|
32397
|
+
for (const extenedSourceFile of extendedResult.extendedSourceFiles) {
|
|
32398
|
+
result.extendedSourceFiles.add(extenedSourceFile);
|
|
32399
|
+
}
|
|
32357
32400
|
}
|
|
32358
32401
|
}
|
|
32359
32402
|
if (extendedResult.parseDiagnostics.length) {
|
|
@@ -32412,7 +32455,9 @@ function convertJsonOption(opt, value, basePath, errors) {
|
|
|
32412
32455
|
const optType = opt.type;
|
|
32413
32456
|
if (optType === "list" && isArray(value)) {
|
|
32414
32457
|
return convertJsonOptionOfListType(opt, value, basePath, errors);
|
|
32415
|
-
} else if (
|
|
32458
|
+
} else if (optType === "listOrElement") {
|
|
32459
|
+
return isArray(value) ? convertJsonOptionOfListType(opt, value, basePath, errors) : convertJsonOption(opt.element, value, basePath, errors);
|
|
32460
|
+
} else if (!isString(opt.type)) {
|
|
32416
32461
|
return convertJsonOptionOfCustomType(opt, value, errors);
|
|
32417
32462
|
}
|
|
32418
32463
|
const validatedValue = validateJsonOptionValue(opt, value, errors);
|
|
@@ -32424,7 +32469,9 @@ function convertJsonOption(opt, value, basePath, errors) {
|
|
|
32424
32469
|
function normalizeOptionValue(option, basePath, value) {
|
|
32425
32470
|
if (isNullOrUndefined(value))
|
|
32426
32471
|
return void 0;
|
|
32427
|
-
if (option.type === "
|
|
32472
|
+
if (option.type === "listOrElement" && !isArray(value))
|
|
32473
|
+
return normalizeOptionValue(option.element, basePath, value);
|
|
32474
|
+
else if (option.type === "list" || option.type === "listOrElement") {
|
|
32428
32475
|
const listOption = option;
|
|
32429
32476
|
if (listOption.element.isFilePath || !isString(listOption.element.type)) {
|
|
32430
32477
|
return filter(map(value, (v) => normalizeOptionValue(listOption.element, basePath, v)), (v) => listOption.listPreserveFalsyValues ? true : !!v);
|
|
@@ -32676,6 +32723,8 @@ function getDefaultValueForOption(option) {
|
|
|
32676
32723
|
return option.isFilePath ? `./${defaultValue && typeof defaultValue === "string" ? defaultValue : ""}` : "";
|
|
32677
32724
|
case "list":
|
|
32678
32725
|
return [];
|
|
32726
|
+
case "listOrElement":
|
|
32727
|
+
return getDefaultValueForOption(option.element);
|
|
32679
32728
|
case "object":
|
|
32680
32729
|
return {};
|
|
32681
32730
|
default:
|
|
@@ -32894,8 +32943,10 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
|
|
|
32894
32943
|
options = redirectedReference.commandLine.options;
|
|
32895
32944
|
}
|
|
32896
32945
|
const containingDirectory = containingFile ? getDirectoryPath(containingFile) : void 0;
|
|
32897
|
-
|
|
32898
|
-
|
|
32946
|
+
let result = containingDirectory ? cache == null ? void 0 : cache.getFromDirectoryCache(typeReferenceDirectiveName, resolutionMode, containingDirectory, redirectedReference) : void 0;
|
|
32947
|
+
if (!result && containingDirectory && !isExternalModuleNameRelative(typeReferenceDirectiveName)) {
|
|
32948
|
+
result = cache == null ? void 0 : cache.getFromNonRelativeNameCache(typeReferenceDirectiveName, resolutionMode, containingDirectory, redirectedReference);
|
|
32949
|
+
}
|
|
32899
32950
|
if (result) {
|
|
32900
32951
|
if (traceEnabled) {
|
|
32901
32952
|
trace(host, Diagnostics.Resolving_type_reference_directive_0_containing_file_1, typeReferenceDirectiveName, containingFile);
|
|
@@ -32971,7 +33022,12 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
|
|
|
32971
33022
|
affectingLocations: initializeResolutionField(affectingLocations),
|
|
32972
33023
|
resolutionDiagnostics: initializeResolutionField(diagnostics)
|
|
32973
33024
|
};
|
|
32974
|
-
|
|
33025
|
+
if (containingDirectory) {
|
|
33026
|
+
cache == null ? void 0 : cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference).set(typeReferenceDirectiveName, resolutionMode, result);
|
|
33027
|
+
if (!isExternalModuleNameRelative(typeReferenceDirectiveName)) {
|
|
33028
|
+
cache == null ? void 0 : cache.getOrCreateCacheForNonRelativeName(typeReferenceDirectiveName, resolutionMode, redirectedReference).set(containingDirectory, result);
|
|
33029
|
+
}
|
|
33030
|
+
}
|
|
32975
33031
|
if (traceEnabled)
|
|
32976
33032
|
traceResult(result);
|
|
32977
33033
|
return result;
|
|
@@ -33091,23 +33147,27 @@ function createCacheWithRedirects(ownOptions) {
|
|
|
33091
33147
|
if (ownOptions)
|
|
33092
33148
|
redirectsMap.set(ownOptions, ownMap);
|
|
33093
33149
|
return {
|
|
33150
|
+
getMapOfCacheRedirects,
|
|
33094
33151
|
getOrCreateMapOfCacheRedirects,
|
|
33095
33152
|
update,
|
|
33096
33153
|
clear: clear2
|
|
33097
33154
|
};
|
|
33155
|
+
function getMapOfCacheRedirects(redirectedReference) {
|
|
33156
|
+
return redirectedReference ? getOrCreateMap(redirectedReference.commandLine.options, false) : ownMap;
|
|
33157
|
+
}
|
|
33098
33158
|
function getOrCreateMapOfCacheRedirects(redirectedReference) {
|
|
33099
|
-
return redirectedReference ? getOrCreateMap(redirectedReference.commandLine.options) : ownMap;
|
|
33159
|
+
return redirectedReference ? getOrCreateMap(redirectedReference.commandLine.options, true) : ownMap;
|
|
33100
33160
|
}
|
|
33101
33161
|
function update(newOptions) {
|
|
33102
33162
|
if (ownOptions !== newOptions) {
|
|
33103
33163
|
if (ownOptions)
|
|
33104
|
-
ownMap = getOrCreateMap(newOptions);
|
|
33164
|
+
ownMap = getOrCreateMap(newOptions, true);
|
|
33105
33165
|
else
|
|
33106
33166
|
redirectsMap.set(newOptions, ownMap);
|
|
33107
33167
|
ownOptions = newOptions;
|
|
33108
33168
|
}
|
|
33109
33169
|
}
|
|
33110
|
-
function getOrCreateMap(redirectOptions) {
|
|
33170
|
+
function getOrCreateMap(redirectOptions, create) {
|
|
33111
33171
|
let result = redirectsMap.get(redirectOptions);
|
|
33112
33172
|
if (result)
|
|
33113
33173
|
return result;
|
|
@@ -33121,9 +33181,13 @@ function createCacheWithRedirects(ownOptions) {
|
|
|
33121
33181
|
else if (!redirectsKeyToMap.has(ownKey))
|
|
33122
33182
|
redirectsKeyToMap.set(ownKey, ownMap);
|
|
33123
33183
|
}
|
|
33124
|
-
|
|
33184
|
+
if (create)
|
|
33185
|
+
result != null ? result : result = /* @__PURE__ */ new Map();
|
|
33186
|
+
if (result)
|
|
33187
|
+
redirectsKeyToMap.set(key, result);
|
|
33125
33188
|
}
|
|
33126
|
-
|
|
33189
|
+
if (result)
|
|
33190
|
+
redirectsMap.set(redirectOptions, result);
|
|
33127
33191
|
return result;
|
|
33128
33192
|
}
|
|
33129
33193
|
function clear2() {
|
|
@@ -33175,8 +33239,10 @@ function getOrCreateCache(cacheWithRedirects, redirectedReference, key, create)
|
|
|
33175
33239
|
}
|
|
33176
33240
|
return result;
|
|
33177
33241
|
}
|
|
33178
|
-
function createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName,
|
|
33242
|
+
function createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, options) {
|
|
33243
|
+
const directoryToModuleNameMap = createCacheWithRedirects(options);
|
|
33179
33244
|
return {
|
|
33245
|
+
getFromDirectoryCache,
|
|
33180
33246
|
getOrCreateCacheForDirectory,
|
|
33181
33247
|
clear: clear2,
|
|
33182
33248
|
update
|
|
@@ -33184,13 +33250,18 @@ function createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileNam
|
|
|
33184
33250
|
function clear2() {
|
|
33185
33251
|
directoryToModuleNameMap.clear();
|
|
33186
33252
|
}
|
|
33187
|
-
function update(
|
|
33188
|
-
directoryToModuleNameMap.update(
|
|
33253
|
+
function update(options2) {
|
|
33254
|
+
directoryToModuleNameMap.update(options2);
|
|
33189
33255
|
}
|
|
33190
33256
|
function getOrCreateCacheForDirectory(directoryName, redirectedReference) {
|
|
33191
33257
|
const path = toPath(directoryName, currentDirectory, getCanonicalFileName);
|
|
33192
33258
|
return getOrCreateCache(directoryToModuleNameMap, redirectedReference, path, () => createModeAwareCache());
|
|
33193
33259
|
}
|
|
33260
|
+
function getFromDirectoryCache(name, mode, directoryName, redirectedReference) {
|
|
33261
|
+
var _a2, _b;
|
|
33262
|
+
const path = toPath(directoryName, currentDirectory, getCanonicalFileName);
|
|
33263
|
+
return (_b = (_a2 = directoryToModuleNameMap.getMapOfCacheRedirects(redirectedReference)) == null ? void 0 : _a2.get(path)) == null ? void 0 : _b.get(name, mode);
|
|
33264
|
+
}
|
|
33194
33265
|
}
|
|
33195
33266
|
function createModeAwareCacheKey(specifier, mode) {
|
|
33196
33267
|
return mode === void 0 ? specifier : `${mode}|${specifier}`;
|
|
@@ -33239,33 +33310,32 @@ function zipToModeAwareCache(file, keys, values, nameAndModeGetter) {
|
|
|
33239
33310
|
}
|
|
33240
33311
|
return map2;
|
|
33241
33312
|
}
|
|
33242
|
-
function
|
|
33243
|
-
|
|
33244
|
-
|
|
33313
|
+
function getOriginalOrResolvedModuleFileName(result) {
|
|
33314
|
+
return result.resolvedModule && (result.resolvedModule.originalPath || result.resolvedModule.resolvedFileName);
|
|
33315
|
+
}
|
|
33316
|
+
function getOriginalOrResolvedTypeReferenceFileName(result) {
|
|
33317
|
+
return result.resolvedTypeReferenceDirective && (result.resolvedTypeReferenceDirective.originalPath || result.resolvedTypeReferenceDirective.resolvedFileName);
|
|
33318
|
+
}
|
|
33319
|
+
function createNonRelativeNameResolutionCache(currentDirectory, getCanonicalFileName, options, getResolvedFileName) {
|
|
33245
33320
|
const moduleNameToDirectoryMap = createCacheWithRedirects(options);
|
|
33246
|
-
const packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName);
|
|
33247
33321
|
return {
|
|
33248
|
-
|
|
33249
|
-
|
|
33250
|
-
getOrCreateCacheForModuleName,
|
|
33322
|
+
getFromNonRelativeNameCache,
|
|
33323
|
+
getOrCreateCacheForNonRelativeName,
|
|
33251
33324
|
clear: clear2,
|
|
33252
|
-
update
|
|
33253
|
-
getPackageJsonInfoCache: () => packageJsonInfoCache,
|
|
33254
|
-
clearAllExceptPackageJsonInfoCache
|
|
33325
|
+
update
|
|
33255
33326
|
};
|
|
33256
33327
|
function clear2() {
|
|
33257
|
-
clearAllExceptPackageJsonInfoCache();
|
|
33258
|
-
packageJsonInfoCache.clear();
|
|
33259
|
-
}
|
|
33260
|
-
function clearAllExceptPackageJsonInfoCache() {
|
|
33261
|
-
perDirectoryResolutionCache.clear();
|
|
33262
33328
|
moduleNameToDirectoryMap.clear();
|
|
33263
33329
|
}
|
|
33264
33330
|
function update(options2) {
|
|
33265
|
-
directoryToModuleNameMap.update(options2);
|
|
33266
33331
|
moduleNameToDirectoryMap.update(options2);
|
|
33267
33332
|
}
|
|
33268
|
-
function
|
|
33333
|
+
function getFromNonRelativeNameCache(nonRelativeModuleName, mode, directoryName, redirectedReference) {
|
|
33334
|
+
var _a2, _b;
|
|
33335
|
+
Debug.assert(!isExternalModuleNameRelative(nonRelativeModuleName));
|
|
33336
|
+
return (_b = (_a2 = moduleNameToDirectoryMap.getMapOfCacheRedirects(redirectedReference)) == null ? void 0 : _a2.get(createModeAwareCacheKey(nonRelativeModuleName, mode))) == null ? void 0 : _b.get(directoryName);
|
|
33337
|
+
}
|
|
33338
|
+
function getOrCreateCacheForNonRelativeName(nonRelativeModuleName, mode, redirectedReference) {
|
|
33269
33339
|
Debug.assert(!isExternalModuleNameRelative(nonRelativeModuleName));
|
|
33270
33340
|
return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, createModeAwareCacheKey(nonRelativeModuleName, mode), createPerModuleNameCache);
|
|
33271
33341
|
}
|
|
@@ -33281,7 +33351,7 @@ function createModuleResolutionCache(currentDirectory, getCanonicalFileName, opt
|
|
|
33281
33351
|
return;
|
|
33282
33352
|
}
|
|
33283
33353
|
directoryPathMap.set(path, result);
|
|
33284
|
-
const resolvedFileName =
|
|
33354
|
+
const resolvedFileName = getResolvedFileName(result);
|
|
33285
33355
|
const commonPrefix = resolvedFileName && getCommonPrefix(path, resolvedFileName);
|
|
33286
33356
|
let current = path;
|
|
33287
33357
|
while (current !== commonPrefix) {
|
|
@@ -33315,14 +33385,22 @@ function createModuleResolutionCache(currentDirectory, getCanonicalFileName, opt
|
|
|
33315
33385
|
}
|
|
33316
33386
|
}
|
|
33317
33387
|
}
|
|
33318
|
-
function
|
|
33319
|
-
const
|
|
33320
|
-
const
|
|
33321
|
-
|
|
33388
|
+
function createModuleOrTypeReferenceResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache, getResolvedFileName) {
|
|
33389
|
+
const perDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, options);
|
|
33390
|
+
const nonRelativeNameResolutionCache = createNonRelativeNameResolutionCache(
|
|
33391
|
+
currentDirectory,
|
|
33392
|
+
getCanonicalFileName,
|
|
33393
|
+
options,
|
|
33394
|
+
getResolvedFileName
|
|
33395
|
+
);
|
|
33396
|
+
packageJsonInfoCache != null ? packageJsonInfoCache : packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName);
|
|
33322
33397
|
return {
|
|
33323
33398
|
...packageJsonInfoCache,
|
|
33324
33399
|
...perDirectoryResolutionCache,
|
|
33400
|
+
...nonRelativeNameResolutionCache,
|
|
33325
33401
|
clear: clear2,
|
|
33402
|
+
update,
|
|
33403
|
+
getPackageJsonInfoCache: () => packageJsonInfoCache,
|
|
33326
33404
|
clearAllExceptPackageJsonInfoCache
|
|
33327
33405
|
};
|
|
33328
33406
|
function clear2() {
|
|
@@ -33331,7 +33409,32 @@ function createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanoni
|
|
|
33331
33409
|
}
|
|
33332
33410
|
function clearAllExceptPackageJsonInfoCache() {
|
|
33333
33411
|
perDirectoryResolutionCache.clear();
|
|
33412
|
+
nonRelativeNameResolutionCache.clear();
|
|
33334
33413
|
}
|
|
33414
|
+
function update(options2) {
|
|
33415
|
+
perDirectoryResolutionCache.update(options2);
|
|
33416
|
+
nonRelativeNameResolutionCache.update(options2);
|
|
33417
|
+
}
|
|
33418
|
+
}
|
|
33419
|
+
function createModuleResolutionCache(currentDirectory, getCanonicalFileName, options) {
|
|
33420
|
+
const result = createModuleOrTypeReferenceResolutionCache(
|
|
33421
|
+
currentDirectory,
|
|
33422
|
+
getCanonicalFileName,
|
|
33423
|
+
options,
|
|
33424
|
+
void 0,
|
|
33425
|
+
getOriginalOrResolvedModuleFileName
|
|
33426
|
+
);
|
|
33427
|
+
result.getOrCreateCacheForModuleName = (nonRelativeName, mode, redirectedReference) => result.getOrCreateCacheForNonRelativeName(nonRelativeName, mode, redirectedReference);
|
|
33428
|
+
return result;
|
|
33429
|
+
}
|
|
33430
|
+
function createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache) {
|
|
33431
|
+
return createModuleOrTypeReferenceResolutionCache(
|
|
33432
|
+
currentDirectory,
|
|
33433
|
+
getCanonicalFileName,
|
|
33434
|
+
options,
|
|
33435
|
+
packageJsonInfoCache,
|
|
33436
|
+
getOriginalOrResolvedTypeReferenceFileName
|
|
33437
|
+
);
|
|
33335
33438
|
}
|
|
33336
33439
|
function resolveModuleName(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
33337
33440
|
const traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
@@ -33345,8 +33448,7 @@ function resolveModuleName(moduleName, containingFile, compilerOptions, host, ca
|
|
|
33345
33448
|
}
|
|
33346
33449
|
}
|
|
33347
33450
|
const containingDirectory = getDirectoryPath(containingFile);
|
|
33348
|
-
|
|
33349
|
-
let result = perFolderCache && perFolderCache.get(moduleName, resolutionMode);
|
|
33451
|
+
let result = cache == null ? void 0 : cache.getFromDirectoryCache(moduleName, resolutionMode, containingDirectory, redirectedReference);
|
|
33350
33452
|
if (result) {
|
|
33351
33453
|
if (traceEnabled) {
|
|
33352
33454
|
trace(host, Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory);
|
|
@@ -33396,11 +33498,9 @@ function resolveModuleName(moduleName, containingFile, compilerOptions, host, ca
|
|
|
33396
33498
|
if (result && result.resolvedModule)
|
|
33397
33499
|
perfLogger.logInfoEvent(`Module "${moduleName}" resolved to "${result.resolvedModule.resolvedFileName}"`);
|
|
33398
33500
|
perfLogger.logStopResolveModule(result && result.resolvedModule ? "" + result.resolvedModule.resolvedFileName : "null");
|
|
33399
|
-
|
|
33400
|
-
|
|
33401
|
-
|
|
33402
|
-
cache.getOrCreateCacheForModuleName(moduleName, resolutionMode, redirectedReference).set(containingDirectory, result);
|
|
33403
|
-
}
|
|
33501
|
+
cache == null ? void 0 : cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference).set(moduleName, resolutionMode, result);
|
|
33502
|
+
if (!isExternalModuleNameRelative(moduleName)) {
|
|
33503
|
+
cache == null ? void 0 : cache.getOrCreateCacheForNonRelativeName(moduleName, resolutionMode, redirectedReference).set(containingDirectory, result);
|
|
33404
33504
|
}
|
|
33405
33505
|
}
|
|
33406
33506
|
if (traceEnabled) {
|
|
@@ -34310,7 +34410,7 @@ function loadModuleFromNearestNodeModulesDirectoryTypesScope(moduleName, directo
|
|
|
34310
34410
|
return loadModuleFromNearestNodeModulesDirectoryWorker(4 /* Declaration */, moduleName, directory, state, true, void 0, void 0);
|
|
34311
34411
|
}
|
|
34312
34412
|
function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) {
|
|
34313
|
-
const
|
|
34413
|
+
const mode = state.features === 0 ? void 0 : state.features & 32 /* EsmMode */ ? 99 /* ESNext */ : 1 /* CommonJS */;
|
|
34314
34414
|
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
|
|
34315
34415
|
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
|
|
34316
34416
|
if (priorityExtensions) {
|
|
@@ -34324,7 +34424,7 @@ function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName,
|
|
|
34324
34424
|
function lookup(extensions2) {
|
|
34325
34425
|
return forEachAncestorDirectory(normalizeSlashes(directory), (ancestorDirectory) => {
|
|
34326
34426
|
if (getBaseFileName(ancestorDirectory) !== "node_modules") {
|
|
34327
|
-
const resolutionFromCache = tryFindNonRelativeModuleNameInCache(
|
|
34427
|
+
const resolutionFromCache = tryFindNonRelativeModuleNameInCache(cache, moduleName, mode, ancestorDirectory, redirectedReference, state);
|
|
34328
34428
|
if (resolutionFromCache) {
|
|
34329
34429
|
return resolutionFromCache;
|
|
34330
34430
|
}
|
|
@@ -34470,8 +34570,8 @@ function getPackageNameFromTypesPackageName(mangledName) {
|
|
|
34470
34570
|
function unmangleScopedPackageName(typesPackageName) {
|
|
34471
34571
|
return stringContains(typesPackageName, mangledScopedPackageSeparator) ? "@" + typesPackageName.replace(mangledScopedPackageSeparator, directorySeparator) : typesPackageName;
|
|
34472
34572
|
}
|
|
34473
|
-
function tryFindNonRelativeModuleNameInCache(cache, moduleName, containingDirectory, state) {
|
|
34474
|
-
const result = cache && cache.
|
|
34573
|
+
function tryFindNonRelativeModuleNameInCache(cache, moduleName, mode, containingDirectory, redirectedReference, state) {
|
|
34574
|
+
const result = cache && cache.getFromNonRelativeNameCache(moduleName, mode, containingDirectory, redirectedReference);
|
|
34475
34575
|
if (result) {
|
|
34476
34576
|
if (state.traceEnabled) {
|
|
34477
34577
|
trace(state.host, Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory);
|
|
@@ -34514,9 +34614,8 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
|
|
|
34514
34614
|
return { value: resolvedUsingSettings };
|
|
34515
34615
|
}
|
|
34516
34616
|
if (!isExternalModuleNameRelative(moduleName)) {
|
|
34517
|
-
const perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName, void 0, redirectedReference);
|
|
34518
34617
|
const resolved2 = forEachAncestorDirectory(containingDirectory, (directory) => {
|
|
34519
|
-
const resolutionFromCache = tryFindNonRelativeModuleNameInCache(
|
|
34618
|
+
const resolutionFromCache = tryFindNonRelativeModuleNameInCache(cache, moduleName, void 0, directory, redirectedReference, state);
|
|
34520
34619
|
if (resolutionFromCache) {
|
|
34521
34620
|
return resolutionFromCache;
|
|
34522
34621
|
}
|
|
@@ -48788,7 +48887,7 @@ function createTypeChecker(host) {
|
|
|
48788
48887
|
return links.resolvedJSDocType;
|
|
48789
48888
|
}
|
|
48790
48889
|
function getSubstitutionType(baseType, constraint) {
|
|
48791
|
-
if (constraint.flags & 3 /* AnyOrUnknown */ || constraint === baseType
|
|
48890
|
+
if (constraint.flags & 3 /* AnyOrUnknown */ || constraint === baseType) {
|
|
48792
48891
|
return baseType;
|
|
48793
48892
|
}
|
|
48794
48893
|
const id = `${getTypeId(baseType)}>${getTypeId(constraint)}`;
|
|
@@ -59014,9 +59113,6 @@ function createTypeChecker(host) {
|
|
|
59014
59113
|
Debug.assert(parent.parent.kind === 225 /* TemplateExpression */);
|
|
59015
59114
|
return getContextualTypeForSubstitutionExpression(parent.parent, node);
|
|
59016
59115
|
case 214 /* ParenthesizedExpression */: {
|
|
59017
|
-
if (isJSDocSatisfiesExpression(parent)) {
|
|
59018
|
-
return getTypeFromTypeNode(getJSDocSatisfiesExpressionType(parent));
|
|
59019
|
-
}
|
|
59020
59116
|
const tag = isInJSFile(parent) ? getJSDocTypeTag(parent) : void 0;
|
|
59021
59117
|
return !tag ? getContextualType(parent, contextFlags) : isJSDocTypeTag(tag) && isConstTypeReference(tag.typeExpression.type) ? tryFindWhenConstTypeReference(parent) : getTypeFromTypeNode(tag.typeExpression.type);
|
|
59022
59118
|
}
|
|
@@ -62675,6 +62771,7 @@ function createTypeChecker(host) {
|
|
|
62675
62771
|
}
|
|
62676
62772
|
function checkExpressionWithTypeArguments(node) {
|
|
62677
62773
|
checkGrammarExpressionWithTypeArguments(node);
|
|
62774
|
+
forEach(node.typeArguments, checkSourceElement);
|
|
62678
62775
|
const exprType = node.kind === 230 /* ExpressionWithTypeArguments */ ? checkExpression(node.expression) : isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) : checkExpression(node.exprName);
|
|
62679
62776
|
const typeArguments = node.typeArguments;
|
|
62680
62777
|
if (exprType === silentNeverType || isErrorType(exprType) || !some(typeArguments)) {
|
|
@@ -62736,15 +62833,12 @@ function createTypeChecker(host) {
|
|
|
62736
62833
|
}
|
|
62737
62834
|
function checkSatisfiesExpression(node) {
|
|
62738
62835
|
checkSourceElement(node.type);
|
|
62739
|
-
|
|
62740
|
-
|
|
62741
|
-
function checkSatisfiesExpressionWorker(expression, target, checkMode) {
|
|
62742
|
-
const exprType = checkExpression(expression, checkMode);
|
|
62743
|
-
const targetType = getTypeFromTypeNode(target);
|
|
62836
|
+
const exprType = checkExpression(node.expression);
|
|
62837
|
+
const targetType = getTypeFromTypeNode(node.type);
|
|
62744
62838
|
if (isErrorType(targetType)) {
|
|
62745
62839
|
return targetType;
|
|
62746
62840
|
}
|
|
62747
|
-
checkTypeAssignableToAndOptionallyElaborate(exprType, targetType,
|
|
62841
|
+
checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, node.type, node.expression, Diagnostics.Type_0_does_not_satisfy_the_expected_type_1);
|
|
62748
62842
|
return exprType;
|
|
62749
62843
|
}
|
|
62750
62844
|
function checkMetaProperty(node) {
|
|
@@ -64858,14 +64952,9 @@ function createTypeChecker(host) {
|
|
|
64858
64952
|
}
|
|
64859
64953
|
}
|
|
64860
64954
|
function checkParenthesizedExpression(node, checkMode) {
|
|
64861
|
-
if (hasJSDocNodes(node)) {
|
|
64862
|
-
|
|
64863
|
-
|
|
64864
|
-
}
|
|
64865
|
-
if (isJSDocTypeAssertion(node)) {
|
|
64866
|
-
const type = getJSDocTypeAssertionType(node);
|
|
64867
|
-
return checkAssertionWorker(type, type, node.expression, checkMode);
|
|
64868
|
-
}
|
|
64955
|
+
if (hasJSDocNodes(node) && isJSDocTypeAssertion(node)) {
|
|
64956
|
+
const type = getJSDocTypeAssertionType(node);
|
|
64957
|
+
return checkAssertionWorker(type, type, node.expression, checkMode);
|
|
64869
64958
|
}
|
|
64870
64959
|
return checkExpression(node.expression, checkMode);
|
|
64871
64960
|
}
|
|
@@ -66493,9 +66582,6 @@ function createTypeChecker(host) {
|
|
|
66493
66582
|
function checkJSDocTypeTag(node) {
|
|
66494
66583
|
checkSourceElement(node.typeExpression);
|
|
66495
66584
|
}
|
|
66496
|
-
function checkJSDocSatisfiesTag(node) {
|
|
66497
|
-
checkSourceElement(node.typeExpression);
|
|
66498
|
-
}
|
|
66499
66585
|
function checkJSDocLinkLikeTag(node) {
|
|
66500
66586
|
if (node.name) {
|
|
66501
66587
|
resolveJSDocMemberName(node.name, true);
|
|
@@ -69831,8 +69917,6 @@ function createTypeChecker(host) {
|
|
|
69831
69917
|
case 338 /* JSDocProtectedTag */:
|
|
69832
69918
|
case 337 /* JSDocPrivateTag */:
|
|
69833
69919
|
return checkJSDocAccessibilityModifiers(node);
|
|
69834
|
-
case 351 /* JSDocSatisfiesTag */:
|
|
69835
|
-
return checkJSDocSatisfiesTag(node);
|
|
69836
69920
|
case 196 /* IndexedAccessType */:
|
|
69837
69921
|
return checkIndexedAccessType(node);
|
|
69838
69922
|
case 197 /* MappedType */:
|
|
@@ -74236,13 +74320,13 @@ var visitEachChildTable = {
|
|
|
74236
74320
|
visitLexicalEnvironment(node.statements, visitor, context)
|
|
74237
74321
|
);
|
|
74238
74322
|
},
|
|
74239
|
-
[
|
|
74323
|
+
[353 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
74240
74324
|
return context.factory.updatePartiallyEmittedExpression(
|
|
74241
74325
|
node,
|
|
74242
74326
|
nodeVisitor(node.expression, visitor, isExpression)
|
|
74243
74327
|
);
|
|
74244
74328
|
},
|
|
74245
|
-
[
|
|
74329
|
+
[354 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
74246
74330
|
return context.factory.updateCommaListExpression(
|
|
74247
74331
|
node,
|
|
74248
74332
|
nodesVisitor(node.elements, visitor, isExpression)
|
|
@@ -80141,7 +80225,7 @@ function transformES2018(context) {
|
|
|
80141
80225
|
return visitObjectLiteralExpression(node);
|
|
80142
80226
|
case 223 /* BinaryExpression */:
|
|
80143
80227
|
return visitBinaryExpression(node, expressionResultIsUnused2);
|
|
80144
|
-
case
|
|
80228
|
+
case 354 /* CommaListExpression */:
|
|
80145
80229
|
return visitCommaListExpression(node, expressionResultIsUnused2);
|
|
80146
80230
|
case 295 /* CatchClause */:
|
|
80147
80231
|
return visitCatchClause(node);
|
|
@@ -82337,7 +82421,7 @@ function transformES2015(context) {
|
|
|
82337
82421
|
return visitParenthesizedExpression(node, expressionResultIsUnused2);
|
|
82338
82422
|
case 223 /* BinaryExpression */:
|
|
82339
82423
|
return visitBinaryExpression(node, expressionResultIsUnused2);
|
|
82340
|
-
case
|
|
82424
|
+
case 354 /* CommaListExpression */:
|
|
82341
82425
|
return visitCommaListExpression(node, expressionResultIsUnused2);
|
|
82342
82426
|
case 14 /* NoSubstitutionTemplateLiteral */:
|
|
82343
82427
|
case 15 /* TemplateHead */:
|
|
@@ -85032,7 +85116,7 @@ function transformGenerators(context) {
|
|
|
85032
85116
|
switch (node.kind) {
|
|
85033
85117
|
case 223 /* BinaryExpression */:
|
|
85034
85118
|
return visitBinaryExpression(node);
|
|
85035
|
-
case
|
|
85119
|
+
case 354 /* CommaListExpression */:
|
|
85036
85120
|
return visitCommaListExpression(node);
|
|
85037
85121
|
case 224 /* ConditionalExpression */:
|
|
85038
85122
|
return visitConditionalExpression(node);
|
|
@@ -87117,9 +87201,9 @@ function transformModule(context) {
|
|
|
87117
87201
|
return visitFunctionDeclaration(node);
|
|
87118
87202
|
case 260 /* ClassDeclaration */:
|
|
87119
87203
|
return visitClassDeclaration(node);
|
|
87120
|
-
case
|
|
87204
|
+
case 355 /* MergeDeclarationMarker */:
|
|
87121
87205
|
return visitMergeDeclarationMarker(node);
|
|
87122
|
-
case
|
|
87206
|
+
case 356 /* EndOfDeclarationMarker */:
|
|
87123
87207
|
return visitEndOfDeclarationMarker(node);
|
|
87124
87208
|
default:
|
|
87125
87209
|
return visitor(node);
|
|
@@ -87136,7 +87220,7 @@ function transformModule(context) {
|
|
|
87136
87220
|
return visitExpressionStatement(node);
|
|
87137
87221
|
case 214 /* ParenthesizedExpression */:
|
|
87138
87222
|
return visitParenthesizedExpression(node, valueIsDiscarded);
|
|
87139
|
-
case
|
|
87223
|
+
case 353 /* PartiallyEmittedExpression */:
|
|
87140
87224
|
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
|
|
87141
87225
|
case 210 /* CallExpression */:
|
|
87142
87226
|
if (isImportCall(node) && currentSourceFile.impliedNodeFormat === void 0) {
|
|
@@ -88911,9 +88995,9 @@ function transformSystemModule(context) {
|
|
|
88911
88995
|
return visitCatchClause(node);
|
|
88912
88996
|
case 238 /* Block */:
|
|
88913
88997
|
return visitBlock(node);
|
|
88914
|
-
case
|
|
88998
|
+
case 355 /* MergeDeclarationMarker */:
|
|
88915
88999
|
return visitMergeDeclarationMarker(node);
|
|
88916
|
-
case
|
|
89000
|
+
case 356 /* EndOfDeclarationMarker */:
|
|
88917
89001
|
return visitEndOfDeclarationMarker(node);
|
|
88918
89002
|
default:
|
|
88919
89003
|
return visitor(node);
|
|
@@ -89061,7 +89145,7 @@ function transformSystemModule(context) {
|
|
|
89061
89145
|
return visitExpressionStatement(node);
|
|
89062
89146
|
case 214 /* ParenthesizedExpression */:
|
|
89063
89147
|
return visitParenthesizedExpression(node, valueIsDiscarded);
|
|
89064
|
-
case
|
|
89148
|
+
case 353 /* PartiallyEmittedExpression */:
|
|
89065
89149
|
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
|
|
89066
89150
|
case 223 /* BinaryExpression */:
|
|
89067
89151
|
if (isDestructuringAssignment(node)) {
|
|
@@ -91462,7 +91546,7 @@ function noEmitNotification(hint, node, callback) {
|
|
|
91462
91546
|
}
|
|
91463
91547
|
function transformNodes(resolver, host, factory2, options, nodes, transformers, allowDtsFiles) {
|
|
91464
91548
|
var _a2, _b;
|
|
91465
|
-
const enabledSyntaxKindFeatures = new Array(
|
|
91549
|
+
const enabledSyntaxKindFeatures = new Array(358 /* Count */);
|
|
91466
91550
|
let lexicalEnvironmentVariableDeclarations;
|
|
91467
91551
|
let lexicalEnvironmentFunctionDeclarations;
|
|
91468
91552
|
let lexicalEnvironmentStatements;
|
|
@@ -93169,7 +93253,6 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
93169
93253
|
case 344 /* JSDocReturnTag */:
|
|
93170
93254
|
case 345 /* JSDocThisTag */:
|
|
93171
93255
|
case 346 /* JSDocTypeTag */:
|
|
93172
|
-
case 351 /* JSDocSatisfiesTag */:
|
|
93173
93256
|
return emitJSDocSimpleTypedTag(node);
|
|
93174
93257
|
case 347 /* JSDocTemplateTag */:
|
|
93175
93258
|
return emitJSDocTemplateTag(node);
|
|
@@ -93177,9 +93260,9 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
93177
93260
|
return emitJSDocTypedefTag(node);
|
|
93178
93261
|
case 349 /* JSDocSeeTag */:
|
|
93179
93262
|
return emitJSDocSeeTag(node);
|
|
93180
|
-
case
|
|
93181
|
-
case
|
|
93182
|
-
case
|
|
93263
|
+
case 352 /* NotEmittedStatement */:
|
|
93264
|
+
case 356 /* EndOfDeclarationMarker */:
|
|
93265
|
+
case 355 /* MergeDeclarationMarker */:
|
|
93183
93266
|
return;
|
|
93184
93267
|
}
|
|
93185
93268
|
if (isExpression(node)) {
|
|
@@ -93274,18 +93357,18 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
93274
93357
|
return emitJsxSelfClosingElement(node);
|
|
93275
93358
|
case 285 /* JsxFragment */:
|
|
93276
93359
|
return emitJsxFragment(node);
|
|
93277
|
-
case
|
|
93360
|
+
case 351 /* SyntaxList */:
|
|
93278
93361
|
return Debug.fail("SyntaxList should not be printed");
|
|
93279
|
-
case
|
|
93362
|
+
case 352 /* NotEmittedStatement */:
|
|
93280
93363
|
return;
|
|
93281
|
-
case
|
|
93364
|
+
case 353 /* PartiallyEmittedExpression */:
|
|
93282
93365
|
return emitPartiallyEmittedExpression(node);
|
|
93283
|
-
case
|
|
93366
|
+
case 354 /* CommaListExpression */:
|
|
93284
93367
|
return emitCommaList(node);
|
|
93285
|
-
case
|
|
93286
|
-
case
|
|
93368
|
+
case 355 /* MergeDeclarationMarker */:
|
|
93369
|
+
case 356 /* EndOfDeclarationMarker */:
|
|
93287
93370
|
return;
|
|
93288
|
-
case
|
|
93371
|
+
case 357 /* SyntheticReferenceExpression */:
|
|
93289
93372
|
return Debug.fail("SyntheticReferenceExpression should not be printed");
|
|
93290
93373
|
}
|
|
93291
93374
|
}
|
|
@@ -96200,7 +96283,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
96200
96283
|
const skipTrailingComments = end < 0 || (emitFlags & 2048 /* NoTrailingComments */) !== 0 || node.kind === 11 /* JsxText */;
|
|
96201
96284
|
if ((pos > 0 || end > 0) && pos !== end) {
|
|
96202
96285
|
if (!skipLeadingComments) {
|
|
96203
|
-
emitLeadingComments(pos, node.kind !==
|
|
96286
|
+
emitLeadingComments(pos, node.kind !== 352 /* NotEmittedStatement */);
|
|
96204
96287
|
}
|
|
96205
96288
|
if (!skipLeadingComments || pos >= 0 && (emitFlags & 1024 /* NoLeadingComments */) !== 0) {
|
|
96206
96289
|
containerPos = pos;
|
|
@@ -96223,7 +96306,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
96223
96306
|
containerPos = savedContainerPos;
|
|
96224
96307
|
containerEnd = savedContainerEnd;
|
|
96225
96308
|
declarationListContainerEnd = savedDeclarationListContainerEnd;
|
|
96226
|
-
if (!skipTrailingComments && node.kind !==
|
|
96309
|
+
if (!skipTrailingComments && node.kind !== 352 /* NotEmittedStatement */) {
|
|
96227
96310
|
emitTrailingComments(end);
|
|
96228
96311
|
}
|
|
96229
96312
|
}
|
|
@@ -96475,7 +96558,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
96475
96558
|
}
|
|
96476
96559
|
} else {
|
|
96477
96560
|
const source = sourceMapRange.source || sourceMapSource;
|
|
96478
|
-
if (node.kind !==
|
|
96561
|
+
if (node.kind !== 352 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) {
|
|
96479
96562
|
emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos));
|
|
96480
96563
|
}
|
|
96481
96564
|
if (emitFlags & 128 /* NoNestedSourceMaps */) {
|
|
@@ -96490,7 +96573,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
96490
96573
|
if (emitFlags & 128 /* NoNestedSourceMaps */) {
|
|
96491
96574
|
sourceMapsDisabled = false;
|
|
96492
96575
|
}
|
|
96493
|
-
if (node.kind !==
|
|
96576
|
+
if (node.kind !== 352 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) {
|
|
96494
96577
|
emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end);
|
|
96495
96578
|
}
|
|
96496
96579
|
}
|
|
@@ -98045,6 +98128,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
98045
98128
|
getSymlinkCache,
|
|
98046
98129
|
realpath: (_o = host.realpath) == null ? void 0 : _o.bind(host),
|
|
98047
98130
|
useCaseSensitiveFileNames: () => host.useCaseSensitiveFileNames(),
|
|
98131
|
+
getCanonicalFileName,
|
|
98048
98132
|
getFileIncludeReasons: () => fileReasons,
|
|
98049
98133
|
structureIsReused,
|
|
98050
98134
|
writeFile: writeFile2
|
|
@@ -98085,7 +98169,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
98085
98169
|
const containingFileName = getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory);
|
|
98086
98170
|
const containingDir = getDirectoryPath(containingFileName);
|
|
98087
98171
|
const redirectedReference = getRedirectReferenceForResolution(containingFile);
|
|
98088
|
-
const fromCache = moduleResolutionCache.
|
|
98172
|
+
const fromCache = moduleResolutionCache.getFromNonRelativeNameCache(name, mode, containingDir, redirectedReference);
|
|
98089
98173
|
if (fromCache)
|
|
98090
98174
|
addResolutionDiagnostics(fromCache);
|
|
98091
98175
|
}
|
|
@@ -100613,14 +100697,13 @@ var BuilderState;
|
|
|
100613
100697
|
const referencedMap = options.module !== 0 /* None */ && !isOutFile ? createManyToManyPathMap() : void 0;
|
|
100614
100698
|
const exportedModulesMap = referencedMap ? createManyToManyPathMap() : void 0;
|
|
100615
100699
|
const useOldState = canReuseOldState(referencedMap, oldState);
|
|
100616
|
-
const getCanonicalFileName = createGetCanonicalFileName(newProgram.useCaseSensitiveFileNames());
|
|
100617
100700
|
newProgram.getTypeChecker();
|
|
100618
100701
|
for (const sourceFile of newProgram.getSourceFiles()) {
|
|
100619
100702
|
const version2 = Debug.checkDefined(sourceFile.version, "Program intended to be used with Builder should have source files with versions set");
|
|
100620
100703
|
const oldUncommittedSignature = useOldState ? (_a2 = oldState.oldSignatures) == null ? void 0 : _a2.get(sourceFile.resolvedPath) : void 0;
|
|
100621
100704
|
const signature = oldUncommittedSignature === void 0 ? useOldState ? (_b = oldState.fileInfos.get(sourceFile.resolvedPath)) == null ? void 0 : _b.signature : void 0 : oldUncommittedSignature || void 0;
|
|
100622
100705
|
if (referencedMap) {
|
|
100623
|
-
const newReferences = getReferencedFiles(newProgram, sourceFile, getCanonicalFileName);
|
|
100706
|
+
const newReferences = getReferencedFiles(newProgram, sourceFile, newProgram.getCanonicalFileName);
|
|
100624
100707
|
if (newReferences) {
|
|
100625
100708
|
referencedMap.set(sourceFile.resolvedPath, newReferences);
|
|
100626
100709
|
}
|
|
@@ -100682,6 +100765,26 @@ var BuilderState;
|
|
|
100682
100765
|
(state.hasCalledUpdateShapeSignature || (state.hasCalledUpdateShapeSignature = /* @__PURE__ */ new Set())).add(path);
|
|
100683
100766
|
}
|
|
100684
100767
|
BuilderState2.updateSignatureOfFile = updateSignatureOfFile;
|
|
100768
|
+
function computeDtsSignature(programOfThisState, sourceFile, cancellationToken, host, onNewSignature) {
|
|
100769
|
+
programOfThisState.emit(
|
|
100770
|
+
sourceFile,
|
|
100771
|
+
(fileName, text, _writeByteOrderMark, _onError, sourceFiles, data) => {
|
|
100772
|
+
Debug.assert(isDeclarationFileName(fileName), `File extension for signature expected to be dts: Got:: ${fileName}`);
|
|
100773
|
+
onNewSignature(computeSignatureWithDiagnostics(
|
|
100774
|
+
programOfThisState,
|
|
100775
|
+
sourceFile,
|
|
100776
|
+
text,
|
|
100777
|
+
host,
|
|
100778
|
+
data
|
|
100779
|
+
), sourceFiles);
|
|
100780
|
+
},
|
|
100781
|
+
cancellationToken,
|
|
100782
|
+
true,
|
|
100783
|
+
void 0,
|
|
100784
|
+
true
|
|
100785
|
+
);
|
|
100786
|
+
}
|
|
100787
|
+
BuilderState2.computeDtsSignature = computeDtsSignature;
|
|
100685
100788
|
function updateShapeSignature(state, programOfThisState, sourceFile, cancellationToken, host, useFileVersionAsSignature = state.useFileVersionAsSignature) {
|
|
100686
100789
|
var _a2;
|
|
100687
100790
|
if ((_a2 = state.hasCalledUpdateShapeSignature) == null ? void 0 : _a2.has(sourceFile.resolvedPath))
|
|
@@ -100690,26 +100793,12 @@ var BuilderState;
|
|
|
100690
100793
|
const prevSignature = info.signature;
|
|
100691
100794
|
let latestSignature;
|
|
100692
100795
|
if (!sourceFile.isDeclarationFile && !useFileVersionAsSignature) {
|
|
100693
|
-
programOfThisState
|
|
100694
|
-
|
|
100695
|
-
(
|
|
100696
|
-
|
|
100697
|
-
|
|
100698
|
-
|
|
100699
|
-
sourceFile,
|
|
100700
|
-
text,
|
|
100701
|
-
host,
|
|
100702
|
-
data
|
|
100703
|
-
);
|
|
100704
|
-
if (latestSignature !== prevSignature) {
|
|
100705
|
-
updateExportedModules(state, sourceFile, sourceFiles[0].exportedModulesFromDeclarationEmit);
|
|
100706
|
-
}
|
|
100707
|
-
},
|
|
100708
|
-
cancellationToken,
|
|
100709
|
-
true,
|
|
100710
|
-
void 0,
|
|
100711
|
-
true
|
|
100712
|
-
);
|
|
100796
|
+
computeDtsSignature(programOfThisState, sourceFile, cancellationToken, host, (signature, sourceFiles) => {
|
|
100797
|
+
latestSignature = signature;
|
|
100798
|
+
if (latestSignature !== prevSignature) {
|
|
100799
|
+
updateExportedModules(state, sourceFile, sourceFiles[0].exportedModulesFromDeclarationEmit);
|
|
100800
|
+
}
|
|
100801
|
+
});
|
|
100713
100802
|
}
|
|
100714
100803
|
if (latestSignature === void 0) {
|
|
100715
100804
|
latestSignature = sourceFile.version;
|
|
@@ -100733,27 +100822,24 @@ var BuilderState;
|
|
|
100733
100822
|
if (!state.exportedModulesMap)
|
|
100734
100823
|
return;
|
|
100735
100824
|
(state.oldExportedModulesMap || (state.oldExportedModulesMap = /* @__PURE__ */ new Map())).set(sourceFile.resolvedPath, state.exportedModulesMap.getValues(sourceFile.resolvedPath) || false);
|
|
100736
|
-
|
|
100737
|
-
state.exportedModulesMap.deleteKey(sourceFile.resolvedPath);
|
|
100738
|
-
return;
|
|
100739
|
-
}
|
|
100740
|
-
let exportedModules;
|
|
100741
|
-
exportedModulesFromDeclarationEmit.forEach((symbol) => addExportedModule(getReferencedFilesFromImportedModuleSymbol(symbol)));
|
|
100825
|
+
const exportedModules = getExportedModules(exportedModulesFromDeclarationEmit);
|
|
100742
100826
|
if (exportedModules) {
|
|
100743
100827
|
state.exportedModulesMap.set(sourceFile.resolvedPath, exportedModules);
|
|
100744
100828
|
} else {
|
|
100745
100829
|
state.exportedModulesMap.deleteKey(sourceFile.resolvedPath);
|
|
100746
100830
|
}
|
|
100747
|
-
function addExportedModule(exportedModulePaths) {
|
|
100748
|
-
if (exportedModulePaths == null ? void 0 : exportedModulePaths.length) {
|
|
100749
|
-
if (!exportedModules) {
|
|
100750
|
-
exportedModules = /* @__PURE__ */ new Set();
|
|
100751
|
-
}
|
|
100752
|
-
exportedModulePaths.forEach((path) => exportedModules.add(path));
|
|
100753
|
-
}
|
|
100754
|
-
}
|
|
100755
100831
|
}
|
|
100756
100832
|
BuilderState2.updateExportedModules = updateExportedModules;
|
|
100833
|
+
function getExportedModules(exportedModulesFromDeclarationEmit) {
|
|
100834
|
+
let exportedModules;
|
|
100835
|
+
exportedModulesFromDeclarationEmit == null ? void 0 : exportedModulesFromDeclarationEmit.forEach(
|
|
100836
|
+
(symbol) => getReferencedFilesFromImportedModuleSymbol(symbol).forEach(
|
|
100837
|
+
(path) => (exportedModules != null ? exportedModules : exportedModules = /* @__PURE__ */ new Set()).add(path)
|
|
100838
|
+
)
|
|
100839
|
+
);
|
|
100840
|
+
return exportedModules;
|
|
100841
|
+
}
|
|
100842
|
+
BuilderState2.getExportedModules = getExportedModules;
|
|
100757
100843
|
function getAllDependencies(state, programOfThisState, sourceFile) {
|
|
100758
100844
|
const compilerOptions = programOfThisState.getCompilerOptions();
|
|
100759
100845
|
if (outFile(compilerOptions)) {
|
|
@@ -100895,9 +100981,9 @@ function getPendingEmitKind(optionsOrEmitKind, oldOptionsOrEmitKind) {
|
|
|
100895
100981
|
function hasSameKeys(map1, map2) {
|
|
100896
100982
|
return map1 === map2 || map1 !== void 0 && map2 !== void 0 && map1.size === map2.size && !forEachKey(map1, (key) => !map2.has(key));
|
|
100897
100983
|
}
|
|
100898
|
-
function createBuilderProgramState(newProgram, oldState
|
|
100984
|
+
function createBuilderProgramState(newProgram, oldState) {
|
|
100899
100985
|
var _a2, _b;
|
|
100900
|
-
const state = BuilderState.create(newProgram, oldState,
|
|
100986
|
+
const state = BuilderState.create(newProgram, oldState, false);
|
|
100901
100987
|
state.program = newProgram;
|
|
100902
100988
|
const compilerOptions = newProgram.getCompilerOptions();
|
|
100903
100989
|
state.compilerOptions = compilerOptions;
|
|
@@ -101005,7 +101091,6 @@ function convertToDiagnostics(diagnostics, newProgram) {
|
|
|
101005
101091
|
if (!diagnostics.length)
|
|
101006
101092
|
return emptyArray;
|
|
101007
101093
|
let buildInfoDirectory;
|
|
101008
|
-
let getCanonicalFileName;
|
|
101009
101094
|
return diagnostics.map((diagnostic) => {
|
|
101010
101095
|
const result = convertToDiagnosticRelatedInformation(diagnostic, newProgram, toPath3);
|
|
101011
101096
|
result.reportsUnnecessary = diagnostic.reportsUnnecessary;
|
|
@@ -101018,7 +101103,7 @@ function convertToDiagnostics(diagnostics, newProgram) {
|
|
|
101018
101103
|
});
|
|
101019
101104
|
function toPath3(path) {
|
|
101020
101105
|
buildInfoDirectory != null ? buildInfoDirectory : buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(newProgram.getCompilerOptions()), newProgram.getCurrentDirectory()));
|
|
101021
|
-
return toPath(path, buildInfoDirectory,
|
|
101106
|
+
return toPath(path, buildInfoDirectory, newProgram.getCanonicalFileName);
|
|
101022
101107
|
}
|
|
101023
101108
|
}
|
|
101024
101109
|
function convertToDiagnosticRelatedInformation(diagnostic, newProgram, toPath3) {
|
|
@@ -101189,7 +101274,7 @@ function handleDtsMayChangeOf(state, path, cancellationToken, host) {
|
|
|
101189
101274
|
sourceFile,
|
|
101190
101275
|
cancellationToken,
|
|
101191
101276
|
host,
|
|
101192
|
-
|
|
101277
|
+
true
|
|
101193
101278
|
);
|
|
101194
101279
|
if (getEmitDeclarations(state.compilerOptions)) {
|
|
101195
101280
|
addToAffectedFilesPendingEmit(state, path, state.compilerOptions.declarationMap ? 24 /* AllDts */ : 8 /* Dts */);
|
|
@@ -101316,7 +101401,6 @@ function isProgramBundleEmitBuildInfo(info) {
|
|
|
101316
101401
|
function getBuildInfo2(state, bundle) {
|
|
101317
101402
|
var _a2, _b, _c;
|
|
101318
101403
|
const currentDirectory = Debug.checkDefined(state.program).getCurrentDirectory();
|
|
101319
|
-
const getCanonicalFileName = createGetCanonicalFileName(state.program.useCaseSensitiveFileNames());
|
|
101320
101404
|
const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(state.compilerOptions), currentDirectory));
|
|
101321
101405
|
const latestChangedDtsFile = state.latestChangedDtsFile ? relativeToBuildInfoEnsuringAbsolutePath(state.latestChangedDtsFile) : void 0;
|
|
101322
101406
|
const fileNames = [];
|
|
@@ -101434,7 +101518,7 @@ function getBuildInfo2(state, bundle) {
|
|
|
101434
101518
|
return relativeToBuildInfo(getNormalizedAbsolutePath(path, currentDirectory));
|
|
101435
101519
|
}
|
|
101436
101520
|
function relativeToBuildInfo(path) {
|
|
101437
|
-
return ensurePathIsNonModuleName(getRelativePathFromDirectory(buildInfoDirectory, path, getCanonicalFileName));
|
|
101521
|
+
return ensurePathIsNonModuleName(getRelativePathFromDirectory(buildInfoDirectory, path, state.program.getCanonicalFileName));
|
|
101438
101522
|
}
|
|
101439
101523
|
function toFileId(path) {
|
|
101440
101524
|
let fileId = fileNameToFileId.get(path);
|
|
@@ -101472,6 +101556,7 @@ function getBuildInfo2(state, bundle) {
|
|
|
101472
101556
|
}
|
|
101473
101557
|
function convertToReusableCompilerOptionValue(option, value, relativeToBuildInfo) {
|
|
101474
101558
|
if (option) {
|
|
101559
|
+
Debug.assert(option.type !== "listOrElement");
|
|
101475
101560
|
if (option.type === "list") {
|
|
101476
101561
|
const values = value;
|
|
101477
101562
|
if (option.element.isFilePath && values.length) {
|
|
@@ -101537,7 +101622,6 @@ function getTextHandlingSourceMapForSignature(text, data) {
|
|
|
101537
101622
|
}
|
|
101538
101623
|
function computeSignatureWithDiagnostics(program, sourceFile, text, host, data) {
|
|
101539
101624
|
var _a2, _b;
|
|
101540
|
-
let getCanonicalFileName;
|
|
101541
101625
|
text = getTextHandlingSourceMapForSignature(text, data);
|
|
101542
101626
|
let sourceFileDirectory;
|
|
101543
101627
|
if ((_a2 = data == null ? void 0 : data.diagnostics) == null ? void 0 : _a2.length) {
|
|
@@ -101557,7 +101641,7 @@ function computeSignatureWithDiagnostics(program, sourceFile, text, host, data)
|
|
|
101557
101641
|
return `${ensurePathIsNonModuleName(getRelativePathFromDirectory(
|
|
101558
101642
|
sourceFileDirectory,
|
|
101559
101643
|
diagnostic.file.resolvedPath,
|
|
101560
|
-
|
|
101644
|
+
program.getCanonicalFileName
|
|
101561
101645
|
))}(${diagnostic.start},${diagnostic.length})`;
|
|
101562
101646
|
}
|
|
101563
101647
|
}
|
|
@@ -101572,7 +101656,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
101572
101656
|
oldState = void 0;
|
|
101573
101657
|
return oldProgram;
|
|
101574
101658
|
}
|
|
101575
|
-
const state = createBuilderProgramState(newProgram, oldState
|
|
101659
|
+
const state = createBuilderProgramState(newProgram, oldState);
|
|
101576
101660
|
newProgram.getBuildInfo = (bundle) => getBuildInfo2(state, bundle);
|
|
101577
101661
|
newProgram = void 0;
|
|
101578
101662
|
oldProgram = void 0;
|
|
@@ -102031,9 +102115,9 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
102031
102115
|
let filesWithInvalidatedResolutions;
|
|
102032
102116
|
let filesWithInvalidatedNonRelativeUnresolvedImports;
|
|
102033
102117
|
const nonRelativeExternalModuleResolutions = createMultiMap();
|
|
102034
|
-
const resolutionsWithFailedLookups =
|
|
102035
|
-
const resolutionsWithOnlyAffectingLocations =
|
|
102036
|
-
const resolvedFileToResolution =
|
|
102118
|
+
const resolutionsWithFailedLookups = /* @__PURE__ */ new Set();
|
|
102119
|
+
const resolutionsWithOnlyAffectingLocations = /* @__PURE__ */ new Set();
|
|
102120
|
+
const resolvedFileToResolution = /* @__PURE__ */ new Map();
|
|
102037
102121
|
const impliedFormatPackageJsons = /* @__PURE__ */ new Map();
|
|
102038
102122
|
let hasChangedAutomaticTypeDirectiveNames = false;
|
|
102039
102123
|
let affectingPathChecksForFile;
|
|
@@ -102106,8 +102190,8 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
102106
102190
|
resolvedModuleNames.clear();
|
|
102107
102191
|
resolvedTypeReferenceDirectives.clear();
|
|
102108
102192
|
resolvedFileToResolution.clear();
|
|
102109
|
-
resolutionsWithFailedLookups.
|
|
102110
|
-
resolutionsWithOnlyAffectingLocations.
|
|
102193
|
+
resolutionsWithFailedLookups.clear();
|
|
102194
|
+
resolutionsWithOnlyAffectingLocations.clear();
|
|
102111
102195
|
failedLookupChecks = void 0;
|
|
102112
102196
|
startsWithPathChecks = void 0;
|
|
102113
102197
|
isInDirectoryChecks = void 0;
|
|
@@ -102424,12 +102508,13 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
102424
102508
|
return fileExtensionIsOneOf(path, failedLookupDefaultExtensions);
|
|
102425
102509
|
}
|
|
102426
102510
|
function watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, filePath, getResolutionWithResolvedFileName) {
|
|
102511
|
+
var _a2, _b;
|
|
102427
102512
|
if (resolution.refCount) {
|
|
102428
102513
|
resolution.refCount++;
|
|
102429
102514
|
Debug.assertIsDefined(resolution.files);
|
|
102430
102515
|
} else {
|
|
102431
102516
|
resolution.refCount = 1;
|
|
102432
|
-
Debug.assert(
|
|
102517
|
+
Debug.assert(!((_a2 = resolution.files) == null ? void 0 : _a2.size));
|
|
102433
102518
|
if (isExternalModuleNameRelative(name)) {
|
|
102434
102519
|
watchFailedLookupLocationOfResolution(resolution);
|
|
102435
102520
|
} else {
|
|
@@ -102437,10 +102522,14 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
102437
102522
|
}
|
|
102438
102523
|
const resolved = getResolutionWithResolvedFileName(resolution);
|
|
102439
102524
|
if (resolved && resolved.resolvedFileName) {
|
|
102440
|
-
|
|
102525
|
+
const key = resolutionHost.toPath(resolved.resolvedFileName);
|
|
102526
|
+
let resolutions = resolvedFileToResolution.get(key);
|
|
102527
|
+
if (!resolutions)
|
|
102528
|
+
resolvedFileToResolution.set(key, resolutions = /* @__PURE__ */ new Set());
|
|
102529
|
+
resolutions.add(resolution);
|
|
102441
102530
|
}
|
|
102442
102531
|
}
|
|
102443
|
-
(resolution.files
|
|
102532
|
+
((_b = resolution.files) != null ? _b : resolution.files = /* @__PURE__ */ new Set()).add(filePath);
|
|
102444
102533
|
}
|
|
102445
102534
|
function watchFailedLookupLocationOfResolution(resolution) {
|
|
102446
102535
|
Debug.assert(!!resolution.refCount);
|
|
@@ -102448,7 +102537,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
102448
102537
|
if (!(failedLookupLocations == null ? void 0 : failedLookupLocations.length) && !(affectingLocations == null ? void 0 : affectingLocations.length))
|
|
102449
102538
|
return;
|
|
102450
102539
|
if (failedLookupLocations == null ? void 0 : failedLookupLocations.length)
|
|
102451
|
-
resolutionsWithFailedLookups.
|
|
102540
|
+
resolutionsWithFailedLookups.add(resolution);
|
|
102452
102541
|
let setAtRoot = false;
|
|
102453
102542
|
if (failedLookupLocations) {
|
|
102454
102543
|
for (const failedLookupLocation of failedLookupLocations) {
|
|
@@ -102480,7 +102569,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
102480
102569
|
if (!(affectingLocations == null ? void 0 : affectingLocations.length))
|
|
102481
102570
|
return;
|
|
102482
102571
|
if (addToResolutionsWithOnlyAffectingLocations)
|
|
102483
|
-
resolutionsWithOnlyAffectingLocations.
|
|
102572
|
+
resolutionsWithOnlyAffectingLocations.add(resolution);
|
|
102484
102573
|
for (const affectingLocation of affectingLocations) {
|
|
102485
102574
|
createFileWatcherOfAffectingLocation(affectingLocation, true);
|
|
102486
102575
|
}
|
|
@@ -102559,17 +102648,20 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
102559
102648
|
}
|
|
102560
102649
|
}
|
|
102561
102650
|
function stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName) {
|
|
102562
|
-
|
|
102651
|
+
Debug.checkDefined(resolution.files).delete(filePath);
|
|
102563
102652
|
resolution.refCount--;
|
|
102564
102653
|
if (resolution.refCount) {
|
|
102565
102654
|
return;
|
|
102566
102655
|
}
|
|
102567
102656
|
const resolved = getResolutionWithResolvedFileName(resolution);
|
|
102568
102657
|
if (resolved && resolved.resolvedFileName) {
|
|
102569
|
-
|
|
102658
|
+
const key = resolutionHost.toPath(resolved.resolvedFileName);
|
|
102659
|
+
const resolutions = resolvedFileToResolution.get(key);
|
|
102660
|
+
if ((resolutions == null ? void 0 : resolutions.delete(resolution)) && !resolutions.size)
|
|
102661
|
+
resolvedFileToResolution.delete(key);
|
|
102570
102662
|
}
|
|
102571
102663
|
const { failedLookupLocations, affectingLocations } = resolution;
|
|
102572
|
-
if (
|
|
102664
|
+
if (resolutionsWithFailedLookups.delete(resolution)) {
|
|
102573
102665
|
let removeAtRoot = false;
|
|
102574
102666
|
for (const failedLookupLocation of failedLookupLocations) {
|
|
102575
102667
|
const failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation);
|
|
@@ -102596,7 +102688,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
102596
102688
|
removeDirectoryWatcher(rootPath);
|
|
102597
102689
|
}
|
|
102598
102690
|
} else if (affectingLocations == null ? void 0 : affectingLocations.length) {
|
|
102599
|
-
|
|
102691
|
+
resolutionsWithOnlyAffectingLocations.delete(resolution);
|
|
102600
102692
|
}
|
|
102601
102693
|
if (affectingLocations) {
|
|
102602
102694
|
for (const affectingLocation of affectingLocations) {
|
|
@@ -102644,15 +102736,15 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
102644
102736
|
if (!resolutions)
|
|
102645
102737
|
return false;
|
|
102646
102738
|
let invalidated = false;
|
|
102647
|
-
|
|
102739
|
+
resolutions.forEach((resolution) => {
|
|
102648
102740
|
if (resolution.isInvalidated || !canInvalidate(resolution))
|
|
102649
|
-
|
|
102741
|
+
return;
|
|
102650
102742
|
resolution.isInvalidated = invalidated = true;
|
|
102651
102743
|
for (const containingFilePath of Debug.checkDefined(resolution.files)) {
|
|
102652
102744
|
(filesWithInvalidatedResolutions != null ? filesWithInvalidatedResolutions : filesWithInvalidatedResolutions = /* @__PURE__ */ new Set()).add(containingFilePath);
|
|
102653
102745
|
hasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames || endsWith(containingFilePath, inferredTypesContainingFile);
|
|
102654
102746
|
}
|
|
102655
|
-
}
|
|
102747
|
+
});
|
|
102656
102748
|
return invalidated;
|
|
102657
102749
|
}
|
|
102658
102750
|
function invalidateResolutionOfFile(filePath) {
|
|
@@ -102947,8 +103039,7 @@ function listFiles(program, write) {
|
|
|
102947
103039
|
function explainFiles(program, write) {
|
|
102948
103040
|
var _a2, _b;
|
|
102949
103041
|
const reasons = program.getFileIncludeReasons();
|
|
102950
|
-
const
|
|
102951
|
-
const relativeFileName = (fileName) => convertToRelativePath(fileName, program.getCurrentDirectory(), getCanonicalFileName);
|
|
103042
|
+
const relativeFileName = (fileName) => convertToRelativePath(fileName, program.getCurrentDirectory(), program.getCanonicalFileName);
|
|
102952
103043
|
for (const file of program.getSourceFiles()) {
|
|
102953
103044
|
write(`${toFileName(file, relativeFileName)}`);
|
|
102954
103045
|
(_a2 = reasons.get(file.path)) == null ? void 0 : _a2.forEach((reason) => write(` ${fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText}`));
|
|
@@ -103006,10 +103097,9 @@ function getMatchedFileSpec(program, fileName) {
|
|
|
103006
103097
|
const configFile = program.getCompilerOptions().configFile;
|
|
103007
103098
|
if (!((_a2 = configFile == null ? void 0 : configFile.configFileSpecs) == null ? void 0 : _a2.validatedFilesSpec))
|
|
103008
103099
|
return void 0;
|
|
103009
|
-
const
|
|
103010
|
-
const filePath = getCanonicalFileName(fileName);
|
|
103100
|
+
const filePath = program.getCanonicalFileName(fileName);
|
|
103011
103101
|
const basePath = getDirectoryPath(getNormalizedAbsolutePath(configFile.fileName, program.getCurrentDirectory()));
|
|
103012
|
-
return find(configFile.configFileSpecs.validatedFilesSpec, (fileSpec) => getCanonicalFileName(getNormalizedAbsolutePath(fileSpec, basePath)) === filePath);
|
|
103102
|
+
return find(configFile.configFileSpecs.validatedFilesSpec, (fileSpec) => program.getCanonicalFileName(getNormalizedAbsolutePath(fileSpec, basePath)) === filePath);
|
|
103013
103103
|
}
|
|
103014
103104
|
function getMatchedIncludeSpec(program, fileName) {
|
|
103015
103105
|
var _a2, _b;
|
|
@@ -103242,7 +103332,6 @@ function createCompilerHostFromProgramHost(host, getCompilerOptions, directorySt
|
|
|
103242
103332
|
getEnvironmentVariable: maybeBind(host, host.getEnvironmentVariable) || (() => ""),
|
|
103243
103333
|
createHash: maybeBind(host, host.createHash),
|
|
103244
103334
|
readDirectory: maybeBind(host, host.readDirectory),
|
|
103245
|
-
disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
|
|
103246
103335
|
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit
|
|
103247
103336
|
};
|
|
103248
103337
|
return compilerHost;
|
|
@@ -103309,7 +103398,6 @@ function createProgramHost(system, createProgram2) {
|
|
|
103309
103398
|
writeFile: (path, data, writeByteOrderMark) => system.writeFile(path, data, writeByteOrderMark),
|
|
103310
103399
|
createHash: maybeBind(system, system.createHash),
|
|
103311
103400
|
createProgram: createProgram2 || createEmitAndSemanticDiagnosticsBuilderProgram,
|
|
103312
|
-
disableUseFileVersionAsSignature: system.disableUseFileVersionAsSignature,
|
|
103313
103401
|
storeFilesChangingSignatureDuringEmit: system.storeFilesChangingSignatureDuringEmit,
|
|
103314
103402
|
now: maybeBind(system, system.now)
|
|
103315
103403
|
};
|
|
@@ -103411,7 +103499,6 @@ function readBuilderProgram(compilerOptions, host) {
|
|
|
103411
103499
|
function createIncrementalCompilerHost(options, system = sys) {
|
|
103412
103500
|
const host = createCompilerHostWorker(options, void 0, system);
|
|
103413
103501
|
host.createHash = maybeBind(system, system.createHash);
|
|
103414
|
-
host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
|
|
103415
103502
|
host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
|
|
103416
103503
|
setGetSourceFileAsHashVersioned(host);
|
|
103417
103504
|
changeCompilerHostLikeToUseCache(host, (fileName) => toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName));
|
|
@@ -104146,8 +104233,6 @@ function createSolutionBuilderWithWatch(host, rootNames, defaultOptions, baseWat
|
|
|
104146
104233
|
function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, options, baseWatchOptions) {
|
|
104147
104234
|
const host = hostOrHostWithWatch;
|
|
104148
104235
|
const hostWithWatch = hostOrHostWithWatch;
|
|
104149
|
-
const currentDirectory = host.getCurrentDirectory();
|
|
104150
|
-
const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames());
|
|
104151
104236
|
const baseCompilerOptions = getCompilerOptionsOfBuildOptions(options);
|
|
104152
104237
|
const compilerHost = createCompilerHostFromProgramHost(host, () => state.projectCompilerOptions);
|
|
104153
104238
|
setGetSourceFileAsHashVersioned(compilerHost);
|
|
@@ -104159,7 +104244,7 @@ function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, optio
|
|
|
104159
104244
|
compilerHost.getModuleResolutionCache = maybeBind(host, host.getModuleResolutionCache);
|
|
104160
104245
|
let moduleResolutionCache, typeReferenceDirectiveResolutionCache;
|
|
104161
104246
|
if (!compilerHost.resolveModuleNameLiterals && !compilerHost.resolveModuleNames) {
|
|
104162
|
-
moduleResolutionCache = createModuleResolutionCache(
|
|
104247
|
+
moduleResolutionCache = createModuleResolutionCache(compilerHost.getCurrentDirectory(), compilerHost.getCanonicalFileName);
|
|
104163
104248
|
compilerHost.resolveModuleNameLiterals = (moduleNames, containingFile, redirectedReference, options2, containingSourceFile) => loadWithModeAwareCache(
|
|
104164
104249
|
moduleNames,
|
|
104165
104250
|
containingFile,
|
|
@@ -104173,7 +104258,7 @@ function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, optio
|
|
|
104173
104258
|
compilerHost.getModuleResolutionCache = () => moduleResolutionCache;
|
|
104174
104259
|
}
|
|
104175
104260
|
if (!compilerHost.resolveTypeReferenceDirectiveReferences && !compilerHost.resolveTypeReferenceDirectives) {
|
|
104176
|
-
typeReferenceDirectiveResolutionCache = createTypeReferenceDirectiveResolutionCache(
|
|
104261
|
+
typeReferenceDirectiveResolutionCache = createTypeReferenceDirectiveResolutionCache(compilerHost.getCurrentDirectory(), compilerHost.getCanonicalFileName, void 0, moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache());
|
|
104177
104262
|
compilerHost.resolveTypeReferenceDirectiveReferences = (typeDirectiveNames, containingFile, redirectedReference, options2, containingSourceFile) => loadWithModeAwareCache(
|
|
104178
104263
|
typeDirectiveNames,
|
|
104179
104264
|
containingFile,
|
|
@@ -104190,8 +104275,6 @@ function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, optio
|
|
|
104190
104275
|
const state = {
|
|
104191
104276
|
host,
|
|
104192
104277
|
hostWithWatch,
|
|
104193
|
-
currentDirectory,
|
|
104194
|
-
getCanonicalFileName,
|
|
104195
104278
|
parseConfigFileHost: parseConfigHostFromCompilerHostLike(host),
|
|
104196
104279
|
write: maybeBind(host, host.trace),
|
|
104197
104280
|
options,
|
|
@@ -104235,7 +104318,7 @@ function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, optio
|
|
|
104235
104318
|
return state;
|
|
104236
104319
|
}
|
|
104237
104320
|
function toPath2(state, fileName) {
|
|
104238
|
-
return toPath(fileName, state.
|
|
104321
|
+
return toPath(fileName, state.compilerHost.getCurrentDirectory(), state.compilerHost.getCanonicalFileName);
|
|
104239
104322
|
}
|
|
104240
104323
|
function toResolvedConfigFilePath(state, fileName) {
|
|
104241
104324
|
const { resolvedConfigFilePaths } = state;
|
|
@@ -104278,7 +104361,7 @@ function parseConfigFile(state, configFileName, configFilePath) {
|
|
|
104278
104361
|
return parsed;
|
|
104279
104362
|
}
|
|
104280
104363
|
function resolveProjectName(state, name) {
|
|
104281
|
-
return resolveConfigFileProjectName(resolvePath(state.
|
|
104364
|
+
return resolveConfigFileProjectName(resolvePath(state.compilerHost.getCurrentDirectory(), name));
|
|
104282
104365
|
}
|
|
104283
104366
|
function createBuildOrder(state, roots) {
|
|
104284
104367
|
const temporaryMarks = /* @__PURE__ */ new Map();
|
|
@@ -104481,7 +104564,7 @@ function createUpdateOutputFileStampsProject(state, project, projectPath, config
|
|
|
104481
104564
|
projectPath,
|
|
104482
104565
|
buildOrder,
|
|
104483
104566
|
getCompilerOptions: () => config.options,
|
|
104484
|
-
getCurrentDirectory: () => state.
|
|
104567
|
+
getCurrentDirectory: () => state.compilerHost.getCurrentDirectory(),
|
|
104485
104568
|
updateOutputFileStatmps: () => {
|
|
104486
104569
|
updateOutputTimestamps(state, config, projectPath);
|
|
104487
104570
|
updateOutputFileStampsPending = false;
|
|
@@ -104506,7 +104589,7 @@ function createBuildOrUpdateInvalidedProject(kind, state, project, projectPath,
|
|
|
104506
104589
|
projectPath,
|
|
104507
104590
|
buildOrder,
|
|
104508
104591
|
getCompilerOptions: () => config.options,
|
|
104509
|
-
getCurrentDirectory: () => state.
|
|
104592
|
+
getCurrentDirectory: () => state.compilerHost.getCurrentDirectory(),
|
|
104510
104593
|
getBuilderProgram: () => withProgramOrUndefined(identity),
|
|
104511
104594
|
getProgram: () => withProgramOrUndefined(
|
|
104512
104595
|
(program2) => program2.getProgramOrUndefined()
|
|
@@ -104562,7 +104645,7 @@ function createBuildOrUpdateInvalidedProject(kind, state, project, projectPath,
|
|
|
104562
104645
|
projectPath,
|
|
104563
104646
|
buildOrder,
|
|
104564
104647
|
getCompilerOptions: () => config.options,
|
|
104565
|
-
getCurrentDirectory: () => state.
|
|
104648
|
+
getCurrentDirectory: () => state.compilerHost.getCurrentDirectory(),
|
|
104566
104649
|
emit: (writeFile2, customTransformers) => {
|
|
104567
104650
|
if (step !== 4 /* EmitBundle */)
|
|
104568
104651
|
return invalidatedProjectOfBundle;
|
|
@@ -105669,7 +105752,7 @@ function watchWildCardDirectories(state, resolved, resolvedPath, parsed) {
|
|
|
105669
105752
|
fileOrDirectory,
|
|
105670
105753
|
fileOrDirectoryPath: toPath2(state, fileOrDirectory),
|
|
105671
105754
|
configFileName: resolved,
|
|
105672
|
-
currentDirectory: state.
|
|
105755
|
+
currentDirectory: state.compilerHost.getCurrentDirectory(),
|
|
105673
105756
|
options: parsed.options,
|
|
105674
105757
|
program: state.builderPrograms.get(resolvedPath) || ((_a2 = getCachedParsedConfigFile(state, resolvedPath)) == null ? void 0 : _a2.fileNames),
|
|
105675
105758
|
useCaseSensitiveFileNames: state.parseConfigFileHost.useCaseSensitiveFileNames,
|
|
@@ -105774,7 +105857,7 @@ function createSolutionBuilderWorker(watch, hostOrHostWithWatch, rootNames, opti
|
|
|
105774
105857
|
};
|
|
105775
105858
|
}
|
|
105776
105859
|
function relName(state, path) {
|
|
105777
|
-
return convertToRelativePath(path, state.
|
|
105860
|
+
return convertToRelativePath(path, state.compilerHost.getCurrentDirectory(), state.compilerHost.getCanonicalFileName);
|
|
105778
105861
|
}
|
|
105779
105862
|
function reportStatus(state, message, ...args) {
|
|
105780
105863
|
state.host.reportSolutionBuilderStatus(createCompilerDiagnostic(message, ...args));
|
|
@@ -106064,7 +106147,7 @@ function generateOptionOutput(sys2, option, rightAlignOfLeft, leftAlignOfRight)
|
|
|
106064
106147
|
const valueCandidates = getValueCandidate(option);
|
|
106065
106148
|
const defaultValueDescription = typeof option.defaultValueDescription === "object" ? getDiagnosticText(option.defaultValueDescription) : formatDefaultValue(
|
|
106066
106149
|
option.defaultValueDescription,
|
|
106067
|
-
option.type === "list" ? option.element.type : option.type
|
|
106150
|
+
option.type === "list" || option.type === "listOrElement" ? option.element.type : option.type
|
|
106068
106151
|
);
|
|
106069
106152
|
const terminalWidth = (_b = (_a2 = sys2.getWidthOfTerminal) == null ? void 0 : _a2.call(sys2)) != null ? _b : 0;
|
|
106070
106153
|
if (terminalWidth >= 80) {
|
|
@@ -106148,6 +106231,7 @@ function generateOptionOutput(sys2, option, rightAlignOfLeft, leftAlignOfRight)
|
|
|
106148
106231
|
possibleValues: getPossibleValues(option2)
|
|
106149
106232
|
};
|
|
106150
106233
|
function getValueType(option3) {
|
|
106234
|
+
Debug.assert(option3.type !== "listOrElement");
|
|
106151
106235
|
switch (option3.type) {
|
|
106152
106236
|
case "string":
|
|
106153
106237
|
case "number":
|
|
@@ -106168,6 +106252,7 @@ function generateOptionOutput(sys2, option, rightAlignOfLeft, leftAlignOfRight)
|
|
|
106168
106252
|
possibleValues = option3.type;
|
|
106169
106253
|
break;
|
|
106170
106254
|
case "list":
|
|
106255
|
+
case "listOrElement":
|
|
106171
106256
|
possibleValues = getPossibleValues(option3.element);
|
|
106172
106257
|
break;
|
|
106173
106258
|
case "object":
|