typescript 4.6.1-rc → 4.7.0-dev.20220215
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/cancellationToken.js +1 -1
- package/lib/cs/diagnosticMessages.generated.json +9 -3
- package/lib/de/diagnosticMessages.generated.json +9 -3
- package/lib/es/diagnosticMessages.generated.json +9 -3
- package/lib/fr/diagnosticMessages.generated.json +9 -3
- package/lib/it/diagnosticMessages.generated.json +9 -3
- package/lib/ja/diagnosticMessages.generated.json +9 -3
- package/lib/ko/diagnosticMessages.generated.json +9 -3
- package/lib/pl/diagnosticMessages.generated.json +9 -3
- package/lib/pt-br/diagnosticMessages.generated.json +9 -3
- package/lib/ru/diagnosticMessages.generated.json +9 -3
- package/lib/tr/diagnosticMessages.generated.json +9 -3
- package/lib/tsc.js +306 -284
- package/lib/tsserver.js +694 -581
- package/lib/tsserverlibrary.d.ts +1 -1
- package/lib/tsserverlibrary.js +669 -556
- package/lib/typescript.d.ts +1 -1
- package/lib/typescript.js +574 -461
- package/lib/typescriptServices.d.ts +1 -1
- package/lib/typescriptServices.js +574 -461
- package/lib/typingsInstaller.js +385 -339
- package/lib/zh-cn/diagnosticMessages.generated.json +9 -3
- package/lib/zh-tw/diagnosticMessages.generated.json +9 -3
- package/package.json +2 -2
package/lib/typescript.js
CHANGED
|
@@ -21,7 +21,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
21
21
|
ar[i] = from[i];
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
return to.concat(ar ||
|
|
24
|
+
return to.concat(ar || from);
|
|
25
25
|
};
|
|
26
26
|
var __assign = (this && this.__assign) || function () {
|
|
27
27
|
__assign = Object.assign || function(t) {
|
|
@@ -290,11 +290,11 @@ var ts;
|
|
|
290
290
|
(function (ts) {
|
|
291
291
|
// WARNING: The script `configurePrerelease.ts` uses a regexp to parse out these values.
|
|
292
292
|
// If changing the text in this section, be sure to test `configurePrerelease` too.
|
|
293
|
-
ts.versionMajorMinor = "4.
|
|
293
|
+
ts.versionMajorMinor = "4.7";
|
|
294
294
|
// The following is baselined as a literal template type without intervention
|
|
295
295
|
/** The version of the TypeScript compiler release */
|
|
296
296
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
297
|
-
ts.version =
|
|
297
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220215";
|
|
298
298
|
/* @internal */
|
|
299
299
|
var Comparison;
|
|
300
300
|
(function (Comparison) {
|
|
@@ -341,7 +341,7 @@ var ts;
|
|
|
341
341
|
var constructor = (_a = NativeCollections[nativeFactory]()) !== null && _a !== void 0 ? _a : ts.ShimCollections === null || ts.ShimCollections === void 0 ? void 0 : ts.ShimCollections[shimFactory](ts.getIterator);
|
|
342
342
|
if (constructor)
|
|
343
343
|
return constructor;
|
|
344
|
-
throw new Error("TypeScript requires an environment that provides a compatible native "
|
|
344
|
+
throw new Error("TypeScript requires an environment that provides a compatible native " + name + " implementation.");
|
|
345
345
|
}
|
|
346
346
|
})(ts || (ts = {}));
|
|
347
347
|
/* @internal */
|
|
@@ -1691,7 +1691,7 @@ var ts;
|
|
|
1691
1691
|
function cast(value, test) {
|
|
1692
1692
|
if (value !== undefined && test(value))
|
|
1693
1693
|
return value;
|
|
1694
|
-
return ts.Debug.fail("Invalid cast. The supplied value "
|
|
1694
|
+
return ts.Debug.fail("Invalid cast. The supplied value " + value + " did not pass the test '" + ts.Debug.getFunctionName(test) + "'.");
|
|
1695
1695
|
}
|
|
1696
1696
|
ts.cast = cast;
|
|
1697
1697
|
/** Does nothing. */
|
|
@@ -1782,7 +1782,7 @@ var ts;
|
|
|
1782
1782
|
function memoizeOne(callback) {
|
|
1783
1783
|
var map = new ts.Map();
|
|
1784
1784
|
return function (arg) {
|
|
1785
|
-
var key =
|
|
1785
|
+
var key = typeof arg + ":" + arg;
|
|
1786
1786
|
var value = map.get(key);
|
|
1787
1787
|
if (value === undefined && !map.has(key)) {
|
|
1788
1788
|
value = callback(arg);
|
|
@@ -2232,7 +2232,7 @@ var ts;
|
|
|
2232
2232
|
ts.createGetCanonicalFileName = createGetCanonicalFileName;
|
|
2233
2233
|
function patternText(_a) {
|
|
2234
2234
|
var prefix = _a.prefix, suffix = _a.suffix;
|
|
2235
|
-
return
|
|
2235
|
+
return prefix + "*" + suffix;
|
|
2236
2236
|
}
|
|
2237
2237
|
ts.patternText = patternText;
|
|
2238
2238
|
/**
|
|
@@ -2545,7 +2545,7 @@ var ts;
|
|
|
2545
2545
|
}
|
|
2546
2546
|
function fail(message, stackCrawlMark) {
|
|
2547
2547
|
debugger;
|
|
2548
|
-
var e = new Error(message ? "Debug Failure. "
|
|
2548
|
+
var e = new Error(message ? "Debug Failure. " + message : "Debug Failure.");
|
|
2549
2549
|
if (Error.captureStackTrace) {
|
|
2550
2550
|
Error.captureStackTrace(e, stackCrawlMark || fail);
|
|
2551
2551
|
}
|
|
@@ -2553,12 +2553,12 @@ var ts;
|
|
|
2553
2553
|
}
|
|
2554
2554
|
Debug.fail = fail;
|
|
2555
2555
|
function failBadSyntaxKind(node, message, stackCrawlMark) {
|
|
2556
|
-
return fail(
|
|
2556
|
+
return fail((message || "Unexpected node.") + "\r\nNode " + formatSyntaxKind(node.kind) + " was unexpected.", stackCrawlMark || failBadSyntaxKind);
|
|
2557
2557
|
}
|
|
2558
2558
|
Debug.failBadSyntaxKind = failBadSyntaxKind;
|
|
2559
2559
|
function assert(expression, message, verboseDebugInfo, stackCrawlMark) {
|
|
2560
2560
|
if (!expression) {
|
|
2561
|
-
message = message ? "False expression: "
|
|
2561
|
+
message = message ? "False expression: " + message : "False expression.";
|
|
2562
2562
|
if (verboseDebugInfo) {
|
|
2563
2563
|
message += "\r\nVerbose Debug Information: " + (typeof verboseDebugInfo === "string" ? verboseDebugInfo : verboseDebugInfo());
|
|
2564
2564
|
}
|
|
@@ -2568,26 +2568,26 @@ var ts;
|
|
|
2568
2568
|
Debug.assert = assert;
|
|
2569
2569
|
function assertEqual(a, b, msg, msg2, stackCrawlMark) {
|
|
2570
2570
|
if (a !== b) {
|
|
2571
|
-
var message = msg ? msg2 ?
|
|
2572
|
-
fail("Expected "
|
|
2571
|
+
var message = msg ? msg2 ? msg + " " + msg2 : msg : "";
|
|
2572
|
+
fail("Expected " + a + " === " + b + ". " + message, stackCrawlMark || assertEqual);
|
|
2573
2573
|
}
|
|
2574
2574
|
}
|
|
2575
2575
|
Debug.assertEqual = assertEqual;
|
|
2576
2576
|
function assertLessThan(a, b, msg, stackCrawlMark) {
|
|
2577
2577
|
if (a >= b) {
|
|
2578
|
-
fail("Expected "
|
|
2578
|
+
fail("Expected " + a + " < " + b + ". " + (msg || ""), stackCrawlMark || assertLessThan);
|
|
2579
2579
|
}
|
|
2580
2580
|
}
|
|
2581
2581
|
Debug.assertLessThan = assertLessThan;
|
|
2582
2582
|
function assertLessThanOrEqual(a, b, stackCrawlMark) {
|
|
2583
2583
|
if (a > b) {
|
|
2584
|
-
fail("Expected "
|
|
2584
|
+
fail("Expected " + a + " <= " + b, stackCrawlMark || assertLessThanOrEqual);
|
|
2585
2585
|
}
|
|
2586
2586
|
}
|
|
2587
2587
|
Debug.assertLessThanOrEqual = assertLessThanOrEqual;
|
|
2588
2588
|
function assertGreaterThanOrEqual(a, b, stackCrawlMark) {
|
|
2589
2589
|
if (a < b) {
|
|
2590
|
-
fail("Expected "
|
|
2590
|
+
fail("Expected " + a + " >= " + b, stackCrawlMark || assertGreaterThanOrEqual);
|
|
2591
2591
|
}
|
|
2592
2592
|
}
|
|
2593
2593
|
Debug.assertGreaterThanOrEqual = assertGreaterThanOrEqual;
|
|
@@ -2618,42 +2618,42 @@ var ts;
|
|
|
2618
2618
|
function assertNever(member, message, stackCrawlMark) {
|
|
2619
2619
|
if (message === void 0) { message = "Illegal value:"; }
|
|
2620
2620
|
var detail = typeof member === "object" && ts.hasProperty(member, "kind") && ts.hasProperty(member, "pos") && formatSyntaxKind ? "SyntaxKind: " + formatSyntaxKind(member.kind) : JSON.stringify(member);
|
|
2621
|
-
return fail(
|
|
2621
|
+
return fail(message + " " + detail, stackCrawlMark || assertNever);
|
|
2622
2622
|
}
|
|
2623
2623
|
Debug.assertNever = assertNever;
|
|
2624
2624
|
function assertEachNode(nodes, test, message, stackCrawlMark) {
|
|
2625
2625
|
if (shouldAssertFunction(1 /* Normal */, "assertEachNode")) {
|
|
2626
|
-
assert(test === undefined || ts.every(nodes, test), message || "Unexpected node.", function () { return "Node array did not pass test '"
|
|
2626
|
+
assert(test === undefined || ts.every(nodes, test), message || "Unexpected node.", function () { return "Node array did not pass test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertEachNode);
|
|
2627
2627
|
}
|
|
2628
2628
|
}
|
|
2629
2629
|
Debug.assertEachNode = assertEachNode;
|
|
2630
2630
|
function assertNode(node, test, message, stackCrawlMark) {
|
|
2631
2631
|
if (shouldAssertFunction(1 /* Normal */, "assertNode")) {
|
|
2632
|
-
assert(node !== undefined && (test === undefined || test(node)), message || "Unexpected node.", function () { return "Node "
|
|
2632
|
+
assert(node !== undefined && (test === undefined || test(node)), message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind) + " did not pass test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertNode);
|
|
2633
2633
|
}
|
|
2634
2634
|
}
|
|
2635
2635
|
Debug.assertNode = assertNode;
|
|
2636
2636
|
function assertNotNode(node, test, message, stackCrawlMark) {
|
|
2637
2637
|
if (shouldAssertFunction(1 /* Normal */, "assertNotNode")) {
|
|
2638
|
-
assert(node === undefined || test === undefined || !test(node), message || "Unexpected node.", function () { return "Node "
|
|
2638
|
+
assert(node === undefined || test === undefined || !test(node), message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node.kind) + " should not have passed test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertNotNode);
|
|
2639
2639
|
}
|
|
2640
2640
|
}
|
|
2641
2641
|
Debug.assertNotNode = assertNotNode;
|
|
2642
2642
|
function assertOptionalNode(node, test, message, stackCrawlMark) {
|
|
2643
2643
|
if (shouldAssertFunction(1 /* Normal */, "assertOptionalNode")) {
|
|
2644
|
-
assert(test === undefined || node === undefined || test(node), message || "Unexpected node.", function () { return "Node "
|
|
2644
|
+
assert(test === undefined || node === undefined || test(node), message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind) + " did not pass test '" + getFunctionName(test) + "'."; }, stackCrawlMark || assertOptionalNode);
|
|
2645
2645
|
}
|
|
2646
2646
|
}
|
|
2647
2647
|
Debug.assertOptionalNode = assertOptionalNode;
|
|
2648
2648
|
function assertOptionalToken(node, kind, message, stackCrawlMark) {
|
|
2649
2649
|
if (shouldAssertFunction(1 /* Normal */, "assertOptionalToken")) {
|
|
2650
|
-
assert(kind === undefined || node === undefined || node.kind === kind, message || "Unexpected node.", function () { return "Node "
|
|
2650
|
+
assert(kind === undefined || node === undefined || node.kind === kind, message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind) + " was not a '" + formatSyntaxKind(kind) + "' token."; }, stackCrawlMark || assertOptionalToken);
|
|
2651
2651
|
}
|
|
2652
2652
|
}
|
|
2653
2653
|
Debug.assertOptionalToken = assertOptionalToken;
|
|
2654
2654
|
function assertMissingNode(node, message, stackCrawlMark) {
|
|
2655
2655
|
if (shouldAssertFunction(1 /* Normal */, "assertMissingNode")) {
|
|
2656
|
-
assert(node === undefined, message || "Unexpected node.", function () { return "Node "
|
|
2656
|
+
assert(node === undefined, message || "Unexpected node.", function () { return "Node " + formatSyntaxKind(node.kind) + " was unexpected'."; }, stackCrawlMark || assertMissingNode);
|
|
2657
2657
|
}
|
|
2658
2658
|
}
|
|
2659
2659
|
Debug.assertMissingNode = assertMissingNode;
|
|
@@ -2674,7 +2674,7 @@ var ts;
|
|
|
2674
2674
|
}
|
|
2675
2675
|
Debug.getFunctionName = getFunctionName;
|
|
2676
2676
|
function formatSymbol(symbol) {
|
|
2677
|
-
return "{ name: "
|
|
2677
|
+
return "{ name: " + ts.unescapeLeadingUnderscores(symbol.escapedName) + "; flags: " + formatSymbolFlags(symbol.flags) + "; declarations: " + ts.map(symbol.declarations, function (node) { return formatSyntaxKind(node.kind); }) + " }";
|
|
2678
2678
|
}
|
|
2679
2679
|
Debug.formatSymbol = formatSymbol;
|
|
2680
2680
|
/**
|
|
@@ -2695,7 +2695,7 @@ var ts;
|
|
|
2695
2695
|
break;
|
|
2696
2696
|
}
|
|
2697
2697
|
if (enumValue !== 0 && enumValue & value) {
|
|
2698
|
-
result = ""
|
|
2698
|
+
result = "" + result + (result ? "|" : "") + enumName;
|
|
2699
2699
|
remainingFlags &= ~enumValue;
|
|
2700
2700
|
}
|
|
2701
2701
|
}
|
|
@@ -2805,7 +2805,7 @@ var ts;
|
|
|
2805
2805
|
this.flags & 1 /* Unreachable */ ? "FlowUnreachable" :
|
|
2806
2806
|
"UnknownFlow";
|
|
2807
2807
|
var remainingFlags = this.flags & ~(2048 /* Referenced */ - 1);
|
|
2808
|
-
return ""
|
|
2808
|
+
return "" + flowHeader + (remainingFlags ? " (" + formatFlowFlags(remainingFlags) + ")" : "");
|
|
2809
2809
|
}
|
|
2810
2810
|
},
|
|
2811
2811
|
__debugFlowFlags: { get: function () { return formatEnum(this.flags, ts.FlowFlags, /*isFlags*/ true); } },
|
|
@@ -2844,7 +2844,7 @@ var ts;
|
|
|
2844
2844
|
// We don't care, this is debug code that's only enabled with a debugger attached -
|
|
2845
2845
|
// we're just taking note of it for anyone checking regex performance in the future.
|
|
2846
2846
|
defaultValue = String(defaultValue).replace(/(?:,[\s\w\d_]+:[^,]+)+\]$/, "]");
|
|
2847
|
-
return "NodeArray "
|
|
2847
|
+
return "NodeArray " + defaultValue;
|
|
2848
2848
|
}
|
|
2849
2849
|
}
|
|
2850
2850
|
});
|
|
@@ -2899,7 +2899,7 @@ var ts;
|
|
|
2899
2899
|
var symbolHeader = this.flags & 33554432 /* Transient */ ? "TransientSymbol" :
|
|
2900
2900
|
"Symbol";
|
|
2901
2901
|
var remainingSymbolFlags = this.flags & ~33554432 /* Transient */;
|
|
2902
|
-
return
|
|
2902
|
+
return symbolHeader + " '" + ts.symbolName(this) + "'" + (remainingSymbolFlags ? " (" + formatSymbolFlags(remainingSymbolFlags) + ")" : "");
|
|
2903
2903
|
}
|
|
2904
2904
|
},
|
|
2905
2905
|
__debugFlags: { get: function () { return formatSymbolFlags(this.flags); } }
|
|
@@ -2909,11 +2909,11 @@ var ts;
|
|
|
2909
2909
|
__tsDebuggerDisplay: {
|
|
2910
2910
|
value: function () {
|
|
2911
2911
|
var typeHeader = this.flags & 98304 /* Nullable */ ? "NullableType" :
|
|
2912
|
-
this.flags & 384 /* StringOrNumberLiteral */ ? "LiteralType "
|
|
2913
|
-
this.flags & 2048 /* BigIntLiteral */ ? "LiteralType "
|
|
2912
|
+
this.flags & 384 /* StringOrNumberLiteral */ ? "LiteralType " + JSON.stringify(this.value) :
|
|
2913
|
+
this.flags & 2048 /* BigIntLiteral */ ? "LiteralType " + (this.value.negative ? "-" : "") + this.value.base10Value + "n" :
|
|
2914
2914
|
this.flags & 8192 /* UniqueESSymbol */ ? "UniqueESSymbolType" :
|
|
2915
2915
|
this.flags & 32 /* Enum */ ? "EnumType" :
|
|
2916
|
-
this.flags & 67359327 /* Intrinsic */ ? "IntrinsicType "
|
|
2916
|
+
this.flags & 67359327 /* Intrinsic */ ? "IntrinsicType " + this.intrinsicName :
|
|
2917
2917
|
this.flags & 1048576 /* Union */ ? "UnionType" :
|
|
2918
2918
|
this.flags & 2097152 /* Intersection */ ? "IntersectionType" :
|
|
2919
2919
|
this.flags & 4194304 /* Index */ ? "IndexType" :
|
|
@@ -2932,7 +2932,7 @@ var ts;
|
|
|
2932
2932
|
"ObjectType" :
|
|
2933
2933
|
"Type";
|
|
2934
2934
|
var remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~1343 /* ObjectTypeKindMask */ : 0;
|
|
2935
|
-
return ""
|
|
2935
|
+
return "" + typeHeader + (this.symbol ? " '" + ts.symbolName(this.symbol) + "'" : "") + (remainingObjectFlags ? " (" + formatObjectFlags(remainingObjectFlags) + ")" : "");
|
|
2936
2936
|
}
|
|
2937
2937
|
},
|
|
2938
2938
|
__debugFlags: { get: function () { return formatTypeFlags(this.flags); } },
|
|
@@ -2968,11 +2968,11 @@ var ts;
|
|
|
2968
2968
|
__tsDebuggerDisplay: {
|
|
2969
2969
|
value: function () {
|
|
2970
2970
|
var nodeHeader = ts.isGeneratedIdentifier(this) ? "GeneratedIdentifier" :
|
|
2971
|
-
ts.isIdentifier(this) ? "Identifier '"
|
|
2972
|
-
ts.isPrivateIdentifier(this) ? "PrivateIdentifier '"
|
|
2973
|
-
ts.isStringLiteral(this) ? "StringLiteral "
|
|
2974
|
-
ts.isNumericLiteral(this) ? "NumericLiteral "
|
|
2975
|
-
ts.isBigIntLiteral(this) ? "BigIntLiteral "
|
|
2971
|
+
ts.isIdentifier(this) ? "Identifier '" + ts.idText(this) + "'" :
|
|
2972
|
+
ts.isPrivateIdentifier(this) ? "PrivateIdentifier '" + ts.idText(this) + "'" :
|
|
2973
|
+
ts.isStringLiteral(this) ? "StringLiteral " + JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + "...") :
|
|
2974
|
+
ts.isNumericLiteral(this) ? "NumericLiteral " + this.text :
|
|
2975
|
+
ts.isBigIntLiteral(this) ? "BigIntLiteral " + this.text + "n" :
|
|
2976
2976
|
ts.isTypeParameterDeclaration(this) ? "TypeParameterDeclaration" :
|
|
2977
2977
|
ts.isParameter(this) ? "ParameterDeclaration" :
|
|
2978
2978
|
ts.isConstructorDeclaration(this) ? "ConstructorDeclaration" :
|
|
@@ -3004,7 +3004,7 @@ var ts;
|
|
|
3004
3004
|
ts.isNamedTupleMember(this) ? "NamedTupleMember" :
|
|
3005
3005
|
ts.isImportTypeNode(this) ? "ImportTypeNode" :
|
|
3006
3006
|
formatSyntaxKind(this.kind);
|
|
3007
|
-
return ""
|
|
3007
|
+
return "" + nodeHeader + (this.flags ? " (" + formatNodeFlags(this.flags) + ")" : "");
|
|
3008
3008
|
}
|
|
3009
3009
|
},
|
|
3010
3010
|
__debugKind: { get: function () { return formatSyntaxKind(this.kind); } },
|
|
@@ -3051,10 +3051,10 @@ var ts;
|
|
|
3051
3051
|
Debug.enableDebugInfo = enableDebugInfo;
|
|
3052
3052
|
function formatDeprecationMessage(name, error, errorAfter, since, message) {
|
|
3053
3053
|
var deprecationMessage = error ? "DeprecationError: " : "DeprecationWarning: ";
|
|
3054
|
-
deprecationMessage += "'"
|
|
3055
|
-
deprecationMessage += since ? "has been deprecated since v"
|
|
3056
|
-
deprecationMessage += error ? " and can no longer be used." : errorAfter ? " and will no longer be usable after v"
|
|
3057
|
-
deprecationMessage += message ? " "
|
|
3054
|
+
deprecationMessage += "'" + name + "' ";
|
|
3055
|
+
deprecationMessage += since ? "has been deprecated since v" + since : "is deprecated";
|
|
3056
|
+
deprecationMessage += error ? " and can no longer be used." : errorAfter ? " and will no longer be usable after v" + errorAfter + "." : ".";
|
|
3057
|
+
deprecationMessage += message ? " " + ts.formatStringFromArgs(message, [name], 0) : "";
|
|
3058
3058
|
return deprecationMessage;
|
|
3059
3059
|
}
|
|
3060
3060
|
function createErrorDeprecation(name, errorAfter, since, message) {
|
|
@@ -3185,11 +3185,11 @@ var ts;
|
|
|
3185
3185
|
}
|
|
3186
3186
|
};
|
|
3187
3187
|
Version.prototype.toString = function () {
|
|
3188
|
-
var result =
|
|
3188
|
+
var result = this.major + "." + this.minor + "." + this.patch;
|
|
3189
3189
|
if (ts.some(this.prerelease))
|
|
3190
|
-
result += "-"
|
|
3190
|
+
result += "-" + this.prerelease.join(".");
|
|
3191
3191
|
if (ts.some(this.build))
|
|
3192
|
-
result += "+"
|
|
3192
|
+
result += "+" + this.build.join(".");
|
|
3193
3193
|
return result;
|
|
3194
3194
|
};
|
|
3195
3195
|
Version.zero = new Version(0, 0, 0);
|
|
@@ -3456,7 +3456,7 @@ var ts;
|
|
|
3456
3456
|
return ts.map(comparators, formatComparator).join(" ");
|
|
3457
3457
|
}
|
|
3458
3458
|
function formatComparator(comparator) {
|
|
3459
|
-
return ""
|
|
3459
|
+
return "" + comparator.operator + comparator.operand;
|
|
3460
3460
|
}
|
|
3461
3461
|
})(ts || (ts = {}));
|
|
3462
3462
|
/*@internal*/
|
|
@@ -3754,7 +3754,7 @@ var ts;
|
|
|
3754
3754
|
fs = require("fs");
|
|
3755
3755
|
}
|
|
3756
3756
|
catch (e) {
|
|
3757
|
-
throw new Error("tracing requires having fs\n(original error: "
|
|
3757
|
+
throw new Error("tracing requires having fs\n(original error: " + (e.message || e) + ")");
|
|
3758
3758
|
}
|
|
3759
3759
|
}
|
|
3760
3760
|
mode = tracingMode;
|
|
@@ -3766,11 +3766,11 @@ var ts;
|
|
|
3766
3766
|
if (!fs.existsSync(traceDir)) {
|
|
3767
3767
|
fs.mkdirSync(traceDir, { recursive: true });
|
|
3768
3768
|
}
|
|
3769
|
-
var countPart = mode === "build" ? "."
|
|
3770
|
-
: mode === "server" ? "."
|
|
3769
|
+
var countPart = mode === "build" ? "." + process.pid + "-" + ++traceCount
|
|
3770
|
+
: mode === "server" ? "." + process.pid
|
|
3771
3771
|
: "";
|
|
3772
|
-
var tracePath = ts.combinePaths(traceDir, "trace"
|
|
3773
|
-
var typesPath = ts.combinePaths(traceDir, "types"
|
|
3772
|
+
var tracePath = ts.combinePaths(traceDir, "trace" + countPart + ".json");
|
|
3773
|
+
var typesPath = ts.combinePaths(traceDir, "types" + countPart + ".json");
|
|
3774
3774
|
legend.push({
|
|
3775
3775
|
configFilePath: configFilePath,
|
|
3776
3776
|
tracePath: tracePath,
|
|
@@ -3860,7 +3860,7 @@ var ts;
|
|
|
3860
3860
|
}
|
|
3861
3861
|
// test if [time,endTime) straddles a sampling point
|
|
3862
3862
|
else if (sampleInterval - (time % sampleInterval) <= endTime - time) {
|
|
3863
|
-
writeEvent("X", phase, name, args, "\"dur\":"
|
|
3863
|
+
writeEvent("X", phase, name, args, "\"dur\":" + (endTime - time), time);
|
|
3864
3864
|
}
|
|
3865
3865
|
}
|
|
3866
3866
|
function writeEvent(eventType, phase, name, args, extras, time) {
|
|
@@ -3869,11 +3869,11 @@ var ts;
|
|
|
3869
3869
|
if (mode === "server" && phase === "checkTypes" /* CheckTypes */)
|
|
3870
3870
|
return;
|
|
3871
3871
|
ts.performance.mark("beginTracing");
|
|
3872
|
-
fs.writeSync(traceFd, ",\n{\"pid\":1,\"tid\":1,\"ph\":\""
|
|
3872
|
+
fs.writeSync(traceFd, ",\n{\"pid\":1,\"tid\":1,\"ph\":\"" + eventType + "\",\"cat\":\"" + phase + "\",\"ts\":" + time + ",\"name\":\"" + name + "\"");
|
|
3873
3873
|
if (extras)
|
|
3874
|
-
fs.writeSync(traceFd, ","
|
|
3874
|
+
fs.writeSync(traceFd, "," + extras);
|
|
3875
3875
|
if (args)
|
|
3876
|
-
fs.writeSync(traceFd, ",\"args\":"
|
|
3876
|
+
fs.writeSync(traceFd, ",\"args\":" + JSON.stringify(args));
|
|
3877
3877
|
fs.writeSync(traceFd, "}");
|
|
3878
3878
|
ts.performance.mark("endTracing");
|
|
3879
3879
|
ts.performance.measure("Tracing", "beginTracing", "endTracing");
|
|
@@ -5986,7 +5986,7 @@ var ts;
|
|
|
5986
5986
|
pollingChunkSize = getCustomPollingBasedLevels("TSC_WATCH_POLLINGCHUNKSIZE", defaultChunkLevels) || pollingChunkSize;
|
|
5987
5987
|
ts.unchangedPollThresholds = getCustomPollingBasedLevels("TSC_WATCH_UNCHANGEDPOLLTHRESHOLDS", defaultChunkLevels) || ts.unchangedPollThresholds;
|
|
5988
5988
|
function getLevel(envVar, level) {
|
|
5989
|
-
return system.getEnvironmentVariable(
|
|
5989
|
+
return system.getEnvironmentVariable(envVar + "_" + level.toUpperCase());
|
|
5990
5990
|
}
|
|
5991
5991
|
function getCustomLevels(baseVariable) {
|
|
5992
5992
|
var customLevels;
|
|
@@ -6455,7 +6455,7 @@ var ts;
|
|
|
6455
6455
|
}
|
|
6456
6456
|
function onTimerToUpdateChildWatches() {
|
|
6457
6457
|
timerToUpdateChildWatches = undefined;
|
|
6458
|
-
sysLog("sysLog:: onTimerToUpdateChildWatches:: "
|
|
6458
|
+
sysLog("sysLog:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size);
|
|
6459
6459
|
var start = ts.timestamp();
|
|
6460
6460
|
var invokeMap = new ts.Map();
|
|
6461
6461
|
while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) {
|
|
@@ -6468,7 +6468,7 @@ var ts;
|
|
|
6468
6468
|
var hasChanges = updateChildWatches(dirName, dirPath, options);
|
|
6469
6469
|
invokeCallbacks(dirPath, invokeMap, hasChanges ? undefined : fileNames);
|
|
6470
6470
|
}
|
|
6471
|
-
sysLog("sysLog:: invokingWatchers:: Elapsed:: "
|
|
6471
|
+
sysLog("sysLog:: invokingWatchers:: Elapsed:: " + (ts.timestamp() - start) + "ms:: " + cacheToUpdateChildWatches.size);
|
|
6472
6472
|
callbackCache.forEach(function (callbacks, rootDirName) {
|
|
6473
6473
|
var existing = invokeMap.get(rootDirName);
|
|
6474
6474
|
if (existing) {
|
|
@@ -6484,7 +6484,7 @@ var ts;
|
|
|
6484
6484
|
}
|
|
6485
6485
|
});
|
|
6486
6486
|
var elapsed = ts.timestamp() - start;
|
|
6487
|
-
sysLog("sysLog:: Elapsed:: "
|
|
6487
|
+
sysLog("sysLog:: Elapsed:: " + elapsed + "ms:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size + " " + timerToUpdateChildWatches);
|
|
6488
6488
|
}
|
|
6489
6489
|
function removeChildWatches(parentWatcher) {
|
|
6490
6490
|
if (!parentWatcher)
|
|
@@ -6944,7 +6944,7 @@ var ts;
|
|
|
6944
6944
|
var remappedPaths = new ts.Map();
|
|
6945
6945
|
var normalizedDir = ts.normalizeSlashes(__dirname);
|
|
6946
6946
|
// Windows rooted dir names need an extra `/` prepended to be valid file:/// urls
|
|
6947
|
-
var fileUrlRoot = "file://"
|
|
6947
|
+
var fileUrlRoot = "file://" + (ts.getRootLength(normalizedDir) === 1 ? "" : "/") + normalizedDir;
|
|
6948
6948
|
for (var _i = 0, _a = profile.nodes; _i < _a.length; _i++) {
|
|
6949
6949
|
var node = _a[_i];
|
|
6950
6950
|
if (node.callFrame.url) {
|
|
@@ -6953,7 +6953,7 @@ var ts;
|
|
|
6953
6953
|
node.callFrame.url = ts.getRelativePathToDirectoryOrUrl(fileUrlRoot, url, fileUrlRoot, ts.createGetCanonicalFileName(useCaseSensitiveFileNames), /*isAbsolutePathAnUrl*/ true);
|
|
6954
6954
|
}
|
|
6955
6955
|
else if (!nativePattern.test(url)) {
|
|
6956
|
-
node.callFrame.url = (remappedPaths.has(url) ? remappedPaths : remappedPaths.set(url, "external"
|
|
6956
|
+
node.callFrame.url = (remappedPaths.has(url) ? remappedPaths : remappedPaths.set(url, "external" + externalFileCounter + ".js")).get(url);
|
|
6957
6957
|
externalFileCounter++;
|
|
6958
6958
|
}
|
|
6959
6959
|
}
|
|
@@ -6969,7 +6969,7 @@ var ts;
|
|
|
6969
6969
|
if (!err) {
|
|
6970
6970
|
try {
|
|
6971
6971
|
if ((_b = statSync(profilePath)) === null || _b === void 0 ? void 0 : _b.isDirectory()) {
|
|
6972
|
-
profilePath = _path.join(profilePath,
|
|
6972
|
+
profilePath = _path.join(profilePath, (new Date()).toISOString().replace(/:/g, "-") + "+P" + process.pid + ".cpuprofile");
|
|
6973
6973
|
}
|
|
6974
6974
|
}
|
|
6975
6975
|
catch (_c) {
|
|
@@ -7071,7 +7071,7 @@ var ts;
|
|
|
7071
7071
|
* @param createWatcher
|
|
7072
7072
|
*/
|
|
7073
7073
|
function invokeCallbackAndUpdateWatcher(createWatcher) {
|
|
7074
|
-
sysLog("sysLog:: "
|
|
7074
|
+
sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher");
|
|
7075
7075
|
// Call the callback for current directory
|
|
7076
7076
|
callback("rename", "");
|
|
7077
7077
|
// If watcher is not closed, update it
|
|
@@ -7096,7 +7096,7 @@ var ts;
|
|
|
7096
7096
|
}
|
|
7097
7097
|
}
|
|
7098
7098
|
if (hitSystemWatcherLimit) {
|
|
7099
|
-
sysLog("sysLog:: "
|
|
7099
|
+
sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to fsWatchFile");
|
|
7100
7100
|
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
7101
7101
|
}
|
|
7102
7102
|
try {
|
|
@@ -7112,7 +7112,7 @@ var ts;
|
|
|
7112
7112
|
// Eg. on linux the number of watches are limited and one could easily exhaust watches and the exception ENOSPC is thrown when creating watcher at that point
|
|
7113
7113
|
// so instead of throwing error, use fs.watchFile
|
|
7114
7114
|
hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC");
|
|
7115
|
-
sysLog("sysLog:: "
|
|
7115
|
+
sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
|
|
7116
7116
|
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
7117
7117
|
}
|
|
7118
7118
|
}
|
|
@@ -7830,18 +7830,6 @@ var ts;
|
|
|
7830
7830
|
return getCanonicalFileName(nonCanonicalizedPath);
|
|
7831
7831
|
}
|
|
7832
7832
|
ts.toPath = toPath;
|
|
7833
|
-
function normalizePathAndParts(path) {
|
|
7834
|
-
path = normalizeSlashes(path);
|
|
7835
|
-
var _a = reducePathComponents(getPathComponents(path)), root = _a[0], parts = _a.slice(1);
|
|
7836
|
-
if (parts.length) {
|
|
7837
|
-
var joinedParts = root + parts.join(ts.directorySeparator);
|
|
7838
|
-
return { path: hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(joinedParts) : joinedParts, parts: parts };
|
|
7839
|
-
}
|
|
7840
|
-
else {
|
|
7841
|
-
return { path: root, parts: parts };
|
|
7842
|
-
}
|
|
7843
|
-
}
|
|
7844
|
-
ts.normalizePathAndParts = normalizePathAndParts;
|
|
7845
7833
|
function removeTrailingDirectorySeparator(path) {
|
|
7846
7834
|
if (hasTrailingDirectorySeparator(path)) {
|
|
7847
7835
|
return path.substr(0, path.length - 1);
|
|
@@ -10127,7 +10115,7 @@ var ts;
|
|
|
10127
10115
|
line = line < 0 ? 0 : line >= lineStarts.length ? lineStarts.length - 1 : line;
|
|
10128
10116
|
}
|
|
10129
10117
|
else {
|
|
10130
|
-
ts.Debug.fail("Bad line number. Line: "
|
|
10118
|
+
ts.Debug.fail("Bad line number. Line: " + line + ", lineStarts.length: " + lineStarts.length + " , line map is correct? " + (debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown"));
|
|
10131
10119
|
}
|
|
10132
10120
|
}
|
|
10133
10121
|
var res = lineStarts[line] + character;
|
|
@@ -13017,7 +13005,7 @@ var ts;
|
|
|
13017
13005
|
: "linkplain";
|
|
13018
13006
|
var name = link.name ? ts.entityNameToString(link.name) : "";
|
|
13019
13007
|
var space = link.name && link.text.startsWith("://") ? "" : " ";
|
|
13020
|
-
return "{@"
|
|
13008
|
+
return "{@" + kind + " " + name + space + link.text + "}";
|
|
13021
13009
|
}
|
|
13022
13010
|
/**
|
|
13023
13011
|
* Gets the effective type parameters. If the node was parsed in a
|
|
@@ -14274,11 +14262,11 @@ var ts;
|
|
|
14274
14262
|
}
|
|
14275
14263
|
function packageIdToPackageName(_a) {
|
|
14276
14264
|
var name = _a.name, subModuleName = _a.subModuleName;
|
|
14277
|
-
return subModuleName ?
|
|
14265
|
+
return subModuleName ? name + "/" + subModuleName : name;
|
|
14278
14266
|
}
|
|
14279
14267
|
ts.packageIdToPackageName = packageIdToPackageName;
|
|
14280
14268
|
function packageIdToString(packageId) {
|
|
14281
|
-
return
|
|
14269
|
+
return packageIdToPackageName(packageId) + "@" + packageId.version;
|
|
14282
14270
|
}
|
|
14283
14271
|
ts.packageIdToString = packageIdToString;
|
|
14284
14272
|
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
|
|
@@ -14361,7 +14349,7 @@ var ts;
|
|
|
14361
14349
|
function nodePosToString(node) {
|
|
14362
14350
|
var file = getSourceFileOfNode(node);
|
|
14363
14351
|
var loc = ts.getLineAndCharacterOfPosition(file, node.pos);
|
|
14364
|
-
return
|
|
14352
|
+
return file.fileName + "(" + (loc.line + 1) + "," + (loc.character + 1) + ")";
|
|
14365
14353
|
}
|
|
14366
14354
|
ts.nodePosToString = nodePosToString;
|
|
14367
14355
|
function getEndLinePosition(line, sourceFile) {
|
|
@@ -14500,7 +14488,7 @@ var ts;
|
|
|
14500
14488
|
ts.isPinnedComment = isPinnedComment;
|
|
14501
14489
|
function createCommentDirectivesMap(sourceFile, commentDirectives) {
|
|
14502
14490
|
var directivesByLine = new ts.Map(commentDirectives.map(function (commentDirective) { return ([
|
|
14503
|
-
""
|
|
14491
|
+
"" + ts.getLineAndCharacterOfPosition(sourceFile, commentDirective.range.end).line,
|
|
14504
14492
|
commentDirective,
|
|
14505
14493
|
]); }));
|
|
14506
14494
|
var usedLines = new ts.Map();
|
|
@@ -14517,10 +14505,10 @@ var ts;
|
|
|
14517
14505
|
});
|
|
14518
14506
|
}
|
|
14519
14507
|
function markUsed(line) {
|
|
14520
|
-
if (!directivesByLine.has(""
|
|
14508
|
+
if (!directivesByLine.has("" + line)) {
|
|
14521
14509
|
return false;
|
|
14522
14510
|
}
|
|
14523
|
-
usedLines.set(""
|
|
14511
|
+
usedLines.set("" + line, true);
|
|
14524
14512
|
return true;
|
|
14525
14513
|
}
|
|
14526
14514
|
}
|
|
@@ -14750,7 +14738,7 @@ var ts;
|
|
|
14750
14738
|
}
|
|
14751
14739
|
return node.text;
|
|
14752
14740
|
}
|
|
14753
|
-
return ts.Debug.fail("Literal kind '"
|
|
14741
|
+
return ts.Debug.fail("Literal kind '" + node.kind + "' not accounted for.");
|
|
14754
14742
|
}
|
|
14755
14743
|
ts.getLiteralText = getLiteralText;
|
|
14756
14744
|
function canUseOriginalText(node, flags) {
|
|
@@ -17331,11 +17319,11 @@ var ts;
|
|
|
17331
17319
|
}
|
|
17332
17320
|
ts.getEscapedTextOfIdentifierOrLiteral = getEscapedTextOfIdentifierOrLiteral;
|
|
17333
17321
|
function getPropertyNameForUniqueESSymbol(symbol) {
|
|
17334
|
-
return "__@"
|
|
17322
|
+
return "__@" + ts.getSymbolId(symbol) + "@" + symbol.escapedName;
|
|
17335
17323
|
}
|
|
17336
17324
|
ts.getPropertyNameForUniqueESSymbol = getPropertyNameForUniqueESSymbol;
|
|
17337
17325
|
function getSymbolNameForPrivateIdentifier(containingClassSymbol, description) {
|
|
17338
|
-
return "__#"
|
|
17326
|
+
return "__#" + ts.getSymbolId(containingClassSymbol) + "@" + description;
|
|
17339
17327
|
}
|
|
17340
17328
|
ts.getSymbolNameForPrivateIdentifier = getSymbolNameForPrivateIdentifier;
|
|
17341
17329
|
function isKnownSymbol(symbol) {
|
|
@@ -20037,7 +20025,7 @@ var ts;
|
|
|
20037
20025
|
}
|
|
20038
20026
|
ts.getJSXImplicitImportBase = getJSXImplicitImportBase;
|
|
20039
20027
|
function getJSXRuntimeImport(base, options) {
|
|
20040
|
-
return base ?
|
|
20028
|
+
return base ? base + "/" + (options.jsx === 5 /* ReactJSXDev */ ? "jsx-dev-runtime" : "jsx-runtime") : undefined;
|
|
20041
20029
|
}
|
|
20042
20030
|
ts.getJSXRuntimeImport = getJSXRuntimeImport;
|
|
20043
20031
|
function hasZeroOrOneAsteriskCharacter(str) {
|
|
@@ -20144,7 +20132,7 @@ var ts;
|
|
|
20144
20132
|
}
|
|
20145
20133
|
var wildcardCharCodes = [42 /* asterisk */, 63 /* question */];
|
|
20146
20134
|
ts.commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"];
|
|
20147
|
-
var implicitExcludePathRegexPattern = "(?!("
|
|
20135
|
+
var implicitExcludePathRegexPattern = "(?!(" + ts.commonPackageFolders.join("|") + ")(/|$))";
|
|
20148
20136
|
var filesMatcher = {
|
|
20149
20137
|
/**
|
|
20150
20138
|
* Matches any single directory segment unless it is the last segment and a .min.js file
|
|
@@ -20157,7 +20145,7 @@ var ts;
|
|
|
20157
20145
|
* Regex for the ** wildcard. Matches any number of subdirectories. When used for including
|
|
20158
20146
|
* files or directories, does not match subdirectories that start with a . character
|
|
20159
20147
|
*/
|
|
20160
|
-
doubleAsteriskRegexFragment: "(/"
|
|
20148
|
+
doubleAsteriskRegexFragment: "(/" + implicitExcludePathRegexPattern + "[^/.][^/]*)*?",
|
|
20161
20149
|
replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment); }
|
|
20162
20150
|
};
|
|
20163
20151
|
var directoriesMatcher = {
|
|
@@ -20166,7 +20154,7 @@ var ts;
|
|
|
20166
20154
|
* Regex for the ** wildcard. Matches any number of subdirectories. When used for including
|
|
20167
20155
|
* files or directories, does not match subdirectories that start with a . character
|
|
20168
20156
|
*/
|
|
20169
|
-
doubleAsteriskRegexFragment: "(/"
|
|
20157
|
+
doubleAsteriskRegexFragment: "(/" + implicitExcludePathRegexPattern + "[^/.][^/]*)*?",
|
|
20170
20158
|
replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment); }
|
|
20171
20159
|
};
|
|
20172
20160
|
var excludeMatcher = {
|
|
@@ -20184,10 +20172,10 @@ var ts;
|
|
|
20184
20172
|
if (!patterns || !patterns.length) {
|
|
20185
20173
|
return undefined;
|
|
20186
20174
|
}
|
|
20187
|
-
var pattern = patterns.map(function (pattern) { return "("
|
|
20175
|
+
var pattern = patterns.map(function (pattern) { return "(" + pattern + ")"; }).join("|");
|
|
20188
20176
|
// If excluding, match "foo/bar/baz...", but if including, only allow "foo".
|
|
20189
20177
|
var terminator = usage === "exclude" ? "($|/)" : "$";
|
|
20190
|
-
return "^("
|
|
20178
|
+
return "^(" + pattern + ")" + terminator;
|
|
20191
20179
|
}
|
|
20192
20180
|
ts.getRegularExpressionForWildcard = getRegularExpressionForWildcard;
|
|
20193
20181
|
function getRegularExpressionsForWildcards(specs, basePath, usage) {
|
|
@@ -20209,7 +20197,7 @@ var ts;
|
|
|
20209
20197
|
ts.isImplicitGlob = isImplicitGlob;
|
|
20210
20198
|
function getPatternFromSpec(spec, basePath, usage) {
|
|
20211
20199
|
var pattern = spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage]);
|
|
20212
|
-
return pattern && "^("
|
|
20200
|
+
return pattern && "^(" + pattern + ")" + (usage === "exclude" ? "($|/)" : "$");
|
|
20213
20201
|
}
|
|
20214
20202
|
ts.getPatternFromSpec = getPatternFromSpec;
|
|
20215
20203
|
function getSubPatternFromSpec(spec, basePath, usage, _a) {
|
|
@@ -20287,7 +20275,7 @@ var ts;
|
|
|
20287
20275
|
currentDirectory = ts.normalizePath(currentDirectory);
|
|
20288
20276
|
var absolutePath = ts.combinePaths(currentDirectory, path);
|
|
20289
20277
|
return {
|
|
20290
|
-
includeFilePatterns: ts.map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^"
|
|
20278
|
+
includeFilePatterns: ts.map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^" + pattern + "$"; }),
|
|
20291
20279
|
includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"),
|
|
20292
20280
|
includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"),
|
|
20293
20281
|
excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"),
|
|
@@ -20568,7 +20556,7 @@ var ts;
|
|
|
20568
20556
|
*/
|
|
20569
20557
|
function extensionFromPath(path) {
|
|
20570
20558
|
var ext = tryGetExtensionFromPath(path);
|
|
20571
|
-
return ext !== undefined ? ext : ts.Debug.fail("File "
|
|
20559
|
+
return ext !== undefined ? ext : ts.Debug.fail("File " + path + " has unknown extension.");
|
|
20572
20560
|
}
|
|
20573
20561
|
ts.extensionFromPath = extensionFromPath;
|
|
20574
20562
|
function isAnySupportedFileExtension(path) {
|
|
@@ -26651,7 +26639,7 @@ var ts;
|
|
|
26651
26639
|
case 326 /* JSDocAugmentsTag */: return "augments";
|
|
26652
26640
|
case 327 /* JSDocImplementsTag */: return "implements";
|
|
26653
26641
|
default:
|
|
26654
|
-
return ts.Debug.fail("Unsupported kind: "
|
|
26642
|
+
return ts.Debug.fail("Unsupported kind: " + ts.Debug.formatSyntaxKind(kind));
|
|
26655
26643
|
}
|
|
26656
26644
|
}
|
|
26657
26645
|
var rawTextScanner;
|
|
@@ -26979,7 +26967,7 @@ var ts;
|
|
|
26979
26967
|
};
|
|
26980
26968
|
var definedTextGetter_1 = function (path) {
|
|
26981
26969
|
var result = textGetter_1(path);
|
|
26982
|
-
return result !== undefined ? result : "/* Input file "
|
|
26970
|
+
return result !== undefined ? result : "/* Input file " + path + " was missing */\r\n";
|
|
26983
26971
|
};
|
|
26984
26972
|
var buildInfo_1;
|
|
26985
26973
|
var getAndCacheBuildInfo_1 = function (getText) {
|
|
@@ -31517,7 +31505,7 @@ var ts;
|
|
|
31517
31505
|
for (var _i = 0, viableKeywordSuggestions_1 = viableKeywordSuggestions; _i < viableKeywordSuggestions_1.length; _i++) {
|
|
31518
31506
|
var keyword = viableKeywordSuggestions_1[_i];
|
|
31519
31507
|
if (expressionText.length > keyword.length + 2 && ts.startsWith(expressionText, keyword)) {
|
|
31520
|
-
return
|
|
31508
|
+
return keyword + " " + expressionText.slice(keyword.length);
|
|
31521
31509
|
}
|
|
31522
31510
|
}
|
|
31523
31511
|
return undefined;
|
|
@@ -38287,7 +38275,7 @@ var ts;
|
|
|
38287
38275
|
if (namedArgRegExCache.has(name)) {
|
|
38288
38276
|
return namedArgRegExCache.get(name);
|
|
38289
38277
|
}
|
|
38290
|
-
var result = new RegExp("(\\s"
|
|
38278
|
+
var result = new RegExp("(\\s" + name + "\\s*=\\s*)(?:(?:'([^']*)')|(?:\"([^\"]*)\"))", "im");
|
|
38291
38279
|
namedArgRegExCache.set(name, result);
|
|
38292
38280
|
return result;
|
|
38293
38281
|
}
|
|
@@ -39765,8 +39753,8 @@ var ts;
|
|
|
39765
39753
|
}
|
|
39766
39754
|
ts.createCompilerDiagnosticForInvalidCustomType = createCompilerDiagnosticForInvalidCustomType;
|
|
39767
39755
|
function createDiagnosticForInvalidCustomType(opt, createDiagnostic) {
|
|
39768
|
-
var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'"
|
|
39769
|
-
return createDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--"
|
|
39756
|
+
var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'" + key + "'"; }).join(", ");
|
|
39757
|
+
return createDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--" + opt.name, namesOfType);
|
|
39770
39758
|
}
|
|
39771
39759
|
/* @internal */
|
|
39772
39760
|
function parseCustomTypeOption(opt, value, errors) {
|
|
@@ -40560,10 +40548,10 @@ var ts;
|
|
|
40560
40548
|
var newValue = compilerOptionsMap.get(cmd.name);
|
|
40561
40549
|
var defaultValue = getDefaultValueForOption(cmd);
|
|
40562
40550
|
if (newValue !== defaultValue) {
|
|
40563
|
-
result.push(""
|
|
40551
|
+
result.push("" + tab + cmd.name + ": " + newValue);
|
|
40564
40552
|
}
|
|
40565
40553
|
else if (ts.hasProperty(ts.defaultInitCompilerOptions, cmd.name)) {
|
|
40566
|
-
result.push(""
|
|
40554
|
+
result.push("" + tab + cmd.name + ": " + defaultValue);
|
|
40567
40555
|
}
|
|
40568
40556
|
});
|
|
40569
40557
|
return result.join(newLine) + newLine;
|
|
@@ -40614,19 +40602,19 @@ var ts;
|
|
|
40614
40602
|
if (entries.length !== 0) {
|
|
40615
40603
|
entries.push({ value: "" });
|
|
40616
40604
|
}
|
|
40617
|
-
entries.push({ value: "/* "
|
|
40605
|
+
entries.push({ value: "/* " + category + " */" });
|
|
40618
40606
|
for (var _i = 0, options_1 = options; _i < options_1.length; _i++) {
|
|
40619
40607
|
var option = options_1[_i];
|
|
40620
40608
|
var optionName = void 0;
|
|
40621
40609
|
if (compilerOptionsMap.has(option.name)) {
|
|
40622
|
-
optionName = "\""
|
|
40610
|
+
optionName = "\"" + option.name + "\": " + JSON.stringify(compilerOptionsMap.get(option.name)) + ((seenKnownKeys += 1) === compilerOptionsMap.size ? "" : ",");
|
|
40623
40611
|
}
|
|
40624
40612
|
else {
|
|
40625
|
-
optionName = "// \""
|
|
40613
|
+
optionName = "// \"" + option.name + "\": " + JSON.stringify(getDefaultValueForOption(option)) + ",";
|
|
40626
40614
|
}
|
|
40627
40615
|
entries.push({
|
|
40628
40616
|
value: optionName,
|
|
40629
|
-
description: "/* "
|
|
40617
|
+
description: "/* " + (option.description && ts.getLocaleSpecificMessage(option.description) || option.name) + " */"
|
|
40630
40618
|
});
|
|
40631
40619
|
marginLength = Math.max(optionName.length, marginLength);
|
|
40632
40620
|
}
|
|
@@ -40635,25 +40623,25 @@ var ts;
|
|
|
40635
40623
|
var tab = makePadding(2);
|
|
40636
40624
|
var result = [];
|
|
40637
40625
|
result.push("{");
|
|
40638
|
-
result.push(
|
|
40639
|
-
result.push(""
|
|
40626
|
+
result.push(tab + "\"compilerOptions\": {");
|
|
40627
|
+
result.push("" + tab + tab + "/* " + ts.getLocaleSpecificMessage(ts.Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_json_to_read_more_about_this_file) + " */");
|
|
40640
40628
|
result.push("");
|
|
40641
40629
|
// Print out each row, aligning all the descriptions on the same column.
|
|
40642
40630
|
for (var _a = 0, entries_2 = entries; _a < entries_2.length; _a++) {
|
|
40643
40631
|
var entry = entries_2[_a];
|
|
40644
40632
|
var value = entry.value, _b = entry.description, description = _b === void 0 ? "" : _b;
|
|
40645
|
-
result.push(value && ""
|
|
40633
|
+
result.push(value && "" + tab + tab + value + (description && (makePadding(marginLength - value.length + 2) + description)));
|
|
40646
40634
|
}
|
|
40647
40635
|
if (fileNames.length) {
|
|
40648
|
-
result.push(
|
|
40649
|
-
result.push(
|
|
40636
|
+
result.push(tab + "},");
|
|
40637
|
+
result.push(tab + "\"files\": [");
|
|
40650
40638
|
for (var i = 0; i < fileNames.length; i++) {
|
|
40651
|
-
result.push(""
|
|
40639
|
+
result.push("" + tab + tab + JSON.stringify(fileNames[i]) + (i === fileNames.length - 1 ? "" : ","));
|
|
40652
40640
|
}
|
|
40653
|
-
result.push(
|
|
40641
|
+
result.push(tab + "]");
|
|
40654
40642
|
}
|
|
40655
40643
|
else {
|
|
40656
|
-
result.push(
|
|
40644
|
+
result.push(tab + "}");
|
|
40657
40645
|
}
|
|
40658
40646
|
result.push("}");
|
|
40659
40647
|
return result.join(newLine) + newLine;
|
|
@@ -41051,7 +41039,7 @@ var ts;
|
|
|
41051
41039
|
if (ts.isRootedDiskPath(extendedConfig) || ts.startsWith(extendedConfig, "./") || ts.startsWith(extendedConfig, "../")) {
|
|
41052
41040
|
var extendedConfigPath = ts.getNormalizedAbsolutePath(extendedConfig, basePath);
|
|
41053
41041
|
if (!host.fileExists(extendedConfigPath) && !ts.endsWith(extendedConfigPath, ".json" /* Json */)) {
|
|
41054
|
-
extendedConfigPath =
|
|
41042
|
+
extendedConfigPath = extendedConfigPath + ".json";
|
|
41055
41043
|
if (!host.fileExists(extendedConfigPath)) {
|
|
41056
41044
|
errors.push(createDiagnostic(ts.Diagnostics.File_0_not_found, extendedConfig));
|
|
41057
41045
|
return undefined;
|
|
@@ -41296,7 +41284,7 @@ var ts;
|
|
|
41296
41284
|
// Valid only if *.json specified
|
|
41297
41285
|
if (!jsonOnlyIncludeRegexes) {
|
|
41298
41286
|
var includes = validatedIncludeSpecs.filter(function (s) { return ts.endsWith(s, ".json" /* Json */); });
|
|
41299
|
-
var includeFilePatterns = ts.map(ts.getRegularExpressionsForWildcards(includes, basePath, "files"), function (pattern) { return "^"
|
|
41287
|
+
var includeFilePatterns = ts.map(ts.getRegularExpressionsForWildcards(includes, basePath, "files"), function (pattern) { return "^" + pattern + "$"; });
|
|
41300
41288
|
jsonOnlyIncludeRegexes = includeFilePatterns ? includeFilePatterns.map(function (pattern) { return ts.getRegexFromPattern(pattern, host.useCaseSensitiveFileNames); }) : ts.emptyArray;
|
|
41301
41289
|
}
|
|
41302
41290
|
var includeIndex = ts.findIndex(jsonOnlyIncludeRegexes, function (re) { return re.test(file); });
|
|
@@ -41732,7 +41720,7 @@ var ts;
|
|
|
41732
41720
|
var bestVersionKey = result.version, bestVersionPaths = result.paths;
|
|
41733
41721
|
if (typeof bestVersionPaths !== "object") {
|
|
41734
41722
|
if (state.traceEnabled) {
|
|
41735
|
-
trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, "typesVersions['"
|
|
41723
|
+
trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, "typesVersions['" + bestVersionKey + "']", "object", typeof bestVersionPaths);
|
|
41736
41724
|
}
|
|
41737
41725
|
return;
|
|
41738
41726
|
}
|
|
@@ -41915,7 +41903,7 @@ var ts;
|
|
|
41915
41903
|
result_4 = searchResult && searchResult.value;
|
|
41916
41904
|
}
|
|
41917
41905
|
else {
|
|
41918
|
-
var candidate =
|
|
41906
|
+
var candidate = normalizePathForCJSResolution(initialLocationForSecondaryLookup, typeReferenceDirectiveName).path;
|
|
41919
41907
|
result_4 = nodeLoadModuleByRelativeName(Extensions.DtsOnly, candidate, /*onlyRecordFailures*/ false, moduleResolutionState, /*considerPackageJson*/ true);
|
|
41920
41908
|
}
|
|
41921
41909
|
return resolvedTypeScriptOnly(result_4);
|
|
@@ -42139,7 +42127,7 @@ var ts;
|
|
|
42139
42127
|
};
|
|
42140
42128
|
return cache;
|
|
42141
42129
|
function getUnderlyingCacheKey(specifier, mode) {
|
|
42142
|
-
var result = mode === undefined ? specifier :
|
|
42130
|
+
var result = mode === undefined ? specifier : mode + "|" + specifier;
|
|
42143
42131
|
memoizedReverseKeys.set(result, [specifier, mode]);
|
|
42144
42132
|
return result;
|
|
42145
42133
|
}
|
|
@@ -42170,7 +42158,7 @@ var ts;
|
|
|
42170
42158
|
}
|
|
42171
42159
|
function getOrCreateCacheForModuleName(nonRelativeModuleName, mode, redirectedReference) {
|
|
42172
42160
|
ts.Debug.assert(!ts.isExternalModuleNameRelative(nonRelativeModuleName));
|
|
42173
|
-
return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, mode === undefined ? nonRelativeModuleName :
|
|
42161
|
+
return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, mode === undefined ? nonRelativeModuleName : mode + "|" + nonRelativeModuleName, createPerModuleNameCache);
|
|
42174
42162
|
}
|
|
42175
42163
|
function createPerModuleNameCache() {
|
|
42176
42164
|
var directoryPathMap = new ts.Map();
|
|
@@ -42317,10 +42305,10 @@ var ts;
|
|
|
42317
42305
|
result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
|
|
42318
42306
|
break;
|
|
42319
42307
|
default:
|
|
42320
|
-
return ts.Debug.fail("Unexpected moduleResolution: "
|
|
42308
|
+
return ts.Debug.fail("Unexpected moduleResolution: " + moduleResolution);
|
|
42321
42309
|
}
|
|
42322
42310
|
if (result && result.resolvedModule)
|
|
42323
|
-
ts.perfLogger.logInfoEvent("Module \""
|
|
42311
|
+
ts.perfLogger.logInfoEvent("Module \"" + moduleName + "\" resolved to \"" + result.resolvedModule.resolvedFileName + "\"");
|
|
42324
42312
|
ts.perfLogger.logStopResolveModule((result && result.resolvedModule) ? "" + result.resolvedModule.resolvedFileName : "null");
|
|
42325
42313
|
if (perFolderCache) {
|
|
42326
42314
|
perFolderCache.set(moduleName, resolutionMode, result);
|
|
@@ -42523,7 +42511,7 @@ var ts;
|
|
|
42523
42511
|
function resolveJSModule(moduleName, initialDir, host) {
|
|
42524
42512
|
var _a = tryResolveJSModuleWorker(moduleName, initialDir, host), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations;
|
|
42525
42513
|
if (!resolvedModule) {
|
|
42526
|
-
throw new Error("Could not resolve JS module '"
|
|
42514
|
+
throw new Error("Could not resolve JS module '" + moduleName + "' starting at '" + initialDir + "'. Looked in: " + failedLookupLocations.join(", "));
|
|
42527
42515
|
}
|
|
42528
42516
|
return resolvedModule.resolvedFileName;
|
|
42529
42517
|
}
|
|
@@ -42618,13 +42606,25 @@ var ts;
|
|
|
42618
42606
|
return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } };
|
|
42619
42607
|
}
|
|
42620
42608
|
else {
|
|
42621
|
-
var _a =
|
|
42609
|
+
var _a = normalizePathForCJSResolution(containingDirectory, moduleName), candidate = _a.path, parts = _a.parts;
|
|
42622
42610
|
var resolved_2 = nodeLoadModuleByRelativeName(extensions, candidate, /*onlyRecordFailures*/ false, state, /*considerPackageJson*/ true);
|
|
42623
42611
|
// Treat explicit "node_modules" import as an external library import.
|
|
42624
42612
|
return resolved_2 && toSearchResult({ resolved: resolved_2, isExternalLibraryImport: ts.contains(parts, "node_modules") });
|
|
42625
42613
|
}
|
|
42626
42614
|
}
|
|
42627
42615
|
}
|
|
42616
|
+
// If you import from "." inside a containing directory "/foo", the result of `normalizePath`
|
|
42617
|
+
// would be "/foo", but this loses the information that `foo` is a directory and we intended
|
|
42618
|
+
// to look inside of it. The Node CommonJS resolution algorithm doesn't call this out
|
|
42619
|
+
// (https://nodejs.org/api/modules.html#all-together), but it seems that module paths ending
|
|
42620
|
+
// in `.` are actually normalized to `./` before proceeding with the resolution algorithm.
|
|
42621
|
+
function normalizePathForCJSResolution(containingDirectory, moduleName) {
|
|
42622
|
+
var combined = ts.combinePaths(containingDirectory, moduleName);
|
|
42623
|
+
var parts = ts.getPathComponents(combined);
|
|
42624
|
+
var lastPart = ts.lastOrUndefined(parts);
|
|
42625
|
+
var path = lastPart === "." || lastPart === ".." ? ts.ensureTrailingDirectorySeparator(ts.normalizePath(combined)) : ts.normalizePath(combined);
|
|
42626
|
+
return { path: path, parts: parts };
|
|
42627
|
+
}
|
|
42628
42628
|
function realPath(path, host, traceEnabled) {
|
|
42629
42629
|
if (!host.realpath) {
|
|
42630
42630
|
return path;
|
|
@@ -42633,7 +42633,7 @@ var ts;
|
|
|
42633
42633
|
if (traceEnabled) {
|
|
42634
42634
|
trace(host, ts.Diagnostics.Resolving_real_path_for_0_result_1, path, real);
|
|
42635
42635
|
}
|
|
42636
|
-
ts.Debug.assert(host.fileExists(real),
|
|
42636
|
+
ts.Debug.assert(host.fileExists(real), path + " linked to nonexistent file " + real);
|
|
42637
42637
|
return real;
|
|
42638
42638
|
}
|
|
42639
42639
|
function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, considerPackageJson) {
|
|
@@ -42666,7 +42666,13 @@ var ts;
|
|
|
42666
42666
|
onlyRecordFailures = true;
|
|
42667
42667
|
}
|
|
42668
42668
|
}
|
|
42669
|
-
|
|
42669
|
+
// esm mode relative imports shouldn't do any directory lookups (either inside `package.json`
|
|
42670
|
+
// files or implicit `index.js`es). This is a notable depature from cjs norms, where `./foo/pkg`
|
|
42671
|
+
// could have been redirected by `./foo/pkg/package.json` to an arbitrary location!
|
|
42672
|
+
if (!(state.features & NodeResolutionFeatures.EsmMode)) {
|
|
42673
|
+
return loadNodeModuleFromDirectory(extensions, candidate, onlyRecordFailures, state, considerPackageJson);
|
|
42674
|
+
}
|
|
42675
|
+
return undefined;
|
|
42670
42676
|
}
|
|
42671
42677
|
/*@internal*/
|
|
42672
42678
|
ts.nodeModulesPathPart = "/node_modules/";
|
|
@@ -43033,7 +43039,16 @@ var ts;
|
|
|
43033
43039
|
// Even if extensions is DtsOnly, we can still look up a .ts file as a result of package.json "types"
|
|
43034
43040
|
var nextExtensions = extensions === Extensions.DtsOnly ? Extensions.TypeScript : extensions;
|
|
43035
43041
|
// Don't do package.json lookup recursively, because Node.js' package lookup doesn't.
|
|
43036
|
-
|
|
43042
|
+
// Disable `EsmMode` for the resolution of the package path for cjs-mode packages (so the `main` field can omit extensions)
|
|
43043
|
+
// (technically it only emits a deprecation warning in esm packages right now, but that's probably
|
|
43044
|
+
// enough to mean we don't need to support it)
|
|
43045
|
+
var features = state.features;
|
|
43046
|
+
if ((jsonContent === null || jsonContent === void 0 ? void 0 : jsonContent.type) !== "module") {
|
|
43047
|
+
state.features &= ~NodeResolutionFeatures.EsmMode;
|
|
43048
|
+
}
|
|
43049
|
+
var result = nodeLoadModuleByRelativeName(nextExtensions, candidate, onlyRecordFailures, state, /*considerPackageJson*/ false);
|
|
43050
|
+
state.features = features;
|
|
43051
|
+
return result;
|
|
43037
43052
|
};
|
|
43038
43053
|
var onlyRecordFailuresForPackageFile = packageFile ? !ts.directoryProbablyExists(ts.getDirectoryPath(packageFile), state.host) : undefined;
|
|
43039
43054
|
var onlyRecordFailuresForIndex = onlyRecordFailures || !ts.directoryProbablyExists(candidate, state.host);
|
|
@@ -43110,7 +43125,7 @@ var ts;
|
|
|
43110
43125
|
return undefined;
|
|
43111
43126
|
}
|
|
43112
43127
|
var trailingParts = parts.slice(nameParts.length);
|
|
43113
|
-
return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : "."
|
|
43128
|
+
return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : "." + ts.directorySeparator + trailingParts.join(ts.directorySeparator), state, cache, redirectedReference);
|
|
43114
43129
|
}
|
|
43115
43130
|
function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
|
|
43116
43131
|
if (!scope.packageJsonContent.exports) {
|
|
@@ -43378,6 +43393,14 @@ var ts;
|
|
|
43378
43393
|
}
|
|
43379
43394
|
var pathAndExtension = loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) ||
|
|
43380
43395
|
loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo && packageInfo.packageJsonContent, packageInfo && packageInfo.versionPaths);
|
|
43396
|
+
if (!pathAndExtension && packageInfo
|
|
43397
|
+
&& packageInfo.packageJsonContent.exports === undefined
|
|
43398
|
+
&& packageInfo.packageJsonContent.main === undefined
|
|
43399
|
+
&& state.features & NodeResolutionFeatures.EsmMode) {
|
|
43400
|
+
// EsmMode disables index lookup in `loadNodeModuleFromDirectoryWorker` generally, however non-relative package resolutions still assume
|
|
43401
|
+
// a default `index.js` entrypoint if no `main` or `exports` are present
|
|
43402
|
+
pathAndExtension = loadModuleFromFile(extensions, ts.combinePaths(candidate, "index.js"), onlyRecordFailures, state);
|
|
43403
|
+
}
|
|
43381
43404
|
return withPackageId(packageInfo, pathAndExtension);
|
|
43382
43405
|
};
|
|
43383
43406
|
if (rest !== "") { // If "rest" is empty, we just did this search above.
|
|
@@ -43438,7 +43461,7 @@ var ts;
|
|
|
43438
43461
|
}
|
|
43439
43462
|
/* @internal */
|
|
43440
43463
|
function getTypesPackageName(packageName) {
|
|
43441
|
-
return "@types/"
|
|
43464
|
+
return "@types/" + mangleScopedPackageName(packageName);
|
|
43442
43465
|
}
|
|
43443
43466
|
ts.getTypesPackageName = getTypesPackageName;
|
|
43444
43467
|
/* @internal */
|
|
@@ -43839,7 +43862,7 @@ var ts;
|
|
|
43839
43862
|
if (name) {
|
|
43840
43863
|
if (ts.isAmbientModule(node)) {
|
|
43841
43864
|
var moduleName = ts.getTextOfIdentifierOrLiteral(name);
|
|
43842
|
-
return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\""
|
|
43865
|
+
return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\"");
|
|
43843
43866
|
}
|
|
43844
43867
|
if (name.kind === 161 /* ComputedPropertyName */) {
|
|
43845
43868
|
var nameExpression = name.expression;
|
|
@@ -43896,7 +43919,7 @@ var ts;
|
|
|
43896
43919
|
case 163 /* Parameter */:
|
|
43897
43920
|
// Parameters with names are handled at the top of this function. Parameters
|
|
43898
43921
|
// without names can only come from JSDocFunctionTypes.
|
|
43899
|
-
ts.Debug.assert(node.parent.kind === 315 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: "
|
|
43922
|
+
ts.Debug.assert(node.parent.kind === 315 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; });
|
|
43900
43923
|
var functionType = node.parent;
|
|
43901
43924
|
var index = functionType.parameters.indexOf(node);
|
|
43902
43925
|
return "arg" + index;
|
|
@@ -44008,7 +44031,7 @@ var ts;
|
|
|
44008
44031
|
var relatedInformation_1 = [];
|
|
44009
44032
|
if (ts.isTypeAliasDeclaration(node) && ts.nodeIsMissing(node.type) && ts.hasSyntacticModifier(node, 1 /* Export */) && symbol.flags & (2097152 /* Alias */ | 788968 /* Type */ | 1920 /* Namespace */)) {
|
|
44010
44033
|
// export type T; - may have meant export type { T }?
|
|
44011
|
-
relatedInformation_1.push(createDiagnosticForNode(node, ts.Diagnostics.Did_you_mean_0, "export type { "
|
|
44034
|
+
relatedInformation_1.push(createDiagnosticForNode(node, ts.Diagnostics.Did_you_mean_0, "export type { " + ts.unescapeLeadingUnderscores(node.name.escapedText) + " }"));
|
|
44012
44035
|
}
|
|
44013
44036
|
var declarationName_1 = ts.getNameOfDeclaration(node) || node;
|
|
44014
44037
|
ts.forEach(symbol.declarations, function (declaration, index) {
|
|
@@ -46084,7 +46107,7 @@ var ts;
|
|
|
46084
46107
|
}
|
|
46085
46108
|
}
|
|
46086
46109
|
function bindSourceFileAsExternalModule() {
|
|
46087
|
-
bindAnonymousDeclaration(file, 512 /* ValueModule */, "\""
|
|
46110
|
+
bindAnonymousDeclaration(file, 512 /* ValueModule */, "\"" + ts.removeFileExtension(file.fileName) + "\"");
|
|
46088
46111
|
}
|
|
46089
46112
|
function bindExportAssignment(node) {
|
|
46090
46113
|
if (!container.symbol || !container.symbol.exports) {
|
|
@@ -48184,7 +48207,7 @@ var ts;
|
|
|
48184
48207
|
if (sourceSymbolFile && targetSymbolFile && amalgamatedDuplicates && !isEitherEnum && sourceSymbolFile !== targetSymbolFile) {
|
|
48185
48208
|
var firstFile_1 = ts.comparePaths(sourceSymbolFile.path, targetSymbolFile.path) === -1 /* LessThan */ ? sourceSymbolFile : targetSymbolFile;
|
|
48186
48209
|
var secondFile_1 = firstFile_1 === sourceSymbolFile ? targetSymbolFile : sourceSymbolFile;
|
|
48187
|
-
var filesDuplicates = ts.getOrUpdate(amalgamatedDuplicates,
|
|
48210
|
+
var filesDuplicates = ts.getOrUpdate(amalgamatedDuplicates, firstFile_1.path + "|" + secondFile_1.path, function () {
|
|
48188
48211
|
return ({ firstFile: firstFile_1, secondFile: secondFile_1, conflictingSymbols: new ts.Map() });
|
|
48189
48212
|
});
|
|
48190
48213
|
var conflictingSymbolInfo = ts.getOrUpdate(filesDuplicates.conflictingSymbols, symbolName_1, function () {
|
|
@@ -50595,8 +50618,15 @@ var ts;
|
|
|
50595
50618
|
return res;
|
|
50596
50619
|
}
|
|
50597
50620
|
var candidates = ts.mapDefined(symbol.declarations, function (d) {
|
|
50598
|
-
if (!ts.isAmbientModule(d) && d.parent
|
|
50599
|
-
|
|
50621
|
+
if (!ts.isAmbientModule(d) && d.parent) {
|
|
50622
|
+
// direct children of a module
|
|
50623
|
+
if (hasNonGlobalAugmentationExternalModuleSymbol(d.parent)) {
|
|
50624
|
+
return getSymbolOfNode(d.parent);
|
|
50625
|
+
}
|
|
50626
|
+
// export ='d member of an ambient module
|
|
50627
|
+
if (ts.isModuleBlock(d.parent) && d.parent.parent && resolveExternalModuleSymbol(getSymbolOfNode(d.parent.parent)) === symbol) {
|
|
50628
|
+
return getSymbolOfNode(d.parent.parent);
|
|
50629
|
+
}
|
|
50600
50630
|
}
|
|
50601
50631
|
if (ts.isClassExpression(d) && ts.isBinaryExpression(d.parent) && d.parent.operatorToken.kind === 63 /* EqualsToken */ && ts.isAccessExpression(d.parent.left) && ts.isEntityNameExpression(d.parent.left.expression)) {
|
|
50602
50632
|
if (ts.isModuleExportsAccessExpression(d.parent.left) || ts.isExportsIdentifier(d.parent.left.expression)) {
|
|
@@ -50837,7 +50867,7 @@ var ts;
|
|
|
50837
50867
|
var cache = (links.accessibleChainCache || (links.accessibleChainCache = new ts.Map()));
|
|
50838
50868
|
// Go from enclosingDeclaration to the first scope we check, so the cache is keyed off the scope and thus shared more
|
|
50839
50869
|
var firstRelevantLocation = forEachSymbolTableInScope(enclosingDeclaration, function (_, __, ___, node) { return node; });
|
|
50840
|
-
var key =
|
|
50870
|
+
var key = (useOnlyExternalAliasing ? 0 : 1) + "|" + (firstRelevantLocation && getNodeId(firstRelevantLocation)) + "|" + meaning;
|
|
50841
50871
|
if (cache.has(key)) {
|
|
50842
50872
|
return cache.get(key);
|
|
50843
50873
|
}
|
|
@@ -51686,7 +51716,7 @@ var ts;
|
|
|
51686
51716
|
context.symbolDepth = new ts.Map();
|
|
51687
51717
|
}
|
|
51688
51718
|
var links = context.enclosingDeclaration && getNodeLinks(context.enclosingDeclaration);
|
|
51689
|
-
var key =
|
|
51719
|
+
var key = getTypeId(type) + "|" + context.flags;
|
|
51690
51720
|
if (links) {
|
|
51691
51721
|
links.serializedTypes || (links.serializedTypes = new ts.Map());
|
|
51692
51722
|
}
|
|
@@ -51955,7 +51985,7 @@ var ts;
|
|
|
51955
51985
|
}
|
|
51956
51986
|
}
|
|
51957
51987
|
if (checkTruncationLength(context) && (i + 2 < properties.length - 1)) {
|
|
51958
|
-
typeElements.push(ts.factory.createPropertySignature(/*modifiers*/ undefined, "... "
|
|
51988
|
+
typeElements.push(ts.factory.createPropertySignature(/*modifiers*/ undefined, "... " + (properties.length - i) + " more ...", /*questionToken*/ undefined, /*type*/ undefined));
|
|
51959
51989
|
addPropertyToElementList(properties[properties.length - 1], context, typeElements);
|
|
51960
51990
|
break;
|
|
51961
51991
|
}
|
|
@@ -52070,7 +52100,7 @@ var ts;
|
|
|
52070
52100
|
else if (types.length > 2) {
|
|
52071
52101
|
return [
|
|
52072
52102
|
typeToTypeNodeHelper(types[0], context),
|
|
52073
|
-
ts.factory.createTypeReferenceNode("... "
|
|
52103
|
+
ts.factory.createTypeReferenceNode("... " + (types.length - 2) + " more ...", /*typeArguments*/ undefined),
|
|
52074
52104
|
typeToTypeNodeHelper(types[types.length - 1], context)
|
|
52075
52105
|
];
|
|
52076
52106
|
}
|
|
@@ -52084,7 +52114,7 @@ var ts;
|
|
|
52084
52114
|
var type = types_2[_i];
|
|
52085
52115
|
i++;
|
|
52086
52116
|
if (checkTruncationLength(context) && (i + 2 < types.length - 1)) {
|
|
52087
|
-
result_5.push(ts.factory.createTypeReferenceNode("... "
|
|
52117
|
+
result_5.push(ts.factory.createTypeReferenceNode("... " + (types.length - i) + " more ...", /*typeArguments*/ undefined));
|
|
52088
52118
|
var typeNode_1 = typeToTypeNodeHelper(types[types.length - 1], context);
|
|
52089
52119
|
if (typeNode_1) {
|
|
52090
52120
|
result_5.push(typeNode_1);
|
|
@@ -52607,7 +52637,7 @@ var ts;
|
|
|
52607
52637
|
var text = rawtext;
|
|
52608
52638
|
while (((_b = context.typeParameterNamesByText) === null || _b === void 0 ? void 0 : _b.has(text)) || typeParameterShadowsNameInScope(text, context, type)) {
|
|
52609
52639
|
i++;
|
|
52610
|
-
text =
|
|
52640
|
+
text = rawtext + "_" + i;
|
|
52611
52641
|
}
|
|
52612
52642
|
if (text !== rawtext) {
|
|
52613
52643
|
result = ts.factory.createIdentifier(text, result.typeArguments);
|
|
@@ -52927,7 +52957,7 @@ var ts;
|
|
|
52927
52957
|
function getNameForJSDocFunctionParameter(p, index) {
|
|
52928
52958
|
return p.name && ts.isIdentifier(p.name) && p.name.escapedText === "this" ? "this"
|
|
52929
52959
|
: getEffectiveDotDotDotForParameter(p) ? "args"
|
|
52930
|
-
: "arg"
|
|
52960
|
+
: "arg" + index;
|
|
52931
52961
|
}
|
|
52932
52962
|
function rewriteModuleSpecifier(parent, lit) {
|
|
52933
52963
|
if (bundled) {
|
|
@@ -54012,7 +54042,7 @@ var ts;
|
|
|
54012
54042
|
return results_1;
|
|
54013
54043
|
}
|
|
54014
54044
|
// The `Constructor`'s symbol isn't in the class's properties lists, obviously, since it's a signature on the static
|
|
54015
|
-
return ts.Debug.fail("Unhandled class member kind! "
|
|
54045
|
+
return ts.Debug.fail("Unhandled class member kind! " + (p.__debugFlags || p.flags));
|
|
54016
54046
|
};
|
|
54017
54047
|
}
|
|
54018
54048
|
function serializePropertySymbolForInterface(p, baseType) {
|
|
@@ -54087,7 +54117,7 @@ var ts;
|
|
|
54087
54117
|
if (ref) {
|
|
54088
54118
|
return ref;
|
|
54089
54119
|
}
|
|
54090
|
-
var tempName = getUnusedName(
|
|
54120
|
+
var tempName = getUnusedName(rootName + "_base");
|
|
54091
54121
|
var statement = ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([
|
|
54092
54122
|
ts.factory.createVariableDeclaration(tempName, /*exclamationToken*/ undefined, typeToTypeNodeHelper(staticType, context))
|
|
54093
54123
|
], 2 /* Const */));
|
|
@@ -54134,7 +54164,7 @@ var ts;
|
|
|
54134
54164
|
var original = input;
|
|
54135
54165
|
while ((_a = context.usedSymbolNames) === null || _a === void 0 ? void 0 : _a.has(input)) {
|
|
54136
54166
|
i++;
|
|
54137
|
-
input =
|
|
54167
|
+
input = original + "_" + i;
|
|
54138
54168
|
}
|
|
54139
54169
|
(_b = context.usedSymbolNames) === null || _b === void 0 ? void 0 : _b.add(input);
|
|
54140
54170
|
if (id) {
|
|
@@ -54242,15 +54272,15 @@ var ts;
|
|
|
54242
54272
|
if (nameType.flags & 384 /* StringOrNumberLiteral */) {
|
|
54243
54273
|
var name = "" + nameType.value;
|
|
54244
54274
|
if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !ts.isNumericLiteralName(name)) {
|
|
54245
|
-
return "\""
|
|
54275
|
+
return "\"" + ts.escapeString(name, 34 /* doubleQuote */) + "\"";
|
|
54246
54276
|
}
|
|
54247
54277
|
if (ts.isNumericLiteralName(name) && ts.startsWith(name, "-")) {
|
|
54248
|
-
return "["
|
|
54278
|
+
return "[" + name + "]";
|
|
54249
54279
|
}
|
|
54250
54280
|
return name;
|
|
54251
54281
|
}
|
|
54252
54282
|
if (nameType.flags & 8192 /* UniqueESSymbol */) {
|
|
54253
|
-
return "["
|
|
54283
|
+
return "[" + getNameOfSymbolAsWritten(nameType.symbol, context) + "]";
|
|
54254
54284
|
}
|
|
54255
54285
|
}
|
|
54256
54286
|
}
|
|
@@ -57081,7 +57111,7 @@ var ts;
|
|
|
57081
57111
|
!leftName ? rightName :
|
|
57082
57112
|
!rightName ? leftName :
|
|
57083
57113
|
undefined;
|
|
57084
|
-
var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg"
|
|
57114
|
+
var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg" + i);
|
|
57085
57115
|
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
|
|
57086
57116
|
params[i] = paramSymbol;
|
|
57087
57117
|
}
|
|
@@ -59032,7 +59062,7 @@ var ts;
|
|
|
59032
59062
|
return result;
|
|
59033
59063
|
}
|
|
59034
59064
|
function getAliasId(aliasSymbol, aliasTypeArguments) {
|
|
59035
|
-
return aliasSymbol ? "@"
|
|
59065
|
+
return aliasSymbol ? "@" + getSymbolId(aliasSymbol) + (aliasTypeArguments ? ":" + getTypeListId(aliasTypeArguments) : "") : "";
|
|
59036
59066
|
}
|
|
59037
59067
|
// This function is used to propagate certain flags when creating new object type references and union types.
|
|
59038
59068
|
// It is only necessary to do so if a constituent type might be the undefined type, the null type, the type
|
|
@@ -59218,7 +59248,7 @@ var ts;
|
|
|
59218
59248
|
return undefined;
|
|
59219
59249
|
}
|
|
59220
59250
|
function getSymbolPath(symbol) {
|
|
59221
|
-
return symbol.parent ?
|
|
59251
|
+
return symbol.parent ? getSymbolPath(symbol.parent) + "." + symbol.escapedName : symbol.escapedName;
|
|
59222
59252
|
}
|
|
59223
59253
|
function getUnresolvedSymbolForEntityName(name) {
|
|
59224
59254
|
var identifier = name.kind === 160 /* QualifiedName */ ? name.right :
|
|
@@ -59229,7 +59259,7 @@ var ts;
|
|
|
59229
59259
|
var parentSymbol = name.kind === 160 /* QualifiedName */ ? getUnresolvedSymbolForEntityName(name.left) :
|
|
59230
59260
|
name.kind === 205 /* PropertyAccessExpression */ ? getUnresolvedSymbolForEntityName(name.expression) :
|
|
59231
59261
|
undefined;
|
|
59232
|
-
var path = parentSymbol ?
|
|
59262
|
+
var path = parentSymbol ? getSymbolPath(parentSymbol) + "." + text : text;
|
|
59233
59263
|
var result = unresolvedSymbols.get(path);
|
|
59234
59264
|
if (!result) {
|
|
59235
59265
|
unresolvedSymbols.set(path, result = createSymbol(524288 /* TypeAlias */, text, 1048576 /* Unresolved */));
|
|
@@ -59302,7 +59332,7 @@ var ts;
|
|
|
59302
59332
|
if (substitute.flags & 3 /* AnyOrUnknown */ || substitute === baseType) {
|
|
59303
59333
|
return baseType;
|
|
59304
59334
|
}
|
|
59305
|
-
var id =
|
|
59335
|
+
var id = getTypeId(baseType) + ">" + getTypeId(substitute);
|
|
59306
59336
|
var cached = substitutionTypes.get(id);
|
|
59307
59337
|
if (cached) {
|
|
59308
59338
|
return cached;
|
|
@@ -60226,9 +60256,9 @@ var ts;
|
|
|
60226
60256
|
return types[0];
|
|
60227
60257
|
}
|
|
60228
60258
|
var typeKey = !origin ? getTypeListId(types) :
|
|
60229
|
-
origin.flags & 1048576 /* Union */ ? "|"
|
|
60230
|
-
origin.flags & 2097152 /* Intersection */ ? "&"
|
|
60231
|
-
"#"
|
|
60259
|
+
origin.flags & 1048576 /* Union */ ? "|" + getTypeListId(origin.types) :
|
|
60260
|
+
origin.flags & 2097152 /* Intersection */ ? "&" + getTypeListId(origin.types) :
|
|
60261
|
+
"#" + origin.type.id + "|" + getTypeListId(types); // origin type id alone is insufficient, as `keyof x` may resolve to multiple WIP values while `x` is still resolving
|
|
60232
60262
|
var id = typeKey + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
60233
60263
|
var type = unionTypes.get(id);
|
|
60234
60264
|
if (!type) {
|
|
@@ -60750,7 +60780,7 @@ var ts;
|
|
|
60750
60780
|
if (ts.every(newTexts, function (t) { return t === ""; }) && ts.every(newTypes, function (t) { return !!(t.flags & 4 /* String */); })) {
|
|
60751
60781
|
return stringType;
|
|
60752
60782
|
}
|
|
60753
|
-
var id =
|
|
60783
|
+
var id = getTypeListId(newTypes) + "|" + ts.map(newTexts, function (t) { return t.length; }).join(",") + "|" + newTexts.join("");
|
|
60754
60784
|
var type = templateLiteralTypes.get(id);
|
|
60755
60785
|
if (!type) {
|
|
60756
60786
|
templateLiteralTypes.set(id, type = createTemplateLiteralType(newTexts, newTypes));
|
|
@@ -60810,7 +60840,7 @@ var ts;
|
|
|
60810
60840
|
return str;
|
|
60811
60841
|
}
|
|
60812
60842
|
function getStringMappingTypeForGenericType(symbol, type) {
|
|
60813
|
-
var id =
|
|
60843
|
+
var id = getSymbolId(symbol) + "," + getTypeId(type);
|
|
60814
60844
|
var result = stringMappingTypes.get(id);
|
|
60815
60845
|
if (!result) {
|
|
60816
60846
|
stringMappingTypes.set(id, result = createStringMappingType(symbol, type));
|
|
@@ -61827,7 +61857,7 @@ var ts;
|
|
|
61827
61857
|
function createUniqueESSymbolType(symbol) {
|
|
61828
61858
|
var type = createType(8192 /* UniqueESSymbol */);
|
|
61829
61859
|
type.symbol = symbol;
|
|
61830
|
-
type.escapedName = "__@"
|
|
61860
|
+
type.escapedName = "__@" + type.symbol.escapedName + "@" + getSymbolId(type.symbol);
|
|
61831
61861
|
return type;
|
|
61832
61862
|
}
|
|
61833
61863
|
function getESSymbolLikeTypeForNode(node) {
|
|
@@ -63331,9 +63361,11 @@ var ts;
|
|
|
63331
63361
|
isEnumTypeRelatedTo(getParentOfSymbol(source.symbol), getParentOfSymbol(target.symbol), errorReporter))
|
|
63332
63362
|
return true;
|
|
63333
63363
|
}
|
|
63334
|
-
|
|
63364
|
+
// In non-strictNullChecks mode, `undefined` and `null` are assignable to anything except `never`.
|
|
63365
|
+
// Since unions and intersections may reduce to `never`, we exclude them here.
|
|
63366
|
+
if (s & 32768 /* Undefined */ && (!strictNullChecks && !(t & 3145728 /* UnionOrIntersection */) || t & (32768 /* Undefined */ | 16384 /* Void */)))
|
|
63335
63367
|
return true;
|
|
63336
|
-
if (s & 65536 /* Null */ && (!strictNullChecks || t & 65536 /* Null */))
|
|
63368
|
+
if (s & 65536 /* Null */ && (!strictNullChecks && !(t & 3145728 /* UnionOrIntersection */) || t & 65536 /* Null */))
|
|
63337
63369
|
return true;
|
|
63338
63370
|
if (s & 524288 /* Object */ && t & 67108864 /* NonPrimitive */)
|
|
63339
63371
|
return true;
|
|
@@ -63516,24 +63548,24 @@ var ts;
|
|
|
63516
63548
|
case ts.Diagnostics.Types_of_property_0_are_incompatible.code: {
|
|
63517
63549
|
// Parenthesize a `new` if there is one
|
|
63518
63550
|
if (path.indexOf("new ") === 0) {
|
|
63519
|
-
path = "("
|
|
63551
|
+
path = "(" + path + ")";
|
|
63520
63552
|
}
|
|
63521
63553
|
var str = "" + args[0];
|
|
63522
63554
|
// If leading, just print back the arg (irrespective of if it's a valid identifier)
|
|
63523
63555
|
if (path.length === 0) {
|
|
63524
|
-
path = ""
|
|
63556
|
+
path = "" + str;
|
|
63525
63557
|
}
|
|
63526
63558
|
// Otherwise write a dotted name if possible
|
|
63527
63559
|
else if (ts.isIdentifierText(str, ts.getEmitScriptTarget(compilerOptions))) {
|
|
63528
|
-
path =
|
|
63560
|
+
path = path + "." + str;
|
|
63529
63561
|
}
|
|
63530
63562
|
// Failing that, check if the name is already a computed name
|
|
63531
63563
|
else if (str[0] === "[" && str[str.length - 1] === "]") {
|
|
63532
|
-
path = ""
|
|
63564
|
+
path = "" + path + str;
|
|
63533
63565
|
}
|
|
63534
63566
|
// And finally write out a computed name as a last resort
|
|
63535
63567
|
else {
|
|
63536
|
-
path =
|
|
63568
|
+
path = path + "[" + str + "]";
|
|
63537
63569
|
}
|
|
63538
63570
|
break;
|
|
63539
63571
|
}
|
|
@@ -63562,7 +63594,7 @@ var ts;
|
|
|
63562
63594
|
msg.code === ts.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code)
|
|
63563
63595
|
? ""
|
|
63564
63596
|
: "...";
|
|
63565
|
-
path = ""
|
|
63597
|
+
path = "" + prefix + path + "(" + params + ")";
|
|
63566
63598
|
}
|
|
63567
63599
|
break;
|
|
63568
63600
|
}
|
|
@@ -63575,7 +63607,7 @@ var ts;
|
|
|
63575
63607
|
break;
|
|
63576
63608
|
}
|
|
63577
63609
|
default:
|
|
63578
|
-
return ts.Debug.fail("Unhandled Diagnostic: "
|
|
63610
|
+
return ts.Debug.fail("Unhandled Diagnostic: " + msg.code);
|
|
63579
63611
|
}
|
|
63580
63612
|
}
|
|
63581
63613
|
if (path) {
|
|
@@ -64789,6 +64821,11 @@ var ts;
|
|
|
64789
64821
|
}
|
|
64790
64822
|
if (ts.getObjectFlags(source) & 4 /* Reference */ && ts.getObjectFlags(target) & 4 /* Reference */ && source.target === target.target &&
|
|
64791
64823
|
!isTupleType(source) && !(ts.getObjectFlags(source) & 4096 /* MarkerType */ || ts.getObjectFlags(target) & 4096 /* MarkerType */)) {
|
|
64824
|
+
// When strictNullChecks is disabled, the element type of the empty array literal is undefinedWideningType,
|
|
64825
|
+
// and an empty array literal wouldn't be assignable to a `never[]` without this check.
|
|
64826
|
+
if (isEmptyArrayLiteralType(source)) {
|
|
64827
|
+
return -1 /* True */;
|
|
64828
|
+
}
|
|
64792
64829
|
// We have type references to the same generic type, and the type references are not marker
|
|
64793
64830
|
// type references (which are intended by be compared structurally). Obtain the variance
|
|
64794
64831
|
// information for the type parameters and relate the type arguments accordingly.
|
|
@@ -65095,6 +65132,15 @@ var ts;
|
|
|
65095
65132
|
}
|
|
65096
65133
|
return 0 /* False */;
|
|
65097
65134
|
}
|
|
65135
|
+
// Ensure {readonly a: whatever} is not a subtype of {a: whatever},
|
|
65136
|
+
// while {a: whatever} is a subtype of {readonly a: whatever}.
|
|
65137
|
+
// This ensures the subtype relationship is ordered, and preventing declaration order
|
|
65138
|
+
// from deciding which type "wins" in union subtype reduction.
|
|
65139
|
+
// They're still assignable to one another, since `readonly` doesn't affect assignability.
|
|
65140
|
+
if ((relation === subtypeRelation || relation === strictSubtypeRelation) &&
|
|
65141
|
+
!!(sourcePropFlags & 64 /* Readonly */) && !(targetPropFlags & 64 /* Readonly */)) {
|
|
65142
|
+
return 0 /* False */;
|
|
65143
|
+
}
|
|
65098
65144
|
// If the target comes from a partial union prop, allow `undefined` in the target type
|
|
65099
65145
|
var related = isPropertySymbolTypeRelated(sourceProp, targetProp, getTypeOfSourceProperty, reportErrors, intersectionState);
|
|
65100
65146
|
if (!related) {
|
|
@@ -65777,7 +65823,7 @@ var ts;
|
|
|
65777
65823
|
var constraintMarker = "";
|
|
65778
65824
|
var sourceId = getTypeReferenceId(source, 0);
|
|
65779
65825
|
var targetId = getTypeReferenceId(target, 0);
|
|
65780
|
-
return ""
|
|
65826
|
+
return "" + constraintMarker + sourceId + "," + targetId + postFix;
|
|
65781
65827
|
// getTypeReferenceId(A<T, number, U>) returns "111=0-12=1"
|
|
65782
65828
|
// where A.id=111 and number.id=12
|
|
65783
65829
|
function getTypeReferenceId(type, depth) {
|
|
@@ -65821,7 +65867,7 @@ var ts;
|
|
|
65821
65867
|
var postFix = intersectionState ? ":" + intersectionState : "";
|
|
65822
65868
|
return isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target) ?
|
|
65823
65869
|
getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) :
|
|
65824
|
-
|
|
65870
|
+
source.id + "," + target.id + postFix;
|
|
65825
65871
|
}
|
|
65826
65872
|
// Invoke the callback for each underlying property symbol of the given symbol and return the first
|
|
65827
65873
|
// value that isn't undefined.
|
|
@@ -67948,11 +67994,11 @@ var ts;
|
|
|
67948
67994
|
case 79 /* Identifier */:
|
|
67949
67995
|
if (!ts.isThisInTypeQuery(node)) {
|
|
67950
67996
|
var symbol = getResolvedSymbol(node);
|
|
67951
|
-
return symbol !== unknownSymbol ?
|
|
67997
|
+
return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType) + "|" + getSymbolId(symbol) : undefined;
|
|
67952
67998
|
}
|
|
67953
67999
|
// falls through
|
|
67954
68000
|
case 108 /* ThisKeyword */:
|
|
67955
|
-
return "0|"
|
|
68001
|
+
return "0|" + (flowContainer ? getNodeId(flowContainer) : "-1") + "|" + getTypeId(declaredType) + "|" + getTypeId(initialType);
|
|
67956
68002
|
case 229 /* NonNullExpression */:
|
|
67957
68003
|
case 211 /* ParenthesizedExpression */:
|
|
67958
68004
|
return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer);
|
|
@@ -71841,7 +71887,7 @@ var ts;
|
|
|
71841
71887
|
!leftName ? rightName :
|
|
71842
71888
|
!rightName ? leftName :
|
|
71843
71889
|
undefined;
|
|
71844
|
-
var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg"
|
|
71890
|
+
var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg" + i);
|
|
71845
71891
|
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
|
|
71846
71892
|
params[i] = paramSymbol;
|
|
71847
71893
|
}
|
|
@@ -81708,7 +81754,7 @@ var ts;
|
|
|
81708
81754
|
function getPropertyNameForKnownSymbolName(symbolName) {
|
|
81709
81755
|
var ctorType = getGlobalESSymbolConstructorSymbol(/*reportErrors*/ false);
|
|
81710
81756
|
var uniqueType = ctorType && getTypeOfPropertyOfType(getTypeOfSymbol(ctorType), ts.escapeLeadingUnderscores(symbolName));
|
|
81711
|
-
return uniqueType && isTypeUsableAsPropertyName(uniqueType) ? getPropertyNameFromType(uniqueType) : "__@"
|
|
81757
|
+
return uniqueType && isTypeUsableAsPropertyName(uniqueType) ? getPropertyNameFromType(uniqueType) : "__@" + symbolName;
|
|
81712
81758
|
}
|
|
81713
81759
|
/**
|
|
81714
81760
|
* Gets the *yield*, *return*, and *next* types of an `Iterable`-like or `AsyncIterable`-like
|
|
@@ -88760,7 +88806,7 @@ var ts;
|
|
|
88760
88806
|
value >= 52 && value < 62 ? 48 /* _0 */ + value - 52 :
|
|
88761
88807
|
value === 62 ? 43 /* plus */ :
|
|
88762
88808
|
value === 63 ? 47 /* slash */ :
|
|
88763
|
-
ts.Debug.fail(
|
|
88809
|
+
ts.Debug.fail(value + ": not a base64 value");
|
|
88764
88810
|
}
|
|
88765
88811
|
function base64FormatDecode(ch) {
|
|
88766
88812
|
return ch >= 65 /* A */ && ch <= 90 /* Z */ ? ch - 65 /* A */ :
|
|
@@ -88835,7 +88881,7 @@ var ts;
|
|
|
88835
88881
|
var mappings = ts.arrayFrom(decoder, processMapping);
|
|
88836
88882
|
if (decoder.error !== undefined) {
|
|
88837
88883
|
if (host.log) {
|
|
88838
|
-
host.log("Encountered error while decoding sourcemap: "
|
|
88884
|
+
host.log("Encountered error while decoding sourcemap: " + decoder.error);
|
|
88839
88885
|
}
|
|
88840
88886
|
decodedMappings = ts.emptyArray;
|
|
88841
88887
|
}
|
|
@@ -92510,7 +92556,7 @@ var ts;
|
|
|
92510
92556
|
var propertyName = ts.isPropertyAccessExpression(originalNode)
|
|
92511
92557
|
? ts.declarationNameToString(originalNode.name)
|
|
92512
92558
|
: ts.getTextOfNode(originalNode.argumentExpression);
|
|
92513
|
-
ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " "
|
|
92559
|
+
ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " " + propertyName + " ");
|
|
92514
92560
|
}
|
|
92515
92561
|
return substitute;
|
|
92516
92562
|
}
|
|
@@ -93986,8 +94032,8 @@ var ts;
|
|
|
93986
94032
|
}
|
|
93987
94033
|
function createHoistedVariableForClass(name, node) {
|
|
93988
94034
|
var className = getPrivateIdentifierEnvironment().className;
|
|
93989
|
-
var prefix = className ? "_"
|
|
93990
|
-
var identifier = factory.createUniqueName(
|
|
94035
|
+
var prefix = className ? "_" + className : "";
|
|
94036
|
+
var identifier = factory.createUniqueName(prefix + "_" + name, 16 /* Optimistic */);
|
|
93991
94037
|
if (resolver.getNodeCheckFlags(node) & 524288 /* BlockScopedBindingInLoop */) {
|
|
93992
94038
|
addBlockScopedVariable(identifier);
|
|
93993
94039
|
}
|
|
@@ -95992,7 +96038,7 @@ var ts;
|
|
|
95992
96038
|
specifierSourceImports = new ts.Map();
|
|
95993
96039
|
currentFileState.utilizedImplicitRuntimeImports.set(importSource, specifierSourceImports);
|
|
95994
96040
|
}
|
|
95995
|
-
var generatedName = factory.createUniqueName("_"
|
|
96041
|
+
var generatedName = factory.createUniqueName("_" + name, 16 /* Optimistic */ | 32 /* FileLevel */ | 64 /* AllowNameSubstitution */);
|
|
95996
96042
|
var specifier = factory.createImportSpecifier(/*isTypeOnly*/ false, factory.createIdentifier(name), generatedName);
|
|
95997
96043
|
generatedName.generatedImportReference = specifier;
|
|
95998
96044
|
specifierSourceImports.set(name, specifier);
|
|
@@ -97140,11 +97186,11 @@ var ts;
|
|
|
97140
97186
|
}
|
|
97141
97187
|
else {
|
|
97142
97188
|
if (node.kind === 245 /* BreakStatement */) {
|
|
97143
|
-
labelMarker = "break-"
|
|
97189
|
+
labelMarker = "break-" + label.escapedText;
|
|
97144
97190
|
setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(label), labelMarker);
|
|
97145
97191
|
}
|
|
97146
97192
|
else {
|
|
97147
|
-
labelMarker = "continue-"
|
|
97193
|
+
labelMarker = "continue-" + label.escapedText;
|
|
97148
97194
|
setLabeledJump(convertedLoopState, /*isBreak*/ false, ts.idText(label), labelMarker);
|
|
97149
97195
|
}
|
|
97150
97196
|
}
|
|
@@ -106001,7 +106047,7 @@ var ts;
|
|
|
106001
106047
|
return getTypeAliasDeclarationVisibilityError;
|
|
106002
106048
|
}
|
|
106003
106049
|
else {
|
|
106004
|
-
return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: "
|
|
106050
|
+
return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.SyntaxKind[node.kind]);
|
|
106005
106051
|
}
|
|
106006
106052
|
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
|
|
106007
106053
|
if (node.kind === 253 /* VariableDeclaration */ || node.kind === 202 /* BindingElement */) {
|
|
@@ -106212,7 +106258,7 @@ var ts;
|
|
|
106212
106258
|
ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2 :
|
|
106213
106259
|
ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_private_name_1;
|
|
106214
106260
|
default:
|
|
106215
|
-
return ts.Debug.fail("Unknown parent for parameter: "
|
|
106261
|
+
return ts.Debug.fail("Unknown parent for parameter: " + ts.SyntaxKind[node.parent.kind]);
|
|
106216
106262
|
}
|
|
106217
106263
|
}
|
|
106218
106264
|
function getTypeParameterConstraintVisibilityError() {
|
|
@@ -106970,7 +107016,7 @@ var ts;
|
|
|
106970
107016
|
while (ts.length(lateMarkedStatements)) {
|
|
106971
107017
|
var i = lateMarkedStatements.shift();
|
|
106972
107018
|
if (!ts.isLateVisibilityPaintedStatement(i)) {
|
|
106973
|
-
return ts.Debug.fail("Late replaced statement was found which is not handled by the declaration transformer!: "
|
|
107019
|
+
return ts.Debug.fail("Late replaced statement was found which is not handled by the declaration transformer!: " + (ts.SyntaxKind ? ts.SyntaxKind[i.kind] : i.kind));
|
|
106974
107020
|
}
|
|
106975
107021
|
var priorNeedsDeclare = needsDeclare;
|
|
106976
107022
|
needsDeclare = i.parent && ts.isSourceFile(i.parent) && !(ts.isExternalModule(i.parent) && isBundledEmit);
|
|
@@ -107159,7 +107205,7 @@ var ts;
|
|
|
107159
107205
|
return cleanup(input);
|
|
107160
107206
|
return cleanup(factory.updateImportTypeNode(input, factory.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), input.qualifier, ts.visitNodes(input.typeArguments, visitDeclarationSubtree, ts.isTypeNode), input.isTypeOf));
|
|
107161
107207
|
}
|
|
107162
|
-
default: ts.Debug.assertNever(input, "Attempted to process unhandled node kind: "
|
|
107208
|
+
default: ts.Debug.assertNever(input, "Attempted to process unhandled node kind: " + ts.SyntaxKind[input.kind]);
|
|
107163
107209
|
}
|
|
107164
107210
|
}
|
|
107165
107211
|
if (ts.isTupleTypeNode(input) && (ts.getLineAndCharacterOfPosition(currentSourceFile, input.pos).line === ts.getLineAndCharacterOfPosition(currentSourceFile, input.end).line)) {
|
|
@@ -107450,7 +107496,7 @@ var ts;
|
|
|
107450
107496
|
if (extendsClause_1 && !ts.isEntityNameExpression(extendsClause_1.expression) && extendsClause_1.expression.kind !== 104 /* NullKeyword */) {
|
|
107451
107497
|
// We must add a temporary declaration for the extends clause expression
|
|
107452
107498
|
var oldId = input.name ? ts.unescapeLeadingUnderscores(input.name.escapedText) : "default";
|
|
107453
|
-
var newId_1 = factory.createUniqueName(
|
|
107499
|
+
var newId_1 = factory.createUniqueName(oldId + "_base", 16 /* Optimistic */);
|
|
107454
107500
|
getSymbolAccessibilityDiagnostic = function () { return ({
|
|
107455
107501
|
diagnosticMessage: ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1,
|
|
107456
107502
|
errorNode: extendsClause_1,
|
|
@@ -107491,7 +107537,7 @@ var ts;
|
|
|
107491
107537
|
}
|
|
107492
107538
|
}
|
|
107493
107539
|
// Anything left unhandled is an error, so this should be unreachable
|
|
107494
|
-
return ts.Debug.assertNever(input, "Unhandled top-level node in declaration emit: "
|
|
107540
|
+
return ts.Debug.assertNever(input, "Unhandled top-level node in declaration emit: " + ts.SyntaxKind[input.kind]);
|
|
107495
107541
|
function cleanup(node) {
|
|
107496
107542
|
if (isEnclosingDeclaration(input)) {
|
|
107497
107543
|
enclosingDeclaration = previousEnclosingDeclaration;
|
|
@@ -108383,13 +108429,13 @@ var ts;
|
|
|
108383
108429
|
if (ts.fileExtensionIs(inputFileName, ".json" /* Json */))
|
|
108384
108430
|
return;
|
|
108385
108431
|
if (js && configFile.options.sourceMap) {
|
|
108386
|
-
addOutput(
|
|
108432
|
+
addOutput(js + ".map");
|
|
108387
108433
|
}
|
|
108388
108434
|
if (ts.getEmitDeclarations(configFile.options)) {
|
|
108389
108435
|
var dts = getOutputDeclarationFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory);
|
|
108390
108436
|
addOutput(dts);
|
|
108391
108437
|
if (configFile.options.declarationMap) {
|
|
108392
|
-
addOutput(
|
|
108438
|
+
addOutput(dts + ".map");
|
|
108393
108439
|
}
|
|
108394
108440
|
}
|
|
108395
108441
|
}
|
|
@@ -108458,7 +108504,7 @@ var ts;
|
|
|
108458
108504
|
function getFirstProjectOutput(configFile, ignoreCase) {
|
|
108459
108505
|
if (ts.outFile(configFile.options)) {
|
|
108460
108506
|
var jsFilePath = getOutputPathsForBundle(configFile.options, /*forceDtsPaths*/ false).jsFilePath;
|
|
108461
|
-
return ts.Debug.checkDefined(jsFilePath, "project "
|
|
108507
|
+
return ts.Debug.checkDefined(jsFilePath, "project " + configFile.options.configFilePath + " expected to have at least one output");
|
|
108462
108508
|
}
|
|
108463
108509
|
var getCommonSourceDirectory = ts.memoize(function () { return getCommonSourceDirectoryOfConfig(configFile, ignoreCase); });
|
|
108464
108510
|
for (var _a = 0, _b = configFile.fileNames; _a < _b.length; _a++) {
|
|
@@ -108477,7 +108523,7 @@ var ts;
|
|
|
108477
108523
|
var buildInfoPath = getTsBuildInfoEmitOutputFilePath(configFile.options);
|
|
108478
108524
|
if (buildInfoPath)
|
|
108479
108525
|
return buildInfoPath;
|
|
108480
|
-
return ts.Debug.fail("project "
|
|
108526
|
+
return ts.Debug.fail("project " + configFile.options.configFilePath + " expected to have at least one output");
|
|
108481
108527
|
}
|
|
108482
108528
|
ts.getFirstProjectOutput = getFirstProjectOutput;
|
|
108483
108529
|
/*@internal*/
|
|
@@ -108703,7 +108749,7 @@ var ts;
|
|
|
108703
108749
|
if (sourceMappingURL) {
|
|
108704
108750
|
if (!writer.isAtStartOfLine())
|
|
108705
108751
|
writer.rawWrite(newLine);
|
|
108706
|
-
writer.writeComment("//# "
|
|
108752
|
+
writer.writeComment("//# " + "sourceMappingURL" + "=" + sourceMappingURL); // Tools can sometimes see this line as a source mapping url comment
|
|
108707
108753
|
}
|
|
108708
108754
|
// Write the source map
|
|
108709
108755
|
if (sourceMapFilePath) {
|
|
@@ -108752,7 +108798,7 @@ var ts;
|
|
|
108752
108798
|
// Encode the sourceMap into the sourceMap url
|
|
108753
108799
|
var sourceMapText = sourceMapGenerator.toString();
|
|
108754
108800
|
var base64SourceMapText = ts.base64encode(ts.sys, sourceMapText);
|
|
108755
|
-
return "data:application/json;base64,"
|
|
108801
|
+
return "data:application/json;base64," + base64SourceMapText;
|
|
108756
108802
|
}
|
|
108757
108803
|
var sourceMapFile = ts.getBaseFileName(ts.normalizeSlashes(ts.Debug.checkDefined(sourceMapFilePath)));
|
|
108758
108804
|
if (mapOptions.mapRoot) {
|
|
@@ -108932,7 +108978,7 @@ var ts;
|
|
|
108932
108978
|
return;
|
|
108933
108979
|
break;
|
|
108934
108980
|
default:
|
|
108935
|
-
ts.Debug.fail("Unexpected path: "
|
|
108981
|
+
ts.Debug.fail("Unexpected path: " + name);
|
|
108936
108982
|
}
|
|
108937
108983
|
outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark });
|
|
108938
108984
|
},
|
|
@@ -109792,7 +109838,7 @@ var ts;
|
|
|
109792
109838
|
return writeTokenNode(node, writeKeyword);
|
|
109793
109839
|
if (ts.isTokenKind(node.kind))
|
|
109794
109840
|
return writeTokenNode(node, writePunctuation);
|
|
109795
|
-
ts.Debug.fail("Unhandled SyntaxKind: "
|
|
109841
|
+
ts.Debug.fail("Unhandled SyntaxKind: " + ts.Debug.formatSyntaxKind(node.kind) + ".");
|
|
109796
109842
|
}
|
|
109797
109843
|
function emitMappedTypeParameter(node) {
|
|
109798
109844
|
emit(node.name);
|
|
@@ -109962,16 +110008,16 @@ var ts;
|
|
|
109962
110008
|
}
|
|
109963
110009
|
}
|
|
109964
110010
|
function emitPlaceholder(hint, node, snippet) {
|
|
109965
|
-
nonEscapingWrite("${"
|
|
110011
|
+
nonEscapingWrite("${" + snippet.order + ":"); // `${2:`
|
|
109966
110012
|
pipelineEmitWithHintWorker(hint, node, /*allowSnippets*/ false); // `...`
|
|
109967
110013
|
nonEscapingWrite("}"); // `}`
|
|
109968
110014
|
// `${2:...}`
|
|
109969
110015
|
}
|
|
109970
110016
|
function emitTabStop(hint, node, snippet) {
|
|
109971
110017
|
// A tab stop should only be attached to an empty node, i.e. a node that doesn't emit any text.
|
|
109972
|
-
ts.Debug.assert(node.kind === 235 /* EmptyStatement */, "A tab stop cannot be attached to a node of kind "
|
|
110018
|
+
ts.Debug.assert(node.kind === 235 /* EmptyStatement */, "A tab stop cannot be attached to a node of kind " + ts.Debug.formatSyntaxKind(node.kind) + ".");
|
|
109973
110019
|
ts.Debug.assert(hint !== 5 /* EmbeddedStatement */, "A tab stop cannot be attached to an embedded statement.");
|
|
109974
|
-
nonEscapingWrite("$"
|
|
110020
|
+
nonEscapingWrite("$" + snippet.order);
|
|
109975
110021
|
}
|
|
109976
110022
|
//
|
|
109977
110023
|
// Identifiers
|
|
@@ -111733,17 +111779,17 @@ var ts;
|
|
|
111733
111779
|
writeLine();
|
|
111734
111780
|
}
|
|
111735
111781
|
if (currentSourceFile && currentSourceFile.moduleName) {
|
|
111736
|
-
writeComment("/// <amd-module name=\""
|
|
111782
|
+
writeComment("/// <amd-module name=\"" + currentSourceFile.moduleName + "\" />");
|
|
111737
111783
|
writeLine();
|
|
111738
111784
|
}
|
|
111739
111785
|
if (currentSourceFile && currentSourceFile.amdDependencies) {
|
|
111740
111786
|
for (var _a = 0, _b = currentSourceFile.amdDependencies; _a < _b.length; _a++) {
|
|
111741
111787
|
var dep = _b[_a];
|
|
111742
111788
|
if (dep.name) {
|
|
111743
|
-
writeComment("/// <amd-dependency name=\""
|
|
111789
|
+
writeComment("/// <amd-dependency name=\"" + dep.name + "\" path=\"" + dep.path + "\" />");
|
|
111744
111790
|
}
|
|
111745
111791
|
else {
|
|
111746
|
-
writeComment("/// <amd-dependency path=\""
|
|
111792
|
+
writeComment("/// <amd-dependency path=\"" + dep.path + "\" />");
|
|
111747
111793
|
}
|
|
111748
111794
|
writeLine();
|
|
111749
111795
|
}
|
|
@@ -111751,7 +111797,7 @@ var ts;
|
|
|
111751
111797
|
for (var _c = 0, files_2 = files; _c < files_2.length; _c++) {
|
|
111752
111798
|
var directive = files_2[_c];
|
|
111753
111799
|
var pos = writer.getTextPos();
|
|
111754
|
-
writeComment("/// <reference path=\""
|
|
111800
|
+
writeComment("/// <reference path=\"" + directive.fileName + "\" />");
|
|
111755
111801
|
if (bundleFileInfo)
|
|
111756
111802
|
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "reference" /* Reference */, data: directive.fileName });
|
|
111757
111803
|
writeLine();
|
|
@@ -111759,7 +111805,7 @@ var ts;
|
|
|
111759
111805
|
for (var _d = 0, types_24 = types; _d < types_24.length; _d++) {
|
|
111760
111806
|
var directive = types_24[_d];
|
|
111761
111807
|
var pos = writer.getTextPos();
|
|
111762
|
-
writeComment("/// <reference types=\""
|
|
111808
|
+
writeComment("/// <reference types=\"" + directive.fileName + "\" />");
|
|
111763
111809
|
if (bundleFileInfo)
|
|
111764
111810
|
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "type" /* Type */, data: directive.fileName });
|
|
111765
111811
|
writeLine();
|
|
@@ -111767,7 +111813,7 @@ var ts;
|
|
|
111767
111813
|
for (var _e = 0, libs_1 = libs; _e < libs_1.length; _e++) {
|
|
111768
111814
|
var directive = libs_1[_e];
|
|
111769
111815
|
var pos = writer.getTextPos();
|
|
111770
|
-
writeComment("/// <reference lib=\""
|
|
111816
|
+
writeComment("/// <reference lib=\"" + directive.fileName + "\" />");
|
|
111771
111817
|
if (bundleFileInfo)
|
|
111772
111818
|
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "lib" /* Lib */, data: directive.fileName });
|
|
111773
111819
|
writeLine();
|
|
@@ -112547,9 +112593,9 @@ var ts;
|
|
|
112547
112593
|
var textSourceNode = node.textSourceNode;
|
|
112548
112594
|
if (ts.isIdentifier(textSourceNode) || ts.isNumericLiteral(textSourceNode)) {
|
|
112549
112595
|
var text = ts.isNumericLiteral(textSourceNode) ? textSourceNode.text : getTextOfNode(textSourceNode);
|
|
112550
|
-
return jsxAttributeEscape ? "\""
|
|
112551
|
-
neverAsciiEscape || (ts.getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? "\""
|
|
112552
|
-
"\""
|
|
112596
|
+
return jsxAttributeEscape ? "\"" + ts.escapeJsxAttributeString(text) + "\"" :
|
|
112597
|
+
neverAsciiEscape || (ts.getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? "\"" + ts.escapeString(text) + "\"" :
|
|
112598
|
+
"\"" + ts.escapeNonAsciiString(text) + "\"";
|
|
112553
112599
|
}
|
|
112554
112600
|
else {
|
|
112555
112601
|
return getLiteralTextOfNode(textSourceNode, neverAsciiEscape, jsxAttributeEscape);
|
|
@@ -113026,8 +113072,8 @@ var ts;
|
|
|
113026
113072
|
}
|
|
113027
113073
|
function formatSynthesizedComment(comment) {
|
|
113028
113074
|
return comment.kind === 3 /* MultiLineCommentTrivia */
|
|
113029
|
-
? "/*"
|
|
113030
|
-
: "//"
|
|
113075
|
+
? "/*" + comment.text + "*/"
|
|
113076
|
+
: "//" + comment.text;
|
|
113031
113077
|
}
|
|
113032
113078
|
function emitBodyWithDetachedComments(node, detachedRange, emitCallback) {
|
|
113033
113079
|
enterComment();
|
|
@@ -113748,7 +113794,7 @@ var ts;
|
|
|
113748
113794
|
var watchedDirPath = _a.watchedDirPath, fileOrDirectory = _a.fileOrDirectory, fileOrDirectoryPath = _a.fileOrDirectoryPath, configFileName = _a.configFileName, options = _a.options, program = _a.program, extraFileExtensions = _a.extraFileExtensions, currentDirectory = _a.currentDirectory, useCaseSensitiveFileNames = _a.useCaseSensitiveFileNames, writeLog = _a.writeLog, toPath = _a.toPath;
|
|
113749
113795
|
var newPath = ts.removeIgnoredPath(fileOrDirectoryPath);
|
|
113750
113796
|
if (!newPath) {
|
|
113751
|
-
writeLog("Project: "
|
|
113797
|
+
writeLog("Project: " + configFileName + " Detected ignored path: " + fileOrDirectory);
|
|
113752
113798
|
return true;
|
|
113753
113799
|
}
|
|
113754
113800
|
fileOrDirectoryPath = newPath;
|
|
@@ -113757,11 +113803,11 @@ var ts;
|
|
|
113757
113803
|
// If the the added or created file or directory is not supported file name, ignore the file
|
|
113758
113804
|
// But when watched directory is added/removed, we need to reload the file list
|
|
113759
113805
|
if (ts.hasExtension(fileOrDirectoryPath) && !ts.isSupportedSourceFileName(fileOrDirectory, options, extraFileExtensions)) {
|
|
113760
|
-
writeLog("Project: "
|
|
113806
|
+
writeLog("Project: " + configFileName + " Detected file add/remove of non supported extension: " + fileOrDirectory);
|
|
113761
113807
|
return true;
|
|
113762
113808
|
}
|
|
113763
113809
|
if (ts.isExcludedFile(fileOrDirectory, options.configFile.configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), useCaseSensitiveFileNames, currentDirectory)) {
|
|
113764
|
-
writeLog("Project: "
|
|
113810
|
+
writeLog("Project: " + configFileName + " Detected excluded file: " + fileOrDirectory);
|
|
113765
113811
|
return true;
|
|
113766
113812
|
}
|
|
113767
113813
|
if (!program)
|
|
@@ -113785,7 +113831,7 @@ var ts;
|
|
|
113785
113831
|
var builderProgram = !realProgram && !ts.isArray(program) ? program : undefined;
|
|
113786
113832
|
if (hasSourceFile((filePathWithoutExtension + ".ts" /* Ts */)) ||
|
|
113787
113833
|
hasSourceFile((filePathWithoutExtension + ".tsx" /* Tsx */))) {
|
|
113788
|
-
writeLog("Project: "
|
|
113834
|
+
writeLog("Project: " + configFileName + " Detected output file: " + fileOrDirectory);
|
|
113789
113835
|
return true;
|
|
113790
113836
|
}
|
|
113791
113837
|
return false;
|
|
@@ -113853,36 +113899,36 @@ var ts;
|
|
|
113853
113899
|
host.useCaseSensitiveFileNames();
|
|
113854
113900
|
}
|
|
113855
113901
|
function createExcludeWatcherWithLogging(file, flags, options, detailInfo1, detailInfo2) {
|
|
113856
|
-
log("ExcludeWatcher:: Added:: "
|
|
113902
|
+
log("ExcludeWatcher:: Added:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
|
|
113857
113903
|
return {
|
|
113858
|
-
close: function () { return log("ExcludeWatcher:: Close:: "
|
|
113904
|
+
close: function () { return log("ExcludeWatcher:: Close:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)); }
|
|
113859
113905
|
};
|
|
113860
113906
|
}
|
|
113861
113907
|
function createFileWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) {
|
|
113862
|
-
log("FileWatcher:: Added:: "
|
|
113908
|
+
log("FileWatcher:: Added:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
|
|
113863
113909
|
var watcher = triggerInvokingFactory.watchFile(file, cb, flags, options, detailInfo1, detailInfo2);
|
|
113864
113910
|
return {
|
|
113865
113911
|
close: function () {
|
|
113866
|
-
log("FileWatcher:: Close:: "
|
|
113912
|
+
log("FileWatcher:: Close:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
|
|
113867
113913
|
watcher.close();
|
|
113868
113914
|
}
|
|
113869
113915
|
};
|
|
113870
113916
|
}
|
|
113871
113917
|
function createDirectoryWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) {
|
|
113872
|
-
var watchInfo = "DirectoryWatcher:: Added:: "
|
|
113918
|
+
var watchInfo = "DirectoryWatcher:: Added:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo);
|
|
113873
113919
|
log(watchInfo);
|
|
113874
113920
|
var start = ts.timestamp();
|
|
113875
113921
|
var watcher = triggerInvokingFactory.watchDirectory(file, cb, flags, options, detailInfo1, detailInfo2);
|
|
113876
113922
|
var elapsed = ts.timestamp() - start;
|
|
113877
|
-
log("Elapsed:: "
|
|
113923
|
+
log("Elapsed:: " + elapsed + "ms " + watchInfo);
|
|
113878
113924
|
return {
|
|
113879
113925
|
close: function () {
|
|
113880
|
-
var watchInfo = "DirectoryWatcher:: Close:: "
|
|
113926
|
+
var watchInfo = "DirectoryWatcher:: Close:: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo);
|
|
113881
113927
|
log(watchInfo);
|
|
113882
113928
|
var start = ts.timestamp();
|
|
113883
113929
|
watcher.close();
|
|
113884
113930
|
var elapsed = ts.timestamp() - start;
|
|
113885
|
-
log("Elapsed:: "
|
|
113931
|
+
log("Elapsed:: " + elapsed + "ms " + watchInfo);
|
|
113886
113932
|
}
|
|
113887
113933
|
};
|
|
113888
113934
|
}
|
|
@@ -113892,16 +113938,16 @@ var ts;
|
|
|
113892
113938
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
113893
113939
|
args[_i] = arguments[_i];
|
|
113894
113940
|
}
|
|
113895
|
-
var triggerredInfo =
|
|
113941
|
+
var triggerredInfo = (key === "watchFile" ? "FileWatcher" : "DirectoryWatcher") + ":: Triggered with " + args[0] + " " + (args[1] !== undefined ? args[1] : "") + ":: " + getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo);
|
|
113896
113942
|
log(triggerredInfo);
|
|
113897
113943
|
var start = ts.timestamp();
|
|
113898
113944
|
cb.call.apply(cb, __spreadArray([/*thisArg*/ undefined], args, false));
|
|
113899
113945
|
var elapsed = ts.timestamp() - start;
|
|
113900
|
-
log("Elapsed:: "
|
|
113946
|
+
log("Elapsed:: " + elapsed + "ms " + triggerredInfo);
|
|
113901
113947
|
}, flags, options, detailInfo1, detailInfo2); };
|
|
113902
113948
|
}
|
|
113903
113949
|
function getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo) {
|
|
113904
|
-
return "WatchInfo: "
|
|
113950
|
+
return "WatchInfo: " + file + " " + flags + " " + JSON.stringify(options) + " " + (getDetailWatchInfo ? getDetailWatchInfo(detailInfo1, detailInfo2) : detailInfo2 === undefined ? detailInfo1 : detailInfo1 + " " + detailInfo2);
|
|
113905
113951
|
}
|
|
113906
113952
|
}
|
|
113907
113953
|
ts.getWatchFactory = getWatchFactory;
|
|
@@ -114208,12 +114254,12 @@ var ts;
|
|
|
114208
114254
|
}
|
|
114209
114255
|
ts.formatDiagnostics = formatDiagnostics;
|
|
114210
114256
|
function formatDiagnostic(diagnostic, host) {
|
|
114211
|
-
var errorMessage =
|
|
114257
|
+
var errorMessage = ts.diagnosticCategoryName(diagnostic) + " TS" + diagnostic.code + ": " + flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()) + host.getNewLine();
|
|
114212
114258
|
if (diagnostic.file) {
|
|
114213
114259
|
var _a = ts.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start), line = _a.line, character = _a.character; // TODO: GH#18217
|
|
114214
114260
|
var fileName = diagnostic.file.fileName;
|
|
114215
114261
|
var relativeFileName = ts.convertToRelativePath(fileName, host.getCurrentDirectory(), function (fileName) { return host.getCanonicalFileName(fileName); });
|
|
114216
|
-
return
|
|
114262
|
+
return relativeFileName + "(" + (line + 1) + "," + (character + 1) + "): " + errorMessage;
|
|
114217
114263
|
}
|
|
114218
114264
|
return errorMessage;
|
|
114219
114265
|
}
|
|
@@ -114301,9 +114347,9 @@ var ts;
|
|
|
114301
114347
|
var output = "";
|
|
114302
114348
|
output += color(relativeFileName, ForegroundColorEscapeSequences.Cyan);
|
|
114303
114349
|
output += ":";
|
|
114304
|
-
output += color(""
|
|
114350
|
+
output += color("" + (firstLine + 1), ForegroundColorEscapeSequences.Yellow);
|
|
114305
114351
|
output += ":";
|
|
114306
|
-
output += color(""
|
|
114352
|
+
output += color("" + (firstLineChar + 1), ForegroundColorEscapeSequences.Yellow);
|
|
114307
114353
|
return output;
|
|
114308
114354
|
}
|
|
114309
114355
|
ts.formatLocation = formatLocation;
|
|
@@ -114317,7 +114363,7 @@ var ts;
|
|
|
114317
114363
|
output += " - ";
|
|
114318
114364
|
}
|
|
114319
114365
|
output += formatColorAndReset(ts.diagnosticCategoryName(diagnostic), getCategoryFormat(diagnostic.category));
|
|
114320
|
-
output += formatColorAndReset(" TS"
|
|
114366
|
+
output += formatColorAndReset(" TS" + diagnostic.code + ": ", ForegroundColorEscapeSequences.Grey);
|
|
114321
114367
|
output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine());
|
|
114322
114368
|
if (diagnostic.file) {
|
|
114323
114369
|
output += host.getNewLine();
|
|
@@ -114426,7 +114472,7 @@ var ts;
|
|
|
114426
114472
|
var result = void 0;
|
|
114427
114473
|
var mode = getModeForResolutionAtIndex(containingFile, i);
|
|
114428
114474
|
i++;
|
|
114429
|
-
var cacheKey = mode !== undefined ?
|
|
114475
|
+
var cacheKey = mode !== undefined ? mode + "|" + name : name;
|
|
114430
114476
|
if (cache.has(cacheKey)) {
|
|
114431
114477
|
result = cache.get(cacheKey);
|
|
114432
114478
|
}
|
|
@@ -116615,7 +116661,7 @@ var ts;
|
|
|
116615
116661
|
path += (i === 2 ? "/" : "-") + components[i];
|
|
116616
116662
|
i++;
|
|
116617
116663
|
}
|
|
116618
|
-
var resolveFrom = ts.combinePaths(currentDirectory, "__lib_node_modules_lookup_"
|
|
116664
|
+
var resolveFrom = ts.combinePaths(currentDirectory, "__lib_node_modules_lookup_" + libFileName + "__.ts");
|
|
116619
116665
|
var localOverrideModuleResult = ts.resolveModuleName("@typescript/lib-" + path, resolveFrom, { moduleResolution: ts.ModuleResolutionKind.NodeJs }, host, moduleResolutionCache);
|
|
116620
116666
|
if (localOverrideModuleResult === null || localOverrideModuleResult === void 0 ? void 0 : localOverrideModuleResult.resolvedModule) {
|
|
116621
116667
|
return localOverrideModuleResult.resolvedModule.resolvedFileName;
|
|
@@ -117436,12 +117482,12 @@ var ts;
|
|
|
117436
117482
|
}
|
|
117437
117483
|
function directoryExistsIfProjectReferenceDeclDir(dir) {
|
|
117438
117484
|
var dirPath = host.toPath(dir);
|
|
117439
|
-
var dirPathWithTrailingDirectorySeparator = ""
|
|
117485
|
+
var dirPathWithTrailingDirectorySeparator = "" + dirPath + ts.directorySeparator;
|
|
117440
117486
|
return ts.forEachKey(setOfDeclarationDirectories, function (declDirPath) { return dirPath === declDirPath ||
|
|
117441
117487
|
// Any parent directory of declaration dir
|
|
117442
117488
|
ts.startsWith(declDirPath, dirPathWithTrailingDirectorySeparator) ||
|
|
117443
117489
|
// Any directory inside declaration dir
|
|
117444
|
-
ts.startsWith(dirPath,
|
|
117490
|
+
ts.startsWith(dirPath, declDirPath + "/"); });
|
|
117445
117491
|
}
|
|
117446
117492
|
function handleDirectoryCouldBeSymlink(directory) {
|
|
117447
117493
|
var _a;
|
|
@@ -117494,7 +117540,7 @@ var ts;
|
|
|
117494
117540
|
if (isFile && result) {
|
|
117495
117541
|
// Store the real path for the file'
|
|
117496
117542
|
var absolutePath = ts.getNormalizedAbsolutePath(fileOrDirectory, host.compilerHost.getCurrentDirectory());
|
|
117497
|
-
symlinkCache.setSymlinkedFile(fileOrDirectoryPath, ""
|
|
117543
|
+
symlinkCache.setSymlinkedFile(fileOrDirectoryPath, "" + symlinkedDirectory.real + absolutePath.replace(new RegExp(directoryPath, "i"), ""));
|
|
117498
117544
|
}
|
|
117499
117545
|
return result;
|
|
117500
117546
|
}) || false;
|
|
@@ -117952,7 +117998,7 @@ var ts;
|
|
|
117952
117998
|
/*forceDtsEmit*/ true);
|
|
117953
117999
|
var firstDts_1 = ts.firstOrUndefined(emitOutput_1.outputFiles);
|
|
117954
118000
|
if (firstDts_1) {
|
|
117955
|
-
ts.Debug.assert(ts.fileExtensionIsOneOf(firstDts_1.name, [".d.ts" /* Dts */, ".d.mts" /* Dmts */, ".d.cts" /* Dcts */]), "File extension for signature expected to be dts", function () { return "Found: "
|
|
118001
|
+
ts.Debug.assert(ts.fileExtensionIsOneOf(firstDts_1.name, [".d.ts" /* Dts */, ".d.mts" /* Dmts */, ".d.cts" /* Dcts */]), "File extension for signature expected to be dts", function () { return "Found: " + ts.getAnyExtensionFromPath(firstDts_1.name) + " for " + firstDts_1.name + ":: All output files: " + JSON.stringify(emitOutput_1.outputFiles.map(function (f) { return f.name; })); });
|
|
117956
118002
|
latestSignature = (computeHash || ts.generateDjb2Hash)(firstDts_1.text);
|
|
117957
118003
|
if (exportedModulesMapCache && latestSignature !== prevSignature) {
|
|
117958
118004
|
updateExportedModules(sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit, exportedModulesMapCache);
|
|
@@ -118460,7 +118506,7 @@ var ts;
|
|
|
118460
118506
|
return;
|
|
118461
118507
|
}
|
|
118462
118508
|
else {
|
|
118463
|
-
ts.Debug.assert(state.hasCalledUpdateShapeSignature.has(affectedFile.resolvedPath) || ((_a = state.currentAffectedFilesSignatures) === null || _a === void 0 ? void 0 : _a.has(affectedFile.resolvedPath)), "Signature not updated for affected file: "
|
|
118509
|
+
ts.Debug.assert(state.hasCalledUpdateShapeSignature.has(affectedFile.resolvedPath) || ((_a = state.currentAffectedFilesSignatures) === null || _a === void 0 ? void 0 : _a.has(affectedFile.resolvedPath)), "Signature not updated for affected file: " + affectedFile.fileName);
|
|
118464
118510
|
}
|
|
118465
118511
|
if (!state.compilerOptions.assumeChangesOnlyAffectDirectDependencies) {
|
|
118466
118512
|
forEachReferencingModulesOfExportOfAffectedFile(state, affectedFile, function (state, path) { return handleDtsMayChangeOf(state, path, cancellationToken, computeHash); });
|
|
@@ -119605,7 +119651,7 @@ var ts;
|
|
|
119605
119651
|
failedLookupLocation = ts.isRootedDiskPath(failedLookupLocation) ? ts.normalizePath(failedLookupLocation) : ts.getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory());
|
|
119606
119652
|
var failedLookupPathSplit = failedLookupLocationPath.split(ts.directorySeparator);
|
|
119607
119653
|
var failedLookupSplit = failedLookupLocation.split(ts.directorySeparator);
|
|
119608
|
-
ts.Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, "FailedLookup: "
|
|
119654
|
+
ts.Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, "FailedLookup: " + failedLookupLocation + " failedLookupLocationPath: " + failedLookupLocationPath);
|
|
119609
119655
|
if (failedLookupPathSplit.length > rootSplitLength + 1) {
|
|
119610
119656
|
// Instead of watching root, watch directory in root to avoid watching excluded directories not needed for module resolution
|
|
119611
119657
|
return {
|
|
@@ -120687,7 +120733,7 @@ var ts;
|
|
|
120687
120733
|
}
|
|
120688
120734
|
function getJSExtensionForFile(fileName, options) {
|
|
120689
120735
|
var _a;
|
|
120690
|
-
return (_a = tryGetJSExtensionForFile(fileName, options)) !== null && _a !== void 0 ? _a : ts.Debug.fail("Extension "
|
|
120736
|
+
return (_a = tryGetJSExtensionForFile(fileName, options)) !== null && _a !== void 0 ? _a : ts.Debug.fail("Extension " + ts.extensionFromPath(fileName) + " is unsupported:: FileName:: " + fileName);
|
|
120691
120737
|
}
|
|
120692
120738
|
function tryGetJSExtensionForFile(fileName, options) {
|
|
120693
120739
|
var ext = ts.tryGetExtensionFromPath(fileName);
|
|
@@ -120790,8 +120836,8 @@ var ts;
|
|
|
120790
120836
|
return pretty ?
|
|
120791
120837
|
function (diagnostic, newLine, options) {
|
|
120792
120838
|
clearScreenIfNotWatchingForFileChanges(system, diagnostic, options);
|
|
120793
|
-
var output = "["
|
|
120794
|
-
output += ""
|
|
120839
|
+
var output = "[" + ts.formatColorAndReset(getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey) + "] ";
|
|
120840
|
+
output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + (newLine + newLine);
|
|
120795
120841
|
system.write(output);
|
|
120796
120842
|
} :
|
|
120797
120843
|
function (diagnostic, newLine, options) {
|
|
@@ -120799,8 +120845,8 @@ var ts;
|
|
|
120799
120845
|
if (!clearScreenIfNotWatchingForFileChanges(system, diagnostic, options)) {
|
|
120800
120846
|
output += newLine;
|
|
120801
120847
|
}
|
|
120802
|
-
output +=
|
|
120803
|
-
output += ""
|
|
120848
|
+
output += getLocaleTimeString(system) + " - ";
|
|
120849
|
+
output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + getPlainDiagnosticFollowingNewLines(diagnostic, newLine);
|
|
120804
120850
|
system.write(output);
|
|
120805
120851
|
};
|
|
120806
120852
|
}
|
|
@@ -120823,7 +120869,7 @@ var ts;
|
|
|
120823
120869
|
.map(function (errorDiagnostic) {
|
|
120824
120870
|
if (errorDiagnostic.file === undefined)
|
|
120825
120871
|
return;
|
|
120826
|
-
return ""
|
|
120872
|
+
return "" + errorDiagnostic.file.fileName;
|
|
120827
120873
|
});
|
|
120828
120874
|
return filesInError.map(function (fileName) {
|
|
120829
120875
|
var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
|
|
@@ -120856,7 +120902,7 @@ var ts;
|
|
|
120856
120902
|
if (errorCount === 0)
|
|
120857
120903
|
return "";
|
|
120858
120904
|
var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
|
|
120859
|
-
var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return
|
|
120905
|
+
var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
|
|
120860
120906
|
.filter(function (value, index, self) { return self.indexOf(value) === index; });
|
|
120861
120907
|
var firstFileReference = nonNilFiles[0] && prettyPathForFileError(nonNilFiles[0], host.getCurrentDirectory());
|
|
120862
120908
|
var d = errorCount === 1 ?
|
|
@@ -120869,7 +120915,7 @@ var ts;
|
|
|
120869
120915
|
ts.Diagnostics.Found_0_errors_in_the_same_file_starting_at_Colon_1 :
|
|
120870
120916
|
ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length === 1 ? firstFileReference : distinctFileNamesWithLines.length);
|
|
120871
120917
|
var suffix = distinctFileNamesWithLines.length > 1 ? createTabularErrorsDisplay(nonNilFiles, host) : "";
|
|
120872
|
-
return ""
|
|
120918
|
+
return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + suffix;
|
|
120873
120919
|
}
|
|
120874
120920
|
ts.getErrorSummaryText = getErrorSummaryText;
|
|
120875
120921
|
function createTabularErrorsDisplay(filesInError, host) {
|
|
@@ -120892,7 +120938,7 @@ var ts;
|
|
|
120892
120938
|
" ".repeat(leftPaddingGoal - errorCountDigitsLength)
|
|
120893
120939
|
: "";
|
|
120894
120940
|
var fileRef = prettyPathForFileError(file, host.getCurrentDirectory());
|
|
120895
|
-
tabularData += ""
|
|
120941
|
+
tabularData += "" + leftPadding + errorCount + " " + fileRef + "\n";
|
|
120896
120942
|
});
|
|
120897
120943
|
return tabularData;
|
|
120898
120944
|
}
|
|
@@ -120919,9 +120965,9 @@ var ts;
|
|
|
120919
120965
|
var relativeFileName = function (fileName) { return ts.convertToRelativePath(fileName, program.getCurrentDirectory(), getCanonicalFileName); };
|
|
120920
120966
|
for (var _i = 0, _c = program.getSourceFiles(); _i < _c.length; _i++) {
|
|
120921
120967
|
var file = _c[_i];
|
|
120922
|
-
write(""
|
|
120923
|
-
(_a = reasons.get(file.path)) === null || _a === void 0 ? void 0 : _a.forEach(function (reason) { return write(" "
|
|
120924
|
-
(_b = explainIfFileIsRedirect(file, relativeFileName)) === null || _b === void 0 ? void 0 : _b.forEach(function (d) { return write(" "
|
|
120968
|
+
write("" + toFileName(file, relativeFileName));
|
|
120969
|
+
(_a = reasons.get(file.path)) === null || _a === void 0 ? void 0 : _a.forEach(function (reason) { return write(" " + fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText); });
|
|
120970
|
+
(_b = explainIfFileIsRedirect(file, relativeFileName)) === null || _b === void 0 ? void 0 : _b.forEach(function (d) { return write(" " + d.messageText); });
|
|
120925
120971
|
}
|
|
120926
120972
|
}
|
|
120927
120973
|
ts.explainFiles = explainFiles;
|
|
@@ -120961,7 +121007,7 @@ var ts;
|
|
|
120961
121007
|
if (isJsonFile && !ts.endsWith(includeSpec, ".json" /* Json */))
|
|
120962
121008
|
return false;
|
|
120963
121009
|
var pattern = ts.getPatternFromSpec(includeSpec, basePath, "files");
|
|
120964
|
-
return !!pattern && ts.getRegexFromPattern("("
|
|
121010
|
+
return !!pattern && ts.getRegexFromPattern("(" + pattern + ")$", useCaseSensitiveFileNames).test(fileName);
|
|
120965
121011
|
});
|
|
120966
121012
|
}
|
|
120967
121013
|
ts.getMatchedIncludeSpec = getMatchedIncludeSpec;
|
|
@@ -120970,7 +121016,7 @@ var ts;
|
|
|
120970
121016
|
var options = program.getCompilerOptions();
|
|
120971
121017
|
if (ts.isReferencedFile(reason)) {
|
|
120972
121018
|
var referenceLocation = ts.getReferencedFileLocation(function (path) { return program.getSourceFileByPath(path); }, reason);
|
|
120973
|
-
var referenceText = ts.isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : "\""
|
|
121019
|
+
var referenceText = ts.isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : "\"" + referenceLocation.text + "\"";
|
|
120974
121020
|
var message = void 0;
|
|
120975
121021
|
ts.Debug.assert(ts.isReferenceFileLocation(referenceLocation) || reason.kind === ts.FileIncludeKind.Import, "Only synthetic references are imports");
|
|
120976
121022
|
switch (reason.kind) {
|
|
@@ -121094,7 +121140,7 @@ var ts;
|
|
|
121094
121140
|
var currentDir_1 = program.getCurrentDirectory();
|
|
121095
121141
|
ts.forEach(emittedFiles, function (file) {
|
|
121096
121142
|
var filepath = ts.getNormalizedAbsolutePath(file, currentDir_1);
|
|
121097
|
-
write("TSFILE: "
|
|
121143
|
+
write("TSFILE: " + filepath);
|
|
121098
121144
|
});
|
|
121099
121145
|
listFiles(program, write);
|
|
121100
121146
|
}
|
|
@@ -121423,7 +121469,7 @@ var ts;
|
|
|
121423
121469
|
}
|
|
121424
121470
|
var _b = ts.createWatchFactory(host, compilerOptions), watchFile = _b.watchFile, watchDirectory = _b.watchDirectory, writeLog = _b.writeLog;
|
|
121425
121471
|
var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
|
|
121426
|
-
writeLog("Current directory: "
|
|
121472
|
+
writeLog("Current directory: " + currentDirectory + " CaseSensitiveFileNames: " + useCaseSensitiveFileNames);
|
|
121427
121473
|
var configFileWatcher;
|
|
121428
121474
|
if (configFileName) {
|
|
121429
121475
|
configFileWatcher = watchFile(configFileName, scheduleProgramReload, ts.PollingInterval.High, watchOptions, ts.WatchType.ConfigFile);
|
|
@@ -121579,10 +121625,10 @@ var ts;
|
|
|
121579
121625
|
function createNewProgram(hasInvalidatedResolution) {
|
|
121580
121626
|
// Compile the program
|
|
121581
121627
|
writeLog("CreatingProgramWith::");
|
|
121582
|
-
writeLog(" roots: "
|
|
121583
|
-
writeLog(" options: "
|
|
121628
|
+
writeLog(" roots: " + JSON.stringify(rootFileNames));
|
|
121629
|
+
writeLog(" options: " + JSON.stringify(compilerOptions));
|
|
121584
121630
|
if (projectReferences)
|
|
121585
|
-
writeLog(" projectReferences: "
|
|
121631
|
+
writeLog(" projectReferences: " + JSON.stringify(projectReferences));
|
|
121586
121632
|
var needsUpdateInTypeRootWatch = hasChangedCompilerOptions || !getCurrentProgram();
|
|
121587
121633
|
hasChangedCompilerOptions = false;
|
|
121588
121634
|
hasChangedConfigFileParsingErrors = false;
|
|
@@ -121743,7 +121789,7 @@ var ts;
|
|
|
121743
121789
|
return resolutionCache.invalidateResolutionsOfFailedLookupLocations();
|
|
121744
121790
|
}
|
|
121745
121791
|
var pending = clearInvalidateResolutionsOfFailedLookupLocations();
|
|
121746
|
-
writeLog("Scheduling invalidateFailedLookup"
|
|
121792
|
+
writeLog("Scheduling invalidateFailedLookup" + (pending ? ", Cancelled earlier one" : ""));
|
|
121747
121793
|
timerToInvalidateFailedLookupResolutions = host.setTimeout(invalidateResolutionsOfFailedLookup, 250);
|
|
121748
121794
|
}
|
|
121749
121795
|
function invalidateResolutionsOfFailedLookup() {
|
|
@@ -121803,7 +121849,7 @@ var ts;
|
|
|
121803
121849
|
synchronizeProgram();
|
|
121804
121850
|
}
|
|
121805
121851
|
function reloadConfigFile() {
|
|
121806
|
-
writeLog("Reloading config file: "
|
|
121852
|
+
writeLog("Reloading config file: " + configFileName);
|
|
121807
121853
|
reloadLevel = ts.ConfigFileProgramReloadLevel.None;
|
|
121808
121854
|
if (cachedDirectoryStructureHost) {
|
|
121809
121855
|
cachedDirectoryStructureHost.clearCache();
|
|
@@ -121844,7 +121890,7 @@ var ts;
|
|
|
121844
121890
|
return config.parsedCommandLine;
|
|
121845
121891
|
}
|
|
121846
121892
|
}
|
|
121847
|
-
writeLog("Loading config file: "
|
|
121893
|
+
writeLog("Loading config file: " + configFileName);
|
|
121848
121894
|
var parsedCommandLine = host.getParsedCommandLine ?
|
|
121849
121895
|
host.getParsedCommandLine(configFileName) :
|
|
121850
121896
|
getParsedCommandLineFromConfigFileHost(configFileName);
|
|
@@ -122148,8 +122194,8 @@ var ts;
|
|
|
122148
122194
|
*/
|
|
122149
122195
|
function createBuilderStatusReporter(system, pretty) {
|
|
122150
122196
|
return function (diagnostic) {
|
|
122151
|
-
var output = pretty ? "["
|
|
122152
|
-
output += ""
|
|
122197
|
+
var output = pretty ? "[" + ts.formatColorAndReset(ts.getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey) + "] " : ts.getLocaleTimeString(system) + " - ";
|
|
122198
|
+
output += "" + ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine) + (system.newLine + system.newLine);
|
|
122153
122199
|
system.write(output);
|
|
122154
122200
|
};
|
|
122155
122201
|
}
|
|
@@ -122924,7 +122970,7 @@ var ts;
|
|
|
122924
122970
|
function listEmittedFile(_a, proj, file) {
|
|
122925
122971
|
var write = _a.write;
|
|
122926
122972
|
if (write && proj.options.listEmittedFiles) {
|
|
122927
|
-
write("TSFILE: "
|
|
122973
|
+
write("TSFILE: " + file);
|
|
122928
122974
|
}
|
|
122929
122975
|
}
|
|
122930
122976
|
function getOldProgram(_a, proj, parsed) {
|
|
@@ -122953,7 +122999,7 @@ var ts;
|
|
|
122953
122999
|
function buildErrors(state, resolvedPath, program, config, diagnostics, buildResult, errorType) {
|
|
122954
123000
|
var canEmitBuildInfo = !(buildResult & BuildResultFlags.SyntaxErrors) && program && !ts.outFile(program.getCompilerOptions());
|
|
122955
123001
|
reportAndStoreErrors(state, resolvedPath, diagnostics);
|
|
122956
|
-
state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason:
|
|
123002
|
+
state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: errorType + " errors" });
|
|
122957
123003
|
if (canEmitBuildInfo)
|
|
122958
123004
|
return { buildResult: buildResult, step: BuildStep.EmitBuildInfo };
|
|
122959
123005
|
afterProgramDone(state, program, config);
|
|
@@ -122981,7 +123027,7 @@ var ts;
|
|
|
122981
123027
|
if (!host.fileExists(inputFile)) {
|
|
122982
123028
|
return {
|
|
122983
123029
|
type: ts.UpToDateStatusType.Unbuildable,
|
|
122984
|
-
reason:
|
|
123030
|
+
reason: inputFile + " does not exist"
|
|
122985
123031
|
};
|
|
122986
123032
|
}
|
|
122987
123033
|
if (!force) {
|
|
@@ -123340,7 +123386,7 @@ var ts;
|
|
|
123340
123386
|
}
|
|
123341
123387
|
}
|
|
123342
123388
|
if (filesToDelete) {
|
|
123343
|
-
reportStatus(state, ts.Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0, filesToDelete.map(function (f) { return "\r\n * "
|
|
123389
|
+
reportStatus(state, ts.Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0, filesToDelete.map(function (f) { return "\r\n * " + f; }).join(""));
|
|
123344
123390
|
}
|
|
123345
123391
|
return ts.ExitStatus.Success;
|
|
123346
123392
|
}
|
|
@@ -123678,7 +123724,7 @@ var ts;
|
|
|
123678
123724
|
function nowString() {
|
|
123679
123725
|
// E.g. "12:34:56.789"
|
|
123680
123726
|
var d = new Date();
|
|
123681
|
-
return
|
|
123727
|
+
return ts.padLeft(d.getHours().toString(), 2, "0") + ":" + ts.padLeft(d.getMinutes().toString(), 2, "0") + ":" + ts.padLeft(d.getSeconds().toString(), 2, "0") + "." + ts.padLeft(d.getMilliseconds().toString(), 3, "0");
|
|
123682
123728
|
}
|
|
123683
123729
|
server.nowString = nowString;
|
|
123684
123730
|
})(server = ts.server || (ts.server = {}));
|
|
@@ -123689,7 +123735,7 @@ var ts;
|
|
|
123689
123735
|
var JsTyping;
|
|
123690
123736
|
(function (JsTyping) {
|
|
123691
123737
|
function isTypingUpToDate(cachedTyping, availableTypingVersions) {
|
|
123692
|
-
var availableVersion = new ts.Version(ts.getProperty(availableTypingVersions, "ts"
|
|
123738
|
+
var availableVersion = new ts.Version(ts.getProperty(availableTypingVersions, "ts" + ts.versionMajorMinor) || ts.getProperty(availableTypingVersions, "latest"));
|
|
123693
123739
|
return availableVersion.compareTo(cachedTyping.version) <= 0;
|
|
123694
123740
|
}
|
|
123695
123741
|
JsTyping.isTypingUpToDate = isTypingUpToDate;
|
|
@@ -123742,7 +123788,7 @@ var ts;
|
|
|
123742
123788
|
"worker_threads",
|
|
123743
123789
|
"zlib"
|
|
123744
123790
|
];
|
|
123745
|
-
JsTyping.prefixedNodeCoreModuleList = unprefixedNodeCoreModuleList.map(function (name) { return "node:"
|
|
123791
|
+
JsTyping.prefixedNodeCoreModuleList = unprefixedNodeCoreModuleList.map(function (name) { return "node:" + name; });
|
|
123746
123792
|
JsTyping.nodeCoreModuleList = __spreadArray(__spreadArray([], unprefixedNodeCoreModuleList, true), JsTyping.prefixedNodeCoreModuleList, true);
|
|
123747
123793
|
JsTyping.nodeCoreModules = new ts.Set(JsTyping.nodeCoreModuleList);
|
|
123748
123794
|
function nonRelativeModuleNameForTypingCache(moduleName) {
|
|
@@ -123815,7 +123861,7 @@ var ts;
|
|
|
123815
123861
|
var excludeTypingName = exclude_1[_i];
|
|
123816
123862
|
var didDelete = inferredTypings.delete(excludeTypingName);
|
|
123817
123863
|
if (didDelete && log)
|
|
123818
|
-
log("Typing for "
|
|
123864
|
+
log("Typing for " + excludeTypingName + " is in exclude list, will be ignored.");
|
|
123819
123865
|
}
|
|
123820
123866
|
var newTypingNames = [];
|
|
123821
123867
|
var cachedTypingPaths = [];
|
|
@@ -123829,7 +123875,7 @@ var ts;
|
|
|
123829
123875
|
});
|
|
123830
123876
|
var result = { cachedTypingPaths: cachedTypingPaths, newTypingNames: newTypingNames, filesToWatch: filesToWatch };
|
|
123831
123877
|
if (log)
|
|
123832
|
-
log("Result: "
|
|
123878
|
+
log("Result: " + JSON.stringify(result));
|
|
123833
123879
|
return result;
|
|
123834
123880
|
function addInferredTyping(typingName) {
|
|
123835
123881
|
if (!inferredTypings.has(typingName)) {
|
|
@@ -123838,7 +123884,7 @@ var ts;
|
|
|
123838
123884
|
}
|
|
123839
123885
|
function addInferredTypings(typingNames, message) {
|
|
123840
123886
|
if (log)
|
|
123841
|
-
log(
|
|
123887
|
+
log(message + ": " + JSON.stringify(typingNames));
|
|
123842
123888
|
ts.forEach(typingNames, addInferredTyping);
|
|
123843
123889
|
}
|
|
123844
123890
|
/**
|
|
@@ -123860,7 +123906,7 @@ var ts;
|
|
|
123860
123906
|
filesToWatch.push(manifestPath);
|
|
123861
123907
|
manifest = ts.readConfigFile(manifestPath, function (path) { return host.readFile(path); }).config;
|
|
123862
123908
|
manifestTypingNames = ts.flatMap([manifest.dependencies, manifest.devDependencies, manifest.optionalDependencies, manifest.peerDependencies], ts.getOwnKeys);
|
|
123863
|
-
addInferredTypings(manifestTypingNames, "Typing names in '"
|
|
123909
|
+
addInferredTypings(manifestTypingNames, "Typing names in '" + manifestPath + "' dependencies");
|
|
123864
123910
|
}
|
|
123865
123911
|
// Now we scan the directories for typing information in
|
|
123866
123912
|
// already-installed dependencies (if present). Note that this
|
|
@@ -123904,7 +123950,7 @@ var ts;
|
|
|
123904
123950
|
!isScoped && pathComponents[pathComponents.length - 3].toLowerCase() === modulesDirName; // `node_modules/foo`
|
|
123905
123951
|
});
|
|
123906
123952
|
if (log)
|
|
123907
|
-
log("Searching for typing names in "
|
|
123953
|
+
log("Searching for typing names in " + packagesFolderPath + "; all files: " + JSON.stringify(dependencyManifestNames));
|
|
123908
123954
|
// Once we have the names of things to look up, we iterate over
|
|
123909
123955
|
// and either collect their included typings, or add them to the
|
|
123910
123956
|
// list of typings we need to look up separately.
|
|
@@ -123923,12 +123969,12 @@ var ts;
|
|
|
123923
123969
|
var absolutePath = ts.getNormalizedAbsolutePath(ownTypes, ts.getDirectoryPath(normalizedFileName));
|
|
123924
123970
|
if (host.fileExists(absolutePath)) {
|
|
123925
123971
|
if (log)
|
|
123926
|
-
log(" Package '"
|
|
123972
|
+
log(" Package '" + manifest_1.name + "' provides its own types.");
|
|
123927
123973
|
inferredTypings.set(manifest_1.name, absolutePath);
|
|
123928
123974
|
}
|
|
123929
123975
|
else {
|
|
123930
123976
|
if (log)
|
|
123931
|
-
log(" Package '"
|
|
123977
|
+
log(" Package '" + manifest_1.name + "' provides its own types but they are missing.");
|
|
123932
123978
|
}
|
|
123933
123979
|
}
|
|
123934
123980
|
else {
|
|
@@ -124024,15 +124070,15 @@ var ts;
|
|
|
124024
124070
|
var kind = isScopeName ? "Scope" : "Package";
|
|
124025
124071
|
switch (result) {
|
|
124026
124072
|
case 1 /* EmptyName */:
|
|
124027
|
-
return "'"
|
|
124073
|
+
return "'" + typing + "':: " + kind + " name '" + name + "' cannot be empty";
|
|
124028
124074
|
case 2 /* NameTooLong */:
|
|
124029
|
-
return "'"
|
|
124075
|
+
return "'" + typing + "':: " + kind + " name '" + name + "' should be less than " + maxPackageNameLength + " characters";
|
|
124030
124076
|
case 3 /* NameStartsWithDot */:
|
|
124031
|
-
return "'"
|
|
124077
|
+
return "'" + typing + "':: " + kind + " name '" + name + "' cannot start with '.'";
|
|
124032
124078
|
case 4 /* NameStartsWithUnderscore */:
|
|
124033
|
-
return "'"
|
|
124079
|
+
return "'" + typing + "':: " + kind + " name '" + name + "' cannot start with '_'";
|
|
124034
124080
|
case 5 /* NameContainsNonURISafeCharacters */:
|
|
124035
|
-
return "'"
|
|
124081
|
+
return "'" + typing + "':: " + kind + " name '" + name + "' contains non URI safe characters";
|
|
124036
124082
|
case 0 /* Ok */:
|
|
124037
124083
|
return ts.Debug.fail(); // Shouldn't have called this.
|
|
124038
124084
|
default:
|
|
@@ -126587,7 +126633,7 @@ var ts;
|
|
|
126587
126633
|
var prefix = ts.isJSDocLink(link) ? "link"
|
|
126588
126634
|
: ts.isJSDocLinkCode(link) ? "linkcode"
|
|
126589
126635
|
: "linkplain";
|
|
126590
|
-
var parts = [linkPart("{@"
|
|
126636
|
+
var parts = [linkPart("{@" + prefix + " ")];
|
|
126591
126637
|
if (!link.name) {
|
|
126592
126638
|
if (link.text)
|
|
126593
126639
|
parts.push(linkTextPart(link.text));
|
|
@@ -126835,7 +126881,7 @@ var ts;
|
|
|
126835
126881
|
function getUniqueName(baseName, sourceFile) {
|
|
126836
126882
|
var nameText = baseName;
|
|
126837
126883
|
for (var i = 1; !ts.isFileLevelUniqueName(sourceFile, nameText); i++) {
|
|
126838
|
-
nameText =
|
|
126884
|
+
nameText = baseName + "_" + i;
|
|
126839
126885
|
}
|
|
126840
126886
|
return nameText;
|
|
126841
126887
|
}
|
|
@@ -126945,7 +126991,7 @@ var ts;
|
|
|
126945
126991
|
// Editors can pass in undefined or empty string - we want to infer the preference in those cases.
|
|
126946
126992
|
var quotePreference = getQuotePreference(sourceFile, preferences);
|
|
126947
126993
|
var quoted = JSON.stringify(text);
|
|
126948
|
-
return quotePreference === 0 /* Single */ ? "'"
|
|
126994
|
+
return quotePreference === 0 /* Single */ ? "'" + ts.stripQuotes(quoted).replace(/'/g, "\\'").replace(/\\"/g, '"') + "'" : quoted;
|
|
126949
126995
|
}
|
|
126950
126996
|
ts.quote = quote;
|
|
126951
126997
|
function isEqualityOperatorKind(kind) {
|
|
@@ -127329,7 +127375,7 @@ var ts;
|
|
|
127329
127375
|
var components = ts.getPathComponents(ts.getPackageNameFromTypesPackageName(fullSpecifier)).slice(1);
|
|
127330
127376
|
// Scoped packages
|
|
127331
127377
|
if (ts.startsWith(components[0], "@")) {
|
|
127332
|
-
return
|
|
127378
|
+
return components[0] + "/" + components[1];
|
|
127333
127379
|
}
|
|
127334
127380
|
return components[0];
|
|
127335
127381
|
}
|
|
@@ -127456,13 +127502,13 @@ var ts;
|
|
|
127456
127502
|
}
|
|
127457
127503
|
function getSymbolParentOrFail(symbol) {
|
|
127458
127504
|
var _a;
|
|
127459
|
-
return ts.Debug.checkDefined(symbol.parent, "Symbol parent was undefined. Flags: "
|
|
127460
|
-
"Declarations: "
|
|
127505
|
+
return ts.Debug.checkDefined(symbol.parent, "Symbol parent was undefined. Flags: " + ts.Debug.formatSymbolFlags(symbol.flags) + ". " +
|
|
127506
|
+
("Declarations: " + ((_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.map(function (d) {
|
|
127461
127507
|
var kind = ts.Debug.formatSyntaxKind(d.kind);
|
|
127462
127508
|
var inJS = ts.isInJSFile(d);
|
|
127463
127509
|
var expression = d.expression;
|
|
127464
|
-
return (inJS ? "[JS]" : "") + kind + (expression ? " (expression: "
|
|
127465
|
-
}).join(", ")
|
|
127510
|
+
return (inJS ? "[JS]" : "") + kind + (expression ? " (expression: " + ts.Debug.formatSyntaxKind(expression.kind) + ")" : "");
|
|
127511
|
+
}).join(", ")) + "."));
|
|
127466
127512
|
}
|
|
127467
127513
|
/**
|
|
127468
127514
|
* Useful to check whether a string contains another string at a specific index
|
|
@@ -127545,6 +127591,10 @@ var ts;
|
|
|
127545
127591
|
return __assign(__assign({}, options), { semicolons: shouldRemoveSemicolons ? ts.SemicolonPreference.Remove : ts.SemicolonPreference.Ignore });
|
|
127546
127592
|
}
|
|
127547
127593
|
ts.getFormatCodeSettingsForWriting = getFormatCodeSettingsForWriting;
|
|
127594
|
+
function jsxModeNeedsExplicitImport(jsx) {
|
|
127595
|
+
return jsx === 2 /* React */ || jsx === 3 /* ReactNative */;
|
|
127596
|
+
}
|
|
127597
|
+
ts.jsxModeNeedsExplicitImport = jsxModeNeedsExplicitImport;
|
|
127548
127598
|
// #endregion
|
|
127549
127599
|
})(ts || (ts = {}));
|
|
127550
127600
|
/*@internal*/
|
|
@@ -127723,7 +127773,7 @@ var ts;
|
|
|
127723
127773
|
: checker.tryFindAmbientModule(info.moduleName));
|
|
127724
127774
|
var symbol = info.symbol || cachedSymbol || ts.Debug.checkDefined(exportKind === 2 /* ExportEquals */
|
|
127725
127775
|
? checker.resolveExternalModuleSymbol(moduleSymbol)
|
|
127726
|
-
: checker.tryGetMemberInModuleExportsAndProperties(ts.unescapeLeadingUnderscores(info.symbolTableKey), moduleSymbol), "Could not find symbol '"
|
|
127776
|
+
: checker.tryGetMemberInModuleExportsAndProperties(ts.unescapeLeadingUnderscores(info.symbolTableKey), moduleSymbol), "Could not find symbol '" + info.symbolName + "' by key '" + info.symbolTableKey + "' in module " + moduleSymbol.name);
|
|
127727
127777
|
symbols.set(id, [symbol, moduleSymbol]);
|
|
127728
127778
|
return {
|
|
127729
127779
|
symbol: symbol,
|
|
@@ -127736,7 +127786,7 @@ var ts;
|
|
|
127736
127786
|
}
|
|
127737
127787
|
function key(importedName, symbol, ambientModuleName, checker) {
|
|
127738
127788
|
var moduleKey = ambientModuleName || "";
|
|
127739
|
-
return
|
|
127789
|
+
return importedName + "|" + ts.getSymbolId(ts.skipAlias(symbol, checker)) + "|" + moduleKey;
|
|
127740
127790
|
}
|
|
127741
127791
|
function parseKey(key) {
|
|
127742
127792
|
var symbolName = key.substring(0, key.indexOf("|"));
|
|
@@ -127822,7 +127872,7 @@ var ts;
|
|
|
127822
127872
|
if (autoImportProvider) {
|
|
127823
127873
|
var start = ts.timestamp();
|
|
127824
127874
|
forEachExternalModule(autoImportProvider.getTypeChecker(), autoImportProvider.getSourceFiles(), function (module, file) { return cb(module, file, autoImportProvider, /*isFromPackageJson*/ true); });
|
|
127825
|
-
(_b = host.log) === null || _b === void 0 ? void 0 : _b.call(host, "forEachExternalModuleToImportFrom autoImportProvider: "
|
|
127875
|
+
(_b = host.log) === null || _b === void 0 ? void 0 : _b.call(host, "forEachExternalModuleToImportFrom autoImportProvider: " + (ts.timestamp() - start));
|
|
127826
127876
|
}
|
|
127827
127877
|
}
|
|
127828
127878
|
ts.forEachExternalModuleToImportFrom = forEachExternalModuleToImportFrom;
|
|
@@ -127875,7 +127925,7 @@ var ts;
|
|
|
127875
127925
|
}
|
|
127876
127926
|
});
|
|
127877
127927
|
});
|
|
127878
|
-
(_e = host.log) === null || _e === void 0 ? void 0 : _e.call(host, "getExportInfoMap: done in "
|
|
127928
|
+
(_e = host.log) === null || _e === void 0 ? void 0 : _e.call(host, "getExportInfoMap: done in " + (ts.timestamp() - start) + " ms");
|
|
127879
127929
|
return cache;
|
|
127880
127930
|
}
|
|
127881
127931
|
ts.getExportInfoMap = getExportInfoMap;
|
|
@@ -128408,7 +128458,7 @@ var ts;
|
|
|
128408
128458
|
return { spans: spans, endOfLineState: 0 /* None */ };
|
|
128409
128459
|
function pushClassification(start, end, type) {
|
|
128410
128460
|
var length = end - start;
|
|
128411
|
-
ts.Debug.assert(length > 0, "Classification had non-positive length of "
|
|
128461
|
+
ts.Debug.assert(length > 0, "Classification had non-positive length of " + length);
|
|
128412
128462
|
spans.push(start);
|
|
128413
128463
|
spans.push(length);
|
|
128414
128464
|
spans.push(type);
|
|
@@ -129280,7 +129330,7 @@ var ts;
|
|
|
129280
129330
|
case ".d.cts" /* Dcts */: return ".d.cts" /* dctsModifier */;
|
|
129281
129331
|
case ".cjs" /* Cjs */: return ".cjs" /* cjsModifier */;
|
|
129282
129332
|
case ".cts" /* Cts */: return ".cts" /* ctsModifier */;
|
|
129283
|
-
case ".tsbuildinfo" /* TsBuildInfo */: return ts.Debug.fail("Extension "
|
|
129333
|
+
case ".tsbuildinfo" /* TsBuildInfo */: return ts.Debug.fail("Extension " + ".tsbuildinfo" /* TsBuildInfo */ + " is unsupported.");
|
|
129284
129334
|
case undefined: return "" /* none */;
|
|
129285
129335
|
default:
|
|
129286
129336
|
return ts.Debug.assertNever(extension);
|
|
@@ -129489,9 +129539,18 @@ var ts;
|
|
|
129489
129539
|
return getCompletionEntriesForDirectoryFragment(literalValue, scriptDirectory, extensionOptions, host, scriptPath);
|
|
129490
129540
|
}
|
|
129491
129541
|
}
|
|
129542
|
+
function isEmitResolutionKindUsingNodeModules(compilerOptions) {
|
|
129543
|
+
return ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeJs ||
|
|
129544
|
+
ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Node12 ||
|
|
129545
|
+
ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeNext;
|
|
129546
|
+
}
|
|
129547
|
+
function isEmitModuleResolutionRespectingExportMaps(compilerOptions) {
|
|
129548
|
+
return ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Node12 ||
|
|
129549
|
+
ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeNext;
|
|
129550
|
+
}
|
|
129492
129551
|
function getSupportedExtensionsForModuleResolution(compilerOptions) {
|
|
129493
129552
|
var extensions = ts.getSupportedExtensions(compilerOptions);
|
|
129494
|
-
return
|
|
129553
|
+
return isEmitResolutionKindUsingNodeModules(compilerOptions) ?
|
|
129495
129554
|
ts.getSupportedExtensionsWithJsonIfResolveJsonModule(compilerOptions, extensions) :
|
|
129496
129555
|
extensions;
|
|
129497
129556
|
}
|
|
@@ -129654,7 +129713,7 @@ var ts;
|
|
|
129654
129713
|
result.push(nameAndKind(ambientName, "external module name" /* externalModuleName */, /*extension*/ undefined));
|
|
129655
129714
|
}
|
|
129656
129715
|
getCompletionEntriesFromTypings(host, compilerOptions, scriptPath, fragmentDirectory, extensionOptions, result);
|
|
129657
|
-
if (
|
|
129716
|
+
if (isEmitResolutionKindUsingNodeModules(compilerOptions)) {
|
|
129658
129717
|
// If looking for a global package name, don't just include everything in `node_modules` because that includes dependencies' own dependencies.
|
|
129659
129718
|
// (But do if we didn't find anything, e.g. 'package.json' missing.)
|
|
129660
129719
|
var foundGlobal = false;
|
|
@@ -129671,12 +129730,68 @@ var ts;
|
|
|
129671
129730
|
}
|
|
129672
129731
|
}
|
|
129673
129732
|
if (!foundGlobal) {
|
|
129674
|
-
|
|
129733
|
+
var ancestorLookup = function (ancestor) {
|
|
129675
129734
|
var nodeModules = ts.combinePaths(ancestor, "node_modules");
|
|
129676
129735
|
if (ts.tryDirectoryExists(host, nodeModules)) {
|
|
129677
129736
|
getCompletionEntriesForDirectoryFragment(fragment, nodeModules, extensionOptions, host, /*exclude*/ undefined, result);
|
|
129678
129737
|
}
|
|
129679
|
-
}
|
|
129738
|
+
};
|
|
129739
|
+
if (fragmentDirectory && isEmitModuleResolutionRespectingExportMaps(compilerOptions)) {
|
|
129740
|
+
var nodeModulesDirectoryLookup_1 = ancestorLookup;
|
|
129741
|
+
ancestorLookup = function (ancestor) {
|
|
129742
|
+
var components = ts.getPathComponents(fragment);
|
|
129743
|
+
components.shift(); // shift off empty root
|
|
129744
|
+
var packagePath = components.shift();
|
|
129745
|
+
if (!packagePath) {
|
|
129746
|
+
return nodeModulesDirectoryLookup_1(ancestor);
|
|
129747
|
+
}
|
|
129748
|
+
if (ts.startsWith(packagePath, "@")) {
|
|
129749
|
+
var subName = components.shift();
|
|
129750
|
+
if (!subName) {
|
|
129751
|
+
return nodeModulesDirectoryLookup_1(ancestor);
|
|
129752
|
+
}
|
|
129753
|
+
packagePath = ts.combinePaths(packagePath, subName);
|
|
129754
|
+
}
|
|
129755
|
+
var packageFile = ts.combinePaths(ancestor, "node_modules", packagePath, "package.json");
|
|
129756
|
+
if (ts.tryFileExists(host, packageFile)) {
|
|
129757
|
+
var packageJson = ts.readJson(packageFile, host);
|
|
129758
|
+
var exports = packageJson.exports;
|
|
129759
|
+
if (exports) {
|
|
129760
|
+
if (typeof exports !== "object" || exports === null) { // eslint-disable-line no-null/no-null
|
|
129761
|
+
return; // null exports or entrypoint only, no sub-modules available
|
|
129762
|
+
}
|
|
129763
|
+
var keys = ts.getOwnKeys(exports);
|
|
129764
|
+
var fragmentSubpath_1 = components.join("/");
|
|
129765
|
+
var processedKeys = ts.mapDefined(keys, function (k) {
|
|
129766
|
+
if (k === ".")
|
|
129767
|
+
return undefined;
|
|
129768
|
+
if (!ts.startsWith(k, "./"))
|
|
129769
|
+
return undefined;
|
|
129770
|
+
var subpath = k.substring(2);
|
|
129771
|
+
if (!ts.startsWith(subpath, fragmentSubpath_1))
|
|
129772
|
+
return undefined;
|
|
129773
|
+
// subpath is a valid export (barring conditions, which we don't currently check here)
|
|
129774
|
+
if (!ts.stringContains(subpath, "*")) {
|
|
129775
|
+
return subpath;
|
|
129776
|
+
}
|
|
129777
|
+
// pattern export - only return everything up to the `*`, so the user can autocomplete, then
|
|
129778
|
+
// keep filling in the pattern (we could speculatively return a list of options by hitting disk,
|
|
129779
|
+
// but conditions will make that somewhat awkward, as each condition may have a different set of possible
|
|
129780
|
+
// options for the `*`.
|
|
129781
|
+
return subpath.slice(0, subpath.indexOf("*"));
|
|
129782
|
+
});
|
|
129783
|
+
ts.forEach(processedKeys, function (k) {
|
|
129784
|
+
if (k) {
|
|
129785
|
+
result.push(nameAndKind(k, "external module name" /* externalModuleName */, /*extension*/ undefined));
|
|
129786
|
+
}
|
|
129787
|
+
});
|
|
129788
|
+
return;
|
|
129789
|
+
}
|
|
129790
|
+
}
|
|
129791
|
+
return nodeModulesDirectoryLookup_1(ancestor);
|
|
129792
|
+
};
|
|
129793
|
+
}
|
|
129794
|
+
ts.forEachAncestorDirectory(scriptPath, ancestorLookup);
|
|
129680
129795
|
}
|
|
129681
129796
|
}
|
|
129682
129797
|
return result;
|
|
@@ -130016,10 +130131,10 @@ var ts;
|
|
|
130016
130131
|
var resolvedFromCacheCount = 0;
|
|
130017
130132
|
var cacheAttemptCount = 0;
|
|
130018
130133
|
var result = cb({ tryResolve: tryResolve, resolutionLimitExceeded: function () { return resolutionLimitExceeded; } });
|
|
130019
|
-
var hitRateMessage = cacheAttemptCount ? " ("
|
|
130020
|
-
(_a = host.log) === null || _a === void 0 ? void 0 : _a.call(host,
|
|
130021
|
-
(_b = host.log) === null || _b === void 0 ? void 0 : _b.call(host,
|
|
130022
|
-
(_c = host.log) === null || _c === void 0 ? void 0 : _c.call(host,
|
|
130134
|
+
var hitRateMessage = cacheAttemptCount ? " (" + (resolvedFromCacheCount / cacheAttemptCount * 100).toFixed(1) + "% hit rate)" : "";
|
|
130135
|
+
(_a = host.log) === null || _a === void 0 ? void 0 : _a.call(host, logPrefix + ": resolved " + resolvedCount + " module specifiers, plus " + ambientCount + " ambient and " + resolvedFromCacheCount + " from cache" + hitRateMessage);
|
|
130136
|
+
(_b = host.log) === null || _b === void 0 ? void 0 : _b.call(host, logPrefix + ": response is " + (resolutionLimitExceeded ? "incomplete" : "complete"));
|
|
130137
|
+
(_c = host.log) === null || _c === void 0 ? void 0 : _c.call(host, logPrefix + ": " + (ts.timestamp() - start));
|
|
130023
130138
|
return result;
|
|
130024
130139
|
function tryResolve(exportInfo, isFromAmbientModule) {
|
|
130025
130140
|
if (isFromAmbientModule) {
|
|
@@ -130352,15 +130467,15 @@ var ts;
|
|
|
130352
130467
|
var useBraces = origin && originIsSymbolMember(origin) || needsConvertPropertyAccess;
|
|
130353
130468
|
if (origin && originIsThisType(origin)) {
|
|
130354
130469
|
insertText = needsConvertPropertyAccess
|
|
130355
|
-
? "this"
|
|
130356
|
-
: "this"
|
|
130470
|
+
? "this" + (insertQuestionDot ? "?." : "") + "[" + quotePropertyName(sourceFile, preferences, name) + "]"
|
|
130471
|
+
: "this" + (insertQuestionDot ? "?." : ".") + name;
|
|
130357
130472
|
}
|
|
130358
130473
|
// We should only have needsConvertPropertyAccess if there's a property access to convert. But see #21790.
|
|
130359
130474
|
// Somehow there was a global with a non-identifier name. Hopefully someone will complain about getting a "foo bar" global completion and provide a repro.
|
|
130360
130475
|
else if ((useBraces || insertQuestionDot) && propertyAccessToConvert) {
|
|
130361
|
-
insertText = useBraces ? needsConvertPropertyAccess ? "["
|
|
130476
|
+
insertText = useBraces ? needsConvertPropertyAccess ? "[" + quotePropertyName(sourceFile, preferences, name) + "]" : "[" + name + "]" : name;
|
|
130362
130477
|
if (insertQuestionDot || propertyAccessToConvert.questionDotToken) {
|
|
130363
|
-
insertText = "?."
|
|
130478
|
+
insertText = "?." + insertText;
|
|
130364
130479
|
}
|
|
130365
130480
|
var dot = ts.findChildOfKind(propertyAccessToConvert, 24 /* DotToken */, sourceFile) ||
|
|
130366
130481
|
ts.findChildOfKind(propertyAccessToConvert, 28 /* QuestionDotToken */, sourceFile);
|
|
@@ -130374,7 +130489,7 @@ var ts;
|
|
|
130374
130489
|
if (isJsxInitializer) {
|
|
130375
130490
|
if (insertText === undefined)
|
|
130376
130491
|
insertText = name;
|
|
130377
|
-
insertText = "{"
|
|
130492
|
+
insertText = "{" + insertText + "}";
|
|
130378
130493
|
if (typeof isJsxInitializer !== "boolean") {
|
|
130379
130494
|
replacementSpan = ts.createTextSpanFromNode(isJsxInitializer, sourceFile);
|
|
130380
130495
|
}
|
|
@@ -130387,8 +130502,8 @@ var ts;
|
|
|
130387
130502
|
if (precedingToken && ts.positionIsASICandidate(precedingToken.end, precedingToken.parent, sourceFile)) {
|
|
130388
130503
|
awaitText = ";";
|
|
130389
130504
|
}
|
|
130390
|
-
awaitText += "(await "
|
|
130391
|
-
insertText = needsConvertPropertyAccess ? ""
|
|
130505
|
+
awaitText += "(await " + propertyAccessToConvert.expression.getText() + ")";
|
|
130506
|
+
insertText = needsConvertPropertyAccess ? "" + awaitText + insertText : "" + awaitText + (insertQuestionDot ? "?." : ".") + insertText;
|
|
130392
130507
|
replacementSpan = ts.createTextSpanFromBounds(propertyAccessToConvert.getStart(sourceFile), propertyAccessToConvert.end);
|
|
130393
130508
|
}
|
|
130394
130509
|
if (originIsResolvedExport(origin)) {
|
|
@@ -130421,7 +130536,7 @@ var ts;
|
|
|
130421
130536
|
&& !(type.flags & 1048576 /* Union */ && ts.find(type.types, function (type) { return !!(type.flags & 528 /* BooleanLike */); }))) {
|
|
130422
130537
|
if (type.flags & 402653316 /* StringLike */ || (type.flags & 1048576 /* Union */ && ts.every(type.types, function (type) { return !!(type.flags & (402653316 /* StringLike */ | 32768 /* Undefined */)); }))) {
|
|
130423
130538
|
// If is string like or undefined use quotes
|
|
130424
|
-
insertText =
|
|
130539
|
+
insertText = ts.escapeSnippetText(name) + "=" + ts.quote(sourceFile, preferences, "$1");
|
|
130425
130540
|
isSnippet = true;
|
|
130426
130541
|
}
|
|
130427
130542
|
else {
|
|
@@ -130430,7 +130545,7 @@ var ts;
|
|
|
130430
130545
|
}
|
|
130431
130546
|
}
|
|
130432
130547
|
if (useBraces_1) {
|
|
130433
|
-
insertText =
|
|
130548
|
+
insertText = ts.escapeSnippetText(name) + "={$1}";
|
|
130434
130549
|
isSnippet = true;
|
|
130435
130550
|
}
|
|
130436
130551
|
}
|
|
@@ -130715,14 +130830,14 @@ var ts;
|
|
|
130715
130830
|
var importKind = ts.codefix.getImportKind(sourceFile, exportKind, options, /*forceImportKeyword*/ true);
|
|
130716
130831
|
var isTopLevelTypeOnly = ((_b = (_a = ts.tryCast(importCompletionNode, ts.isImportDeclaration)) === null || _a === void 0 ? void 0 : _a.importClause) === null || _b === void 0 ? void 0 : _b.isTypeOnly) || ((_c = ts.tryCast(importCompletionNode, ts.isImportEqualsDeclaration)) === null || _c === void 0 ? void 0 : _c.isTypeOnly);
|
|
130717
130832
|
var isImportSpecifierTypeOnly = couldBeTypeOnlyImportSpecifier(importCompletionNode, contextToken);
|
|
130718
|
-
var topLevelTypeOnlyText = isTopLevelTypeOnly ? " "
|
|
130719
|
-
var importSpecifierTypeOnlyText = isImportSpecifierTypeOnly ?
|
|
130833
|
+
var topLevelTypeOnlyText = isTopLevelTypeOnly ? " " + ts.tokenToString(151 /* TypeKeyword */) + " " : " ";
|
|
130834
|
+
var importSpecifierTypeOnlyText = isImportSpecifierTypeOnly ? ts.tokenToString(151 /* TypeKeyword */) + " " : "";
|
|
130720
130835
|
var suffix = useSemicolons ? ";" : "";
|
|
130721
130836
|
switch (importKind) {
|
|
130722
|
-
case 3 /* CommonJS */: return { replacementSpan: replacementSpan, insertText: "import"
|
|
130723
|
-
case 1 /* Default */: return { replacementSpan: replacementSpan, insertText: "import"
|
|
130724
|
-
case 2 /* Namespace */: return { replacementSpan: replacementSpan, insertText: "import"
|
|
130725
|
-
case 0 /* Named */: return { replacementSpan: replacementSpan, insertText: "import"
|
|
130837
|
+
case 3 /* CommonJS */: return { replacementSpan: replacementSpan, insertText: "import" + topLevelTypeOnlyText + ts.escapeSnippetText(name) + tabStop + " = require(" + quotedModuleSpecifier + ")" + suffix };
|
|
130838
|
+
case 1 /* Default */: return { replacementSpan: replacementSpan, insertText: "import" + topLevelTypeOnlyText + ts.escapeSnippetText(name) + tabStop + " from " + quotedModuleSpecifier + suffix };
|
|
130839
|
+
case 2 /* Namespace */: return { replacementSpan: replacementSpan, insertText: "import" + topLevelTypeOnlyText + "* as " + ts.escapeSnippetText(name) + " from " + quotedModuleSpecifier + suffix };
|
|
130840
|
+
case 0 /* Named */: return { replacementSpan: replacementSpan, insertText: "import" + topLevelTypeOnlyText + "{ " + importSpecifierTypeOnlyText + ts.escapeSnippetText(name) + tabStop + " } from " + quotedModuleSpecifier + suffix };
|
|
130726
130841
|
}
|
|
130727
130842
|
}
|
|
130728
130843
|
function quotePropertyName(sourceFile, preferences, name) {
|
|
@@ -133684,7 +133799,7 @@ var ts;
|
|
|
133684
133799
|
}
|
|
133685
133800
|
function getDocumentRegistryEntry(bucketEntry, scriptKind) {
|
|
133686
133801
|
var entry = isDocumentRegistryEntry(bucketEntry) ? bucketEntry : bucketEntry.get(ts.Debug.checkDefined(scriptKind, "If there are more than one scriptKind's for same document the scriptKind should be provided"));
|
|
133687
|
-
ts.Debug.assert(scriptKind === undefined || !entry || entry.sourceFile.scriptKind === scriptKind, "Script kind should match provided ScriptKind:"
|
|
133802
|
+
ts.Debug.assert(scriptKind === undefined || !entry || entry.sourceFile.scriptKind === scriptKind, "Script kind should match provided ScriptKind:" + scriptKind + " and sourceFile.scriptKind: " + (entry === null || entry === void 0 ? void 0 : entry.sourceFile.scriptKind) + ", !entry: " + !entry);
|
|
133688
133803
|
return entry;
|
|
133689
133804
|
}
|
|
133690
133805
|
function acquireOrUpdateDocument(fileName, path, compilationSettings, key, scriptSnapshot, version, acquiring, scriptKind) {
|
|
@@ -134713,7 +134828,7 @@ var ts;
|
|
|
134713
134828
|
sourceFile: def.file,
|
|
134714
134829
|
name: def.reference.fileName,
|
|
134715
134830
|
kind: "string" /* string */,
|
|
134716
|
-
displayParts: [ts.displayPart("\""
|
|
134831
|
+
displayParts: [ts.displayPart("\"" + def.reference.fileName + "\"", ts.SymbolDisplayPartKind.stringLiteral)]
|
|
134717
134832
|
};
|
|
134718
134833
|
}
|
|
134719
134834
|
default:
|
|
@@ -135293,7 +135408,7 @@ var ts;
|
|
|
135293
135408
|
if (symbol.flags & 33554432 /* Transient */)
|
|
135294
135409
|
return undefined;
|
|
135295
135410
|
// Assertions for GH#21814. We should be handling SourceFile symbols in `getReferencedSymbolsForModule` instead of getting here.
|
|
135296
|
-
ts.Debug.fail("Unexpected symbol at "
|
|
135411
|
+
ts.Debug.fail("Unexpected symbol at " + ts.Debug.formatSyntaxKind(node.kind) + ": " + ts.Debug.formatSymbol(symbol));
|
|
135297
135412
|
}
|
|
135298
135413
|
return ts.isTypeLiteralNode(decl.parent) && ts.isUnionTypeNode(decl.parent.parent)
|
|
135299
135414
|
? checker.getPropertyOfType(checker.getTypeFromTypeNode(decl.parent.parent), symbol.name)
|
|
@@ -136578,8 +136693,8 @@ var ts;
|
|
|
136578
136693
|
var end = pos + 6; /* "static".length */
|
|
136579
136694
|
var typeChecker = program.getTypeChecker();
|
|
136580
136695
|
var symbol = typeChecker.getSymbolAtLocation(node.parent);
|
|
136581
|
-
var prefix = symbol ?
|
|
136582
|
-
return { text:
|
|
136696
|
+
var prefix = symbol ? typeChecker.symbolToString(symbol, node.parent) + " " : "";
|
|
136697
|
+
return { text: prefix + "static {}", pos: pos, end: end };
|
|
136583
136698
|
}
|
|
136584
136699
|
var declName = isConstNamedExpression(node) ? node.parent.name :
|
|
136585
136700
|
ts.Debug.checkDefined(ts.getNameOfDeclaration(node), "Expected call hierarchy item to have a name");
|
|
@@ -137863,7 +137978,7 @@ var ts;
|
|
|
137863
137978
|
function getJSDocTagCompletions() {
|
|
137864
137979
|
return jsDocTagCompletionEntries || (jsDocTagCompletionEntries = ts.map(jsDocTagNames, function (tagName) {
|
|
137865
137980
|
return {
|
|
137866
|
-
name: "@"
|
|
137981
|
+
name: "@" + tagName,
|
|
137867
137982
|
kind: "keyword" /* keyword */,
|
|
137868
137983
|
kindModifiers: "",
|
|
137869
137984
|
sortText: ts.Completions.SortText.LocationPriority
|
|
@@ -137995,11 +138110,11 @@ var ts;
|
|
|
137995
138110
|
var name = _a.name, dotDotDotToken = _a.dotDotDotToken;
|
|
137996
138111
|
var paramName = name.kind === 79 /* Identifier */ ? name.text : "param" + i;
|
|
137997
138112
|
var type = isJavaScriptFile ? (dotDotDotToken ? "{...any} " : "{any} ") : "";
|
|
137998
|
-
return
|
|
138113
|
+
return indentationStr + " * @param " + type + paramName + newLine;
|
|
137999
138114
|
}).join("");
|
|
138000
138115
|
}
|
|
138001
138116
|
function returnsDocComment(indentationStr, newLine) {
|
|
138002
|
-
return
|
|
138117
|
+
return indentationStr + " * @returns" + newLine;
|
|
138003
138118
|
}
|
|
138004
138119
|
function getCommentOwnerInfo(tokenAtPos, options) {
|
|
138005
138120
|
return ts.forEachAncestor(tokenAtPos, function (n) { return getCommentOwnerInfoWorker(n, options); });
|
|
@@ -138842,7 +138957,7 @@ var ts;
|
|
|
138842
138957
|
}
|
|
138843
138958
|
if (name) {
|
|
138844
138959
|
var text = ts.isIdentifier(name) ? name.text
|
|
138845
|
-
: ts.isElementAccessExpression(name) ? "["
|
|
138960
|
+
: ts.isElementAccessExpression(name) ? "[" + nodeText(name.argumentExpression) + "]"
|
|
138846
138961
|
: nodeText(name);
|
|
138847
138962
|
if (text.length > 0) {
|
|
138848
138963
|
return cleanText(text);
|
|
@@ -138852,7 +138967,7 @@ var ts;
|
|
|
138852
138967
|
case 303 /* SourceFile */:
|
|
138853
138968
|
var sourceFile = node;
|
|
138854
138969
|
return ts.isExternalModule(sourceFile)
|
|
138855
|
-
? "\""
|
|
138970
|
+
? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\""
|
|
138856
138971
|
: "<global>";
|
|
138857
138972
|
case 270 /* ExportAssignment */:
|
|
138858
138973
|
return ts.isExportAssignment(node) && node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */;
|
|
@@ -139048,10 +139163,10 @@ var ts;
|
|
|
139048
139163
|
if (name !== undefined) {
|
|
139049
139164
|
name = cleanText(name);
|
|
139050
139165
|
if (name.length > maxLength) {
|
|
139051
|
-
return
|
|
139166
|
+
return name + " callback";
|
|
139052
139167
|
}
|
|
139053
139168
|
var args = cleanText(ts.mapDefined(parent.arguments, function (a) { return ts.isStringLiteralLike(a) ? a.getText(curSourceFile) : undefined; }).join(", "));
|
|
139054
|
-
return
|
|
139169
|
+
return name + "(" + args + ") callback";
|
|
139055
139170
|
}
|
|
139056
139171
|
}
|
|
139057
139172
|
return "<function>";
|
|
@@ -139064,7 +139179,7 @@ var ts;
|
|
|
139064
139179
|
else if (ts.isPropertyAccessExpression(expr)) {
|
|
139065
139180
|
var left = getCalledExpressionName(expr.expression);
|
|
139066
139181
|
var right = expr.name.text;
|
|
139067
|
-
return left === undefined ? right :
|
|
139182
|
+
return left === undefined ? right : left + "." + right;
|
|
139068
139183
|
}
|
|
139069
139184
|
else {
|
|
139070
139185
|
return undefined;
|
|
@@ -139169,6 +139284,7 @@ var ts;
|
|
|
139169
139284
|
return oldImports;
|
|
139170
139285
|
}
|
|
139171
139286
|
var typeChecker = program.getTypeChecker();
|
|
139287
|
+
var compilerOptions = program.getCompilerOptions();
|
|
139172
139288
|
var jsxNamespace = typeChecker.getJsxNamespace(sourceFile);
|
|
139173
139289
|
var jsxFragmentFactory = typeChecker.getJsxFragmentFactory(sourceFile);
|
|
139174
139290
|
var jsxElementsPresent = !!(sourceFile.transformFlags & 2 /* ContainsJsx */);
|
|
@@ -139225,7 +139341,7 @@ var ts;
|
|
|
139225
139341
|
return usedImports;
|
|
139226
139342
|
function isDeclarationUsed(identifier) {
|
|
139227
139343
|
// The JSX factory symbol is always used if JSX elements are present - even if they are not allowed.
|
|
139228
|
-
return jsxElementsPresent && (identifier.text === jsxNamespace || jsxFragmentFactory && identifier.text === jsxFragmentFactory) ||
|
|
139344
|
+
return jsxElementsPresent && (identifier.text === jsxNamespace || jsxFragmentFactory && identifier.text === jsxFragmentFactory) && ts.jsxModeNeedsExplicitImport(compilerOptions.jsx) ||
|
|
139229
139345
|
ts.FindAllReferences.Core.isSymbolReferencedInFile(identifier, typeChecker, sourceFile);
|
|
139230
139346
|
}
|
|
139231
139347
|
}
|
|
@@ -141511,7 +141627,7 @@ var ts;
|
|
|
141511
141627
|
var _loop_9 = function (n) {
|
|
141512
141628
|
// If the node is not a subspan of its parent, this is a big problem.
|
|
141513
141629
|
// There have been crashes that might be caused by this violation.
|
|
141514
|
-
ts.Debug.assert(ts.rangeContainsRange(n.parent, n), "Not a subspan", function () { return "Child: "
|
|
141630
|
+
ts.Debug.assert(ts.rangeContainsRange(n.parent, n), "Not a subspan", function () { return "Child: " + ts.Debug.formatSyntaxKind(n.kind) + ", parent: " + ts.Debug.formatSyntaxKind(n.parent.kind); });
|
|
141515
141631
|
var argumentInfo = getImmediatelyContainingArgumentOrContextualParameterInfo(n, position, sourceFile, checker);
|
|
141516
141632
|
if (argumentInfo) {
|
|
141517
141633
|
return { value: argumentInfo };
|
|
@@ -141683,7 +141799,7 @@ var ts;
|
|
|
141683
141799
|
(function (InlayHints) {
|
|
141684
141800
|
var maxHintsLength = 30;
|
|
141685
141801
|
var leadingParameterNameCommentRegexFactory = function (name) {
|
|
141686
|
-
return new RegExp("^\\s?/\\*\\*?\\s?"
|
|
141802
|
+
return new RegExp("^\\s?/\\*\\*?\\s?" + name + "\\s?\\*\\/\\s?$");
|
|
141687
141803
|
};
|
|
141688
141804
|
function shouldShowParameterNameHints(preferences) {
|
|
141689
141805
|
return preferences.includeInlayParameterNameHints === "literals" || preferences.includeInlayParameterNameHints === "all";
|
|
@@ -141747,7 +141863,7 @@ var ts;
|
|
|
141747
141863
|
}
|
|
141748
141864
|
function addParameterHints(text, position, isFirstVariadicArgument) {
|
|
141749
141865
|
result.push({
|
|
141750
|
-
text: ""
|
|
141866
|
+
text: "" + (isFirstVariadicArgument ? "..." : "") + truncation(text, maxHintsLength) + ":",
|
|
141751
141867
|
position: position,
|
|
141752
141868
|
kind: "Parameter" /* Parameter */,
|
|
141753
141869
|
whitespaceAfter: true,
|
|
@@ -141755,7 +141871,7 @@ var ts;
|
|
|
141755
141871
|
}
|
|
141756
141872
|
function addTypeHints(text, position) {
|
|
141757
141873
|
result.push({
|
|
141758
|
-
text: ": "
|
|
141874
|
+
text: ": " + truncation(text, maxHintsLength),
|
|
141759
141875
|
position: position,
|
|
141760
141876
|
kind: "Type" /* Type */,
|
|
141761
141877
|
whitespaceBefore: true,
|
|
@@ -141763,7 +141879,7 @@ var ts;
|
|
|
141763
141879
|
}
|
|
141764
141880
|
function addEnumMemberValueHints(text, position) {
|
|
141765
141881
|
result.push({
|
|
141766
|
-
text: "= "
|
|
141882
|
+
text: "= " + truncation(text, maxHintsLength),
|
|
141767
141883
|
position: position,
|
|
141768
141884
|
kind: "Enum" /* Enum */,
|
|
141769
141885
|
whitespaceBefore: true,
|
|
@@ -142298,7 +142414,7 @@ var ts;
|
|
|
142298
142414
|
}
|
|
142299
142415
|
}
|
|
142300
142416
|
function getKeyFromNode(exp) {
|
|
142301
|
-
return
|
|
142417
|
+
return exp.pos.toString() + ":" + exp.end.toString();
|
|
142302
142418
|
}
|
|
142303
142419
|
function canBeConvertedToClass(node, checker) {
|
|
142304
142420
|
var _a, _b, _c, _d;
|
|
@@ -146447,7 +146563,7 @@ var ts;
|
|
|
146447
146563
|
var insertAtLineStart = isValidLocationToAddComment(sourceFile, startPosition);
|
|
146448
146564
|
var token = ts.getTouchingToken(sourceFile, insertAtLineStart ? startPosition : position);
|
|
146449
146565
|
var indent = sourceFile.text.slice(lineStartPosition, startPosition);
|
|
146450
|
-
var text =
|
|
146566
|
+
var text = (insertAtLineStart ? "" : this.newLineCharacter) + "//" + commentText + this.newLineCharacter + indent;
|
|
146451
146567
|
this.insertText(sourceFile, token.getStart(sourceFile), text);
|
|
146452
146568
|
};
|
|
146453
146569
|
ChangeTracker.prototype.insertJsdocCommentBefore = function (sourceFile, node, tag) {
|
|
@@ -146671,7 +146787,7 @@ var ts;
|
|
|
146671
146787
|
};
|
|
146672
146788
|
ChangeTracker.prototype.getInsertNodeAfterOptions = function (sourceFile, after) {
|
|
146673
146789
|
var options = this.getInsertNodeAfterOptionsWorker(after);
|
|
146674
|
-
return __assign(__assign({}, options), { prefix: after.end === sourceFile.end && ts.isStatement(after) ? (options.prefix ? "\n"
|
|
146790
|
+
return __assign(__assign({}, options), { prefix: after.end === sourceFile.end && ts.isStatement(after) ? (options.prefix ? "\n" + options.prefix : "\n") : options.prefix });
|
|
146675
146791
|
};
|
|
146676
146792
|
ChangeTracker.prototype.getInsertNodeAfterOptionsWorker = function (node) {
|
|
146677
146793
|
switch (node.kind) {
|
|
@@ -146705,7 +146821,7 @@ var ts;
|
|
|
146705
146821
|
}
|
|
146706
146822
|
else {
|
|
146707
146823
|
// `x => {}` -> `function f(x) {}`
|
|
146708
|
-
this.insertText(sourceFile, ts.first(node.parameters).getStart(sourceFile), "function "
|
|
146824
|
+
this.insertText(sourceFile, ts.first(node.parameters).getStart(sourceFile), "function " + name + "(");
|
|
146709
146825
|
// Replacing full range of arrow to get rid of the leading space -- replace ` =>` with `)`
|
|
146710
146826
|
this.replaceRange(sourceFile, arrow, ts.factory.createToken(21 /* CloseParenToken */));
|
|
146711
146827
|
}
|
|
@@ -146771,7 +146887,7 @@ var ts;
|
|
|
146771
146887
|
var nextNode = containingList[index + 1];
|
|
146772
146888
|
var startPos = skipWhitespacesAndLineBreaks(sourceFile.text, nextNode.getFullStart());
|
|
146773
146889
|
// write separator and leading trivia of the next element as suffix
|
|
146774
|
-
var suffix = ""
|
|
146890
|
+
var suffix = "" + ts.tokenToString(nextToken.kind) + sourceFile.text.substring(nextToken.end, startPos);
|
|
146775
146891
|
this.insertNodesAt(sourceFile, startPos, [newNode], { suffix: suffix });
|
|
146776
146892
|
}
|
|
146777
146893
|
}
|
|
@@ -146816,7 +146932,7 @@ var ts;
|
|
|
146816
146932
|
this.replaceRange(sourceFile, ts.createRange(insertPos), newNode, { indentation: indentation, prefix: this.newLineCharacter });
|
|
146817
146933
|
}
|
|
146818
146934
|
else {
|
|
146819
|
-
this.replaceRange(sourceFile, ts.createRange(end), newNode, { prefix:
|
|
146935
|
+
this.replaceRange(sourceFile, ts.createRange(end), newNode, { prefix: ts.tokenToString(separator) + " " });
|
|
146820
146936
|
}
|
|
146821
146937
|
}
|
|
146822
146938
|
};
|
|
@@ -146947,7 +147063,7 @@ var ts;
|
|
|
146947
147063
|
var normalized = ts.stableSort(changesInFile, function (a, b) { return (a.range.pos - b.range.pos) || (a.range.end - b.range.end); });
|
|
146948
147064
|
var _loop_12 = function (i) {
|
|
146949
147065
|
ts.Debug.assert(normalized[i].range.end <= normalized[i + 1].range.pos, "Changes overlap", function () {
|
|
146950
|
-
return
|
|
147066
|
+
return JSON.stringify(normalized[i].range) + " and " + JSON.stringify(normalized[i + 1].range);
|
|
146951
147067
|
});
|
|
146952
147068
|
};
|
|
146953
147069
|
// verify that change intervals do not overlap, except possibly at end points.
|
|
@@ -147038,7 +147154,7 @@ var ts;
|
|
|
147038
147154
|
function applyChanges(text, changes) {
|
|
147039
147155
|
for (var i = changes.length - 1; i >= 0; i--) {
|
|
147040
147156
|
var _a = changes[i], span = _a.span, newText = _a.newText;
|
|
147041
|
-
text = ""
|
|
147157
|
+
text = "" + text.substring(0, span.start) + newText + text.substring(ts.textSpanEnd(span));
|
|
147042
147158
|
}
|
|
147043
147159
|
return text;
|
|
147044
147160
|
}
|
|
@@ -149523,7 +149639,7 @@ var ts;
|
|
|
149523
149639
|
if (!res.has(text) && (originalKeywordKind !== undefined && ts.isNonContextualKeyword(originalKeywordKind)
|
|
149524
149640
|
|| checker.resolveName(text, node, 111551 /* Value */, /*excludeGlobals*/ true))) {
|
|
149525
149641
|
// Unconditionally add an underscore in case `text` is a keyword.
|
|
149526
|
-
res.set(text, makeUniqueName("_"
|
|
149642
|
+
res.set(text, makeUniqueName("_" + text, identifiers));
|
|
149527
149643
|
}
|
|
149528
149644
|
});
|
|
149529
149645
|
return res;
|
|
@@ -149623,7 +149739,7 @@ var ts;
|
|
|
149623
149739
|
// `const a = require("b").c` --> `import { c as a } from "./b";
|
|
149624
149740
|
return convertedImports([makeSingleImport(name.text, propertyName, moduleSpecifier, quotePreference)]);
|
|
149625
149741
|
default:
|
|
149626
|
-
return ts.Debug.assertNever(name, "Convert to ES module got invalid syntax form "
|
|
149742
|
+
return ts.Debug.assertNever(name, "Convert to ES module got invalid syntax form " + name.kind);
|
|
149627
149743
|
}
|
|
149628
149744
|
}
|
|
149629
149745
|
function convertAssignment(sourceFile, checker, assignment, changes, exports, useSitesToUnqualify) {
|
|
@@ -149674,7 +149790,7 @@ var ts;
|
|
|
149674
149790
|
case 168 /* MethodDeclaration */:
|
|
149675
149791
|
return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.factory.createToken(93 /* ExportKeyword */)], prop, useSitesToUnqualify);
|
|
149676
149792
|
default:
|
|
149677
|
-
ts.Debug.assertNever(prop, "Convert to ES6 got invalid prop kind "
|
|
149793
|
+
ts.Debug.assertNever(prop, "Convert to ES6 got invalid prop kind " + prop.kind);
|
|
149678
149794
|
}
|
|
149679
149795
|
});
|
|
149680
149796
|
return statements && [statements, false];
|
|
@@ -149806,7 +149922,7 @@ var ts;
|
|
|
149806
149922
|
case 79 /* Identifier */:
|
|
149807
149923
|
return convertSingleIdentifierImport(name, moduleSpecifier, checker, identifiers, quotePreference);
|
|
149808
149924
|
default:
|
|
149809
|
-
return ts.Debug.assertNever(name, "Convert to ES module got invalid name kind "
|
|
149925
|
+
return ts.Debug.assertNever(name, "Convert to ES module got invalid name kind " + name.kind);
|
|
149810
149926
|
}
|
|
149811
149927
|
}
|
|
149812
149928
|
/**
|
|
@@ -149863,7 +149979,7 @@ var ts;
|
|
|
149863
149979
|
// Identifiers helpers
|
|
149864
149980
|
function makeUniqueName(name, identifiers) {
|
|
149865
149981
|
while (identifiers.original.has(name) || identifiers.additional.has(name)) {
|
|
149866
|
-
name = "_"
|
|
149982
|
+
name = "_" + name;
|
|
149867
149983
|
}
|
|
149868
149984
|
identifiers.additional.add(name);
|
|
149869
149985
|
return name;
|
|
@@ -149943,7 +150059,7 @@ var ts;
|
|
|
149943
150059
|
if (!qualifiedName)
|
|
149944
150060
|
return undefined;
|
|
149945
150061
|
var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, context.sourceFile, qualifiedName); });
|
|
149946
|
-
var newText =
|
|
150062
|
+
var newText = qualifiedName.left.text + "[\"" + qualifiedName.right.text + "\"]";
|
|
149947
150063
|
return [codefix.createCodeFixAction(fixId, changes, [ts.Diagnostics.Rewrite_as_the_indexed_access_type_0, newText], fixId, ts.Diagnostics.Rewrite_all_as_indexed_access_types)];
|
|
149948
150064
|
},
|
|
149949
150065
|
fixIds: [fixId],
|
|
@@ -150345,7 +150461,7 @@ var ts;
|
|
|
150345
150461
|
// Excluding from fix-all
|
|
150346
150462
|
break;
|
|
150347
150463
|
default:
|
|
150348
|
-
ts.Debug.assertNever(fix, "fix wasn't never - got kind "
|
|
150464
|
+
ts.Debug.assertNever(fix, "fix wasn't never - got kind " + fix.kind);
|
|
150349
150465
|
}
|
|
150350
150466
|
function reduceAddAsTypeOnlyValues(prevValue, newValue) {
|
|
150351
150467
|
// `NotAllowed` overrides `Required` because one addition of a new import might be required to be type-only
|
|
@@ -150389,7 +150505,7 @@ var ts;
|
|
|
150389
150505
|
return newEntry;
|
|
150390
150506
|
}
|
|
150391
150507
|
function newImportsKey(moduleSpecifier, topLevelTypeOnly) {
|
|
150392
|
-
return
|
|
150508
|
+
return (topLevelTypeOnly ? 1 : 0) + "|" + moduleSpecifier;
|
|
150393
150509
|
}
|
|
150394
150510
|
}
|
|
150395
150511
|
function writeFixes(changeTracker) {
|
|
@@ -150887,7 +151003,7 @@ var ts;
|
|
|
150887
151003
|
case ts.ModuleKind.NodeNext:
|
|
150888
151004
|
return importingFile.impliedNodeFormat === ts.ModuleKind.ESNext ? 2 /* Namespace */ : 3 /* CommonJS */;
|
|
150889
151005
|
default:
|
|
150890
|
-
return ts.Debug.assertNever(moduleKind, "Unexpected moduleKind "
|
|
151006
|
+
return ts.Debug.assertNever(moduleKind, "Unexpected moduleKind " + moduleKind);
|
|
150891
151007
|
}
|
|
150892
151008
|
}
|
|
150893
151009
|
function getFixesInfoForNonUMDImport(_a, symbolToken, useAutoImportProvider) {
|
|
@@ -150916,12 +151032,9 @@ var ts;
|
|
|
150916
151032
|
return undefined;
|
|
150917
151033
|
return { kind: 4 /* PromoteTypeOnly */, typeOnlyAliasDeclaration: typeOnlyAliasDeclaration };
|
|
150918
151034
|
}
|
|
150919
|
-
function jsxModeNeedsExplicitImport(jsx) {
|
|
150920
|
-
return jsx === 2 /* React */ || jsx === 3 /* ReactNative */;
|
|
150921
|
-
}
|
|
150922
151035
|
function getSymbolName(sourceFile, checker, symbolToken, compilerOptions) {
|
|
150923
151036
|
var parent = symbolToken.parent;
|
|
150924
|
-
if ((ts.isJsxOpeningLikeElement(parent) || ts.isJsxClosingElement(parent)) && parent.tagName === symbolToken && jsxModeNeedsExplicitImport(compilerOptions.jsx)) {
|
|
151037
|
+
if ((ts.isJsxOpeningLikeElement(parent) || ts.isJsxClosingElement(parent)) && parent.tagName === symbolToken && ts.jsxModeNeedsExplicitImport(compilerOptions.jsx)) {
|
|
150925
151038
|
var jsxNamespace = checker.getJsxNamespace(sourceFile);
|
|
150926
151039
|
if (needsJsxNamespaceFix(jsxNamespace, symbolToken, checker)) {
|
|
150927
151040
|
return jsxNamespace;
|
|
@@ -151010,7 +151123,7 @@ var ts;
|
|
|
151010
151123
|
switch (fix.kind) {
|
|
151011
151124
|
case 0 /* UseNamespace */:
|
|
151012
151125
|
addNamespaceQualifier(changes, sourceFile, fix);
|
|
151013
|
-
return [ts.Diagnostics.Change_0_to_1, symbolName,
|
|
151126
|
+
return [ts.Diagnostics.Change_0_to_1, symbolName, fix.namespacePrefix + "." + symbolName];
|
|
151014
151127
|
case 1 /* JsdocTypeImport */:
|
|
151015
151128
|
addImportType(changes, sourceFile, fix, quotePreference);
|
|
151016
151129
|
return [ts.Diagnostics.Change_0_to_1, symbolName, getImportTypePrefix(fix.moduleSpecifier, quotePreference) + symbolName];
|
|
@@ -151041,7 +151154,7 @@ var ts;
|
|
|
151041
151154
|
: [ts.Diagnostics.Remove_type_from_import_declaration_from_0, getModuleSpecifierText(promotedDeclaration)];
|
|
151042
151155
|
}
|
|
151043
151156
|
default:
|
|
151044
|
-
return ts.Debug.assertNever(fix, "Unexpected fix kind "
|
|
151157
|
+
return ts.Debug.assertNever(fix, "Unexpected fix kind " + fix.kind);
|
|
151045
151158
|
}
|
|
151046
151159
|
}
|
|
151047
151160
|
function getModuleSpecifierText(promotedDeclaration) {
|
|
@@ -151194,7 +151307,7 @@ var ts;
|
|
|
151194
151307
|
}
|
|
151195
151308
|
function getImportTypePrefix(moduleSpecifier, quotePreference) {
|
|
151196
151309
|
var quote = ts.getQuoteFromPreference(quotePreference);
|
|
151197
|
-
return "import("
|
|
151310
|
+
return "import(" + quote + moduleSpecifier + quote + ").";
|
|
151198
151311
|
}
|
|
151199
151312
|
function needsTypeOnly(_a) {
|
|
151200
151313
|
var addAsTypeOnly = _a.addAsTypeOnly;
|
|
@@ -151290,7 +151403,7 @@ var ts;
|
|
|
151290
151403
|
lastCharWasValid = isValid;
|
|
151291
151404
|
}
|
|
151292
151405
|
// Need `|| "_"` to ensure result isn't empty.
|
|
151293
|
-
return !ts.isStringANonContextualKeyword(res) ? res || "_" : "_"
|
|
151406
|
+
return !ts.isStringANonContextualKeyword(res) ? res || "_" : "_" + res;
|
|
151294
151407
|
}
|
|
151295
151408
|
codefix.moduleSpecifierToValidIdentifier = moduleSpecifierToValidIdentifier;
|
|
151296
151409
|
})(codefix = ts.codefix || (ts.codefix = {}));
|
|
@@ -152546,7 +152659,7 @@ var ts;
|
|
|
152546
152659
|
break;
|
|
152547
152660
|
}
|
|
152548
152661
|
default:
|
|
152549
|
-
ts.Debug.fail("Bad fixId: "
|
|
152662
|
+
ts.Debug.fail("Bad fixId: " + context.fixId);
|
|
152550
152663
|
}
|
|
152551
152664
|
});
|
|
152552
152665
|
},
|
|
@@ -152994,7 +153107,7 @@ var ts;
|
|
|
152994
153107
|
if (!isValidCharacter(character)) {
|
|
152995
153108
|
return;
|
|
152996
153109
|
}
|
|
152997
|
-
var replacement = useHtmlEntity ? htmlEntity[character] : "{"
|
|
153110
|
+
var replacement = useHtmlEntity ? htmlEntity[character] : "{" + ts.quote(sourceFile, preferences, character) + "}";
|
|
152998
153111
|
changes.replaceRangeWithText(sourceFile, { pos: start, end: start + 1 }, replacement);
|
|
152999
153112
|
}
|
|
153000
153113
|
})(codefix = ts.codefix || (ts.codefix = {}));
|
|
@@ -153274,11 +153387,11 @@ var ts;
|
|
|
153274
153387
|
token = ts.cast(token.parent, ts.isInferTypeNode).typeParameter.name;
|
|
153275
153388
|
}
|
|
153276
153389
|
if (ts.isIdentifier(token) && canPrefix(token)) {
|
|
153277
|
-
changes.replaceNode(sourceFile, token, ts.factory.createIdentifier("_"
|
|
153390
|
+
changes.replaceNode(sourceFile, token, ts.factory.createIdentifier("_" + token.text));
|
|
153278
153391
|
if (ts.isParameter(token.parent)) {
|
|
153279
153392
|
ts.getJSDocParameterTags(token.parent).forEach(function (tag) {
|
|
153280
153393
|
if (ts.isIdentifier(tag.name)) {
|
|
153281
|
-
changes.replaceNode(sourceFile, tag.name, ts.factory.createIdentifier("_"
|
|
153394
|
+
changes.replaceNode(sourceFile, tag.name, ts.factory.createIdentifier("_" + tag.name.text));
|
|
153282
153395
|
}
|
|
153283
153396
|
});
|
|
153284
153397
|
}
|
|
@@ -153620,7 +153733,7 @@ var ts;
|
|
|
153620
153733
|
}); }
|
|
153621
153734
|
});
|
|
153622
153735
|
function doChange(changes, sourceFile, name) {
|
|
153623
|
-
changes.replaceNodeWithText(sourceFile, name,
|
|
153736
|
+
changes.replaceNodeWithText(sourceFile, name, name.text + "()");
|
|
153624
153737
|
}
|
|
153625
153738
|
function getCallName(sourceFile, start) {
|
|
153626
153739
|
var token = ts.getTokenAtPosition(sourceFile, start);
|
|
@@ -154744,7 +154857,7 @@ var ts;
|
|
|
154744
154857
|
var parameters = [];
|
|
154745
154858
|
var length = Math.max.apply(Math, calls.map(function (c) { return c.argumentTypes.length; }));
|
|
154746
154859
|
var _loop_16 = function (i) {
|
|
154747
|
-
var symbol = checker.createSymbol(1 /* FunctionScopedVariable */, ts.escapeLeadingUnderscores("arg"
|
|
154860
|
+
var symbol = checker.createSymbol(1 /* FunctionScopedVariable */, ts.escapeLeadingUnderscores("arg" + i));
|
|
154748
154861
|
symbol.type = combineTypes(calls.map(function (call) { return call.argumentTypes[i] || checker.getUndefinedType(); }));
|
|
154749
154862
|
if (calls.some(function (call) { return call.argumentTypes[i] === undefined; })) {
|
|
154750
154863
|
symbol.flags |= 16777216 /* Optional */;
|
|
@@ -154847,7 +154960,7 @@ var ts;
|
|
|
154847
154960
|
codefix.createCodeFixActionWithoutFixAll(fixName, [codefix.createFileTextChanges(sourceFile.fileName, [
|
|
154848
154961
|
ts.createTextChange(sourceFile.checkJsDirective
|
|
154849
154962
|
? ts.createTextSpanFromBounds(sourceFile.checkJsDirective.pos, sourceFile.checkJsDirective.end)
|
|
154850
|
-
: ts.createTextSpan(0, 0), "// @ts-nocheck"
|
|
154963
|
+
: ts.createTextSpan(0, 0), "// @ts-nocheck" + newLineCharacter),
|
|
154851
154964
|
])], ts.Diagnostics.Disable_checking_for_this_file),
|
|
154852
154965
|
];
|
|
154853
154966
|
if (ts.textChanges.isValidLocationToAddComment(sourceFile, span.start)) {
|
|
@@ -155113,7 +155226,7 @@ var ts;
|
|
|
155113
155226
|
var typeParameters = isJs || typeArguments === undefined
|
|
155114
155227
|
? undefined
|
|
155115
155228
|
: ts.map(typeArguments, function (_, i) {
|
|
155116
|
-
return ts.factory.createTypeParameterDeclaration(84 /* T */ + typeArguments.length - 1 <= 90 /* Z */ ? String.fromCharCode(84 /* T */ + i) : "T"
|
|
155229
|
+
return ts.factory.createTypeParameterDeclaration(84 /* T */ + typeArguments.length - 1 <= 90 /* Z */ ? String.fromCharCode(84 /* T */ + i) : "T" + i);
|
|
155117
155230
|
});
|
|
155118
155231
|
var parameters = createDummyParameters(args.length, names, types, /*minArgumentCount*/ undefined, isJs);
|
|
155119
155232
|
var type = isJs || contextualType === undefined
|
|
@@ -155148,7 +155261,7 @@ var ts;
|
|
|
155148
155261
|
/*decorators*/ undefined,
|
|
155149
155262
|
/*modifiers*/ undefined,
|
|
155150
155263
|
/*dotDotDotToken*/ undefined,
|
|
155151
|
-
/*name*/ names && names[i] || "arg"
|
|
155264
|
+
/*name*/ names && names[i] || "arg" + i,
|
|
155152
155265
|
/*questionToken*/ minArgumentCount !== undefined && i >= minArgumentCount ? ts.factory.createToken(57 /* QuestionToken */) : undefined,
|
|
155153
155266
|
/*type*/ inJs ? undefined : types && types[i] || ts.factory.createKeywordTypeNode(130 /* AnyKeyword */),
|
|
155154
155267
|
/*initializer*/ undefined);
|
|
@@ -155399,7 +155512,7 @@ var ts;
|
|
|
155399
155512
|
}
|
|
155400
155513
|
var name = declaration.name.text;
|
|
155401
155514
|
var startWithUnderscore = ts.startsWithUnderscore(name);
|
|
155402
|
-
var fieldName = createPropertyName(startWithUnderscore ? name : ts.getUniqueName("_"
|
|
155515
|
+
var fieldName = createPropertyName(startWithUnderscore ? name : ts.getUniqueName("_" + name, file), declaration.name);
|
|
155403
155516
|
var accessorName = createPropertyName(startWithUnderscore ? ts.getUniqueName(name.substring(1), file) : name, declaration.name);
|
|
155404
155517
|
return {
|
|
155405
155518
|
isStatic: ts.hasStaticModifier(declaration),
|
|
@@ -156438,7 +156551,7 @@ var ts;
|
|
|
156438
156551
|
changes.insertNodeAfter(exportingSourceFile, exportNode, ts.factory.createExportDefault(ts.factory.createIdentifier(exportName.text)));
|
|
156439
156552
|
break;
|
|
156440
156553
|
default:
|
|
156441
|
-
ts.Debug.fail("Unexpected exportNode kind "
|
|
156554
|
+
ts.Debug.fail("Unexpected exportNode kind " + exportNode.kind);
|
|
156442
156555
|
}
|
|
156443
156556
|
}
|
|
156444
156557
|
}
|
|
@@ -156526,7 +156639,7 @@ var ts;
|
|
|
156526
156639
|
break;
|
|
156527
156640
|
}
|
|
156528
156641
|
default:
|
|
156529
|
-
ts.Debug.assertNever(parent, "Unexpected parent kind "
|
|
156642
|
+
ts.Debug.assertNever(parent, "Unexpected parent kind " + parent.kind);
|
|
156530
156643
|
}
|
|
156531
156644
|
}
|
|
156532
156645
|
function makeImportSpecifier(propertyName, name) {
|
|
@@ -157109,7 +157222,7 @@ var ts;
|
|
|
157109
157222
|
var newComment = ts.displayPartsToString(parameterDocComment);
|
|
157110
157223
|
if (newComment.length) {
|
|
157111
157224
|
ts.setSyntheticLeadingComments(result, [{
|
|
157112
|
-
text: "*\n"
|
|
157225
|
+
text: "*\n" + newComment.split("\n").map(function (c) { return " * " + c; }).join("\n") + "\n ",
|
|
157113
157226
|
kind: 3 /* MultiLineCommentTrivia */,
|
|
157114
157227
|
pos: -1,
|
|
157115
157228
|
end: -1,
|
|
@@ -157254,7 +157367,7 @@ var ts;
|
|
|
157254
157367
|
usedFunctionNames.set(description, true);
|
|
157255
157368
|
functionActions.push({
|
|
157256
157369
|
description: description,
|
|
157257
|
-
name: "function_scope_"
|
|
157370
|
+
name: "function_scope_" + i,
|
|
157258
157371
|
kind: extractFunctionAction.kind
|
|
157259
157372
|
});
|
|
157260
157373
|
}
|
|
@@ -157262,7 +157375,7 @@ var ts;
|
|
|
157262
157375
|
else if (!innermostErrorFunctionAction) {
|
|
157263
157376
|
innermostErrorFunctionAction = {
|
|
157264
157377
|
description: description,
|
|
157265
|
-
name: "function_scope_"
|
|
157378
|
+
name: "function_scope_" + i,
|
|
157266
157379
|
notApplicableReason: getStringError(functionExtraction.errors),
|
|
157267
157380
|
kind: extractFunctionAction.kind
|
|
157268
157381
|
};
|
|
@@ -157278,7 +157391,7 @@ var ts;
|
|
|
157278
157391
|
usedConstantNames.set(description_1, true);
|
|
157279
157392
|
constantActions.push({
|
|
157280
157393
|
description: description_1,
|
|
157281
|
-
name: "constant_scope_"
|
|
157394
|
+
name: "constant_scope_" + i,
|
|
157282
157395
|
kind: extractConstantAction.kind
|
|
157283
157396
|
});
|
|
157284
157397
|
}
|
|
@@ -157286,7 +157399,7 @@ var ts;
|
|
|
157286
157399
|
else if (!innermostErrorConstantAction) {
|
|
157287
157400
|
innermostErrorConstantAction = {
|
|
157288
157401
|
description: description,
|
|
157289
|
-
name: "constant_scope_"
|
|
157402
|
+
name: "constant_scope_" + i,
|
|
157290
157403
|
notApplicableReason: getStringError(constantExtraction.errors),
|
|
157291
157404
|
kind: extractConstantAction.kind
|
|
157292
157405
|
};
|
|
@@ -157870,28 +157983,28 @@ var ts;
|
|
|
157870
157983
|
case 212 /* FunctionExpression */:
|
|
157871
157984
|
case 255 /* FunctionDeclaration */:
|
|
157872
157985
|
return scope.name
|
|
157873
|
-
? "function '"
|
|
157986
|
+
? "function '" + scope.name.text + "'"
|
|
157874
157987
|
: ts.ANONYMOUS;
|
|
157875
157988
|
case 213 /* ArrowFunction */:
|
|
157876
157989
|
return "arrow function";
|
|
157877
157990
|
case 168 /* MethodDeclaration */:
|
|
157878
|
-
return "method '"
|
|
157991
|
+
return "method '" + scope.name.getText() + "'";
|
|
157879
157992
|
case 171 /* GetAccessor */:
|
|
157880
|
-
return "'get "
|
|
157993
|
+
return "'get " + scope.name.getText() + "'";
|
|
157881
157994
|
case 172 /* SetAccessor */:
|
|
157882
|
-
return "'set "
|
|
157995
|
+
return "'set " + scope.name.getText() + "'";
|
|
157883
157996
|
default:
|
|
157884
|
-
throw ts.Debug.assertNever(scope, "Unexpected scope kind "
|
|
157997
|
+
throw ts.Debug.assertNever(scope, "Unexpected scope kind " + scope.kind);
|
|
157885
157998
|
}
|
|
157886
157999
|
}
|
|
157887
158000
|
function getDescriptionForClassLikeDeclaration(scope) {
|
|
157888
158001
|
return scope.kind === 256 /* ClassDeclaration */
|
|
157889
|
-
? scope.name ? "class '"
|
|
157890
|
-
: scope.name ? "class expression '"
|
|
158002
|
+
? scope.name ? "class '" + scope.name.text + "'" : "anonymous class declaration"
|
|
158003
|
+
: scope.name ? "class expression '" + scope.name.text + "'" : "anonymous class expression";
|
|
157891
158004
|
}
|
|
157892
158005
|
function getDescriptionForModuleLikeDeclaration(scope) {
|
|
157893
158006
|
return scope.kind === 261 /* ModuleBlock */
|
|
157894
|
-
? "namespace '"
|
|
158007
|
+
? "namespace '" + scope.parent.name.getText() + "'"
|
|
157895
158008
|
: scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */;
|
|
157896
158009
|
}
|
|
157897
158010
|
var SpecialScope;
|
|
@@ -159367,7 +159480,7 @@ var ts;
|
|
|
159367
159480
|
case 253 /* VariableDeclaration */:
|
|
159368
159481
|
return ts.tryCast(node.name, ts.isIdentifier);
|
|
159369
159482
|
default:
|
|
159370
|
-
return ts.Debug.assertNever(node, "Unexpected node kind "
|
|
159483
|
+
return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind);
|
|
159371
159484
|
}
|
|
159372
159485
|
}
|
|
159373
159486
|
function updateNamespaceLikeImport(changes, sourceFile, checker, movedSymbols, newModuleName, newModuleSpecifier, oldImportId, oldImportNode) {
|
|
@@ -159404,7 +159517,7 @@ var ts;
|
|
|
159404
159517
|
case 253 /* VariableDeclaration */:
|
|
159405
159518
|
return ts.factory.createVariableDeclaration(newNamespaceId, /*exclamationToken*/ undefined, /*type*/ undefined, createRequireCall(newModuleString));
|
|
159406
159519
|
default:
|
|
159407
|
-
return ts.Debug.assertNever(node, "Unexpected node kind "
|
|
159520
|
+
return ts.Debug.assertNever(node, "Unexpected node kind " + node.kind);
|
|
159408
159521
|
}
|
|
159409
159522
|
}
|
|
159410
159523
|
function moduleSpecifierFromImport(i) {
|
|
@@ -159491,7 +159604,7 @@ var ts;
|
|
|
159491
159604
|
deleteUnusedImportsInVariableDeclaration(sourceFile, importDecl, changes, isUnused);
|
|
159492
159605
|
break;
|
|
159493
159606
|
default:
|
|
159494
|
-
ts.Debug.assertNever(importDecl, "Unexpected import decl kind "
|
|
159607
|
+
ts.Debug.assertNever(importDecl, "Unexpected import decl kind " + importDecl.kind);
|
|
159495
159608
|
}
|
|
159496
159609
|
}
|
|
159497
159610
|
function deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnused) {
|
|
@@ -159591,7 +159704,7 @@ var ts;
|
|
|
159591
159704
|
var name = ts.combinePaths(inDirectory, newModuleName + extension);
|
|
159592
159705
|
if (!host.fileExists(name))
|
|
159593
159706
|
return newModuleName; // TODO: GH#18217
|
|
159594
|
-
newModuleName =
|
|
159707
|
+
newModuleName = moduleName + "." + i;
|
|
159595
159708
|
}
|
|
159596
159709
|
}
|
|
159597
159710
|
function getNewModuleName(movedSymbols) {
|
|
@@ -159698,7 +159811,7 @@ var ts;
|
|
|
159698
159811
|
return name ? makeVariableStatement(name, i.type, createRequireCall(moduleSpecifier), i.parent.flags) : undefined;
|
|
159699
159812
|
}
|
|
159700
159813
|
default:
|
|
159701
|
-
return ts.Debug.assertNever(i, "Unexpected import kind "
|
|
159814
|
+
return ts.Debug.assertNever(i, "Unexpected import kind " + i.kind);
|
|
159702
159815
|
}
|
|
159703
159816
|
}
|
|
159704
159817
|
function filterNamedBindings(namedBindings, keep) {
|
|
@@ -159813,7 +159926,7 @@ var ts;
|
|
|
159813
159926
|
case 200 /* ObjectBindingPattern */:
|
|
159814
159927
|
return ts.firstDefined(name.elements, function (em) { return ts.isOmittedExpression(em) ? undefined : forEachTopLevelDeclarationInBindingName(em.name, cb); });
|
|
159815
159928
|
default:
|
|
159816
|
-
return ts.Debug.assertNever(name, "Unexpected name kind "
|
|
159929
|
+
return ts.Debug.assertNever(name, "Unexpected name kind " + name.kind);
|
|
159817
159930
|
}
|
|
159818
159931
|
}
|
|
159819
159932
|
function nameOfTopLevelDeclaration(d) {
|
|
@@ -159874,7 +159987,7 @@ var ts;
|
|
|
159874
159987
|
case 237 /* ExpressionStatement */:
|
|
159875
159988
|
return ts.Debug.fail(); // Shouldn't try to add 'export' keyword to `exports.x = ...`
|
|
159876
159989
|
default:
|
|
159877
|
-
return ts.Debug.assertNever(d, "Unexpected declaration kind "
|
|
159990
|
+
return ts.Debug.assertNever(d, "Unexpected declaration kind " + d.kind);
|
|
159878
159991
|
}
|
|
159879
159992
|
}
|
|
159880
159993
|
function addCommonjsExport(decl) {
|
|
@@ -159896,7 +160009,7 @@ var ts;
|
|
|
159896
160009
|
case 237 /* ExpressionStatement */:
|
|
159897
160010
|
return ts.Debug.fail("Can't export an ExpressionStatement"); // Shouldn't try to add 'export' keyword to `exports.x = ...`
|
|
159898
160011
|
default:
|
|
159899
|
-
return ts.Debug.assertNever(decl, "Unexpected decl kind "
|
|
160012
|
+
return ts.Debug.assertNever(decl, "Unexpected decl kind " + decl.kind);
|
|
159900
160013
|
}
|
|
159901
160014
|
}
|
|
159902
160015
|
/** Creates `exports.x = x;` */
|
|
@@ -160534,7 +160647,7 @@ var ts;
|
|
|
160534
160647
|
return [functionDeclaration.name, functionDeclaration.parent.name];
|
|
160535
160648
|
return [functionDeclaration.parent.name];
|
|
160536
160649
|
default:
|
|
160537
|
-
return ts.Debug.assertNever(functionDeclaration, "Unexpected function declaration kind "
|
|
160650
|
+
return ts.Debug.assertNever(functionDeclaration, "Unexpected function declaration kind " + functionDeclaration.kind);
|
|
160538
160651
|
}
|
|
160539
160652
|
}
|
|
160540
160653
|
})(convertParamsToDestructuredObject = refactor.convertParamsToDestructuredObject || (refactor.convertParamsToDestructuredObject = {}));
|
|
@@ -161238,7 +161351,7 @@ var ts;
|
|
|
161238
161351
|
var textPos = ts.scanner.getTextPos();
|
|
161239
161352
|
if (textPos <= end) {
|
|
161240
161353
|
if (token === 79 /* Identifier */) {
|
|
161241
|
-
ts.Debug.fail("Did not expect "
|
|
161354
|
+
ts.Debug.fail("Did not expect " + ts.Debug.formatSyntaxKind(parent.kind) + " to have an Identifier in its trivia");
|
|
161242
161355
|
}
|
|
161243
161356
|
nodes.push(createNode(token, pos, textPos, parent));
|
|
161244
161357
|
}
|
|
@@ -162168,7 +162281,7 @@ var ts;
|
|
|
162168
162281
|
function getValidSourceFile(fileName) {
|
|
162169
162282
|
var sourceFile = program.getSourceFile(fileName);
|
|
162170
162283
|
if (!sourceFile) {
|
|
162171
|
-
var error = new Error("Could not find source file: '"
|
|
162284
|
+
var error = new Error("Could not find source file: '" + fileName + "'.");
|
|
162172
162285
|
// We've been having trouble debugging this, so attach sidecar data for the tsserver log.
|
|
162173
162286
|
// See https://github.com/microsoft/TypeScript/issues/30180.
|
|
162174
162287
|
error.ProgramFiles = program.getSourceFiles().map(function (f) { return f.fileName; });
|
|
@@ -162844,7 +162957,7 @@ var ts;
|
|
|
162844
162957
|
var element = token.kind === 31 /* GreaterThanToken */ && ts.isJsxOpeningElement(token.parent) ? token.parent.parent
|
|
162845
162958
|
: ts.isJsxText(token) && ts.isJsxElement(token.parent) ? token.parent : undefined;
|
|
162846
162959
|
if (element && isUnclosedTag(element)) {
|
|
162847
|
-
return { newText: "</"
|
|
162960
|
+
return { newText: "</" + element.openingElement.tagName.getText(sourceFile) + ">" };
|
|
162848
162961
|
}
|
|
162849
162962
|
var fragment = token.kind === 31 /* GreaterThanToken */ && ts.isJsxOpeningFragment(token.parent) ? token.parent.parent
|
|
162850
162963
|
: ts.isJsxText(token) && ts.isJsxFragment(token.parent) ? token.parent : undefined;
|
|
@@ -162950,7 +163063,7 @@ var ts;
|
|
|
162950
163063
|
pos = commentRange.end + 1;
|
|
162951
163064
|
}
|
|
162952
163065
|
else { // If it's not in a comment range, then we need to comment the uncommented portions.
|
|
162953
|
-
var newPos = text.substring(pos, textRange.end).search("("
|
|
163066
|
+
var newPos = text.substring(pos, textRange.end).search("(" + openMultilineRegex + ")|(" + closeMultilineRegex + ")");
|
|
162954
163067
|
isCommenting = insertComment !== undefined
|
|
162955
163068
|
? insertComment
|
|
162956
163069
|
: isCommenting || !ts.isTextWhiteSpaceLike(text, pos, newPos === -1 ? textRange.end : pos + newPos); // If isCommenting is already true we don't need to check whitespace again.
|
|
@@ -163345,14 +163458,14 @@ var ts;
|
|
|
163345
163458
|
case ts.LanguageServiceMode.PartialSemantic:
|
|
163346
163459
|
invalidOperationsInPartialSemanticMode.forEach(function (key) {
|
|
163347
163460
|
return ls[key] = function () {
|
|
163348
|
-
throw new Error("LanguageService Operation: "
|
|
163461
|
+
throw new Error("LanguageService Operation: " + key + " not allowed in LanguageServiceMode.PartialSemantic");
|
|
163349
163462
|
};
|
|
163350
163463
|
});
|
|
163351
163464
|
break;
|
|
163352
163465
|
case ts.LanguageServiceMode.Syntactic:
|
|
163353
163466
|
invalidOperationsInSyntacticMode.forEach(function (key) {
|
|
163354
163467
|
return ls[key] = function () {
|
|
163355
|
-
throw new Error("LanguageService Operation: "
|
|
163468
|
+
throw new Error("LanguageService Operation: " + key + " not allowed in LanguageServiceMode.Syntactic");
|
|
163356
163469
|
};
|
|
163357
163470
|
});
|
|
163358
163471
|
break;
|
|
@@ -164334,13 +164447,13 @@ var ts;
|
|
|
164334
164447
|
var result = action();
|
|
164335
164448
|
if (logPerformance) {
|
|
164336
164449
|
var end = ts.timestamp();
|
|
164337
|
-
logger.log(
|
|
164450
|
+
logger.log(actionDescription + " completed in " + (end - start) + " msec");
|
|
164338
164451
|
if (ts.isString(result)) {
|
|
164339
164452
|
var str = result;
|
|
164340
164453
|
if (str.length > 128) {
|
|
164341
164454
|
str = str.substring(0, 128) + "...";
|
|
164342
164455
|
}
|
|
164343
|
-
logger.log(" result.length="
|
|
164456
|
+
logger.log(" result.length=" + str.length + ", result='" + JSON.stringify(str) + "'");
|
|
164344
164457
|
}
|
|
164345
164458
|
}
|
|
164346
164459
|
return result;
|
|
@@ -164422,7 +164535,7 @@ var ts;
|
|
|
164422
164535
|
* Update the list of scripts known to the compiler
|
|
164423
164536
|
*/
|
|
164424
164537
|
LanguageServiceShimObject.prototype.refresh = function (throwOnError) {
|
|
164425
|
-
this.forwardJSONCall("refresh("
|
|
164538
|
+
this.forwardJSONCall("refresh(" + throwOnError + ")", function () { return null; } // eslint-disable-line no-null/no-null
|
|
164426
164539
|
);
|
|
164427
164540
|
};
|
|
164428
164541
|
LanguageServiceShimObject.prototype.cleanupSemanticCache = function () {
|
|
@@ -164438,43 +164551,43 @@ var ts;
|
|
|
164438
164551
|
};
|
|
164439
164552
|
LanguageServiceShimObject.prototype.getSyntacticClassifications = function (fileName, start, length) {
|
|
164440
164553
|
var _this = this;
|
|
164441
|
-
return this.forwardJSONCall("getSyntacticClassifications('"
|
|
164554
|
+
return this.forwardJSONCall("getSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return _this.languageService.getSyntacticClassifications(fileName, ts.createTextSpan(start, length)); });
|
|
164442
164555
|
};
|
|
164443
164556
|
LanguageServiceShimObject.prototype.getSemanticClassifications = function (fileName, start, length) {
|
|
164444
164557
|
var _this = this;
|
|
164445
|
-
return this.forwardJSONCall("getSemanticClassifications('"
|
|
164558
|
+
return this.forwardJSONCall("getSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { return _this.languageService.getSemanticClassifications(fileName, ts.createTextSpan(start, length)); });
|
|
164446
164559
|
};
|
|
164447
164560
|
LanguageServiceShimObject.prototype.getEncodedSyntacticClassifications = function (fileName, start, length) {
|
|
164448
164561
|
var _this = this;
|
|
164449
|
-
return this.forwardJSONCall("getEncodedSyntacticClassifications('"
|
|
164562
|
+
return this.forwardJSONCall("getEncodedSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")",
|
|
164450
164563
|
// directly serialize the spans out to a string. This is much faster to decode
|
|
164451
164564
|
// on the managed side versus a full JSON array.
|
|
164452
164565
|
function () { return convertClassifications(_this.languageService.getEncodedSyntacticClassifications(fileName, ts.createTextSpan(start, length))); });
|
|
164453
164566
|
};
|
|
164454
164567
|
LanguageServiceShimObject.prototype.getEncodedSemanticClassifications = function (fileName, start, length) {
|
|
164455
164568
|
var _this = this;
|
|
164456
|
-
return this.forwardJSONCall("getEncodedSemanticClassifications('"
|
|
164569
|
+
return this.forwardJSONCall("getEncodedSemanticClassifications('" + fileName + "', " + start + ", " + length + ")",
|
|
164457
164570
|
// directly serialize the spans out to a string. This is much faster to decode
|
|
164458
164571
|
// on the managed side versus a full JSON array.
|
|
164459
164572
|
function () { return convertClassifications(_this.languageService.getEncodedSemanticClassifications(fileName, ts.createTextSpan(start, length))); });
|
|
164460
164573
|
};
|
|
164461
164574
|
LanguageServiceShimObject.prototype.getSyntacticDiagnostics = function (fileName) {
|
|
164462
164575
|
var _this = this;
|
|
164463
|
-
return this.forwardJSONCall("getSyntacticDiagnostics('"
|
|
164576
|
+
return this.forwardJSONCall("getSyntacticDiagnostics('" + fileName + "')", function () {
|
|
164464
164577
|
var diagnostics = _this.languageService.getSyntacticDiagnostics(fileName);
|
|
164465
164578
|
return _this.realizeDiagnostics(diagnostics);
|
|
164466
164579
|
});
|
|
164467
164580
|
};
|
|
164468
164581
|
LanguageServiceShimObject.prototype.getSemanticDiagnostics = function (fileName) {
|
|
164469
164582
|
var _this = this;
|
|
164470
|
-
return this.forwardJSONCall("getSemanticDiagnostics('"
|
|
164583
|
+
return this.forwardJSONCall("getSemanticDiagnostics('" + fileName + "')", function () {
|
|
164471
164584
|
var diagnostics = _this.languageService.getSemanticDiagnostics(fileName);
|
|
164472
164585
|
return _this.realizeDiagnostics(diagnostics);
|
|
164473
164586
|
});
|
|
164474
164587
|
};
|
|
164475
164588
|
LanguageServiceShimObject.prototype.getSuggestionDiagnostics = function (fileName) {
|
|
164476
164589
|
var _this = this;
|
|
164477
|
-
return this.forwardJSONCall("getSuggestionDiagnostics('"
|
|
164590
|
+
return this.forwardJSONCall("getSuggestionDiagnostics('" + fileName + "')", function () { return _this.realizeDiagnostics(_this.languageService.getSuggestionDiagnostics(fileName)); });
|
|
164478
164591
|
};
|
|
164479
164592
|
LanguageServiceShimObject.prototype.getCompilerOptionsDiagnostics = function () {
|
|
164480
164593
|
var _this = this;
|
|
@@ -164490,7 +164603,7 @@ var ts;
|
|
|
164490
164603
|
*/
|
|
164491
164604
|
LanguageServiceShimObject.prototype.getQuickInfoAtPosition = function (fileName, position) {
|
|
164492
164605
|
var _this = this;
|
|
164493
|
-
return this.forwardJSONCall("getQuickInfoAtPosition('"
|
|
164606
|
+
return this.forwardJSONCall("getQuickInfoAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getQuickInfoAtPosition(fileName, position); });
|
|
164494
164607
|
};
|
|
164495
164608
|
/// NAMEORDOTTEDNAMESPAN
|
|
164496
164609
|
/**
|
|
@@ -164499,7 +164612,7 @@ var ts;
|
|
|
164499
164612
|
*/
|
|
164500
164613
|
LanguageServiceShimObject.prototype.getNameOrDottedNameSpan = function (fileName, startPos, endPos) {
|
|
164501
164614
|
var _this = this;
|
|
164502
|
-
return this.forwardJSONCall("getNameOrDottedNameSpan('"
|
|
164615
|
+
return this.forwardJSONCall("getNameOrDottedNameSpan('" + fileName + "', " + startPos + ", " + endPos + ")", function () { return _this.languageService.getNameOrDottedNameSpan(fileName, startPos, endPos); });
|
|
164503
164616
|
};
|
|
164504
164617
|
/**
|
|
164505
164618
|
* STATEMENTSPAN
|
|
@@ -164507,12 +164620,12 @@ var ts;
|
|
|
164507
164620
|
*/
|
|
164508
164621
|
LanguageServiceShimObject.prototype.getBreakpointStatementAtPosition = function (fileName, position) {
|
|
164509
164622
|
var _this = this;
|
|
164510
|
-
return this.forwardJSONCall("getBreakpointStatementAtPosition('"
|
|
164623
|
+
return this.forwardJSONCall("getBreakpointStatementAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getBreakpointStatementAtPosition(fileName, position); });
|
|
164511
164624
|
};
|
|
164512
164625
|
/// SIGNATUREHELP
|
|
164513
164626
|
LanguageServiceShimObject.prototype.getSignatureHelpItems = function (fileName, position, options) {
|
|
164514
164627
|
var _this = this;
|
|
164515
|
-
return this.forwardJSONCall("getSignatureHelpItems('"
|
|
164628
|
+
return this.forwardJSONCall("getSignatureHelpItems('" + fileName + "', " + position + ")", function () { return _this.languageService.getSignatureHelpItems(fileName, position, options); });
|
|
164516
164629
|
};
|
|
164517
164630
|
/// GOTO DEFINITION
|
|
164518
164631
|
/**
|
|
@@ -164521,7 +164634,7 @@ var ts;
|
|
|
164521
164634
|
*/
|
|
164522
164635
|
LanguageServiceShimObject.prototype.getDefinitionAtPosition = function (fileName, position) {
|
|
164523
164636
|
var _this = this;
|
|
164524
|
-
return this.forwardJSONCall("getDefinitionAtPosition('"
|
|
164637
|
+
return this.forwardJSONCall("getDefinitionAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getDefinitionAtPosition(fileName, position); });
|
|
164525
164638
|
};
|
|
164526
164639
|
/**
|
|
164527
164640
|
* Computes the definition location and file for the symbol
|
|
@@ -164529,7 +164642,7 @@ var ts;
|
|
|
164529
164642
|
*/
|
|
164530
164643
|
LanguageServiceShimObject.prototype.getDefinitionAndBoundSpan = function (fileName, position) {
|
|
164531
164644
|
var _this = this;
|
|
164532
|
-
return this.forwardJSONCall("getDefinitionAndBoundSpan('"
|
|
164645
|
+
return this.forwardJSONCall("getDefinitionAndBoundSpan('" + fileName + "', " + position + ")", function () { return _this.languageService.getDefinitionAndBoundSpan(fileName, position); });
|
|
164533
164646
|
};
|
|
164534
164647
|
/// GOTO Type
|
|
164535
164648
|
/**
|
|
@@ -164538,7 +164651,7 @@ var ts;
|
|
|
164538
164651
|
*/
|
|
164539
164652
|
LanguageServiceShimObject.prototype.getTypeDefinitionAtPosition = function (fileName, position) {
|
|
164540
164653
|
var _this = this;
|
|
164541
|
-
return this.forwardJSONCall("getTypeDefinitionAtPosition('"
|
|
164654
|
+
return this.forwardJSONCall("getTypeDefinitionAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getTypeDefinitionAtPosition(fileName, position); });
|
|
164542
164655
|
};
|
|
164543
164656
|
/// GOTO Implementation
|
|
164544
164657
|
/**
|
|
@@ -164547,37 +164660,37 @@ var ts;
|
|
|
164547
164660
|
*/
|
|
164548
164661
|
LanguageServiceShimObject.prototype.getImplementationAtPosition = function (fileName, position) {
|
|
164549
164662
|
var _this = this;
|
|
164550
|
-
return this.forwardJSONCall("getImplementationAtPosition('"
|
|
164663
|
+
return this.forwardJSONCall("getImplementationAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getImplementationAtPosition(fileName, position); });
|
|
164551
164664
|
};
|
|
164552
164665
|
LanguageServiceShimObject.prototype.getRenameInfo = function (fileName, position, options) {
|
|
164553
164666
|
var _this = this;
|
|
164554
|
-
return this.forwardJSONCall("getRenameInfo('"
|
|
164667
|
+
return this.forwardJSONCall("getRenameInfo('" + fileName + "', " + position + ")", function () { return _this.languageService.getRenameInfo(fileName, position, options); });
|
|
164555
164668
|
};
|
|
164556
164669
|
LanguageServiceShimObject.prototype.getSmartSelectionRange = function (fileName, position) {
|
|
164557
164670
|
var _this = this;
|
|
164558
|
-
return this.forwardJSONCall("getSmartSelectionRange('"
|
|
164671
|
+
return this.forwardJSONCall("getSmartSelectionRange('" + fileName + "', " + position + ")", function () { return _this.languageService.getSmartSelectionRange(fileName, position); });
|
|
164559
164672
|
};
|
|
164560
164673
|
LanguageServiceShimObject.prototype.findRenameLocations = function (fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename) {
|
|
164561
164674
|
var _this = this;
|
|
164562
|
-
return this.forwardJSONCall("findRenameLocations('"
|
|
164675
|
+
return this.forwardJSONCall("findRenameLocations('" + fileName + "', " + position + ", " + findInStrings + ", " + findInComments + ", " + providePrefixAndSuffixTextForRename + ")", function () { return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename); });
|
|
164563
164676
|
};
|
|
164564
164677
|
/// GET BRACE MATCHING
|
|
164565
164678
|
LanguageServiceShimObject.prototype.getBraceMatchingAtPosition = function (fileName, position) {
|
|
164566
164679
|
var _this = this;
|
|
164567
|
-
return this.forwardJSONCall("getBraceMatchingAtPosition('"
|
|
164680
|
+
return this.forwardJSONCall("getBraceMatchingAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getBraceMatchingAtPosition(fileName, position); });
|
|
164568
164681
|
};
|
|
164569
164682
|
LanguageServiceShimObject.prototype.isValidBraceCompletionAtPosition = function (fileName, position, openingBrace) {
|
|
164570
164683
|
var _this = this;
|
|
164571
|
-
return this.forwardJSONCall("isValidBraceCompletionAtPosition('"
|
|
164684
|
+
return this.forwardJSONCall("isValidBraceCompletionAtPosition('" + fileName + "', " + position + ", " + openingBrace + ")", function () { return _this.languageService.isValidBraceCompletionAtPosition(fileName, position, openingBrace); });
|
|
164572
164685
|
};
|
|
164573
164686
|
LanguageServiceShimObject.prototype.getSpanOfEnclosingComment = function (fileName, position, onlyMultiLine) {
|
|
164574
164687
|
var _this = this;
|
|
164575
|
-
return this.forwardJSONCall("getSpanOfEnclosingComment('"
|
|
164688
|
+
return this.forwardJSONCall("getSpanOfEnclosingComment('" + fileName + "', " + position + ")", function () { return _this.languageService.getSpanOfEnclosingComment(fileName, position, onlyMultiLine); });
|
|
164576
164689
|
};
|
|
164577
164690
|
/// GET SMART INDENT
|
|
164578
164691
|
LanguageServiceShimObject.prototype.getIndentationAtPosition = function (fileName, position, options /*Services.EditorOptions*/) {
|
|
164579
164692
|
var _this = this;
|
|
164580
|
-
return this.forwardJSONCall("getIndentationAtPosition('"
|
|
164693
|
+
return this.forwardJSONCall("getIndentationAtPosition('" + fileName + "', " + position + ")", function () {
|
|
164581
164694
|
var localOptions = JSON.parse(options);
|
|
164582
164695
|
return _this.languageService.getIndentationAtPosition(fileName, position, localOptions);
|
|
164583
164696
|
});
|
|
@@ -164585,23 +164698,23 @@ var ts;
|
|
|
164585
164698
|
/// GET REFERENCES
|
|
164586
164699
|
LanguageServiceShimObject.prototype.getReferencesAtPosition = function (fileName, position) {
|
|
164587
164700
|
var _this = this;
|
|
164588
|
-
return this.forwardJSONCall("getReferencesAtPosition('"
|
|
164701
|
+
return this.forwardJSONCall("getReferencesAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getReferencesAtPosition(fileName, position); });
|
|
164589
164702
|
};
|
|
164590
164703
|
LanguageServiceShimObject.prototype.findReferences = function (fileName, position) {
|
|
164591
164704
|
var _this = this;
|
|
164592
|
-
return this.forwardJSONCall("findReferences('"
|
|
164705
|
+
return this.forwardJSONCall("findReferences('" + fileName + "', " + position + ")", function () { return _this.languageService.findReferences(fileName, position); });
|
|
164593
164706
|
};
|
|
164594
164707
|
LanguageServiceShimObject.prototype.getFileReferences = function (fileName) {
|
|
164595
164708
|
var _this = this;
|
|
164596
|
-
return this.forwardJSONCall("getFileReferences('"
|
|
164709
|
+
return this.forwardJSONCall("getFileReferences('" + fileName + ")", function () { return _this.languageService.getFileReferences(fileName); });
|
|
164597
164710
|
};
|
|
164598
164711
|
LanguageServiceShimObject.prototype.getOccurrencesAtPosition = function (fileName, position) {
|
|
164599
164712
|
var _this = this;
|
|
164600
|
-
return this.forwardJSONCall("getOccurrencesAtPosition('"
|
|
164713
|
+
return this.forwardJSONCall("getOccurrencesAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getOccurrencesAtPosition(fileName, position); });
|
|
164601
164714
|
};
|
|
164602
164715
|
LanguageServiceShimObject.prototype.getDocumentHighlights = function (fileName, position, filesToSearch) {
|
|
164603
164716
|
var _this = this;
|
|
164604
|
-
return this.forwardJSONCall("getDocumentHighlights('"
|
|
164717
|
+
return this.forwardJSONCall("getDocumentHighlights('" + fileName + "', " + position + ")", function () {
|
|
164605
164718
|
var results = _this.languageService.getDocumentHighlights(fileName, position, JSON.parse(filesToSearch));
|
|
164606
164719
|
// workaround for VS document highlighting issue - keep only items from the initial file
|
|
164607
164720
|
var normalizedName = ts.toFileNameLowerCase(ts.normalizeSlashes(fileName));
|
|
@@ -164616,108 +164729,108 @@ var ts;
|
|
|
164616
164729
|
*/
|
|
164617
164730
|
LanguageServiceShimObject.prototype.getCompletionsAtPosition = function (fileName, position, preferences, formattingSettings) {
|
|
164618
164731
|
var _this = this;
|
|
164619
|
-
return this.forwardJSONCall("getCompletionsAtPosition('"
|
|
164732
|
+
return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ", " + preferences + ", " + formattingSettings + ")", function () { return _this.languageService.getCompletionsAtPosition(fileName, position, preferences, formattingSettings); });
|
|
164620
164733
|
};
|
|
164621
164734
|
/** Get a string based representation of a completion list entry details */
|
|
164622
164735
|
LanguageServiceShimObject.prototype.getCompletionEntryDetails = function (fileName, position, entryName, formatOptions, source, preferences, data) {
|
|
164623
164736
|
var _this = this;
|
|
164624
|
-
return this.forwardJSONCall("getCompletionEntryDetails('"
|
|
164737
|
+
return this.forwardJSONCall("getCompletionEntryDetails('" + fileName + "', " + position + ", '" + entryName + "')", function () {
|
|
164625
164738
|
var localOptions = formatOptions === undefined ? undefined : JSON.parse(formatOptions);
|
|
164626
164739
|
return _this.languageService.getCompletionEntryDetails(fileName, position, entryName, localOptions, source, preferences, data);
|
|
164627
164740
|
});
|
|
164628
164741
|
};
|
|
164629
164742
|
LanguageServiceShimObject.prototype.getFormattingEditsForRange = function (fileName, start, end, options /*Services.FormatCodeOptions*/) {
|
|
164630
164743
|
var _this = this;
|
|
164631
|
-
return this.forwardJSONCall("getFormattingEditsForRange('"
|
|
164744
|
+
return this.forwardJSONCall("getFormattingEditsForRange('" + fileName + "', " + start + ", " + end + ")", function () {
|
|
164632
164745
|
var localOptions = JSON.parse(options);
|
|
164633
164746
|
return _this.languageService.getFormattingEditsForRange(fileName, start, end, localOptions);
|
|
164634
164747
|
});
|
|
164635
164748
|
};
|
|
164636
164749
|
LanguageServiceShimObject.prototype.getFormattingEditsForDocument = function (fileName, options /*Services.FormatCodeOptions*/) {
|
|
164637
164750
|
var _this = this;
|
|
164638
|
-
return this.forwardJSONCall("getFormattingEditsForDocument('"
|
|
164751
|
+
return this.forwardJSONCall("getFormattingEditsForDocument('" + fileName + "')", function () {
|
|
164639
164752
|
var localOptions = JSON.parse(options);
|
|
164640
164753
|
return _this.languageService.getFormattingEditsForDocument(fileName, localOptions);
|
|
164641
164754
|
});
|
|
164642
164755
|
};
|
|
164643
164756
|
LanguageServiceShimObject.prototype.getFormattingEditsAfterKeystroke = function (fileName, position, key, options /*Services.FormatCodeOptions*/) {
|
|
164644
164757
|
var _this = this;
|
|
164645
|
-
return this.forwardJSONCall("getFormattingEditsAfterKeystroke('"
|
|
164758
|
+
return this.forwardJSONCall("getFormattingEditsAfterKeystroke('" + fileName + "', " + position + ", '" + key + "')", function () {
|
|
164646
164759
|
var localOptions = JSON.parse(options);
|
|
164647
164760
|
return _this.languageService.getFormattingEditsAfterKeystroke(fileName, position, key, localOptions);
|
|
164648
164761
|
});
|
|
164649
164762
|
};
|
|
164650
164763
|
LanguageServiceShimObject.prototype.getDocCommentTemplateAtPosition = function (fileName, position, options) {
|
|
164651
164764
|
var _this = this;
|
|
164652
|
-
return this.forwardJSONCall("getDocCommentTemplateAtPosition('"
|
|
164765
|
+
return this.forwardJSONCall("getDocCommentTemplateAtPosition('" + fileName + "', " + position + ")", function () { return _this.languageService.getDocCommentTemplateAtPosition(fileName, position, options); });
|
|
164653
164766
|
};
|
|
164654
164767
|
/// NAVIGATE TO
|
|
164655
164768
|
/** Return a list of symbols that are interesting to navigate to */
|
|
164656
164769
|
LanguageServiceShimObject.prototype.getNavigateToItems = function (searchValue, maxResultCount, fileName) {
|
|
164657
164770
|
var _this = this;
|
|
164658
|
-
return this.forwardJSONCall("getNavigateToItems('"
|
|
164771
|
+
return this.forwardJSONCall("getNavigateToItems('" + searchValue + "', " + maxResultCount + ", " + fileName + ")", function () { return _this.languageService.getNavigateToItems(searchValue, maxResultCount, fileName); });
|
|
164659
164772
|
};
|
|
164660
164773
|
LanguageServiceShimObject.prototype.getNavigationBarItems = function (fileName) {
|
|
164661
164774
|
var _this = this;
|
|
164662
|
-
return this.forwardJSONCall("getNavigationBarItems('"
|
|
164775
|
+
return this.forwardJSONCall("getNavigationBarItems('" + fileName + "')", function () { return _this.languageService.getNavigationBarItems(fileName); });
|
|
164663
164776
|
};
|
|
164664
164777
|
LanguageServiceShimObject.prototype.getNavigationTree = function (fileName) {
|
|
164665
164778
|
var _this = this;
|
|
164666
|
-
return this.forwardJSONCall("getNavigationTree('"
|
|
164779
|
+
return this.forwardJSONCall("getNavigationTree('" + fileName + "')", function () { return _this.languageService.getNavigationTree(fileName); });
|
|
164667
164780
|
};
|
|
164668
164781
|
LanguageServiceShimObject.prototype.getOutliningSpans = function (fileName) {
|
|
164669
164782
|
var _this = this;
|
|
164670
|
-
return this.forwardJSONCall("getOutliningSpans('"
|
|
164783
|
+
return this.forwardJSONCall("getOutliningSpans('" + fileName + "')", function () { return _this.languageService.getOutliningSpans(fileName); });
|
|
164671
164784
|
};
|
|
164672
164785
|
LanguageServiceShimObject.prototype.getTodoComments = function (fileName, descriptors) {
|
|
164673
164786
|
var _this = this;
|
|
164674
|
-
return this.forwardJSONCall("getTodoComments('"
|
|
164787
|
+
return this.forwardJSONCall("getTodoComments('" + fileName + "')", function () { return _this.languageService.getTodoComments(fileName, JSON.parse(descriptors)); });
|
|
164675
164788
|
};
|
|
164676
164789
|
/// CALL HIERARCHY
|
|
164677
164790
|
LanguageServiceShimObject.prototype.prepareCallHierarchy = function (fileName, position) {
|
|
164678
164791
|
var _this = this;
|
|
164679
|
-
return this.forwardJSONCall("prepareCallHierarchy('"
|
|
164792
|
+
return this.forwardJSONCall("prepareCallHierarchy('" + fileName + "', " + position + ")", function () { return _this.languageService.prepareCallHierarchy(fileName, position); });
|
|
164680
164793
|
};
|
|
164681
164794
|
LanguageServiceShimObject.prototype.provideCallHierarchyIncomingCalls = function (fileName, position) {
|
|
164682
164795
|
var _this = this;
|
|
164683
|
-
return this.forwardJSONCall("provideCallHierarchyIncomingCalls('"
|
|
164796
|
+
return this.forwardJSONCall("provideCallHierarchyIncomingCalls('" + fileName + "', " + position + ")", function () { return _this.languageService.provideCallHierarchyIncomingCalls(fileName, position); });
|
|
164684
164797
|
};
|
|
164685
164798
|
LanguageServiceShimObject.prototype.provideCallHierarchyOutgoingCalls = function (fileName, position) {
|
|
164686
164799
|
var _this = this;
|
|
164687
|
-
return this.forwardJSONCall("provideCallHierarchyOutgoingCalls('"
|
|
164800
|
+
return this.forwardJSONCall("provideCallHierarchyOutgoingCalls('" + fileName + "', " + position + ")", function () { return _this.languageService.provideCallHierarchyOutgoingCalls(fileName, position); });
|
|
164688
164801
|
};
|
|
164689
164802
|
LanguageServiceShimObject.prototype.provideInlayHints = function (fileName, span, preference) {
|
|
164690
164803
|
var _this = this;
|
|
164691
|
-
return this.forwardJSONCall("provideInlayHints('"
|
|
164804
|
+
return this.forwardJSONCall("provideInlayHints('" + fileName + "', '" + JSON.stringify(span) + "', " + JSON.stringify(preference) + ")", function () { return _this.languageService.provideInlayHints(fileName, span, preference); });
|
|
164692
164805
|
};
|
|
164693
164806
|
/// Emit
|
|
164694
164807
|
LanguageServiceShimObject.prototype.getEmitOutput = function (fileName) {
|
|
164695
164808
|
var _this = this;
|
|
164696
|
-
return this.forwardJSONCall("getEmitOutput('"
|
|
164809
|
+
return this.forwardJSONCall("getEmitOutput('" + fileName + "')", function () {
|
|
164697
164810
|
var _a = _this.languageService.getEmitOutput(fileName), diagnostics = _a.diagnostics, rest = __rest(_a, ["diagnostics"]);
|
|
164698
164811
|
return __assign(__assign({}, rest), { diagnostics: _this.realizeDiagnostics(diagnostics) });
|
|
164699
164812
|
});
|
|
164700
164813
|
};
|
|
164701
164814
|
LanguageServiceShimObject.prototype.getEmitOutputObject = function (fileName) {
|
|
164702
164815
|
var _this = this;
|
|
164703
|
-
return forwardCall(this.logger, "getEmitOutput('"
|
|
164816
|
+
return forwardCall(this.logger, "getEmitOutput('" + fileName + "')",
|
|
164704
164817
|
/*returnJson*/ false, function () { return _this.languageService.getEmitOutput(fileName); }, this.logPerformance);
|
|
164705
164818
|
};
|
|
164706
164819
|
LanguageServiceShimObject.prototype.toggleLineComment = function (fileName, textRange) {
|
|
164707
164820
|
var _this = this;
|
|
164708
|
-
return this.forwardJSONCall("toggleLineComment('"
|
|
164821
|
+
return this.forwardJSONCall("toggleLineComment('" + fileName + "', '" + JSON.stringify(textRange) + "')", function () { return _this.languageService.toggleLineComment(fileName, textRange); });
|
|
164709
164822
|
};
|
|
164710
164823
|
LanguageServiceShimObject.prototype.toggleMultilineComment = function (fileName, textRange) {
|
|
164711
164824
|
var _this = this;
|
|
164712
|
-
return this.forwardJSONCall("toggleMultilineComment('"
|
|
164825
|
+
return this.forwardJSONCall("toggleMultilineComment('" + fileName + "', '" + JSON.stringify(textRange) + "')", function () { return _this.languageService.toggleMultilineComment(fileName, textRange); });
|
|
164713
164826
|
};
|
|
164714
164827
|
LanguageServiceShimObject.prototype.commentSelection = function (fileName, textRange) {
|
|
164715
164828
|
var _this = this;
|
|
164716
|
-
return this.forwardJSONCall("commentSelection('"
|
|
164829
|
+
return this.forwardJSONCall("commentSelection('" + fileName + "', '" + JSON.stringify(textRange) + "')", function () { return _this.languageService.commentSelection(fileName, textRange); });
|
|
164717
164830
|
};
|
|
164718
164831
|
LanguageServiceShimObject.prototype.uncommentSelection = function (fileName, textRange) {
|
|
164719
164832
|
var _this = this;
|
|
164720
|
-
return this.forwardJSONCall("uncommentSelection('"
|
|
164833
|
+
return this.forwardJSONCall("uncommentSelection('" + fileName + "', '" + JSON.stringify(textRange) + "')", function () { return _this.languageService.uncommentSelection(fileName, textRange); });
|
|
164721
164834
|
};
|
|
164722
164835
|
return LanguageServiceShimObject;
|
|
164723
164836
|
}(ShimBase));
|
|
@@ -164767,7 +164880,7 @@ var ts;
|
|
|
164767
164880
|
};
|
|
164768
164881
|
CoreServicesShimObject.prototype.resolveModuleName = function (fileName, moduleName, compilerOptionsJson) {
|
|
164769
164882
|
var _this = this;
|
|
164770
|
-
return this.forwardJSONCall("resolveModuleName('"
|
|
164883
|
+
return this.forwardJSONCall("resolveModuleName('" + fileName + "')", function () {
|
|
164771
164884
|
var compilerOptions = JSON.parse(compilerOptionsJson);
|
|
164772
164885
|
var result = ts.resolveModuleName(moduleName, ts.normalizeSlashes(fileName), compilerOptions, _this.host);
|
|
164773
164886
|
var resolvedFileName = result.resolvedModule ? result.resolvedModule.resolvedFileName : undefined;
|
|
@@ -164782,7 +164895,7 @@ var ts;
|
|
|
164782
164895
|
};
|
|
164783
164896
|
CoreServicesShimObject.prototype.resolveTypeReferenceDirective = function (fileName, typeReferenceDirective, compilerOptionsJson) {
|
|
164784
164897
|
var _this = this;
|
|
164785
|
-
return this.forwardJSONCall("resolveTypeReferenceDirective("
|
|
164898
|
+
return this.forwardJSONCall("resolveTypeReferenceDirective(" + fileName + ")", function () {
|
|
164786
164899
|
var compilerOptions = JSON.parse(compilerOptionsJson);
|
|
164787
164900
|
var result = ts.resolveTypeReferenceDirective(typeReferenceDirective, ts.normalizeSlashes(fileName), compilerOptions, _this.host);
|
|
164788
164901
|
return {
|
|
@@ -164794,7 +164907,7 @@ var ts;
|
|
|
164794
164907
|
};
|
|
164795
164908
|
CoreServicesShimObject.prototype.getPreProcessedFileInfo = function (fileName, sourceTextSnapshot) {
|
|
164796
164909
|
var _this = this;
|
|
164797
|
-
return this.forwardJSONCall("getPreProcessedFileInfo('"
|
|
164910
|
+
return this.forwardJSONCall("getPreProcessedFileInfo('" + fileName + "')", function () {
|
|
164798
164911
|
// for now treat files as JavaScript
|
|
164799
164912
|
var result = ts.preProcessFile(ts.getSnapshotText(sourceTextSnapshot), /* readImportFiles */ true, /* detectJavaScriptImports */ true);
|
|
164800
164913
|
return {
|
|
@@ -164809,7 +164922,7 @@ var ts;
|
|
|
164809
164922
|
};
|
|
164810
164923
|
CoreServicesShimObject.prototype.getAutomaticTypeDirectiveNames = function (compilerOptionsJson) {
|
|
164811
164924
|
var _this = this;
|
|
164812
|
-
return this.forwardJSONCall("getAutomaticTypeDirectiveNames('"
|
|
164925
|
+
return this.forwardJSONCall("getAutomaticTypeDirectiveNames('" + compilerOptionsJson + "')", function () {
|
|
164813
164926
|
var compilerOptions = JSON.parse(compilerOptionsJson);
|
|
164814
164927
|
return ts.getAutomaticTypeDirectiveNames(compilerOptions, _this.host);
|
|
164815
164928
|
});
|
|
@@ -164831,7 +164944,7 @@ var ts;
|
|
|
164831
164944
|
};
|
|
164832
164945
|
CoreServicesShimObject.prototype.getTSConfigFileInfo = function (fileName, sourceTextSnapshot) {
|
|
164833
164946
|
var _this = this;
|
|
164834
|
-
return this.forwardJSONCall("getTSConfigFileInfo('"
|
|
164947
|
+
return this.forwardJSONCall("getTSConfigFileInfo('" + fileName + "')", function () {
|
|
164835
164948
|
var result = ts.parseJsonText(fileName, ts.getSnapshotText(sourceTextSnapshot));
|
|
164836
164949
|
var normalizedFileName = ts.normalizeSlashes(fileName);
|
|
164837
164950
|
var configFile = ts.parseJsonSourceFileConfigFileContent(result, _this.host, ts.getDirectoryPath(normalizedFileName), /*existingOptions*/ {}, normalizedFileName);
|