typescript 4.6.0-dev.20220208 → 4.6.1-rc
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 +1 -2
- package/lib/es/diagnosticMessages.generated.json +1 -2
- package/lib/fr/diagnosticMessages.generated.json +1 -2
- package/lib/it/diagnosticMessages.generated.json +1 -2
- package/lib/ja/diagnosticMessages.generated.json +1 -2
- package/lib/ko/diagnosticMessages.generated.json +1 -2
- package/lib/pl/diagnosticMessages.generated.json +1 -2
- package/lib/pt-br/diagnosticMessages.generated.json +1 -2
- package/lib/tr/diagnosticMessages.generated.json +1 -2
- package/lib/tsc.js +449 -355
- package/lib/tsserver.js +903 -685
- package/lib/tsserverlibrary.js +878 -660
- package/lib/typescript.js +783 -565
- package/lib/typescriptServices.js +783 -565
- package/lib/typingsInstaller.js +520 -415
- package/lib/zh-cn/diagnosticMessages.generated.json +1 -2
- 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 || from);
|
|
24
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
25
25
|
};
|
|
26
26
|
var __assign = (this && this.__assign) || function () {
|
|
27
27
|
__assign = Object.assign || function(t) {
|
|
@@ -294,7 +294,7 @@ var ts;
|
|
|
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 = ts.versionMajorMinor
|
|
297
|
+
ts.version = "".concat(ts.versionMajorMinor, ".1-rc");
|
|
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 ".concat(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 ".concat(value, " did not pass the test '").concat(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 = typeof arg
|
|
1785
|
+
var key = "".concat(typeof arg, ":").concat(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 prefix
|
|
2235
|
+
return "".concat(prefix, "*").concat(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. ".concat(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((message || "Unexpected node."
|
|
2556
|
+
return fail("".concat(message || "Unexpected node.", "\r\nNode ").concat(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: ".concat(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 ? msg
|
|
2572
|
-
fail("Expected "
|
|
2571
|
+
var message = msg ? msg2 ? "".concat(msg, " ").concat(msg2) : msg : "";
|
|
2572
|
+
fail("Expected ".concat(a, " === ").concat(b, ". ").concat(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 ".concat(a, " < ").concat(b, ". ").concat(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 ".concat(a, " <= ").concat(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 ".concat(a, " >= ").concat(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(message
|
|
2621
|
+
return fail("".concat(message, " ").concat(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 '".concat(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 ".concat(formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind), " did not pass test '").concat(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 ".concat(formatSyntaxKind(node.kind), " should not have passed test '").concat(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 ".concat(formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind), " did not pass test '").concat(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 ".concat(formatSyntaxKind(node === null || node === void 0 ? void 0 : node.kind), " was not a '").concat(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 ".concat(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: ".concat(ts.unescapeLeadingUnderscores(symbol.escapedName), "; flags: ").concat(formatSymbolFlags(symbol.flags), "; declarations: ").concat(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 = "".concat(result).concat(result ? "|" : "").concat(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 "".concat(flowHeader).concat(remainingFlags ? " (".concat(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 ".concat(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 symbolHeader
|
|
2902
|
+
return "".concat(symbolHeader, " '").concat(ts.symbolName(this), "'").concat(remainingSymbolFlags ? " (".concat(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 ".concat(JSON.stringify(this.value)) :
|
|
2913
|
+
this.flags & 2048 /* BigIntLiteral */ ? "LiteralType ".concat(this.value.negative ? "-" : "").concat(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 ".concat(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 "".concat(typeHeader).concat(this.symbol ? " '".concat(ts.symbolName(this.symbol), "'") : "").concat(remainingObjectFlags ? " (".concat(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 '".concat(ts.idText(this), "'") :
|
|
2972
|
+
ts.isPrivateIdentifier(this) ? "PrivateIdentifier '".concat(ts.idText(this), "'") :
|
|
2973
|
+
ts.isStringLiteral(this) ? "StringLiteral ".concat(JSON.stringify(this.text.length < 10 ? this.text : this.text.slice(10) + "...")) :
|
|
2974
|
+
ts.isNumericLiteral(this) ? "NumericLiteral ".concat(this.text) :
|
|
2975
|
+
ts.isBigIntLiteral(this) ? "BigIntLiteral ".concat(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 "".concat(nodeHeader).concat(this.flags ? " (".concat(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 += "'".concat(name, "' ");
|
|
3055
|
+
deprecationMessage += since ? "has been deprecated since v".concat(since) : "is deprecated";
|
|
3056
|
+
deprecationMessage += error ? " and can no longer be used." : errorAfter ? " and will no longer be usable after v".concat(errorAfter, ".") : ".";
|
|
3057
|
+
deprecationMessage += message ? " ".concat(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 = this.major
|
|
3188
|
+
var result = "".concat(this.major, ".").concat(this.minor, ".").concat(this.patch);
|
|
3189
3189
|
if (ts.some(this.prerelease))
|
|
3190
|
-
result += "-"
|
|
3190
|
+
result += "-".concat(this.prerelease.join("."));
|
|
3191
3191
|
if (ts.some(this.build))
|
|
3192
|
-
result += "+"
|
|
3192
|
+
result += "+".concat(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 "".concat(comparator.operator).concat(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: ".concat(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" ? ".".concat(process.pid, "-").concat(++traceCount)
|
|
3770
|
+
: mode === "server" ? ".".concat(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".concat(countPart, ".json"));
|
|
3773
|
+
var typesPath = ts.combinePaths(traceDir, "types".concat(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\":".concat(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\":\"".concat(eventType, "\",\"cat\":\"").concat(phase, "\",\"ts\":").concat(time, ",\"name\":\"").concat(name, "\""));
|
|
3873
3873
|
if (extras)
|
|
3874
|
-
fs.writeSync(traceFd, ","
|
|
3874
|
+
fs.writeSync(traceFd, ",".concat(extras));
|
|
3875
3875
|
if (args)
|
|
3876
|
-
fs.writeSync(traceFd, ",\"args\":"
|
|
3876
|
+
fs.writeSync(traceFd, ",\"args\":".concat(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(envVar
|
|
5989
|
+
return system.getEnvironmentVariable("".concat(envVar, "_").concat(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:: ".concat(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:: ".concat(ts.timestamp() - start, "ms:: ").concat(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:: ".concat(elapsed, "ms:: onTimerToUpdateChildWatches:: ").concat(cacheToUpdateChildWatches.size, " ").concat(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://".concat(ts.getRootLength(normalizedDir) === 1 ? "" : "/").concat(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".concat(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, (new Date()).toISOString().replace(/:/g, "-")
|
|
6972
|
+
profilePath = _path.join(profilePath, "".concat((new Date()).toISOString().replace(/:/g, "-"), "+P").concat(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:: ".concat(fileOrDirectory, ":: Changing watcher to ").concat(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:: ".concat(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:: ".concat(fileOrDirectory, ":: Changing to fsWatchFile"));
|
|
7116
7116
|
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
7117
7117
|
}
|
|
7118
7118
|
}
|
|
@@ -8239,10 +8239,10 @@ var ts;
|
|
|
8239
8239
|
A_type_predicate_cannot_reference_a_rest_parameter: diag(1229, ts.DiagnosticCategory.Error, "A_type_predicate_cannot_reference_a_rest_parameter_1229", "A type predicate cannot reference a rest parameter."),
|
|
8240
8240
|
A_type_predicate_cannot_reference_element_0_in_a_binding_pattern: diag(1230, ts.DiagnosticCategory.Error, "A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230", "A type predicate cannot reference element '{0}' in a binding pattern."),
|
|
8241
8241
|
An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration: diag(1231, ts.DiagnosticCategory.Error, "An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration_1231", "An export assignment must be at the top level of a file or module declaration."),
|
|
8242
|
-
|
|
8243
|
-
|
|
8242
|
+
An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module: diag(1232, ts.DiagnosticCategory.Error, "An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1232", "An import declaration can only be used at the top level of a namespace or module."),
|
|
8243
|
+
An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module: diag(1233, ts.DiagnosticCategory.Error, "An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1233", "An export declaration can only be used at the top level of a namespace or module."),
|
|
8244
8244
|
An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file: diag(1234, ts.DiagnosticCategory.Error, "An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file_1234", "An ambient module declaration is only allowed at the top level in a file."),
|
|
8245
|
-
|
|
8245
|
+
A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module: diag(1235, ts.DiagnosticCategory.Error, "A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235", "A namespace declaration is only allowed at the top level of a namespace or module."),
|
|
8246
8246
|
The_return_type_of_a_property_decorator_function_must_be_either_void_or_any: diag(1236, ts.DiagnosticCategory.Error, "The_return_type_of_a_property_decorator_function_must_be_either_void_or_any_1236", "The return type of a property decorator function must be either 'void' or 'any'."),
|
|
8247
8247
|
The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any: diag(1237, ts.DiagnosticCategory.Error, "The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any_1237", "The return type of a parameter decorator function must be either 'void' or 'any'."),
|
|
8248
8248
|
Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression: diag(1238, ts.DiagnosticCategory.Error, "Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression_1238", "Unable to resolve signature of class decorator when called as an expression."),
|
|
@@ -8274,6 +8274,7 @@ var ts;
|
|
|
8274
8274
|
An_optional_element_cannot_follow_a_rest_element: diag(1266, ts.DiagnosticCategory.Error, "An_optional_element_cannot_follow_a_rest_element_1266", "An optional element cannot follow a rest element."),
|
|
8275
8275
|
Property_0_cannot_have_an_initializer_because_it_is_marked_abstract: diag(1267, ts.DiagnosticCategory.Error, "Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267", "Property '{0}' cannot have an initializer because it is marked abstract."),
|
|
8276
8276
|
An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type: diag(1268, ts.DiagnosticCategory.Error, "An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type_1268", "An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type."),
|
|
8277
|
+
Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided: diag(1269, ts.DiagnosticCategory.Error, "Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269", "Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided."),
|
|
8277
8278
|
with_statements_are_not_allowed_in_an_async_function_block: diag(1300, ts.DiagnosticCategory.Error, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
|
|
8278
8279
|
await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, ts.DiagnosticCategory.Error, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."),
|
|
8279
8280
|
Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern: diag(1312, ts.DiagnosticCategory.Error, "Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312", "Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."),
|
|
@@ -8410,6 +8411,8 @@ var ts;
|
|
|
8410
8411
|
The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output: diag(1470, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470", "The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."),
|
|
8411
8412
|
Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_synchronously_Use_dynamic_import_instead: diag(1471, ts.DiagnosticCategory.Error, "Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471", "Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead."),
|
|
8412
8413
|
catch_or_finally_expected: diag(1472, ts.DiagnosticCategory.Error, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
|
|
8414
|
+
An_import_declaration_can_only_be_used_at_the_top_level_of_a_module: diag(1473, ts.DiagnosticCategory.Error, "An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473", "An import declaration can only be used at the top level of a module."),
|
|
8415
|
+
An_export_declaration_can_only_be_used_at_the_top_level_of_a_module: diag(1474, ts.DiagnosticCategory.Error, "An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474", "An export declaration can only be used at the top level of a module."),
|
|
8413
8416
|
The_types_of_0_are_incompatible_between_these_types: diag(2200, ts.DiagnosticCategory.Error, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
|
|
8414
8417
|
The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, ts.DiagnosticCategory.Error, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
|
|
8415
8418
|
Call_signature_return_types_0_and_1_are_incompatible: diag(2202, ts.DiagnosticCategory.Error, "Call_signature_return_types_0_and_1_are_incompatible_2202", "Call signature return types '{0}' and '{1}' are incompatible.", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ true),
|
|
@@ -9830,6 +9833,9 @@ var ts;
|
|
|
9830
9833
|
Add_all_missing_attributes: diag(95168, ts.DiagnosticCategory.Message, "Add_all_missing_attributes_95168", "Add all missing attributes"),
|
|
9831
9834
|
Add_undefined_to_optional_property_type: diag(95169, ts.DiagnosticCategory.Message, "Add_undefined_to_optional_property_type_95169", "Add 'undefined' to optional property type"),
|
|
9832
9835
|
Convert_named_imports_to_default_import: diag(95170, ts.DiagnosticCategory.Message, "Convert_named_imports_to_default_import_95170", "Convert named imports to default import"),
|
|
9836
|
+
Delete_unused_param_tag_0: diag(95171, ts.DiagnosticCategory.Message, "Delete_unused_param_tag_0_95171", "Delete unused '@param' tag '{0}'"),
|
|
9837
|
+
Delete_all_unused_param_tags: diag(95172, ts.DiagnosticCategory.Message, "Delete_all_unused_param_tags_95172", "Delete all unused '@param' tags"),
|
|
9838
|
+
Rename_param_tag_name_0_to_1: diag(95173, ts.DiagnosticCategory.Message, "Rename_param_tag_name_0_to_1_95173", "Rename '@param' tag name '{0}' to '{1}'"),
|
|
9833
9839
|
No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, ts.DiagnosticCategory.Error, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),
|
|
9834
9840
|
Classes_may_not_have_a_field_named_constructor: diag(18006, ts.DiagnosticCategory.Error, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."),
|
|
9835
9841
|
JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, ts.DiagnosticCategory.Error, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"),
|
|
@@ -10121,7 +10127,7 @@ var ts;
|
|
|
10121
10127
|
line = line < 0 ? 0 : line >= lineStarts.length ? lineStarts.length - 1 : line;
|
|
10122
10128
|
}
|
|
10123
10129
|
else {
|
|
10124
|
-
ts.Debug.fail("Bad line number. Line: "
|
|
10130
|
+
ts.Debug.fail("Bad line number. Line: ".concat(line, ", lineStarts.length: ").concat(lineStarts.length, " , line map is correct? ").concat(debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown"));
|
|
10125
10131
|
}
|
|
10126
10132
|
}
|
|
10127
10133
|
var res = lineStarts[line] + character;
|
|
@@ -13011,7 +13017,7 @@ var ts;
|
|
|
13011
13017
|
: "linkplain";
|
|
13012
13018
|
var name = link.name ? ts.entityNameToString(link.name) : "";
|
|
13013
13019
|
var space = link.name && link.text.startsWith("://") ? "" : " ";
|
|
13014
|
-
return "{@"
|
|
13020
|
+
return "{@".concat(kind, " ").concat(name).concat(space).concat(link.text, "}");
|
|
13015
13021
|
}
|
|
13016
13022
|
/**
|
|
13017
13023
|
* Gets the effective type parameters. If the node was parsed in a
|
|
@@ -14091,6 +14097,10 @@ var ts;
|
|
|
14091
14097
|
return undefined;
|
|
14092
14098
|
}
|
|
14093
14099
|
ts.getDeclarationOfKind = getDeclarationOfKind;
|
|
14100
|
+
function getDeclarationsOfKind(symbol, kind) {
|
|
14101
|
+
return ts.filter(symbol.declarations || ts.emptyArray, function (d) { return d.kind === kind; });
|
|
14102
|
+
}
|
|
14103
|
+
ts.getDeclarationsOfKind = getDeclarationsOfKind;
|
|
14094
14104
|
function createSymbolTable(symbols) {
|
|
14095
14105
|
var result = new ts.Map();
|
|
14096
14106
|
if (symbols) {
|
|
@@ -14264,11 +14274,11 @@ var ts;
|
|
|
14264
14274
|
}
|
|
14265
14275
|
function packageIdToPackageName(_a) {
|
|
14266
14276
|
var name = _a.name, subModuleName = _a.subModuleName;
|
|
14267
|
-
return subModuleName ? name
|
|
14277
|
+
return subModuleName ? "".concat(name, "/").concat(subModuleName) : name;
|
|
14268
14278
|
}
|
|
14269
14279
|
ts.packageIdToPackageName = packageIdToPackageName;
|
|
14270
14280
|
function packageIdToString(packageId) {
|
|
14271
|
-
return packageIdToPackageName(packageId)
|
|
14281
|
+
return "".concat(packageIdToPackageName(packageId), "@").concat(packageId.version);
|
|
14272
14282
|
}
|
|
14273
14283
|
ts.packageIdToString = packageIdToString;
|
|
14274
14284
|
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
|
|
@@ -14326,6 +14336,10 @@ var ts;
|
|
|
14326
14336
|
return getSourceFileOfNode(module.valueDeclaration || getNonAugmentationDeclaration(module));
|
|
14327
14337
|
}
|
|
14328
14338
|
ts.getSourceFileOfModule = getSourceFileOfModule;
|
|
14339
|
+
function isPlainJsFile(file, checkJs) {
|
|
14340
|
+
return !!file && (file.scriptKind === 1 /* JS */ || file.scriptKind === 2 /* JSX */) && !file.checkJsDirective && checkJs === undefined;
|
|
14341
|
+
}
|
|
14342
|
+
ts.isPlainJsFile = isPlainJsFile;
|
|
14329
14343
|
function isStatementWithLocals(node) {
|
|
14330
14344
|
switch (node.kind) {
|
|
14331
14345
|
case 234 /* Block */:
|
|
@@ -14347,7 +14361,7 @@ var ts;
|
|
|
14347
14361
|
function nodePosToString(node) {
|
|
14348
14362
|
var file = getSourceFileOfNode(node);
|
|
14349
14363
|
var loc = ts.getLineAndCharacterOfPosition(file, node.pos);
|
|
14350
|
-
return file.fileName
|
|
14364
|
+
return "".concat(file.fileName, "(").concat(loc.line + 1, ",").concat(loc.character + 1, ")");
|
|
14351
14365
|
}
|
|
14352
14366
|
ts.nodePosToString = nodePosToString;
|
|
14353
14367
|
function getEndLinePosition(line, sourceFile) {
|
|
@@ -14486,7 +14500,7 @@ var ts;
|
|
|
14486
14500
|
ts.isPinnedComment = isPinnedComment;
|
|
14487
14501
|
function createCommentDirectivesMap(sourceFile, commentDirectives) {
|
|
14488
14502
|
var directivesByLine = new ts.Map(commentDirectives.map(function (commentDirective) { return ([
|
|
14489
|
-
""
|
|
14503
|
+
"".concat(ts.getLineAndCharacterOfPosition(sourceFile, commentDirective.range.end).line),
|
|
14490
14504
|
commentDirective,
|
|
14491
14505
|
]); }));
|
|
14492
14506
|
var usedLines = new ts.Map();
|
|
@@ -14503,10 +14517,10 @@ var ts;
|
|
|
14503
14517
|
});
|
|
14504
14518
|
}
|
|
14505
14519
|
function markUsed(line) {
|
|
14506
|
-
if (!directivesByLine.has(""
|
|
14520
|
+
if (!directivesByLine.has("".concat(line))) {
|
|
14507
14521
|
return false;
|
|
14508
14522
|
}
|
|
14509
|
-
usedLines.set(""
|
|
14523
|
+
usedLines.set("".concat(line), true);
|
|
14510
14524
|
return true;
|
|
14511
14525
|
}
|
|
14512
14526
|
}
|
|
@@ -14736,7 +14750,7 @@ var ts;
|
|
|
14736
14750
|
}
|
|
14737
14751
|
return node.text;
|
|
14738
14752
|
}
|
|
14739
|
-
return ts.Debug.fail("Literal kind '"
|
|
14753
|
+
return ts.Debug.fail("Literal kind '".concat(node.kind, "' not accounted for."));
|
|
14740
14754
|
}
|
|
14741
14755
|
ts.getLiteralText = getLiteralText;
|
|
14742
14756
|
function canUseOriginalText(node, flags) {
|
|
@@ -17317,11 +17331,11 @@ var ts;
|
|
|
17317
17331
|
}
|
|
17318
17332
|
ts.getEscapedTextOfIdentifierOrLiteral = getEscapedTextOfIdentifierOrLiteral;
|
|
17319
17333
|
function getPropertyNameForUniqueESSymbol(symbol) {
|
|
17320
|
-
return "__@"
|
|
17334
|
+
return "__@".concat(ts.getSymbolId(symbol), "@").concat(symbol.escapedName);
|
|
17321
17335
|
}
|
|
17322
17336
|
ts.getPropertyNameForUniqueESSymbol = getPropertyNameForUniqueESSymbol;
|
|
17323
17337
|
function getSymbolNameForPrivateIdentifier(containingClassSymbol, description) {
|
|
17324
|
-
return "__#"
|
|
17338
|
+
return "__#".concat(ts.getSymbolId(containingClassSymbol), "@").concat(description);
|
|
17325
17339
|
}
|
|
17326
17340
|
ts.getSymbolNameForPrivateIdentifier = getSymbolNameForPrivateIdentifier;
|
|
17327
17341
|
function isKnownSymbol(symbol) {
|
|
@@ -20023,7 +20037,7 @@ var ts;
|
|
|
20023
20037
|
}
|
|
20024
20038
|
ts.getJSXImplicitImportBase = getJSXImplicitImportBase;
|
|
20025
20039
|
function getJSXRuntimeImport(base, options) {
|
|
20026
|
-
return base ? base
|
|
20040
|
+
return base ? "".concat(base, "/").concat(options.jsx === 5 /* ReactJSXDev */ ? "jsx-dev-runtime" : "jsx-runtime") : undefined;
|
|
20027
20041
|
}
|
|
20028
20042
|
ts.getJSXRuntimeImport = getJSXRuntimeImport;
|
|
20029
20043
|
function hasZeroOrOneAsteriskCharacter(str) {
|
|
@@ -20130,7 +20144,7 @@ var ts;
|
|
|
20130
20144
|
}
|
|
20131
20145
|
var wildcardCharCodes = [42 /* asterisk */, 63 /* question */];
|
|
20132
20146
|
ts.commonPackageFolders = ["node_modules", "bower_components", "jspm_packages"];
|
|
20133
|
-
var implicitExcludePathRegexPattern = "(?!("
|
|
20147
|
+
var implicitExcludePathRegexPattern = "(?!(".concat(ts.commonPackageFolders.join("|"), ")(/|$))");
|
|
20134
20148
|
var filesMatcher = {
|
|
20135
20149
|
/**
|
|
20136
20150
|
* Matches any single directory segment unless it is the last segment and a .min.js file
|
|
@@ -20143,7 +20157,7 @@ var ts;
|
|
|
20143
20157
|
* Regex for the ** wildcard. Matches any number of subdirectories. When used for including
|
|
20144
20158
|
* files or directories, does not match subdirectories that start with a . character
|
|
20145
20159
|
*/
|
|
20146
|
-
doubleAsteriskRegexFragment: "(/"
|
|
20160
|
+
doubleAsteriskRegexFragment: "(/".concat(implicitExcludePathRegexPattern, "[^/.][^/]*)*?"),
|
|
20147
20161
|
replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, filesMatcher.singleAsteriskRegexFragment); }
|
|
20148
20162
|
};
|
|
20149
20163
|
var directoriesMatcher = {
|
|
@@ -20152,7 +20166,7 @@ var ts;
|
|
|
20152
20166
|
* Regex for the ** wildcard. Matches any number of subdirectories. When used for including
|
|
20153
20167
|
* files or directories, does not match subdirectories that start with a . character
|
|
20154
20168
|
*/
|
|
20155
|
-
doubleAsteriskRegexFragment: "(/"
|
|
20169
|
+
doubleAsteriskRegexFragment: "(/".concat(implicitExcludePathRegexPattern, "[^/.][^/]*)*?"),
|
|
20156
20170
|
replaceWildcardCharacter: function (match) { return replaceWildcardCharacter(match, directoriesMatcher.singleAsteriskRegexFragment); }
|
|
20157
20171
|
};
|
|
20158
20172
|
var excludeMatcher = {
|
|
@@ -20170,10 +20184,10 @@ var ts;
|
|
|
20170
20184
|
if (!patterns || !patterns.length) {
|
|
20171
20185
|
return undefined;
|
|
20172
20186
|
}
|
|
20173
|
-
var pattern = patterns.map(function (pattern) { return "("
|
|
20187
|
+
var pattern = patterns.map(function (pattern) { return "(".concat(pattern, ")"); }).join("|");
|
|
20174
20188
|
// If excluding, match "foo/bar/baz...", but if including, only allow "foo".
|
|
20175
20189
|
var terminator = usage === "exclude" ? "($|/)" : "$";
|
|
20176
|
-
return "^("
|
|
20190
|
+
return "^(".concat(pattern, ")").concat(terminator);
|
|
20177
20191
|
}
|
|
20178
20192
|
ts.getRegularExpressionForWildcard = getRegularExpressionForWildcard;
|
|
20179
20193
|
function getRegularExpressionsForWildcards(specs, basePath, usage) {
|
|
@@ -20195,7 +20209,7 @@ var ts;
|
|
|
20195
20209
|
ts.isImplicitGlob = isImplicitGlob;
|
|
20196
20210
|
function getPatternFromSpec(spec, basePath, usage) {
|
|
20197
20211
|
var pattern = spec && getSubPatternFromSpec(spec, basePath, usage, wildcardMatchers[usage]);
|
|
20198
|
-
return pattern && "^("
|
|
20212
|
+
return pattern && "^(".concat(pattern, ")").concat(usage === "exclude" ? "($|/)" : "$");
|
|
20199
20213
|
}
|
|
20200
20214
|
ts.getPatternFromSpec = getPatternFromSpec;
|
|
20201
20215
|
function getSubPatternFromSpec(spec, basePath, usage, _a) {
|
|
@@ -20273,7 +20287,7 @@ var ts;
|
|
|
20273
20287
|
currentDirectory = ts.normalizePath(currentDirectory);
|
|
20274
20288
|
var absolutePath = ts.combinePaths(currentDirectory, path);
|
|
20275
20289
|
return {
|
|
20276
|
-
includeFilePatterns: ts.map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^"
|
|
20290
|
+
includeFilePatterns: ts.map(getRegularExpressionsForWildcards(includes, absolutePath, "files"), function (pattern) { return "^".concat(pattern, "$"); }),
|
|
20277
20291
|
includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"),
|
|
20278
20292
|
includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"),
|
|
20279
20293
|
excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"),
|
|
@@ -20554,7 +20568,7 @@ var ts;
|
|
|
20554
20568
|
*/
|
|
20555
20569
|
function extensionFromPath(path) {
|
|
20556
20570
|
var ext = tryGetExtensionFromPath(path);
|
|
20557
|
-
return ext !== undefined ? ext : ts.Debug.fail("File "
|
|
20571
|
+
return ext !== undefined ? ext : ts.Debug.fail("File ".concat(path, " has unknown extension."));
|
|
20558
20572
|
}
|
|
20559
20573
|
ts.extensionFromPath = extensionFromPath;
|
|
20560
20574
|
function isAnySupportedFileExtension(path) {
|
|
@@ -26637,7 +26651,7 @@ var ts;
|
|
|
26637
26651
|
case 326 /* JSDocAugmentsTag */: return "augments";
|
|
26638
26652
|
case 327 /* JSDocImplementsTag */: return "implements";
|
|
26639
26653
|
default:
|
|
26640
|
-
return ts.Debug.fail("Unsupported kind: "
|
|
26654
|
+
return ts.Debug.fail("Unsupported kind: ".concat(ts.Debug.formatSyntaxKind(kind)));
|
|
26641
26655
|
}
|
|
26642
26656
|
}
|
|
26643
26657
|
var rawTextScanner;
|
|
@@ -26965,7 +26979,7 @@ var ts;
|
|
|
26965
26979
|
};
|
|
26966
26980
|
var definedTextGetter_1 = function (path) {
|
|
26967
26981
|
var result = textGetter_1(path);
|
|
26968
|
-
return result !== undefined ? result : "/* Input file "
|
|
26982
|
+
return result !== undefined ? result : "/* Input file ".concat(path, " was missing */\r\n");
|
|
26969
26983
|
};
|
|
26970
26984
|
var buildInfo_1;
|
|
26971
26985
|
var getAndCacheBuildInfo_1 = function (getText) {
|
|
@@ -31503,7 +31517,7 @@ var ts;
|
|
|
31503
31517
|
for (var _i = 0, viableKeywordSuggestions_1 = viableKeywordSuggestions; _i < viableKeywordSuggestions_1.length; _i++) {
|
|
31504
31518
|
var keyword = viableKeywordSuggestions_1[_i];
|
|
31505
31519
|
if (expressionText.length > keyword.length + 2 && ts.startsWith(expressionText, keyword)) {
|
|
31506
|
-
return keyword
|
|
31520
|
+
return "".concat(keyword, " ").concat(expressionText.slice(keyword.length));
|
|
31507
31521
|
}
|
|
31508
31522
|
}
|
|
31509
31523
|
return undefined;
|
|
@@ -38273,7 +38287,7 @@ var ts;
|
|
|
38273
38287
|
if (namedArgRegExCache.has(name)) {
|
|
38274
38288
|
return namedArgRegExCache.get(name);
|
|
38275
38289
|
}
|
|
38276
|
-
var result = new RegExp("(\\s"
|
|
38290
|
+
var result = new RegExp("(\\s".concat(name, "\\s*=\\s*)(?:(?:'([^']*)')|(?:\"([^\"]*)\"))"), "im");
|
|
38277
38291
|
namedArgRegExCache.set(name, result);
|
|
38278
38292
|
return result;
|
|
38279
38293
|
}
|
|
@@ -39751,8 +39765,8 @@ var ts;
|
|
|
39751
39765
|
}
|
|
39752
39766
|
ts.createCompilerDiagnosticForInvalidCustomType = createCompilerDiagnosticForInvalidCustomType;
|
|
39753
39767
|
function createDiagnosticForInvalidCustomType(opt, createDiagnostic) {
|
|
39754
|
-
var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'"
|
|
39755
|
-
return createDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--"
|
|
39768
|
+
var namesOfType = ts.arrayFrom(opt.type.keys()).map(function (key) { return "'".concat(key, "'"); }).join(", ");
|
|
39769
|
+
return createDiagnostic(ts.Diagnostics.Argument_for_0_option_must_be_Colon_1, "--".concat(opt.name), namesOfType);
|
|
39756
39770
|
}
|
|
39757
39771
|
/* @internal */
|
|
39758
39772
|
function parseCustomTypeOption(opt, value, errors) {
|
|
@@ -40546,10 +40560,10 @@ var ts;
|
|
|
40546
40560
|
var newValue = compilerOptionsMap.get(cmd.name);
|
|
40547
40561
|
var defaultValue = getDefaultValueForOption(cmd);
|
|
40548
40562
|
if (newValue !== defaultValue) {
|
|
40549
|
-
result.push(""
|
|
40563
|
+
result.push("".concat(tab).concat(cmd.name, ": ").concat(newValue));
|
|
40550
40564
|
}
|
|
40551
40565
|
else if (ts.hasProperty(ts.defaultInitCompilerOptions, cmd.name)) {
|
|
40552
|
-
result.push(""
|
|
40566
|
+
result.push("".concat(tab).concat(cmd.name, ": ").concat(defaultValue));
|
|
40553
40567
|
}
|
|
40554
40568
|
});
|
|
40555
40569
|
return result.join(newLine) + newLine;
|
|
@@ -40600,19 +40614,19 @@ var ts;
|
|
|
40600
40614
|
if (entries.length !== 0) {
|
|
40601
40615
|
entries.push({ value: "" });
|
|
40602
40616
|
}
|
|
40603
|
-
entries.push({ value: "/* "
|
|
40617
|
+
entries.push({ value: "/* ".concat(category, " */") });
|
|
40604
40618
|
for (var _i = 0, options_1 = options; _i < options_1.length; _i++) {
|
|
40605
40619
|
var option = options_1[_i];
|
|
40606
40620
|
var optionName = void 0;
|
|
40607
40621
|
if (compilerOptionsMap.has(option.name)) {
|
|
40608
|
-
optionName = "\""
|
|
40622
|
+
optionName = "\"".concat(option.name, "\": ").concat(JSON.stringify(compilerOptionsMap.get(option.name))).concat((seenKnownKeys += 1) === compilerOptionsMap.size ? "" : ",");
|
|
40609
40623
|
}
|
|
40610
40624
|
else {
|
|
40611
|
-
optionName = "// \""
|
|
40625
|
+
optionName = "// \"".concat(option.name, "\": ").concat(JSON.stringify(getDefaultValueForOption(option)), ",");
|
|
40612
40626
|
}
|
|
40613
40627
|
entries.push({
|
|
40614
40628
|
value: optionName,
|
|
40615
|
-
description: "/* "
|
|
40629
|
+
description: "/* ".concat(option.description && ts.getLocaleSpecificMessage(option.description) || option.name, " */")
|
|
40616
40630
|
});
|
|
40617
40631
|
marginLength = Math.max(optionName.length, marginLength);
|
|
40618
40632
|
}
|
|
@@ -40621,25 +40635,25 @@ var ts;
|
|
|
40621
40635
|
var tab = makePadding(2);
|
|
40622
40636
|
var result = [];
|
|
40623
40637
|
result.push("{");
|
|
40624
|
-
result.push(tab
|
|
40625
|
-
result.push(""
|
|
40638
|
+
result.push("".concat(tab, "\"compilerOptions\": {"));
|
|
40639
|
+
result.push("".concat(tab).concat(tab, "/* ").concat(ts.getLocaleSpecificMessage(ts.Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_json_to_read_more_about_this_file), " */"));
|
|
40626
40640
|
result.push("");
|
|
40627
40641
|
// Print out each row, aligning all the descriptions on the same column.
|
|
40628
40642
|
for (var _a = 0, entries_2 = entries; _a < entries_2.length; _a++) {
|
|
40629
40643
|
var entry = entries_2[_a];
|
|
40630
40644
|
var value = entry.value, _b = entry.description, description = _b === void 0 ? "" : _b;
|
|
40631
|
-
result.push(value && ""
|
|
40645
|
+
result.push(value && "".concat(tab).concat(tab).concat(value).concat(description && (makePadding(marginLength - value.length + 2) + description)));
|
|
40632
40646
|
}
|
|
40633
40647
|
if (fileNames.length) {
|
|
40634
|
-
result.push(tab
|
|
40635
|
-
result.push(tab
|
|
40648
|
+
result.push("".concat(tab, "},"));
|
|
40649
|
+
result.push("".concat(tab, "\"files\": ["));
|
|
40636
40650
|
for (var i = 0; i < fileNames.length; i++) {
|
|
40637
|
-
result.push(""
|
|
40651
|
+
result.push("".concat(tab).concat(tab).concat(JSON.stringify(fileNames[i])).concat(i === fileNames.length - 1 ? "" : ","));
|
|
40638
40652
|
}
|
|
40639
|
-
result.push(tab
|
|
40653
|
+
result.push("".concat(tab, "]"));
|
|
40640
40654
|
}
|
|
40641
40655
|
else {
|
|
40642
|
-
result.push(tab
|
|
40656
|
+
result.push("".concat(tab, "}"));
|
|
40643
40657
|
}
|
|
40644
40658
|
result.push("}");
|
|
40645
40659
|
return result.join(newLine) + newLine;
|
|
@@ -41037,7 +41051,7 @@ var ts;
|
|
|
41037
41051
|
if (ts.isRootedDiskPath(extendedConfig) || ts.startsWith(extendedConfig, "./") || ts.startsWith(extendedConfig, "../")) {
|
|
41038
41052
|
var extendedConfigPath = ts.getNormalizedAbsolutePath(extendedConfig, basePath);
|
|
41039
41053
|
if (!host.fileExists(extendedConfigPath) && !ts.endsWith(extendedConfigPath, ".json" /* Json */)) {
|
|
41040
|
-
extendedConfigPath = extendedConfigPath
|
|
41054
|
+
extendedConfigPath = "".concat(extendedConfigPath, ".json");
|
|
41041
41055
|
if (!host.fileExists(extendedConfigPath)) {
|
|
41042
41056
|
errors.push(createDiagnostic(ts.Diagnostics.File_0_not_found, extendedConfig));
|
|
41043
41057
|
return undefined;
|
|
@@ -41282,7 +41296,7 @@ var ts;
|
|
|
41282
41296
|
// Valid only if *.json specified
|
|
41283
41297
|
if (!jsonOnlyIncludeRegexes) {
|
|
41284
41298
|
var includes = validatedIncludeSpecs.filter(function (s) { return ts.endsWith(s, ".json" /* Json */); });
|
|
41285
|
-
var includeFilePatterns = ts.map(ts.getRegularExpressionsForWildcards(includes, basePath, "files"), function (pattern) { return "^"
|
|
41299
|
+
var includeFilePatterns = ts.map(ts.getRegularExpressionsForWildcards(includes, basePath, "files"), function (pattern) { return "^".concat(pattern, "$"); });
|
|
41286
41300
|
jsonOnlyIncludeRegexes = includeFilePatterns ? includeFilePatterns.map(function (pattern) { return ts.getRegexFromPattern(pattern, host.useCaseSensitiveFileNames); }) : ts.emptyArray;
|
|
41287
41301
|
}
|
|
41288
41302
|
var includeIndex = ts.findIndex(jsonOnlyIncludeRegexes, function (re) { return re.test(file); });
|
|
@@ -41718,7 +41732,7 @@ var ts;
|
|
|
41718
41732
|
var bestVersionKey = result.version, bestVersionPaths = result.paths;
|
|
41719
41733
|
if (typeof bestVersionPaths !== "object") {
|
|
41720
41734
|
if (state.traceEnabled) {
|
|
41721
|
-
trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, "typesVersions['"
|
|
41735
|
+
trace(state.host, ts.Diagnostics.Expected_type_of_0_field_in_package_json_to_be_1_got_2, "typesVersions['".concat(bestVersionKey, "']"), "object", typeof bestVersionPaths);
|
|
41722
41736
|
}
|
|
41723
41737
|
return;
|
|
41724
41738
|
}
|
|
@@ -42125,7 +42139,7 @@ var ts;
|
|
|
42125
42139
|
};
|
|
42126
42140
|
return cache;
|
|
42127
42141
|
function getUnderlyingCacheKey(specifier, mode) {
|
|
42128
|
-
var result = mode === undefined ? specifier : mode
|
|
42142
|
+
var result = mode === undefined ? specifier : "".concat(mode, "|").concat(specifier);
|
|
42129
42143
|
memoizedReverseKeys.set(result, [specifier, mode]);
|
|
42130
42144
|
return result;
|
|
42131
42145
|
}
|
|
@@ -42156,7 +42170,7 @@ var ts;
|
|
|
42156
42170
|
}
|
|
42157
42171
|
function getOrCreateCacheForModuleName(nonRelativeModuleName, mode, redirectedReference) {
|
|
42158
42172
|
ts.Debug.assert(!ts.isExternalModuleNameRelative(nonRelativeModuleName));
|
|
42159
|
-
return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, mode === undefined ? nonRelativeModuleName : mode
|
|
42173
|
+
return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, mode === undefined ? nonRelativeModuleName : "".concat(mode, "|").concat(nonRelativeModuleName), createPerModuleNameCache);
|
|
42160
42174
|
}
|
|
42161
42175
|
function createPerModuleNameCache() {
|
|
42162
42176
|
var directoryPathMap = new ts.Map();
|
|
@@ -42303,10 +42317,10 @@ var ts;
|
|
|
42303
42317
|
result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
|
|
42304
42318
|
break;
|
|
42305
42319
|
default:
|
|
42306
|
-
return ts.Debug.fail("Unexpected moduleResolution: "
|
|
42320
|
+
return ts.Debug.fail("Unexpected moduleResolution: ".concat(moduleResolution));
|
|
42307
42321
|
}
|
|
42308
42322
|
if (result && result.resolvedModule)
|
|
42309
|
-
ts.perfLogger.logInfoEvent("Module \""
|
|
42323
|
+
ts.perfLogger.logInfoEvent("Module \"".concat(moduleName, "\" resolved to \"").concat(result.resolvedModule.resolvedFileName, "\""));
|
|
42310
42324
|
ts.perfLogger.logStopResolveModule((result && result.resolvedModule) ? "" + result.resolvedModule.resolvedFileName : "null");
|
|
42311
42325
|
if (perFolderCache) {
|
|
42312
42326
|
perFolderCache.set(moduleName, resolutionMode, result);
|
|
@@ -42509,7 +42523,7 @@ var ts;
|
|
|
42509
42523
|
function resolveJSModule(moduleName, initialDir, host) {
|
|
42510
42524
|
var _a = tryResolveJSModuleWorker(moduleName, initialDir, host), resolvedModule = _a.resolvedModule, failedLookupLocations = _a.failedLookupLocations;
|
|
42511
42525
|
if (!resolvedModule) {
|
|
42512
|
-
throw new Error("Could not resolve JS module '"
|
|
42526
|
+
throw new Error("Could not resolve JS module '".concat(moduleName, "' starting at '").concat(initialDir, "'. Looked in: ").concat(failedLookupLocations.join(", ")));
|
|
42513
42527
|
}
|
|
42514
42528
|
return resolvedModule.resolvedFileName;
|
|
42515
42529
|
}
|
|
@@ -42619,7 +42633,7 @@ var ts;
|
|
|
42619
42633
|
if (traceEnabled) {
|
|
42620
42634
|
trace(host, ts.Diagnostics.Resolving_real_path_for_0_result_1, path, real);
|
|
42621
42635
|
}
|
|
42622
|
-
ts.Debug.assert(host.fileExists(real), path
|
|
42636
|
+
ts.Debug.assert(host.fileExists(real), "".concat(path, " linked to nonexistent file ").concat(real));
|
|
42623
42637
|
return real;
|
|
42624
42638
|
}
|
|
42625
42639
|
function nodeLoadModuleByRelativeName(extensions, candidate, onlyRecordFailures, state, considerPackageJson) {
|
|
@@ -43096,7 +43110,7 @@ var ts;
|
|
|
43096
43110
|
return undefined;
|
|
43097
43111
|
}
|
|
43098
43112
|
var trailingParts = parts.slice(nameParts.length);
|
|
43099
|
-
return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : "."
|
|
43113
|
+
return loadModuleFromExports(scope, extensions, !ts.length(trailingParts) ? "." : ".".concat(ts.directorySeparator).concat(trailingParts.join(ts.directorySeparator)), state, cache, redirectedReference);
|
|
43100
43114
|
}
|
|
43101
43115
|
function loadModuleFromExports(scope, extensions, subpath, state, cache, redirectedReference) {
|
|
43102
43116
|
if (!scope.packageJsonContent.exports) {
|
|
@@ -43424,7 +43438,7 @@ var ts;
|
|
|
43424
43438
|
}
|
|
43425
43439
|
/* @internal */
|
|
43426
43440
|
function getTypesPackageName(packageName) {
|
|
43427
|
-
return "@types/"
|
|
43441
|
+
return "@types/".concat(mangleScopedPackageName(packageName));
|
|
43428
43442
|
}
|
|
43429
43443
|
ts.getTypesPackageName = getTypesPackageName;
|
|
43430
43444
|
/* @internal */
|
|
@@ -43825,7 +43839,7 @@ var ts;
|
|
|
43825
43839
|
if (name) {
|
|
43826
43840
|
if (ts.isAmbientModule(node)) {
|
|
43827
43841
|
var moduleName = ts.getTextOfIdentifierOrLiteral(name);
|
|
43828
|
-
return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\""
|
|
43842
|
+
return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"".concat(moduleName, "\""));
|
|
43829
43843
|
}
|
|
43830
43844
|
if (name.kind === 161 /* ComputedPropertyName */) {
|
|
43831
43845
|
var nameExpression = name.expression;
|
|
@@ -43882,7 +43896,7 @@ var ts;
|
|
|
43882
43896
|
case 163 /* Parameter */:
|
|
43883
43897
|
// Parameters with names are handled at the top of this function. Parameters
|
|
43884
43898
|
// without names can only come from JSDocFunctionTypes.
|
|
43885
|
-
ts.Debug.assert(node.parent.kind === 315 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: "
|
|
43899
|
+
ts.Debug.assert(node.parent.kind === 315 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: ".concat(ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind, ", expected JSDocFunctionType"); });
|
|
43886
43900
|
var functionType = node.parent;
|
|
43887
43901
|
var index = functionType.parameters.indexOf(node);
|
|
43888
43902
|
return "arg" + index;
|
|
@@ -43994,7 +44008,7 @@ var ts;
|
|
|
43994
44008
|
var relatedInformation_1 = [];
|
|
43995
44009
|
if (ts.isTypeAliasDeclaration(node) && ts.nodeIsMissing(node.type) && ts.hasSyntacticModifier(node, 1 /* Export */) && symbol.flags & (2097152 /* Alias */ | 788968 /* Type */ | 1920 /* Namespace */)) {
|
|
43996
44010
|
// export type T; - may have meant export type { T }?
|
|
43997
|
-
relatedInformation_1.push(createDiagnosticForNode(node, ts.Diagnostics.Did_you_mean_0, "export type { "
|
|
44011
|
+
relatedInformation_1.push(createDiagnosticForNode(node, ts.Diagnostics.Did_you_mean_0, "export type { ".concat(ts.unescapeLeadingUnderscores(node.name.escapedText), " }")));
|
|
43998
44012
|
}
|
|
43999
44013
|
var declarationName_1 = ts.getNameOfDeclaration(node) || node;
|
|
44000
44014
|
ts.forEach(symbol.declarations, function (declaration, index) {
|
|
@@ -46070,7 +46084,7 @@ var ts;
|
|
|
46070
46084
|
}
|
|
46071
46085
|
}
|
|
46072
46086
|
function bindSourceFileAsExternalModule() {
|
|
46073
|
-
bindAnonymousDeclaration(file, 512 /* ValueModule */, "\""
|
|
46087
|
+
bindAnonymousDeclaration(file, 512 /* ValueModule */, "\"".concat(ts.removeFileExtension(file.fileName), "\""));
|
|
46074
46088
|
}
|
|
46075
46089
|
function bindExportAssignment(node) {
|
|
46076
46090
|
if (!container.symbol || !container.symbol.exports) {
|
|
@@ -47103,6 +47117,9 @@ var ts;
|
|
|
47103
47117
|
CheckMode[CheckMode["SkipContextSensitive"] = 4] = "SkipContextSensitive";
|
|
47104
47118
|
CheckMode[CheckMode["SkipGenericFunctions"] = 8] = "SkipGenericFunctions";
|
|
47105
47119
|
CheckMode[CheckMode["IsForSignatureHelp"] = 16] = "IsForSignatureHelp";
|
|
47120
|
+
CheckMode[CheckMode["RestBindingElement"] = 32] = "RestBindingElement";
|
|
47121
|
+
// e.g. in `const { a, ...rest } = foo`, when checking the type of `foo` to determine the type of `rest`,
|
|
47122
|
+
// we need to preserve generic types instead of substituting them for constraints
|
|
47106
47123
|
})(CheckMode || (CheckMode = {}));
|
|
47107
47124
|
var SignatureCheckMode;
|
|
47108
47125
|
(function (SignatureCheckMode) {
|
|
@@ -48155,30 +48172,34 @@ var ts;
|
|
|
48155
48172
|
else { // error
|
|
48156
48173
|
var isEitherEnum = !!(target.flags & 384 /* Enum */ || source.flags & 384 /* Enum */);
|
|
48157
48174
|
var isEitherBlockScoped_1 = !!(target.flags & 2 /* BlockScopedVariable */ || source.flags & 2 /* BlockScopedVariable */);
|
|
48158
|
-
var message = isEitherEnum
|
|
48159
|
-
? ts.Diagnostics.
|
|
48160
|
-
: isEitherBlockScoped_1
|
|
48161
|
-
? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0
|
|
48175
|
+
var message = isEitherEnum ? ts.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations
|
|
48176
|
+
: isEitherBlockScoped_1 ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0
|
|
48162
48177
|
: ts.Diagnostics.Duplicate_identifier_0;
|
|
48163
48178
|
var sourceSymbolFile = source.declarations && ts.getSourceFileOfNode(source.declarations[0]);
|
|
48164
48179
|
var targetSymbolFile = target.declarations && ts.getSourceFileOfNode(target.declarations[0]);
|
|
48180
|
+
var isSourcePlainJs = ts.isPlainJsFile(sourceSymbolFile, compilerOptions.checkJs);
|
|
48181
|
+
var isTargetPlainJs = ts.isPlainJsFile(targetSymbolFile, compilerOptions.checkJs);
|
|
48165
48182
|
var symbolName_1 = symbolToString(source);
|
|
48166
48183
|
// Collect top-level duplicate identifier errors into one mapping, so we can then merge their diagnostics if there are a bunch
|
|
48167
48184
|
if (sourceSymbolFile && targetSymbolFile && amalgamatedDuplicates && !isEitherEnum && sourceSymbolFile !== targetSymbolFile) {
|
|
48168
48185
|
var firstFile_1 = ts.comparePaths(sourceSymbolFile.path, targetSymbolFile.path) === -1 /* LessThan */ ? sourceSymbolFile : targetSymbolFile;
|
|
48169
48186
|
var secondFile_1 = firstFile_1 === sourceSymbolFile ? targetSymbolFile : sourceSymbolFile;
|
|
48170
|
-
var filesDuplicates = ts.getOrUpdate(amalgamatedDuplicates, firstFile_1.path
|
|
48187
|
+
var filesDuplicates = ts.getOrUpdate(amalgamatedDuplicates, "".concat(firstFile_1.path, "|").concat(secondFile_1.path), function () {
|
|
48171
48188
|
return ({ firstFile: firstFile_1, secondFile: secondFile_1, conflictingSymbols: new ts.Map() });
|
|
48172
48189
|
});
|
|
48173
48190
|
var conflictingSymbolInfo = ts.getOrUpdate(filesDuplicates.conflictingSymbols, symbolName_1, function () {
|
|
48174
48191
|
return ({ isBlockScoped: isEitherBlockScoped_1, firstFileLocations: [], secondFileLocations: [] });
|
|
48175
48192
|
});
|
|
48176
|
-
|
|
48177
|
-
|
|
48193
|
+
if (!isSourcePlainJs)
|
|
48194
|
+
addDuplicateLocations(conflictingSymbolInfo.firstFileLocations, source);
|
|
48195
|
+
if (!isTargetPlainJs)
|
|
48196
|
+
addDuplicateLocations(conflictingSymbolInfo.secondFileLocations, target);
|
|
48178
48197
|
}
|
|
48179
48198
|
else {
|
|
48180
|
-
|
|
48181
|
-
|
|
48199
|
+
if (!isSourcePlainJs)
|
|
48200
|
+
addDuplicateDeclarationErrorsForSymbols(source, message, symbolName_1, target);
|
|
48201
|
+
if (!isTargetPlainJs)
|
|
48202
|
+
addDuplicateDeclarationErrorsForSymbols(target, message, symbolName_1, source);
|
|
48182
48203
|
}
|
|
48183
48204
|
}
|
|
48184
48205
|
return target;
|
|
@@ -48635,6 +48656,8 @@ var ts;
|
|
|
48635
48656
|
// type parameters are visible in parameter list, return type and type parameter list
|
|
48636
48657
|
? lastLocation === location.type ||
|
|
48637
48658
|
lastLocation.kind === 163 /* Parameter */ ||
|
|
48659
|
+
lastLocation.kind === 338 /* JSDocParameterTag */ ||
|
|
48660
|
+
lastLocation.kind === 339 /* JSDocReturnTag */ ||
|
|
48638
48661
|
lastLocation.kind === 162 /* TypeParameter */
|
|
48639
48662
|
// local types not visible outside the function body
|
|
48640
48663
|
: false;
|
|
@@ -48894,9 +48917,9 @@ var ts;
|
|
|
48894
48917
|
lastSelfReferenceLocation = location;
|
|
48895
48918
|
}
|
|
48896
48919
|
lastLocation = location;
|
|
48897
|
-
location = ts.isJSDocTemplateTag(location) ?
|
|
48898
|
-
ts.
|
|
48899
|
-
|
|
48920
|
+
location = ts.isJSDocTemplateTag(location) ? ts.getEffectiveContainerForJSDocTemplateTag(location) || location.parent :
|
|
48921
|
+
ts.isJSDocParameterTag(location) || ts.isJSDocReturnTag(location) ? ts.getHostSignatureFromJSDoc(location) || location.parent :
|
|
48922
|
+
location.parent;
|
|
48900
48923
|
}
|
|
48901
48924
|
// We just climbed up parents looking for the name, meaning that we started in a descendant node of `lastLocation`.
|
|
48902
48925
|
// If `result === lastSelfReferenceLocation.symbol`, that means that we are somewhere inside `lastSelfReferenceLocation` looking up a name, and resolving to `lastLocation` itself.
|
|
@@ -50030,16 +50053,20 @@ var ts;
|
|
|
50030
50053
|
return;
|
|
50031
50054
|
}
|
|
50032
50055
|
var host = ts.getJSDocHost(node);
|
|
50033
|
-
if (host &&
|
|
50034
|
-
|
|
50035
|
-
ts.isBinaryExpression(host.expression) &&
|
|
50036
|
-
ts.getAssignmentDeclarationKind(host.expression) === 3 /* PrototypeProperty */) {
|
|
50037
|
-
// X.prototype.m = /** @param {K} p */ function () { } <-- look for K on X's declaration
|
|
50056
|
+
if (host && ts.isExpressionStatement(host) && ts.isPrototypePropertyAssignment(host.expression)) {
|
|
50057
|
+
// /** @param {K} p */ X.prototype.m = function () { } <-- look for K on X's declaration
|
|
50038
50058
|
var symbol = getSymbolOfNode(host.expression.left);
|
|
50039
50059
|
if (symbol) {
|
|
50040
50060
|
return getDeclarationOfJSPrototypeContainer(symbol);
|
|
50041
50061
|
}
|
|
50042
50062
|
}
|
|
50063
|
+
if (host && ts.isFunctionExpression(host) && ts.isPrototypePropertyAssignment(host.parent) && ts.isExpressionStatement(host.parent.parent)) {
|
|
50064
|
+
// X.prototype.m = /** @param {K} p */ function () { } <-- look for K on X's declaration
|
|
50065
|
+
var symbol = getSymbolOfNode(host.parent.left);
|
|
50066
|
+
if (symbol) {
|
|
50067
|
+
return getDeclarationOfJSPrototypeContainer(symbol);
|
|
50068
|
+
}
|
|
50069
|
+
}
|
|
50043
50070
|
if (host && (ts.isObjectLiteralMethod(host) || ts.isPropertyAssignment(host)) &&
|
|
50044
50071
|
ts.isBinaryExpression(host.parent.parent) &&
|
|
50045
50072
|
ts.getAssignmentDeclarationKind(host.parent.parent) === 6 /* Prototype */) {
|
|
@@ -50810,7 +50837,7 @@ var ts;
|
|
|
50810
50837
|
var cache = (links.accessibleChainCache || (links.accessibleChainCache = new ts.Map()));
|
|
50811
50838
|
// Go from enclosingDeclaration to the first scope we check, so the cache is keyed off the scope and thus shared more
|
|
50812
50839
|
var firstRelevantLocation = forEachSymbolTableInScope(enclosingDeclaration, function (_, __, ___, node) { return node; });
|
|
50813
|
-
var key = (useOnlyExternalAliasing ? 0 : 1
|
|
50840
|
+
var key = "".concat(useOnlyExternalAliasing ? 0 : 1, "|").concat(firstRelevantLocation && getNodeId(firstRelevantLocation), "|").concat(meaning);
|
|
50814
50841
|
if (cache.has(key)) {
|
|
50815
50842
|
return cache.get(key);
|
|
50816
50843
|
}
|
|
@@ -51659,7 +51686,7 @@ var ts;
|
|
|
51659
51686
|
context.symbolDepth = new ts.Map();
|
|
51660
51687
|
}
|
|
51661
51688
|
var links = context.enclosingDeclaration && getNodeLinks(context.enclosingDeclaration);
|
|
51662
|
-
var key = getTypeId(type)
|
|
51689
|
+
var key = "".concat(getTypeId(type), "|").concat(context.flags);
|
|
51663
51690
|
if (links) {
|
|
51664
51691
|
links.serializedTypes || (links.serializedTypes = new ts.Map());
|
|
51665
51692
|
}
|
|
@@ -51928,7 +51955,7 @@ var ts;
|
|
|
51928
51955
|
}
|
|
51929
51956
|
}
|
|
51930
51957
|
if (checkTruncationLength(context) && (i + 2 < properties.length - 1)) {
|
|
51931
|
-
typeElements.push(ts.factory.createPropertySignature(/*modifiers*/ undefined, "... "
|
|
51958
|
+
typeElements.push(ts.factory.createPropertySignature(/*modifiers*/ undefined, "... ".concat(properties.length - i, " more ..."), /*questionToken*/ undefined, /*type*/ undefined));
|
|
51932
51959
|
addPropertyToElementList(properties[properties.length - 1], context, typeElements);
|
|
51933
51960
|
break;
|
|
51934
51961
|
}
|
|
@@ -52043,7 +52070,7 @@ var ts;
|
|
|
52043
52070
|
else if (types.length > 2) {
|
|
52044
52071
|
return [
|
|
52045
52072
|
typeToTypeNodeHelper(types[0], context),
|
|
52046
|
-
ts.factory.createTypeReferenceNode("... "
|
|
52073
|
+
ts.factory.createTypeReferenceNode("... ".concat(types.length - 2, " more ..."), /*typeArguments*/ undefined),
|
|
52047
52074
|
typeToTypeNodeHelper(types[types.length - 1], context)
|
|
52048
52075
|
];
|
|
52049
52076
|
}
|
|
@@ -52057,7 +52084,7 @@ var ts;
|
|
|
52057
52084
|
var type = types_2[_i];
|
|
52058
52085
|
i++;
|
|
52059
52086
|
if (checkTruncationLength(context) && (i + 2 < types.length - 1)) {
|
|
52060
|
-
result_5.push(ts.factory.createTypeReferenceNode("... "
|
|
52087
|
+
result_5.push(ts.factory.createTypeReferenceNode("... ".concat(types.length - i, " more ..."), /*typeArguments*/ undefined));
|
|
52061
52088
|
var typeNode_1 = typeToTypeNodeHelper(types[types.length - 1], context);
|
|
52062
52089
|
if (typeNode_1) {
|
|
52063
52090
|
result_5.push(typeNode_1);
|
|
@@ -52580,7 +52607,7 @@ var ts;
|
|
|
52580
52607
|
var text = rawtext;
|
|
52581
52608
|
while (((_b = context.typeParameterNamesByText) === null || _b === void 0 ? void 0 : _b.has(text)) || typeParameterShadowsNameInScope(text, context, type)) {
|
|
52582
52609
|
i++;
|
|
52583
|
-
text = rawtext
|
|
52610
|
+
text = "".concat(rawtext, "_").concat(i);
|
|
52584
52611
|
}
|
|
52585
52612
|
if (text !== rawtext) {
|
|
52586
52613
|
result = ts.factory.createIdentifier(text, result.typeArguments);
|
|
@@ -52900,7 +52927,7 @@ var ts;
|
|
|
52900
52927
|
function getNameForJSDocFunctionParameter(p, index) {
|
|
52901
52928
|
return p.name && ts.isIdentifier(p.name) && p.name.escapedText === "this" ? "this"
|
|
52902
52929
|
: getEffectiveDotDotDotForParameter(p) ? "args"
|
|
52903
|
-
: "arg"
|
|
52930
|
+
: "arg".concat(index);
|
|
52904
52931
|
}
|
|
52905
52932
|
function rewriteModuleSpecifier(parent, lit) {
|
|
52906
52933
|
if (bundled) {
|
|
@@ -53985,7 +54012,7 @@ var ts;
|
|
|
53985
54012
|
return results_1;
|
|
53986
54013
|
}
|
|
53987
54014
|
// The `Constructor`'s symbol isn't in the class's properties lists, obviously, since it's a signature on the static
|
|
53988
|
-
return ts.Debug.fail("Unhandled class member kind! "
|
|
54015
|
+
return ts.Debug.fail("Unhandled class member kind! ".concat(p.__debugFlags || p.flags));
|
|
53989
54016
|
};
|
|
53990
54017
|
}
|
|
53991
54018
|
function serializePropertySymbolForInterface(p, baseType) {
|
|
@@ -54060,7 +54087,7 @@ var ts;
|
|
|
54060
54087
|
if (ref) {
|
|
54061
54088
|
return ref;
|
|
54062
54089
|
}
|
|
54063
|
-
var tempName = getUnusedName(rootName
|
|
54090
|
+
var tempName = getUnusedName("".concat(rootName, "_base"));
|
|
54064
54091
|
var statement = ts.factory.createVariableStatement(/*modifiers*/ undefined, ts.factory.createVariableDeclarationList([
|
|
54065
54092
|
ts.factory.createVariableDeclaration(tempName, /*exclamationToken*/ undefined, typeToTypeNodeHelper(staticType, context))
|
|
54066
54093
|
], 2 /* Const */));
|
|
@@ -54107,7 +54134,7 @@ var ts;
|
|
|
54107
54134
|
var original = input;
|
|
54108
54135
|
while ((_a = context.usedSymbolNames) === null || _a === void 0 ? void 0 : _a.has(input)) {
|
|
54109
54136
|
i++;
|
|
54110
|
-
input = original
|
|
54137
|
+
input = "".concat(original, "_").concat(i);
|
|
54111
54138
|
}
|
|
54112
54139
|
(_b = context.usedSymbolNames) === null || _b === void 0 ? void 0 : _b.add(input);
|
|
54113
54140
|
if (id) {
|
|
@@ -54215,15 +54242,15 @@ var ts;
|
|
|
54215
54242
|
if (nameType.flags & 384 /* StringOrNumberLiteral */) {
|
|
54216
54243
|
var name = "" + nameType.value;
|
|
54217
54244
|
if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !ts.isNumericLiteralName(name)) {
|
|
54218
|
-
return "\""
|
|
54245
|
+
return "\"".concat(ts.escapeString(name, 34 /* doubleQuote */), "\"");
|
|
54219
54246
|
}
|
|
54220
54247
|
if (ts.isNumericLiteralName(name) && ts.startsWith(name, "-")) {
|
|
54221
|
-
return "["
|
|
54248
|
+
return "[".concat(name, "]");
|
|
54222
54249
|
}
|
|
54223
54250
|
return name;
|
|
54224
54251
|
}
|
|
54225
54252
|
if (nameType.flags & 8192 /* UniqueESSymbol */) {
|
|
54226
|
-
return "["
|
|
54253
|
+
return "[".concat(getNameOfSymbolAsWritten(nameType.symbol, context), "]");
|
|
54227
54254
|
}
|
|
54228
54255
|
}
|
|
54229
54256
|
}
|
|
@@ -54526,9 +54553,12 @@ var ts;
|
|
|
54526
54553
|
}
|
|
54527
54554
|
// Return the type of a binding element parent. We check SymbolLinks first to see if a type has been
|
|
54528
54555
|
// assigned by contextual typing.
|
|
54529
|
-
function getTypeForBindingElementParent(node) {
|
|
54556
|
+
function getTypeForBindingElementParent(node, checkMode) {
|
|
54557
|
+
if (checkMode !== 0 /* Normal */) {
|
|
54558
|
+
return getTypeForVariableLikeDeclaration(node, /*includeOptionality*/ false, checkMode);
|
|
54559
|
+
}
|
|
54530
54560
|
var symbol = getSymbolOfNode(node);
|
|
54531
|
-
return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, /*includeOptionality*/ false);
|
|
54561
|
+
return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, /*includeOptionality*/ false, checkMode);
|
|
54532
54562
|
}
|
|
54533
54563
|
function getRestType(source, properties, symbol) {
|
|
54534
54564
|
source = filterType(source, function (t) { return !(t.flags & 98304 /* Nullable */); });
|
|
@@ -54646,7 +54676,8 @@ var ts;
|
|
|
54646
54676
|
}
|
|
54647
54677
|
/** Return the inferred type for a binding element */
|
|
54648
54678
|
function getTypeForBindingElement(declaration) {
|
|
54649
|
-
var
|
|
54679
|
+
var checkMode = declaration.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */;
|
|
54680
|
+
var parentType = getTypeForBindingElementParent(declaration.parent.parent, checkMode);
|
|
54650
54681
|
return parentType && getBindingElementTypeFromParentType(declaration, parentType);
|
|
54651
54682
|
}
|
|
54652
54683
|
function getBindingElementTypeFromParentType(declaration, parentType) {
|
|
@@ -54718,9 +54749,9 @@ var ts;
|
|
|
54718
54749
|
if (ts.getEffectiveTypeAnnotationNode(ts.walkUpBindingElementsAndPatterns(declaration))) {
|
|
54719
54750
|
// In strict null checking mode, if a default value of a non-undefined type is specified, remove
|
|
54720
54751
|
// undefined from the final type.
|
|
54721
|
-
return strictNullChecks && !(getFalsyFlags(checkDeclarationInitializer(declaration)) & 32768 /* Undefined */) ? getNonUndefinedType(type) : type;
|
|
54752
|
+
return strictNullChecks && !(getFalsyFlags(checkDeclarationInitializer(declaration, 0 /* Normal */)) & 32768 /* Undefined */) ? getNonUndefinedType(type) : type;
|
|
54722
54753
|
}
|
|
54723
|
-
return widenTypeInferredFromInitializer(declaration, getUnionType([getNonUndefinedType(type), checkDeclarationInitializer(declaration)], 2 /* Subtype */));
|
|
54754
|
+
return widenTypeInferredFromInitializer(declaration, getUnionType([getNonUndefinedType(type), checkDeclarationInitializer(declaration, 0 /* Normal */)], 2 /* Subtype */));
|
|
54724
54755
|
}
|
|
54725
54756
|
function getTypeForDeclarationFromJSDocComment(declaration) {
|
|
54726
54757
|
var jsdocType = ts.getJSDocType(declaration);
|
|
@@ -54743,11 +54774,11 @@ var ts;
|
|
|
54743
54774
|
return strictNullChecks && isOptional ? getOptionalType(type, isProperty) : type;
|
|
54744
54775
|
}
|
|
54745
54776
|
// Return the inferred type for a variable, parameter, or property declaration
|
|
54746
|
-
function getTypeForVariableLikeDeclaration(declaration, includeOptionality) {
|
|
54777
|
+
function getTypeForVariableLikeDeclaration(declaration, includeOptionality, checkMode) {
|
|
54747
54778
|
// A variable declared in a for..in statement is of type string, or of type keyof T when the
|
|
54748
54779
|
// right hand expression is of a type parameter type.
|
|
54749
54780
|
if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 242 /* ForInStatement */) {
|
|
54750
|
-
var indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression)));
|
|
54781
|
+
var indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression, /*checkMode*/ checkMode)));
|
|
54751
54782
|
return indexType.flags & (262144 /* TypeParameter */ | 4194304 /* Index */) ? getExtractStringType(indexType) : stringType;
|
|
54752
54783
|
}
|
|
54753
54784
|
if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 243 /* ForOfStatement */) {
|
|
@@ -54802,12 +54833,9 @@ var ts;
|
|
|
54802
54833
|
}
|
|
54803
54834
|
}
|
|
54804
54835
|
if (ts.isInJSFile(declaration)) {
|
|
54805
|
-
var
|
|
54806
|
-
if (
|
|
54807
|
-
|
|
54808
|
-
var pos = func.parameters.indexOf(declaration);
|
|
54809
|
-
return declaration.dotDotDotToken ? getRestTypeAtPosition(signature, pos) : getTypeAtPosition(signature, pos);
|
|
54810
|
-
}
|
|
54836
|
+
var type_1 = getParameterTypeOfTypeTag(func, declaration);
|
|
54837
|
+
if (type_1)
|
|
54838
|
+
return type_1;
|
|
54811
54839
|
}
|
|
54812
54840
|
// Use contextual parameter type if one is available
|
|
54813
54841
|
var type = declaration.symbol.escapedName === "this" /* This */ ? getContextualThisParameterType(func) : getContextuallyTypedParameterType(declaration);
|
|
@@ -54824,7 +54852,7 @@ var ts;
|
|
|
54824
54852
|
return containerObjectType;
|
|
54825
54853
|
}
|
|
54826
54854
|
}
|
|
54827
|
-
var type = widenTypeInferredFromInitializer(declaration, checkDeclarationInitializer(declaration));
|
|
54855
|
+
var type = widenTypeInferredFromInitializer(declaration, checkDeclarationInitializer(declaration, checkMode));
|
|
54828
54856
|
return addOptionality(type, isProperty, isOptional);
|
|
54829
54857
|
}
|
|
54830
54858
|
if (ts.isPropertyDeclaration(declaration) && (noImplicitAny || ts.isInJSFile(declaration))) {
|
|
@@ -55196,7 +55224,7 @@ var ts;
|
|
|
55196
55224
|
// contextual type or, if the element itself is a binding pattern, with the type implied by that binding
|
|
55197
55225
|
// pattern.
|
|
55198
55226
|
var contextualType = ts.isBindingPattern(element.name) ? getTypeFromBindingPattern(element.name, /*includePatternInType*/ true, /*reportErrors*/ false) : unknownType;
|
|
55199
|
-
return addOptionality(widenTypeInferredFromInitializer(element, checkDeclarationInitializer(element, contextualType)));
|
|
55227
|
+
return addOptionality(widenTypeInferredFromInitializer(element, checkDeclarationInitializer(element, 0 /* Normal */, contextualType)));
|
|
55200
55228
|
}
|
|
55201
55229
|
if (ts.isBindingPattern(element.name)) {
|
|
55202
55230
|
return getTypeFromBindingPattern(element.name, includePatternInType, reportErrors);
|
|
@@ -55285,7 +55313,7 @@ var ts;
|
|
|
55285
55313
|
// binding pattern [x, s = ""]. Because the contextual type is a tuple type, the resulting type of [1, "one"] is the
|
|
55286
55314
|
// tuple type [number, string]. Thus, the type inferred for 'x' is number and the type inferred for 's' is string.
|
|
55287
55315
|
function getWidenedTypeForVariableLikeDeclaration(declaration, reportErrors) {
|
|
55288
|
-
return widenTypeForVariableLikeDeclaration(getTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ true), declaration, reportErrors);
|
|
55316
|
+
return widenTypeForVariableLikeDeclaration(getTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ true, 0 /* Normal */), declaration, reportErrors);
|
|
55289
55317
|
}
|
|
55290
55318
|
function isGlobalSymbolConstructor(node) {
|
|
55291
55319
|
var symbol = getSymbolOfNode(node);
|
|
@@ -55374,9 +55402,9 @@ var ts;
|
|
|
55374
55402
|
if (typeNode === undefined) {
|
|
55375
55403
|
return useUnknownInCatchVariables ? unknownType : anyType;
|
|
55376
55404
|
}
|
|
55377
|
-
var
|
|
55405
|
+
var type_2 = getTypeOfNode(typeNode);
|
|
55378
55406
|
// an errorType will make `checkTryStatement` issue an error
|
|
55379
|
-
return isTypeAny(
|
|
55407
|
+
return isTypeAny(type_2) || type_2 === unknownType ? type_2 : errorType;
|
|
55380
55408
|
}
|
|
55381
55409
|
// Handle export default expressions
|
|
55382
55410
|
if (ts.isSourceFile(declaration) && ts.isJsonSourceFile(declaration)) {
|
|
@@ -55514,10 +55542,12 @@ var ts;
|
|
|
55514
55542
|
if (writing === void 0) { writing = false; }
|
|
55515
55543
|
var getter = ts.getDeclarationOfKind(symbol, 171 /* GetAccessor */);
|
|
55516
55544
|
var setter = ts.getDeclarationOfKind(symbol, 172 /* SetAccessor */);
|
|
55517
|
-
var setterType = getAnnotatedAccessorType(setter);
|
|
55518
55545
|
// For write operations, prioritize type annotations on the setter
|
|
55519
|
-
if (writing
|
|
55520
|
-
|
|
55546
|
+
if (writing) {
|
|
55547
|
+
var setterType_1 = getAnnotatedAccessorType(setter);
|
|
55548
|
+
if (setterType_1) {
|
|
55549
|
+
return instantiateTypeIfNeeded(setterType_1, symbol);
|
|
55550
|
+
}
|
|
55521
55551
|
}
|
|
55522
55552
|
// Else defer to the getter type
|
|
55523
55553
|
if (getter && ts.isInJSFile(getter)) {
|
|
@@ -55532,6 +55562,7 @@ var ts;
|
|
|
55532
55562
|
return instantiateTypeIfNeeded(getterType, symbol);
|
|
55533
55563
|
}
|
|
55534
55564
|
// If the user didn't specify a return type, try to use the set-accessor's parameter type.
|
|
55565
|
+
var setterType = getAnnotatedAccessorType(setter);
|
|
55535
55566
|
if (setterType) {
|
|
55536
55567
|
return setterType;
|
|
55537
55568
|
}
|
|
@@ -55602,11 +55633,11 @@ var ts;
|
|
|
55602
55633
|
return errorType;
|
|
55603
55634
|
}
|
|
55604
55635
|
var exportEquals = getMergedSymbol(symbol.exports.get("export=" /* ExportEquals */));
|
|
55605
|
-
var
|
|
55636
|
+
var type_3 = getWidenedTypeForAssignmentDeclaration(exportEquals, exportEquals === resolvedModule ? undefined : resolvedModule);
|
|
55606
55637
|
if (!popTypeResolution()) {
|
|
55607
55638
|
return reportCircularityError(symbol);
|
|
55608
55639
|
}
|
|
55609
|
-
return
|
|
55640
|
+
return type_3;
|
|
55610
55641
|
}
|
|
55611
55642
|
}
|
|
55612
55643
|
var type = createObjectType(16 /* Anonymous */, symbol);
|
|
@@ -55680,6 +55711,39 @@ var ts;
|
|
|
55680
55711
|
}
|
|
55681
55712
|
return links.type;
|
|
55682
55713
|
}
|
|
55714
|
+
function getWriteTypeOfSymbolWithDeferredType(symbol) {
|
|
55715
|
+
var links = getSymbolLinks(symbol);
|
|
55716
|
+
if (!links.writeType && links.deferralWriteConstituents) {
|
|
55717
|
+
ts.Debug.assertIsDefined(links.deferralParent);
|
|
55718
|
+
ts.Debug.assertIsDefined(links.deferralConstituents);
|
|
55719
|
+
links.writeType = links.deferralParent.flags & 1048576 /* Union */ ? getUnionType(links.deferralWriteConstituents) : getIntersectionType(links.deferralWriteConstituents);
|
|
55720
|
+
}
|
|
55721
|
+
return links.writeType;
|
|
55722
|
+
}
|
|
55723
|
+
/**
|
|
55724
|
+
* Distinct write types come only from set accessors, but union and intersection
|
|
55725
|
+
* properties deriving from set accessors will either pre-compute or defer the
|
|
55726
|
+
* union or intersection of the writeTypes of their constituents. To account for
|
|
55727
|
+
* this, we will assume that any deferred type or transient symbol may have a
|
|
55728
|
+
* `writeType` (or a deferred write type ready to be computed) that should be
|
|
55729
|
+
* used before looking for set accessor declarations.
|
|
55730
|
+
*/
|
|
55731
|
+
function getWriteTypeOfSymbol(symbol) {
|
|
55732
|
+
var checkFlags = ts.getCheckFlags(symbol);
|
|
55733
|
+
if (checkFlags & 65536 /* DeferredType */) {
|
|
55734
|
+
var writeType = getWriteTypeOfSymbolWithDeferredType(symbol);
|
|
55735
|
+
if (writeType) {
|
|
55736
|
+
return writeType;
|
|
55737
|
+
}
|
|
55738
|
+
}
|
|
55739
|
+
if (symbol.flags & 33554432 /* Transient */) {
|
|
55740
|
+
var writeType = symbol.writeType;
|
|
55741
|
+
if (writeType) {
|
|
55742
|
+
return writeType;
|
|
55743
|
+
}
|
|
55744
|
+
}
|
|
55745
|
+
return getSetAccessorTypeOfSymbol(symbol);
|
|
55746
|
+
}
|
|
55683
55747
|
function getSetAccessorTypeOfSymbol(symbol) {
|
|
55684
55748
|
if (symbol.flags & 98304 /* Accessor */) {
|
|
55685
55749
|
var type = getTypeOfSetAccessor(symbol);
|
|
@@ -57017,7 +57081,7 @@ var ts;
|
|
|
57017
57081
|
!leftName ? rightName :
|
|
57018
57082
|
!rightName ? leftName :
|
|
57019
57083
|
undefined;
|
|
57020
|
-
var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg"
|
|
57084
|
+
var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg".concat(i));
|
|
57021
57085
|
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
|
|
57022
57086
|
params[i] = paramSymbol;
|
|
57023
57087
|
}
|
|
@@ -57805,10 +57869,10 @@ var ts;
|
|
|
57805
57869
|
var baseTypes = [];
|
|
57806
57870
|
var different = false;
|
|
57807
57871
|
for (var _i = 0, types_7 = types; _i < types_7.length; _i++) {
|
|
57808
|
-
var
|
|
57809
|
-
var baseType = getBaseConstraint(
|
|
57872
|
+
var type_4 = types_7[_i];
|
|
57873
|
+
var baseType = getBaseConstraint(type_4);
|
|
57810
57874
|
if (baseType) {
|
|
57811
|
-
if (baseType !==
|
|
57875
|
+
if (baseType !== type_4) {
|
|
57812
57876
|
different = true;
|
|
57813
57877
|
}
|
|
57814
57878
|
baseTypes.push(baseType);
|
|
@@ -58050,6 +58114,7 @@ var ts;
|
|
|
58050
58114
|
var firstType;
|
|
58051
58115
|
var nameType;
|
|
58052
58116
|
var propTypes = [];
|
|
58117
|
+
var writeTypes;
|
|
58053
58118
|
var firstValueDeclaration;
|
|
58054
58119
|
var hasNonUniformValueDeclaration = false;
|
|
58055
58120
|
for (var _d = 0, props_1 = props; _d < props_1.length; _d++) {
|
|
@@ -58066,6 +58131,10 @@ var ts;
|
|
|
58066
58131
|
firstType = type;
|
|
58067
58132
|
nameType = getSymbolLinks(prop).nameType;
|
|
58068
58133
|
}
|
|
58134
|
+
var writeType = getWriteTypeOfSymbol(prop);
|
|
58135
|
+
if (writeTypes || writeType !== type) {
|
|
58136
|
+
writeTypes = ts.append(!writeTypes ? propTypes.slice() : writeTypes, writeType);
|
|
58137
|
+
}
|
|
58069
58138
|
else if (type !== firstType) {
|
|
58070
58139
|
checkFlags |= 64 /* HasNonUniformType */;
|
|
58071
58140
|
}
|
|
@@ -58094,9 +58163,13 @@ var ts;
|
|
|
58094
58163
|
result.checkFlags |= 65536 /* DeferredType */;
|
|
58095
58164
|
result.deferralParent = containingType;
|
|
58096
58165
|
result.deferralConstituents = propTypes;
|
|
58166
|
+
result.deferralWriteConstituents = writeTypes;
|
|
58097
58167
|
}
|
|
58098
58168
|
else {
|
|
58099
58169
|
result.type = isUnion ? getUnionType(propTypes) : getIntersectionType(propTypes);
|
|
58170
|
+
if (writeTypes) {
|
|
58171
|
+
result.writeType = isUnion ? getUnionType(writeTypes) : getIntersectionType(writeTypes);
|
|
58172
|
+
}
|
|
58100
58173
|
}
|
|
58101
58174
|
return result;
|
|
58102
58175
|
}
|
|
@@ -58512,6 +58585,13 @@ var ts;
|
|
|
58512
58585
|
var typeTag = ts.getJSDocTypeTag(node);
|
|
58513
58586
|
return (typeTag === null || typeTag === void 0 ? void 0 : typeTag.typeExpression) && getSingleCallSignature(getTypeFromTypeNode(typeTag.typeExpression));
|
|
58514
58587
|
}
|
|
58588
|
+
function getParameterTypeOfTypeTag(func, parameter) {
|
|
58589
|
+
var signature = getSignatureOfTypeTag(func);
|
|
58590
|
+
if (!signature)
|
|
58591
|
+
return undefined;
|
|
58592
|
+
var pos = func.parameters.indexOf(parameter);
|
|
58593
|
+
return parameter.dotDotDotToken ? getRestTypeAtPosition(signature, pos) : getTypeAtPosition(signature, pos);
|
|
58594
|
+
}
|
|
58515
58595
|
function getReturnTypeOfTypeTag(node) {
|
|
58516
58596
|
var signature = getSignatureOfTypeTag(node);
|
|
58517
58597
|
return signature && getReturnTypeOfSignature(signature);
|
|
@@ -58952,7 +59032,7 @@ var ts;
|
|
|
58952
59032
|
return result;
|
|
58953
59033
|
}
|
|
58954
59034
|
function getAliasId(aliasSymbol, aliasTypeArguments) {
|
|
58955
|
-
return aliasSymbol ? "@"
|
|
59035
|
+
return aliasSymbol ? "@".concat(getSymbolId(aliasSymbol)) + (aliasTypeArguments ? ":".concat(getTypeListId(aliasTypeArguments)) : "") : "";
|
|
58956
59036
|
}
|
|
58957
59037
|
// This function is used to propagate certain flags when creating new object type references and union types.
|
|
58958
59038
|
// It is only necessary to do so if a constituent type might be the undefined type, the null type, the type
|
|
@@ -59138,7 +59218,7 @@ var ts;
|
|
|
59138
59218
|
return undefined;
|
|
59139
59219
|
}
|
|
59140
59220
|
function getSymbolPath(symbol) {
|
|
59141
|
-
return symbol.parent ? getSymbolPath(symbol.parent)
|
|
59221
|
+
return symbol.parent ? "".concat(getSymbolPath(symbol.parent), ".").concat(symbol.escapedName) : symbol.escapedName;
|
|
59142
59222
|
}
|
|
59143
59223
|
function getUnresolvedSymbolForEntityName(name) {
|
|
59144
59224
|
var identifier = name.kind === 160 /* QualifiedName */ ? name.right :
|
|
@@ -59149,7 +59229,7 @@ var ts;
|
|
|
59149
59229
|
var parentSymbol = name.kind === 160 /* QualifiedName */ ? getUnresolvedSymbolForEntityName(name.left) :
|
|
59150
59230
|
name.kind === 205 /* PropertyAccessExpression */ ? getUnresolvedSymbolForEntityName(name.expression) :
|
|
59151
59231
|
undefined;
|
|
59152
|
-
var path = parentSymbol ? getSymbolPath(parentSymbol)
|
|
59232
|
+
var path = parentSymbol ? "".concat(getSymbolPath(parentSymbol), ".").concat(text) : text;
|
|
59153
59233
|
var result = unresolvedSymbols.get(path);
|
|
59154
59234
|
if (!result) {
|
|
59155
59235
|
unresolvedSymbols.set(path, result = createSymbol(524288 /* TypeAlias */, text, 1048576 /* Unresolved */));
|
|
@@ -59222,7 +59302,7 @@ var ts;
|
|
|
59222
59302
|
if (substitute.flags & 3 /* AnyOrUnknown */ || substitute === baseType) {
|
|
59223
59303
|
return baseType;
|
|
59224
59304
|
}
|
|
59225
|
-
var id = getTypeId(baseType)
|
|
59305
|
+
var id = "".concat(getTypeId(baseType), ">").concat(getTypeId(substitute));
|
|
59226
59306
|
var cached = substitutionTypes.get(id);
|
|
59227
59307
|
if (cached) {
|
|
59228
59308
|
return cached;
|
|
@@ -60146,9 +60226,9 @@ var ts;
|
|
|
60146
60226
|
return types[0];
|
|
60147
60227
|
}
|
|
60148
60228
|
var typeKey = !origin ? getTypeListId(types) :
|
|
60149
|
-
origin.flags & 1048576 /* Union */ ? "|"
|
|
60150
|
-
origin.flags & 2097152 /* Intersection */ ? "&"
|
|
60151
|
-
"#"
|
|
60229
|
+
origin.flags & 1048576 /* Union */ ? "|".concat(getTypeListId(origin.types)) :
|
|
60230
|
+
origin.flags & 2097152 /* Intersection */ ? "&".concat(getTypeListId(origin.types)) :
|
|
60231
|
+
"#".concat(origin.type.id, "|").concat(getTypeListId(types)); // origin type id alone is insufficient, as `keyof x` may resolve to multiple WIP values while `x` is still resolving
|
|
60152
60232
|
var id = typeKey + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
60153
60233
|
var type = unionTypes.get(id);
|
|
60154
60234
|
if (!type) {
|
|
@@ -60670,7 +60750,7 @@ var ts;
|
|
|
60670
60750
|
if (ts.every(newTexts, function (t) { return t === ""; }) && ts.every(newTypes, function (t) { return !!(t.flags & 4 /* String */); })) {
|
|
60671
60751
|
return stringType;
|
|
60672
60752
|
}
|
|
60673
|
-
var id = getTypeListId(newTypes)
|
|
60753
|
+
var id = "".concat(getTypeListId(newTypes), "|").concat(ts.map(newTexts, function (t) { return t.length; }).join(","), "|").concat(newTexts.join(""));
|
|
60674
60754
|
var type = templateLiteralTypes.get(id);
|
|
60675
60755
|
if (!type) {
|
|
60676
60756
|
templateLiteralTypes.set(id, type = createTemplateLiteralType(newTexts, newTypes));
|
|
@@ -60730,7 +60810,7 @@ var ts;
|
|
|
60730
60810
|
return str;
|
|
60731
60811
|
}
|
|
60732
60812
|
function getStringMappingTypeForGenericType(symbol, type) {
|
|
60733
|
-
var id = getSymbolId(symbol)
|
|
60813
|
+
var id = "".concat(getSymbolId(symbol), ",").concat(getTypeId(type));
|
|
60734
60814
|
var result = stringMappingTypes.get(id);
|
|
60735
60815
|
if (!result) {
|
|
60736
60816
|
stringMappingTypes.set(id, result = createStringMappingType(symbol, type));
|
|
@@ -61747,7 +61827,7 @@ var ts;
|
|
|
61747
61827
|
function createUniqueESSymbolType(symbol) {
|
|
61748
61828
|
var type = createType(8192 /* UniqueESSymbol */);
|
|
61749
61829
|
type.symbol = symbol;
|
|
61750
|
-
type.escapedName = "__@"
|
|
61830
|
+
type.escapedName = "__@".concat(type.symbol.escapedName, "@").concat(getSymbolId(type.symbol));
|
|
61751
61831
|
return type;
|
|
61752
61832
|
}
|
|
61753
61833
|
function getESSymbolLikeTypeForNode(node) {
|
|
@@ -63436,24 +63516,24 @@ var ts;
|
|
|
63436
63516
|
case ts.Diagnostics.Types_of_property_0_are_incompatible.code: {
|
|
63437
63517
|
// Parenthesize a `new` if there is one
|
|
63438
63518
|
if (path.indexOf("new ") === 0) {
|
|
63439
|
-
path = "("
|
|
63519
|
+
path = "(".concat(path, ")");
|
|
63440
63520
|
}
|
|
63441
63521
|
var str = "" + args[0];
|
|
63442
63522
|
// If leading, just print back the arg (irrespective of if it's a valid identifier)
|
|
63443
63523
|
if (path.length === 0) {
|
|
63444
|
-
path = ""
|
|
63524
|
+
path = "".concat(str);
|
|
63445
63525
|
}
|
|
63446
63526
|
// Otherwise write a dotted name if possible
|
|
63447
63527
|
else if (ts.isIdentifierText(str, ts.getEmitScriptTarget(compilerOptions))) {
|
|
63448
|
-
path = path
|
|
63528
|
+
path = "".concat(path, ".").concat(str);
|
|
63449
63529
|
}
|
|
63450
63530
|
// Failing that, check if the name is already a computed name
|
|
63451
63531
|
else if (str[0] === "[" && str[str.length - 1] === "]") {
|
|
63452
|
-
path = ""
|
|
63532
|
+
path = "".concat(path).concat(str);
|
|
63453
63533
|
}
|
|
63454
63534
|
// And finally write out a computed name as a last resort
|
|
63455
63535
|
else {
|
|
63456
|
-
path = path
|
|
63536
|
+
path = "".concat(path, "[").concat(str, "]");
|
|
63457
63537
|
}
|
|
63458
63538
|
break;
|
|
63459
63539
|
}
|
|
@@ -63482,7 +63562,7 @@ var ts;
|
|
|
63482
63562
|
msg.code === ts.Diagnostics.Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1.code)
|
|
63483
63563
|
? ""
|
|
63484
63564
|
: "...";
|
|
63485
|
-
path = ""
|
|
63565
|
+
path = "".concat(prefix).concat(path, "(").concat(params, ")");
|
|
63486
63566
|
}
|
|
63487
63567
|
break;
|
|
63488
63568
|
}
|
|
@@ -63495,7 +63575,7 @@ var ts;
|
|
|
63495
63575
|
break;
|
|
63496
63576
|
}
|
|
63497
63577
|
default:
|
|
63498
|
-
return ts.Debug.fail("Unhandled Diagnostic: "
|
|
63578
|
+
return ts.Debug.fail("Unhandled Diagnostic: ".concat(msg.code));
|
|
63499
63579
|
}
|
|
63500
63580
|
}
|
|
63501
63581
|
if (path) {
|
|
@@ -65697,7 +65777,7 @@ var ts;
|
|
|
65697
65777
|
var constraintMarker = "";
|
|
65698
65778
|
var sourceId = getTypeReferenceId(source, 0);
|
|
65699
65779
|
var targetId = getTypeReferenceId(target, 0);
|
|
65700
|
-
return ""
|
|
65780
|
+
return "".concat(constraintMarker).concat(sourceId, ",").concat(targetId).concat(postFix);
|
|
65701
65781
|
// getTypeReferenceId(A<T, number, U>) returns "111=0-12=1"
|
|
65702
65782
|
// where A.id=111 and number.id=12
|
|
65703
65783
|
function getTypeReferenceId(type, depth) {
|
|
@@ -65741,7 +65821,7 @@ var ts;
|
|
|
65741
65821
|
var postFix = intersectionState ? ":" + intersectionState : "";
|
|
65742
65822
|
return isTypeReferenceWithGenericArguments(source) && isTypeReferenceWithGenericArguments(target) ?
|
|
65743
65823
|
getGenericTypeReferenceRelationKey(source, target, postFix, ignoreConstraints) :
|
|
65744
|
-
source.id
|
|
65824
|
+
"".concat(source.id, ",").concat(target.id).concat(postFix);
|
|
65745
65825
|
}
|
|
65746
65826
|
// Invoke the callback for each underlying property symbol of the given symbol and return the first
|
|
65747
65827
|
// value that isn't undefined.
|
|
@@ -67868,11 +67948,11 @@ var ts;
|
|
|
67868
67948
|
case 79 /* Identifier */:
|
|
67869
67949
|
if (!ts.isThisInTypeQuery(node)) {
|
|
67870
67950
|
var symbol = getResolvedSymbol(node);
|
|
67871
|
-
return symbol !== unknownSymbol ? (flowContainer ? getNodeId(flowContainer) : "-1"
|
|
67951
|
+
return symbol !== unknownSymbol ? "".concat(flowContainer ? getNodeId(flowContainer) : "-1", "|").concat(getTypeId(declaredType), "|").concat(getTypeId(initialType), "|").concat(getSymbolId(symbol)) : undefined;
|
|
67872
67952
|
}
|
|
67873
67953
|
// falls through
|
|
67874
67954
|
case 108 /* ThisKeyword */:
|
|
67875
|
-
return "0|"
|
|
67955
|
+
return "0|".concat(flowContainer ? getNodeId(flowContainer) : "-1", "|").concat(getTypeId(declaredType), "|").concat(getTypeId(initialType));
|
|
67876
67956
|
case 229 /* NonNullExpression */:
|
|
67877
67957
|
case 211 /* ParenthesizedExpression */:
|
|
67878
67958
|
return getFlowCacheKey(node.expression, declaredType, initialType, flowContainer);
|
|
@@ -70047,12 +70127,16 @@ var ts;
|
|
|
70047
70127
|
function isGenericTypeWithoutNullableConstraint(type) {
|
|
70048
70128
|
return !!(type.flags & 465829888 /* Instantiable */ && !maybeTypeOfKind(getBaseConstraintOrType(type), 98304 /* Nullable */));
|
|
70049
70129
|
}
|
|
70050
|
-
function
|
|
70130
|
+
function hasContextualTypeWithNoGenericTypes(node, checkMode) {
|
|
70051
70131
|
// Computing the contextual type for a child of a JSX element involves resolving the type of the
|
|
70052
70132
|
// element's tag name, so we exclude that here to avoid circularities.
|
|
70133
|
+
// If check mode has `CheckMode.RestBindingElement`, we skip binding pattern contextual types,
|
|
70134
|
+
// as we want the type of a rest element to be generic when possible.
|
|
70053
70135
|
var contextualType = (ts.isIdentifier(node) || ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node)) &&
|
|
70054
70136
|
!((ts.isJsxOpeningElement(node.parent) || ts.isJsxSelfClosingElement(node.parent)) && node.parent.tagName === node) &&
|
|
70055
|
-
|
|
70137
|
+
(checkMode && checkMode & 32 /* RestBindingElement */ ?
|
|
70138
|
+
getContextualType(node, 8 /* SkipBindingPatterns */)
|
|
70139
|
+
: getContextualType(node));
|
|
70056
70140
|
return contextualType && !isGenericType(contextualType);
|
|
70057
70141
|
}
|
|
70058
70142
|
function getNarrowableTypeForReference(type, reference, checkMode) {
|
|
@@ -70065,7 +70149,7 @@ var ts;
|
|
|
70065
70149
|
// 'string | undefined' to give control flow analysis the opportunity to narrow to type 'string'.
|
|
70066
70150
|
var substituteConstraints = !(checkMode && checkMode & 2 /* Inferential */) &&
|
|
70067
70151
|
someType(type, isGenericTypeWithUnionConstraint) &&
|
|
70068
|
-
(isConstraintPosition(type, reference) ||
|
|
70152
|
+
(isConstraintPosition(type, reference) || hasContextualTypeWithNoGenericTypes(reference, checkMode));
|
|
70069
70153
|
return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 /* Instantiable */ && !isMappedTypeGenericIndexedAccess(t) ? getBaseConstraintOrType(t) : t; }) : type;
|
|
70070
70154
|
}
|
|
70071
70155
|
function isExportOrExportExpression(location) {
|
|
@@ -70133,7 +70217,7 @@ var ts;
|
|
|
70133
70217
|
var links = getNodeLinks(location);
|
|
70134
70218
|
if (!(links.flags & 268435456 /* InCheckIdentifier */)) {
|
|
70135
70219
|
links.flags |= 268435456 /* InCheckIdentifier */;
|
|
70136
|
-
var parentType = getTypeForBindingElementParent(parent);
|
|
70220
|
+
var parentType = getTypeForBindingElementParent(parent, 0 /* Normal */);
|
|
70137
70221
|
links.flags &= ~268435456 /* InCheckIdentifier */;
|
|
70138
70222
|
if (parentType && parentType.flags & 1048576 /* Union */ && !(parent.kind === 163 /* Parameter */ && isSymbolAssigned(symbol))) {
|
|
70139
70223
|
var pattern = declaration.parent;
|
|
@@ -70986,7 +71070,7 @@ var ts;
|
|
|
70986
71070
|
var parent = declaration.parent.parent;
|
|
70987
71071
|
var name = declaration.propertyName || declaration.name;
|
|
70988
71072
|
var parentType = getContextualTypeForVariableLikeDeclaration(parent) ||
|
|
70989
|
-
parent.kind !== 202 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent);
|
|
71073
|
+
parent.kind !== 202 /* BindingElement */ && parent.initializer && checkDeclarationInitializer(parent, declaration.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */);
|
|
70990
71074
|
if (!parentType || ts.isBindingPattern(name) || ts.isComputedNonLiteralName(name))
|
|
70991
71075
|
return undefined;
|
|
70992
71076
|
if (parent.name.kind === 201 /* ArrayBindingPattern */) {
|
|
@@ -71757,7 +71841,7 @@ var ts;
|
|
|
71757
71841
|
!leftName ? rightName :
|
|
71758
71842
|
!rightName ? leftName :
|
|
71759
71843
|
undefined;
|
|
71760
|
-
var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg"
|
|
71844
|
+
var paramSymbol = createSymbol(1 /* FunctionScopedVariable */ | (isOptional && !isRestParam ? 16777216 /* Optional */ : 0), paramName || "arg".concat(i));
|
|
71761
71845
|
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
|
|
71762
71846
|
params[i] = paramSymbol;
|
|
71763
71847
|
}
|
|
@@ -73227,7 +73311,7 @@ var ts;
|
|
|
73227
73311
|
error(right, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, ts.idText(right));
|
|
73228
73312
|
return errorType;
|
|
73229
73313
|
}
|
|
73230
|
-
propType = isThisPropertyAccessInConstructor(node, prop) ? autoType : writing ?
|
|
73314
|
+
propType = isThisPropertyAccessInConstructor(node, prop) ? autoType : writing ? getWriteTypeOfSymbol(prop) : getTypeOfSymbol(prop);
|
|
73231
73315
|
}
|
|
73232
73316
|
return getFlowTypeOfAccessExpression(node, prop, propType, right, checkMode);
|
|
73233
73317
|
}
|
|
@@ -75697,8 +75781,8 @@ var ts;
|
|
|
75697
75781
|
if (hasDefaultOnly && type && !isErrorType(type)) {
|
|
75698
75782
|
var synthType = type;
|
|
75699
75783
|
if (!synthType.defaultOnlyType) {
|
|
75700
|
-
var
|
|
75701
|
-
synthType.defaultOnlyType =
|
|
75784
|
+
var type_5 = createDefaultPropertyWrapperForModule(symbol, originalSymbol);
|
|
75785
|
+
synthType.defaultOnlyType = type_5;
|
|
75702
75786
|
}
|
|
75703
75787
|
return synthType.defaultOnlyType;
|
|
75704
75788
|
}
|
|
@@ -76152,7 +76236,7 @@ var ts;
|
|
|
76152
76236
|
var links = getSymbolLinks(parameter);
|
|
76153
76237
|
if (!links.type) {
|
|
76154
76238
|
var declaration = parameter.valueDeclaration;
|
|
76155
|
-
links.type = type || getWidenedTypeForVariableLikeDeclaration(declaration, /*
|
|
76239
|
+
links.type = type || getWidenedTypeForVariableLikeDeclaration(declaration, /*reportErrors*/ true);
|
|
76156
76240
|
if (declaration.name.kind !== 79 /* Identifier */) {
|
|
76157
76241
|
// if inference didn't come up with anything but unknown, fall back to the binding pattern if present.
|
|
76158
76242
|
if (links.type === unknownType) {
|
|
@@ -76425,12 +76509,12 @@ var ts;
|
|
|
76425
76509
|
var witnesses = getSwitchClauseTypeOfWitnesses(node, /*retainDefault*/ false);
|
|
76426
76510
|
// notEqualFacts states that the type of the switched value is not equal to every type in the switch.
|
|
76427
76511
|
var notEqualFacts_1 = getFactsFromTypeofSwitch(0, 0, witnesses, /*hasDefault*/ true);
|
|
76428
|
-
var
|
|
76512
|
+
var type_6 = getBaseConstraintOfType(operandType) || operandType;
|
|
76429
76513
|
// Take any/unknown as a special condition. Or maybe we could change `type` to a union containing all primitive types.
|
|
76430
|
-
if (
|
|
76514
|
+
if (type_6.flags & 3 /* AnyOrUnknown */) {
|
|
76431
76515
|
return (556800 /* AllTypeofNE */ & notEqualFacts_1) === 556800 /* AllTypeofNE */;
|
|
76432
76516
|
}
|
|
76433
|
-
return !!(filterType(
|
|
76517
|
+
return !!(filterType(type_6, function (t) { return (getTypeFacts(t) & notEqualFacts_1) === notEqualFacts_1; }).flags & 131072 /* Never */);
|
|
76434
76518
|
}
|
|
76435
76519
|
var type = getTypeOfExpression(node.expression);
|
|
76436
76520
|
if (!isLiteralType(type)) {
|
|
@@ -77883,11 +77967,11 @@ var ts;
|
|
|
77883
77967
|
}
|
|
77884
77968
|
}
|
|
77885
77969
|
function checkExpressionCached(node, checkMode) {
|
|
77970
|
+
if (checkMode && checkMode !== 0 /* Normal */) {
|
|
77971
|
+
return checkExpression(node, checkMode);
|
|
77972
|
+
}
|
|
77886
77973
|
var links = getNodeLinks(node);
|
|
77887
77974
|
if (!links.resolvedType) {
|
|
77888
|
-
if (checkMode && checkMode !== 0 /* Normal */) {
|
|
77889
|
-
return checkExpression(node, checkMode);
|
|
77890
|
-
}
|
|
77891
77975
|
// When computing a type that we're going to cache, we need to ignore any ongoing control flow
|
|
77892
77976
|
// analysis because variables may have transient types in indeterminable states. Moving flowLoopStart
|
|
77893
77977
|
// to the top of the stack ensures all transient types are computed from a known point.
|
|
@@ -77907,10 +77991,12 @@ var ts;
|
|
|
77907
77991
|
node.kind === 228 /* AsExpression */ ||
|
|
77908
77992
|
ts.isJSDocTypeAssertion(node);
|
|
77909
77993
|
}
|
|
77910
|
-
function checkDeclarationInitializer(declaration, contextualType) {
|
|
77994
|
+
function checkDeclarationInitializer(declaration, checkMode, contextualType) {
|
|
77911
77995
|
var initializer = ts.getEffectiveInitializer(declaration);
|
|
77912
77996
|
var type = getQuickTypeOfExpression(initializer) ||
|
|
77913
|
-
(contextualType ?
|
|
77997
|
+
(contextualType ?
|
|
77998
|
+
checkExpressionWithContextualType(initializer, contextualType, /*inferenceContext*/ undefined, checkMode || 0 /* Normal */)
|
|
77999
|
+
: checkExpressionCached(initializer, checkMode));
|
|
77914
78000
|
return ts.isParameter(declaration) && declaration.name.kind === 201 /* ArrayBindingPattern */ &&
|
|
77915
78001
|
isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ?
|
|
77916
78002
|
padTupleType(type, declaration.name) : type;
|
|
@@ -78550,6 +78636,7 @@ var ts;
|
|
|
78550
78636
|
}
|
|
78551
78637
|
}
|
|
78552
78638
|
checkTypeParameters(ts.getEffectiveTypeParameterDeclarations(node));
|
|
78639
|
+
checkUnmatchedJSDocParameters(node);
|
|
78553
78640
|
ts.forEach(node.parameters, checkParameter);
|
|
78554
78641
|
// TODO(rbuckton): Should we start checking JSDoc types?
|
|
78555
78642
|
if (node.type) {
|
|
@@ -80121,31 +80208,6 @@ var ts;
|
|
|
80121
80208
|
}
|
|
80122
80209
|
function checkJSDocParameterTag(node) {
|
|
80123
80210
|
checkSourceElement(node.typeExpression);
|
|
80124
|
-
if (!ts.getParameterSymbolFromJSDoc(node)) {
|
|
80125
|
-
var decl = ts.getHostSignatureFromJSDoc(node);
|
|
80126
|
-
// don't issue an error for invalid hosts -- just functions --
|
|
80127
|
-
// and give a better error message when the host function mentions `arguments`
|
|
80128
|
-
// but the tag doesn't have an array type
|
|
80129
|
-
if (decl) {
|
|
80130
|
-
var i = ts.getJSDocTags(decl).filter(ts.isJSDocParameterTag).indexOf(node);
|
|
80131
|
-
if (i > -1 && i < decl.parameters.length && ts.isBindingPattern(decl.parameters[i].name)) {
|
|
80132
|
-
return;
|
|
80133
|
-
}
|
|
80134
|
-
if (!containsArgumentsReference(decl)) {
|
|
80135
|
-
if (ts.isQualifiedName(node.name)) {
|
|
80136
|
-
error(node.name, ts.Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1, ts.entityNameToString(node.name), ts.entityNameToString(node.name.left));
|
|
80137
|
-
}
|
|
80138
|
-
else {
|
|
80139
|
-
error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(node.name));
|
|
80140
|
-
}
|
|
80141
|
-
}
|
|
80142
|
-
else if (ts.findLast(ts.getJSDocTags(decl), ts.isJSDocParameterTag) === node &&
|
|
80143
|
-
node.typeExpression && node.typeExpression.type &&
|
|
80144
|
-
!isArrayType(getTypeFromTypeNode(node.typeExpression.type))) {
|
|
80145
|
-
error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 160 /* QualifiedName */ ? node.name.right : node.name));
|
|
80146
|
-
}
|
|
80147
|
-
}
|
|
80148
|
-
}
|
|
80149
80211
|
}
|
|
80150
80212
|
function checkJSDocPropertyTag(node) {
|
|
80151
80213
|
checkSourceElement(node.typeExpression);
|
|
@@ -80847,7 +80909,8 @@ var ts;
|
|
|
80847
80909
|
}
|
|
80848
80910
|
// check private/protected variable access
|
|
80849
80911
|
var parent = node.parent.parent;
|
|
80850
|
-
var
|
|
80912
|
+
var parentCheckMode = node.dotDotDotToken ? 32 /* RestBindingElement */ : 0 /* Normal */;
|
|
80913
|
+
var parentType = getTypeForBindingElementParent(parent, parentCheckMode);
|
|
80851
80914
|
var name = node.propertyName || node.name;
|
|
80852
80915
|
if (parentType && !ts.isBindingPattern(name)) {
|
|
80853
80916
|
var exprType = getLiteralTypeFromPropertyName(name);
|
|
@@ -81645,7 +81708,7 @@ var ts;
|
|
|
81645
81708
|
function getPropertyNameForKnownSymbolName(symbolName) {
|
|
81646
81709
|
var ctorType = getGlobalESSymbolConstructorSymbol(/*reportErrors*/ false);
|
|
81647
81710
|
var uniqueType = ctorType && getTypeOfPropertyOfType(getTypeOfSymbol(ctorType), ts.escapeLeadingUnderscores(symbolName));
|
|
81648
|
-
return uniqueType && isTypeUsableAsPropertyName(uniqueType) ? getPropertyNameFromType(uniqueType) : "__@"
|
|
81711
|
+
return uniqueType && isTypeUsableAsPropertyName(uniqueType) ? getPropertyNameFromType(uniqueType) : "__@".concat(symbolName);
|
|
81649
81712
|
}
|
|
81650
81713
|
/**
|
|
81651
81714
|
* Gets the *yield*, *return*, and *next* types of an `Iterable`-like or `AsyncIterable`-like
|
|
@@ -82086,7 +82149,7 @@ var ts;
|
|
|
82086
82149
|
var declaration = catchClause.variableDeclaration;
|
|
82087
82150
|
var typeNode = ts.getEffectiveTypeAnnotationNode(ts.getRootDeclaration(declaration));
|
|
82088
82151
|
if (typeNode) {
|
|
82089
|
-
var type = getTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ false);
|
|
82152
|
+
var type = getTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ false, 0 /* Normal */);
|
|
82090
82153
|
if (type && !(type.flags & 3 /* AnyOrUnknown */)) {
|
|
82091
82154
|
grammarErrorOnFirstToken(typeNode, ts.Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified);
|
|
82092
82155
|
}
|
|
@@ -82217,6 +82280,45 @@ var ts;
|
|
|
82217
82280
|
error(name, ts.Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0, ts.ModuleKind[moduleKind]); // https://github.com/Microsoft/TypeScript/issues/17494
|
|
82218
82281
|
}
|
|
82219
82282
|
}
|
|
82283
|
+
function checkUnmatchedJSDocParameters(node) {
|
|
82284
|
+
var jsdocParameters = ts.filter(ts.getJSDocTags(node), ts.isJSDocParameterTag);
|
|
82285
|
+
if (!ts.length(jsdocParameters))
|
|
82286
|
+
return;
|
|
82287
|
+
var isJs = ts.isInJSFile(node);
|
|
82288
|
+
var parameters = new ts.Set();
|
|
82289
|
+
var excludedParameters = new ts.Set();
|
|
82290
|
+
ts.forEach(node.parameters, function (_a, index) {
|
|
82291
|
+
var name = _a.name;
|
|
82292
|
+
if (ts.isIdentifier(name)) {
|
|
82293
|
+
parameters.add(name.escapedText);
|
|
82294
|
+
}
|
|
82295
|
+
if (ts.isBindingPattern(name)) {
|
|
82296
|
+
excludedParameters.add(index);
|
|
82297
|
+
}
|
|
82298
|
+
});
|
|
82299
|
+
var containsArguments = containsArgumentsReference(node);
|
|
82300
|
+
if (containsArguments) {
|
|
82301
|
+
var lastJSDocParam = ts.lastOrUndefined(jsdocParameters);
|
|
82302
|
+
if (lastJSDocParam && ts.isIdentifier(lastJSDocParam.name) && lastJSDocParam.typeExpression &&
|
|
82303
|
+
lastJSDocParam.typeExpression.type && !parameters.has(lastJSDocParam.name.escapedText) && !isArrayType(getTypeFromTypeNode(lastJSDocParam.typeExpression.type))) {
|
|
82304
|
+
errorOrSuggestion(isJs, lastJSDocParam.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(lastJSDocParam.name));
|
|
82305
|
+
}
|
|
82306
|
+
}
|
|
82307
|
+
else {
|
|
82308
|
+
ts.forEach(jsdocParameters, function (_a, index) {
|
|
82309
|
+
var name = _a.name;
|
|
82310
|
+
if (excludedParameters.has(index) || ts.isIdentifier(name) && parameters.has(name.escapedText)) {
|
|
82311
|
+
return;
|
|
82312
|
+
}
|
|
82313
|
+
if (ts.isQualifiedName(name)) {
|
|
82314
|
+
errorOrSuggestion(isJs, name, ts.Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1, ts.entityNameToString(name), ts.entityNameToString(name.left));
|
|
82315
|
+
}
|
|
82316
|
+
else {
|
|
82317
|
+
errorOrSuggestion(isJs, name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(name));
|
|
82318
|
+
}
|
|
82319
|
+
});
|
|
82320
|
+
}
|
|
82321
|
+
}
|
|
82220
82322
|
/**
|
|
82221
82323
|
* Check each type parameter and check that type parameters have no duplicate type parameter declarations
|
|
82222
82324
|
*/
|
|
@@ -83192,7 +83294,7 @@ var ts;
|
|
|
83192
83294
|
var isAmbientExternalModule = ts.isAmbientModule(node);
|
|
83193
83295
|
var contextErrorMessage = isAmbientExternalModule
|
|
83194
83296
|
? ts.Diagnostics.An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file
|
|
83195
|
-
: ts.Diagnostics.
|
|
83297
|
+
: ts.Diagnostics.A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module;
|
|
83196
83298
|
if (checkGrammarModuleElementContext(node, contextErrorMessage)) {
|
|
83197
83299
|
// If we hit a module declaration in an illegal context, just bail out to avoid cascading errors.
|
|
83198
83300
|
return;
|
|
@@ -83425,6 +83527,9 @@ var ts;
|
|
|
83425
83527
|
var name = ts.idText(node.kind === 269 /* ImportSpecifier */ ? node.propertyName || node.name : node.name);
|
|
83426
83528
|
addTypeOnlyDeclarationRelatedInfo(error(node, message, name), isType ? undefined : typeOnlyAlias, name);
|
|
83427
83529
|
}
|
|
83530
|
+
if (isType && node.kind === 264 /* ImportEqualsDeclaration */ && ts.hasEffectiveModifier(node, 1 /* Export */)) {
|
|
83531
|
+
error(node, ts.Diagnostics.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided);
|
|
83532
|
+
}
|
|
83428
83533
|
break;
|
|
83429
83534
|
}
|
|
83430
83535
|
case 274 /* ExportSpecifier */: {
|
|
@@ -83508,7 +83613,7 @@ var ts;
|
|
|
83508
83613
|
}
|
|
83509
83614
|
}
|
|
83510
83615
|
function checkImportDeclaration(node) {
|
|
83511
|
-
if (checkGrammarModuleElementContext(node, ts.Diagnostics.
|
|
83616
|
+
if (checkGrammarModuleElementContext(node, ts.isInJSFile(node) ? ts.Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module : ts.Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) {
|
|
83512
83617
|
// If we hit an import declaration in an illegal context, just bail out to avoid cascading errors.
|
|
83513
83618
|
return;
|
|
83514
83619
|
}
|
|
@@ -83541,7 +83646,7 @@ var ts;
|
|
|
83541
83646
|
checkAssertClause(node);
|
|
83542
83647
|
}
|
|
83543
83648
|
function checkImportEqualsDeclaration(node) {
|
|
83544
|
-
if (checkGrammarModuleElementContext(node, ts.Diagnostics.
|
|
83649
|
+
if (checkGrammarModuleElementContext(node, ts.isInJSFile(node) ? ts.Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module : ts.Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) {
|
|
83545
83650
|
// If we hit an import declaration in an illegal context, just bail out to avoid cascading errors.
|
|
83546
83651
|
return;
|
|
83547
83652
|
}
|
|
@@ -83578,7 +83683,7 @@ var ts;
|
|
|
83578
83683
|
}
|
|
83579
83684
|
}
|
|
83580
83685
|
function checkExportDeclaration(node) {
|
|
83581
|
-
if (checkGrammarModuleElementContext(node, ts.Diagnostics.
|
|
83686
|
+
if (checkGrammarModuleElementContext(node, ts.isInJSFile(node) ? ts.Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_module : ts.Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) {
|
|
83582
83687
|
// If we hit an export in an illegal context, just bail out to avoid cascading errors.
|
|
83583
83688
|
return;
|
|
83584
83689
|
}
|
|
@@ -84812,7 +84917,7 @@ var ts;
|
|
|
84812
84917
|
return errorType;
|
|
84813
84918
|
}
|
|
84814
84919
|
if (ts.isBindingPattern(node)) {
|
|
84815
|
-
return getTypeForVariableLikeDeclaration(node.parent, /*includeOptionality*/ true) || errorType;
|
|
84920
|
+
return getTypeForVariableLikeDeclaration(node.parent, /*includeOptionality*/ true, 0 /* Normal */) || errorType;
|
|
84816
84921
|
}
|
|
84817
84922
|
if (isInRightSideOfImportOrExportAssignment(node)) {
|
|
84818
84923
|
var symbol = getSymbolAtLocation(node);
|
|
@@ -88655,7 +88760,7 @@ var ts;
|
|
|
88655
88760
|
value >= 52 && value < 62 ? 48 /* _0 */ + value - 52 :
|
|
88656
88761
|
value === 62 ? 43 /* plus */ :
|
|
88657
88762
|
value === 63 ? 47 /* slash */ :
|
|
88658
|
-
ts.Debug.fail(value
|
|
88763
|
+
ts.Debug.fail("".concat(value, ": not a base64 value"));
|
|
88659
88764
|
}
|
|
88660
88765
|
function base64FormatDecode(ch) {
|
|
88661
88766
|
return ch >= 65 /* A */ && ch <= 90 /* Z */ ? ch - 65 /* A */ :
|
|
@@ -88730,7 +88835,7 @@ var ts;
|
|
|
88730
88835
|
var mappings = ts.arrayFrom(decoder, processMapping);
|
|
88731
88836
|
if (decoder.error !== undefined) {
|
|
88732
88837
|
if (host.log) {
|
|
88733
|
-
host.log("Encountered error while decoding sourcemap: "
|
|
88838
|
+
host.log("Encountered error while decoding sourcemap: ".concat(decoder.error));
|
|
88734
88839
|
}
|
|
88735
88840
|
decodedMappings = ts.emptyArray;
|
|
88736
88841
|
}
|
|
@@ -92405,7 +92510,7 @@ var ts;
|
|
|
92405
92510
|
var propertyName = ts.isPropertyAccessExpression(originalNode)
|
|
92406
92511
|
? ts.declarationNameToString(originalNode.name)
|
|
92407
92512
|
: ts.getTextOfNode(originalNode.argumentExpression);
|
|
92408
|
-
ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " "
|
|
92513
|
+
ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " ".concat(propertyName, " "));
|
|
92409
92514
|
}
|
|
92410
92515
|
return substitute;
|
|
92411
92516
|
}
|
|
@@ -93881,8 +93986,8 @@ var ts;
|
|
|
93881
93986
|
}
|
|
93882
93987
|
function createHoistedVariableForClass(name, node) {
|
|
93883
93988
|
var className = getPrivateIdentifierEnvironment().className;
|
|
93884
|
-
var prefix = className ? "_"
|
|
93885
|
-
var identifier = factory.createUniqueName(prefix
|
|
93989
|
+
var prefix = className ? "_".concat(className) : "";
|
|
93990
|
+
var identifier = factory.createUniqueName("".concat(prefix, "_").concat(name), 16 /* Optimistic */);
|
|
93886
93991
|
if (resolver.getNodeCheckFlags(node) & 524288 /* BlockScopedBindingInLoop */) {
|
|
93887
93992
|
addBlockScopedVariable(identifier);
|
|
93888
93993
|
}
|
|
@@ -95887,7 +95992,7 @@ var ts;
|
|
|
95887
95992
|
specifierSourceImports = new ts.Map();
|
|
95888
95993
|
currentFileState.utilizedImplicitRuntimeImports.set(importSource, specifierSourceImports);
|
|
95889
95994
|
}
|
|
95890
|
-
var generatedName = factory.createUniqueName("_"
|
|
95995
|
+
var generatedName = factory.createUniqueName("_".concat(name), 16 /* Optimistic */ | 32 /* FileLevel */ | 64 /* AllowNameSubstitution */);
|
|
95891
95996
|
var specifier = factory.createImportSpecifier(/*isTypeOnly*/ false, factory.createIdentifier(name), generatedName);
|
|
95892
95997
|
generatedName.generatedImportReference = specifier;
|
|
95893
95998
|
specifierSourceImports.set(name, specifier);
|
|
@@ -97035,11 +97140,11 @@ var ts;
|
|
|
97035
97140
|
}
|
|
97036
97141
|
else {
|
|
97037
97142
|
if (node.kind === 245 /* BreakStatement */) {
|
|
97038
|
-
labelMarker = "break-"
|
|
97143
|
+
labelMarker = "break-".concat(label.escapedText);
|
|
97039
97144
|
setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(label), labelMarker);
|
|
97040
97145
|
}
|
|
97041
97146
|
else {
|
|
97042
|
-
labelMarker = "continue-"
|
|
97147
|
+
labelMarker = "continue-".concat(label.escapedText);
|
|
97043
97148
|
setLabeledJump(convertedLoopState, /*isBreak*/ false, ts.idText(label), labelMarker);
|
|
97044
97149
|
}
|
|
97045
97150
|
}
|
|
@@ -105896,7 +106001,7 @@ var ts;
|
|
|
105896
106001
|
return getTypeAliasDeclarationVisibilityError;
|
|
105897
106002
|
}
|
|
105898
106003
|
else {
|
|
105899
|
-
return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: "
|
|
106004
|
+
return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: ".concat(ts.SyntaxKind[node.kind]));
|
|
105900
106005
|
}
|
|
105901
106006
|
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
|
|
105902
106007
|
if (node.kind === 253 /* VariableDeclaration */ || node.kind === 202 /* BindingElement */) {
|
|
@@ -106107,7 +106212,7 @@ var ts;
|
|
|
106107
106212
|
ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2 :
|
|
106108
106213
|
ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_private_name_1;
|
|
106109
106214
|
default:
|
|
106110
|
-
return ts.Debug.fail("Unknown parent for parameter: "
|
|
106215
|
+
return ts.Debug.fail("Unknown parent for parameter: ".concat(ts.SyntaxKind[node.parent.kind]));
|
|
106111
106216
|
}
|
|
106112
106217
|
}
|
|
106113
106218
|
function getTypeParameterConstraintVisibilityError() {
|
|
@@ -106865,7 +106970,7 @@ var ts;
|
|
|
106865
106970
|
while (ts.length(lateMarkedStatements)) {
|
|
106866
106971
|
var i = lateMarkedStatements.shift();
|
|
106867
106972
|
if (!ts.isLateVisibilityPaintedStatement(i)) {
|
|
106868
|
-
return ts.Debug.fail("Late replaced statement was found which is not handled by the declaration transformer!: "
|
|
106973
|
+
return ts.Debug.fail("Late replaced statement was found which is not handled by the declaration transformer!: ".concat(ts.SyntaxKind ? ts.SyntaxKind[i.kind] : i.kind));
|
|
106869
106974
|
}
|
|
106870
106975
|
var priorNeedsDeclare = needsDeclare;
|
|
106871
106976
|
needsDeclare = i.parent && ts.isSourceFile(i.parent) && !(ts.isExternalModule(i.parent) && isBundledEmit);
|
|
@@ -107054,7 +107159,7 @@ var ts;
|
|
|
107054
107159
|
return cleanup(input);
|
|
107055
107160
|
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));
|
|
107056
107161
|
}
|
|
107057
|
-
default: ts.Debug.assertNever(input, "Attempted to process unhandled node kind: "
|
|
107162
|
+
default: ts.Debug.assertNever(input, "Attempted to process unhandled node kind: ".concat(ts.SyntaxKind[input.kind]));
|
|
107058
107163
|
}
|
|
107059
107164
|
}
|
|
107060
107165
|
if (ts.isTupleTypeNode(input) && (ts.getLineAndCharacterOfPosition(currentSourceFile, input.pos).line === ts.getLineAndCharacterOfPosition(currentSourceFile, input.end).line)) {
|
|
@@ -107345,7 +107450,7 @@ var ts;
|
|
|
107345
107450
|
if (extendsClause_1 && !ts.isEntityNameExpression(extendsClause_1.expression) && extendsClause_1.expression.kind !== 104 /* NullKeyword */) {
|
|
107346
107451
|
// We must add a temporary declaration for the extends clause expression
|
|
107347
107452
|
var oldId = input.name ? ts.unescapeLeadingUnderscores(input.name.escapedText) : "default";
|
|
107348
|
-
var newId_1 = factory.createUniqueName(oldId
|
|
107453
|
+
var newId_1 = factory.createUniqueName("".concat(oldId, "_base"), 16 /* Optimistic */);
|
|
107349
107454
|
getSymbolAccessibilityDiagnostic = function () { return ({
|
|
107350
107455
|
diagnosticMessage: ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1,
|
|
107351
107456
|
errorNode: extendsClause_1,
|
|
@@ -107386,7 +107491,7 @@ var ts;
|
|
|
107386
107491
|
}
|
|
107387
107492
|
}
|
|
107388
107493
|
// Anything left unhandled is an error, so this should be unreachable
|
|
107389
|
-
return ts.Debug.assertNever(input, "Unhandled top-level node in declaration emit: "
|
|
107494
|
+
return ts.Debug.assertNever(input, "Unhandled top-level node in declaration emit: ".concat(ts.SyntaxKind[input.kind]));
|
|
107390
107495
|
function cleanup(node) {
|
|
107391
107496
|
if (isEnclosingDeclaration(input)) {
|
|
107392
107497
|
enclosingDeclaration = previousEnclosingDeclaration;
|
|
@@ -108278,13 +108383,13 @@ var ts;
|
|
|
108278
108383
|
if (ts.fileExtensionIs(inputFileName, ".json" /* Json */))
|
|
108279
108384
|
return;
|
|
108280
108385
|
if (js && configFile.options.sourceMap) {
|
|
108281
|
-
addOutput(js
|
|
108386
|
+
addOutput("".concat(js, ".map"));
|
|
108282
108387
|
}
|
|
108283
108388
|
if (ts.getEmitDeclarations(configFile.options)) {
|
|
108284
108389
|
var dts = getOutputDeclarationFileName(inputFileName, configFile, ignoreCase, getCommonSourceDirectory);
|
|
108285
108390
|
addOutput(dts);
|
|
108286
108391
|
if (configFile.options.declarationMap) {
|
|
108287
|
-
addOutput(dts
|
|
108392
|
+
addOutput("".concat(dts, ".map"));
|
|
108288
108393
|
}
|
|
108289
108394
|
}
|
|
108290
108395
|
}
|
|
@@ -108353,7 +108458,7 @@ var ts;
|
|
|
108353
108458
|
function getFirstProjectOutput(configFile, ignoreCase) {
|
|
108354
108459
|
if (ts.outFile(configFile.options)) {
|
|
108355
108460
|
var jsFilePath = getOutputPathsForBundle(configFile.options, /*forceDtsPaths*/ false).jsFilePath;
|
|
108356
|
-
return ts.Debug.checkDefined(jsFilePath, "project "
|
|
108461
|
+
return ts.Debug.checkDefined(jsFilePath, "project ".concat(configFile.options.configFilePath, " expected to have at least one output"));
|
|
108357
108462
|
}
|
|
108358
108463
|
var getCommonSourceDirectory = ts.memoize(function () { return getCommonSourceDirectoryOfConfig(configFile, ignoreCase); });
|
|
108359
108464
|
for (var _a = 0, _b = configFile.fileNames; _a < _b.length; _a++) {
|
|
@@ -108372,7 +108477,7 @@ var ts;
|
|
|
108372
108477
|
var buildInfoPath = getTsBuildInfoEmitOutputFilePath(configFile.options);
|
|
108373
108478
|
if (buildInfoPath)
|
|
108374
108479
|
return buildInfoPath;
|
|
108375
|
-
return ts.Debug.fail("project "
|
|
108480
|
+
return ts.Debug.fail("project ".concat(configFile.options.configFilePath, " expected to have at least one output"));
|
|
108376
108481
|
}
|
|
108377
108482
|
ts.getFirstProjectOutput = getFirstProjectOutput;
|
|
108378
108483
|
/*@internal*/
|
|
@@ -108598,7 +108703,7 @@ var ts;
|
|
|
108598
108703
|
if (sourceMappingURL) {
|
|
108599
108704
|
if (!writer.isAtStartOfLine())
|
|
108600
108705
|
writer.rawWrite(newLine);
|
|
108601
|
-
writer.writeComment("//# "
|
|
108706
|
+
writer.writeComment("//# ".concat("sourceMappingURL", "=").concat(sourceMappingURL)); // Tools can sometimes see this line as a source mapping url comment
|
|
108602
108707
|
}
|
|
108603
108708
|
// Write the source map
|
|
108604
108709
|
if (sourceMapFilePath) {
|
|
@@ -108647,7 +108752,7 @@ var ts;
|
|
|
108647
108752
|
// Encode the sourceMap into the sourceMap url
|
|
108648
108753
|
var sourceMapText = sourceMapGenerator.toString();
|
|
108649
108754
|
var base64SourceMapText = ts.base64encode(ts.sys, sourceMapText);
|
|
108650
|
-
return "data:application/json;base64,"
|
|
108755
|
+
return "data:application/json;base64,".concat(base64SourceMapText);
|
|
108651
108756
|
}
|
|
108652
108757
|
var sourceMapFile = ts.getBaseFileName(ts.normalizeSlashes(ts.Debug.checkDefined(sourceMapFilePath)));
|
|
108653
108758
|
if (mapOptions.mapRoot) {
|
|
@@ -108827,7 +108932,7 @@ var ts;
|
|
|
108827
108932
|
return;
|
|
108828
108933
|
break;
|
|
108829
108934
|
default:
|
|
108830
|
-
ts.Debug.fail("Unexpected path: "
|
|
108935
|
+
ts.Debug.fail("Unexpected path: ".concat(name));
|
|
108831
108936
|
}
|
|
108832
108937
|
outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark });
|
|
108833
108938
|
},
|
|
@@ -109687,7 +109792,7 @@ var ts;
|
|
|
109687
109792
|
return writeTokenNode(node, writeKeyword);
|
|
109688
109793
|
if (ts.isTokenKind(node.kind))
|
|
109689
109794
|
return writeTokenNode(node, writePunctuation);
|
|
109690
|
-
ts.Debug.fail("Unhandled SyntaxKind: "
|
|
109795
|
+
ts.Debug.fail("Unhandled SyntaxKind: ".concat(ts.Debug.formatSyntaxKind(node.kind), "."));
|
|
109691
109796
|
}
|
|
109692
109797
|
function emitMappedTypeParameter(node) {
|
|
109693
109798
|
emit(node.name);
|
|
@@ -109857,16 +109962,16 @@ var ts;
|
|
|
109857
109962
|
}
|
|
109858
109963
|
}
|
|
109859
109964
|
function emitPlaceholder(hint, node, snippet) {
|
|
109860
|
-
nonEscapingWrite("${"
|
|
109965
|
+
nonEscapingWrite("${".concat(snippet.order, ":")); // `${2:`
|
|
109861
109966
|
pipelineEmitWithHintWorker(hint, node, /*allowSnippets*/ false); // `...`
|
|
109862
109967
|
nonEscapingWrite("}"); // `}`
|
|
109863
109968
|
// `${2:...}`
|
|
109864
109969
|
}
|
|
109865
109970
|
function emitTabStop(hint, node, snippet) {
|
|
109866
109971
|
// A tab stop should only be attached to an empty node, i.e. a node that doesn't emit any text.
|
|
109867
|
-
ts.Debug.assert(node.kind === 235 /* EmptyStatement */, "A tab stop cannot be attached to a node of kind "
|
|
109972
|
+
ts.Debug.assert(node.kind === 235 /* EmptyStatement */, "A tab stop cannot be attached to a node of kind ".concat(ts.Debug.formatSyntaxKind(node.kind), "."));
|
|
109868
109973
|
ts.Debug.assert(hint !== 5 /* EmbeddedStatement */, "A tab stop cannot be attached to an embedded statement.");
|
|
109869
|
-
nonEscapingWrite("$"
|
|
109974
|
+
nonEscapingWrite("$".concat(snippet.order));
|
|
109870
109975
|
}
|
|
109871
109976
|
//
|
|
109872
109977
|
// Identifiers
|
|
@@ -111628,17 +111733,17 @@ var ts;
|
|
|
111628
111733
|
writeLine();
|
|
111629
111734
|
}
|
|
111630
111735
|
if (currentSourceFile && currentSourceFile.moduleName) {
|
|
111631
|
-
writeComment("/// <amd-module name=\""
|
|
111736
|
+
writeComment("/// <amd-module name=\"".concat(currentSourceFile.moduleName, "\" />"));
|
|
111632
111737
|
writeLine();
|
|
111633
111738
|
}
|
|
111634
111739
|
if (currentSourceFile && currentSourceFile.amdDependencies) {
|
|
111635
111740
|
for (var _a = 0, _b = currentSourceFile.amdDependencies; _a < _b.length; _a++) {
|
|
111636
111741
|
var dep = _b[_a];
|
|
111637
111742
|
if (dep.name) {
|
|
111638
|
-
writeComment("/// <amd-dependency name=\""
|
|
111743
|
+
writeComment("/// <amd-dependency name=\"".concat(dep.name, "\" path=\"").concat(dep.path, "\" />"));
|
|
111639
111744
|
}
|
|
111640
111745
|
else {
|
|
111641
|
-
writeComment("/// <amd-dependency path=\""
|
|
111746
|
+
writeComment("/// <amd-dependency path=\"".concat(dep.path, "\" />"));
|
|
111642
111747
|
}
|
|
111643
111748
|
writeLine();
|
|
111644
111749
|
}
|
|
@@ -111646,7 +111751,7 @@ var ts;
|
|
|
111646
111751
|
for (var _c = 0, files_2 = files; _c < files_2.length; _c++) {
|
|
111647
111752
|
var directive = files_2[_c];
|
|
111648
111753
|
var pos = writer.getTextPos();
|
|
111649
|
-
writeComment("/// <reference path=\""
|
|
111754
|
+
writeComment("/// <reference path=\"".concat(directive.fileName, "\" />"));
|
|
111650
111755
|
if (bundleFileInfo)
|
|
111651
111756
|
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "reference" /* Reference */, data: directive.fileName });
|
|
111652
111757
|
writeLine();
|
|
@@ -111654,7 +111759,7 @@ var ts;
|
|
|
111654
111759
|
for (var _d = 0, types_24 = types; _d < types_24.length; _d++) {
|
|
111655
111760
|
var directive = types_24[_d];
|
|
111656
111761
|
var pos = writer.getTextPos();
|
|
111657
|
-
writeComment("/// <reference types=\""
|
|
111762
|
+
writeComment("/// <reference types=\"".concat(directive.fileName, "\" />"));
|
|
111658
111763
|
if (bundleFileInfo)
|
|
111659
111764
|
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "type" /* Type */, data: directive.fileName });
|
|
111660
111765
|
writeLine();
|
|
@@ -111662,7 +111767,7 @@ var ts;
|
|
|
111662
111767
|
for (var _e = 0, libs_1 = libs; _e < libs_1.length; _e++) {
|
|
111663
111768
|
var directive = libs_1[_e];
|
|
111664
111769
|
var pos = writer.getTextPos();
|
|
111665
|
-
writeComment("/// <reference lib=\""
|
|
111770
|
+
writeComment("/// <reference lib=\"".concat(directive.fileName, "\" />"));
|
|
111666
111771
|
if (bundleFileInfo)
|
|
111667
111772
|
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "lib" /* Lib */, data: directive.fileName });
|
|
111668
111773
|
writeLine();
|
|
@@ -112442,9 +112547,9 @@ var ts;
|
|
|
112442
112547
|
var textSourceNode = node.textSourceNode;
|
|
112443
112548
|
if (ts.isIdentifier(textSourceNode) || ts.isNumericLiteral(textSourceNode)) {
|
|
112444
112549
|
var text = ts.isNumericLiteral(textSourceNode) ? textSourceNode.text : getTextOfNode(textSourceNode);
|
|
112445
|
-
return jsxAttributeEscape ? "\""
|
|
112446
|
-
neverAsciiEscape || (ts.getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? "\""
|
|
112447
|
-
"\""
|
|
112550
|
+
return jsxAttributeEscape ? "\"".concat(ts.escapeJsxAttributeString(text), "\"") :
|
|
112551
|
+
neverAsciiEscape || (ts.getEmitFlags(node) & 16777216 /* NoAsciiEscaping */) ? "\"".concat(ts.escapeString(text), "\"") :
|
|
112552
|
+
"\"".concat(ts.escapeNonAsciiString(text), "\"");
|
|
112448
112553
|
}
|
|
112449
112554
|
else {
|
|
112450
112555
|
return getLiteralTextOfNode(textSourceNode, neverAsciiEscape, jsxAttributeEscape);
|
|
@@ -112921,8 +113026,8 @@ var ts;
|
|
|
112921
113026
|
}
|
|
112922
113027
|
function formatSynthesizedComment(comment) {
|
|
112923
113028
|
return comment.kind === 3 /* MultiLineCommentTrivia */
|
|
112924
|
-
? "/*"
|
|
112925
|
-
: "//"
|
|
113029
|
+
? "/*".concat(comment.text, "*/")
|
|
113030
|
+
: "//".concat(comment.text);
|
|
112926
113031
|
}
|
|
112927
113032
|
function emitBodyWithDetachedComments(node, detachedRange, emitCallback) {
|
|
112928
113033
|
enterComment();
|
|
@@ -113643,7 +113748,7 @@ var ts;
|
|
|
113643
113748
|
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;
|
|
113644
113749
|
var newPath = ts.removeIgnoredPath(fileOrDirectoryPath);
|
|
113645
113750
|
if (!newPath) {
|
|
113646
|
-
writeLog("Project: "
|
|
113751
|
+
writeLog("Project: ".concat(configFileName, " Detected ignored path: ").concat(fileOrDirectory));
|
|
113647
113752
|
return true;
|
|
113648
113753
|
}
|
|
113649
113754
|
fileOrDirectoryPath = newPath;
|
|
@@ -113652,11 +113757,11 @@ var ts;
|
|
|
113652
113757
|
// If the the added or created file or directory is not supported file name, ignore the file
|
|
113653
113758
|
// But when watched directory is added/removed, we need to reload the file list
|
|
113654
113759
|
if (ts.hasExtension(fileOrDirectoryPath) && !ts.isSupportedSourceFileName(fileOrDirectory, options, extraFileExtensions)) {
|
|
113655
|
-
writeLog("Project: "
|
|
113760
|
+
writeLog("Project: ".concat(configFileName, " Detected file add/remove of non supported extension: ").concat(fileOrDirectory));
|
|
113656
113761
|
return true;
|
|
113657
113762
|
}
|
|
113658
113763
|
if (ts.isExcludedFile(fileOrDirectory, options.configFile.configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), useCaseSensitiveFileNames, currentDirectory)) {
|
|
113659
|
-
writeLog("Project: "
|
|
113764
|
+
writeLog("Project: ".concat(configFileName, " Detected excluded file: ").concat(fileOrDirectory));
|
|
113660
113765
|
return true;
|
|
113661
113766
|
}
|
|
113662
113767
|
if (!program)
|
|
@@ -113680,7 +113785,7 @@ var ts;
|
|
|
113680
113785
|
var builderProgram = !realProgram && !ts.isArray(program) ? program : undefined;
|
|
113681
113786
|
if (hasSourceFile((filePathWithoutExtension + ".ts" /* Ts */)) ||
|
|
113682
113787
|
hasSourceFile((filePathWithoutExtension + ".tsx" /* Tsx */))) {
|
|
113683
|
-
writeLog("Project: "
|
|
113788
|
+
writeLog("Project: ".concat(configFileName, " Detected output file: ").concat(fileOrDirectory));
|
|
113684
113789
|
return true;
|
|
113685
113790
|
}
|
|
113686
113791
|
return false;
|
|
@@ -113748,36 +113853,36 @@ var ts;
|
|
|
113748
113853
|
host.useCaseSensitiveFileNames();
|
|
113749
113854
|
}
|
|
113750
113855
|
function createExcludeWatcherWithLogging(file, flags, options, detailInfo1, detailInfo2) {
|
|
113751
|
-
log("ExcludeWatcher:: Added:: "
|
|
113856
|
+
log("ExcludeWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
|
|
113752
113857
|
return {
|
|
113753
|
-
close: function () { return log("ExcludeWatcher:: Close:: "
|
|
113858
|
+
close: function () { return log("ExcludeWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo))); }
|
|
113754
113859
|
};
|
|
113755
113860
|
}
|
|
113756
113861
|
function createFileWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) {
|
|
113757
|
-
log("FileWatcher:: Added:: "
|
|
113862
|
+
log("FileWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
|
|
113758
113863
|
var watcher = triggerInvokingFactory.watchFile(file, cb, flags, options, detailInfo1, detailInfo2);
|
|
113759
113864
|
return {
|
|
113760
113865
|
close: function () {
|
|
113761
|
-
log("FileWatcher:: Close:: "
|
|
113866
|
+
log("FileWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo)));
|
|
113762
113867
|
watcher.close();
|
|
113763
113868
|
}
|
|
113764
113869
|
};
|
|
113765
113870
|
}
|
|
113766
113871
|
function createDirectoryWatcherWithLogging(file, cb, flags, options, detailInfo1, detailInfo2) {
|
|
113767
|
-
var watchInfo = "DirectoryWatcher:: Added:: "
|
|
113872
|
+
var watchInfo = "DirectoryWatcher:: Added:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
|
|
113768
113873
|
log(watchInfo);
|
|
113769
113874
|
var start = ts.timestamp();
|
|
113770
113875
|
var watcher = triggerInvokingFactory.watchDirectory(file, cb, flags, options, detailInfo1, detailInfo2);
|
|
113771
113876
|
var elapsed = ts.timestamp() - start;
|
|
113772
|
-
log("Elapsed:: "
|
|
113877
|
+
log("Elapsed:: ".concat(elapsed, "ms ").concat(watchInfo));
|
|
113773
113878
|
return {
|
|
113774
113879
|
close: function () {
|
|
113775
|
-
var watchInfo = "DirectoryWatcher:: Close:: "
|
|
113880
|
+
var watchInfo = "DirectoryWatcher:: Close:: ".concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
|
|
113776
113881
|
log(watchInfo);
|
|
113777
113882
|
var start = ts.timestamp();
|
|
113778
113883
|
watcher.close();
|
|
113779
113884
|
var elapsed = ts.timestamp() - start;
|
|
113780
|
-
log("Elapsed:: "
|
|
113885
|
+
log("Elapsed:: ".concat(elapsed, "ms ").concat(watchInfo));
|
|
113781
113886
|
}
|
|
113782
113887
|
};
|
|
113783
113888
|
}
|
|
@@ -113787,16 +113892,16 @@ var ts;
|
|
|
113787
113892
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
113788
113893
|
args[_i] = arguments[_i];
|
|
113789
113894
|
}
|
|
113790
|
-
var triggerredInfo = (key === "watchFile" ? "FileWatcher" : "DirectoryWatcher"
|
|
113895
|
+
var triggerredInfo = "".concat(key === "watchFile" ? "FileWatcher" : "DirectoryWatcher", ":: Triggered with ").concat(args[0], " ").concat(args[1] !== undefined ? args[1] : "", ":: ").concat(getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo));
|
|
113791
113896
|
log(triggerredInfo);
|
|
113792
113897
|
var start = ts.timestamp();
|
|
113793
113898
|
cb.call.apply(cb, __spreadArray([/*thisArg*/ undefined], args, false));
|
|
113794
113899
|
var elapsed = ts.timestamp() - start;
|
|
113795
|
-
log("Elapsed:: "
|
|
113900
|
+
log("Elapsed:: ".concat(elapsed, "ms ").concat(triggerredInfo));
|
|
113796
113901
|
}, flags, options, detailInfo1, detailInfo2); };
|
|
113797
113902
|
}
|
|
113798
113903
|
function getWatchInfo(file, flags, options, detailInfo1, detailInfo2, getDetailWatchInfo) {
|
|
113799
|
-
return "WatchInfo: "
|
|
113904
|
+
return "WatchInfo: ".concat(file, " ").concat(flags, " ").concat(JSON.stringify(options), " ").concat(getDetailWatchInfo ? getDetailWatchInfo(detailInfo1, detailInfo2) : detailInfo2 === undefined ? detailInfo1 : "".concat(detailInfo1, " ").concat(detailInfo2));
|
|
113800
113905
|
}
|
|
113801
113906
|
}
|
|
113802
113907
|
ts.getWatchFactory = getWatchFactory;
|
|
@@ -114103,12 +114208,12 @@ var ts;
|
|
|
114103
114208
|
}
|
|
114104
114209
|
ts.formatDiagnostics = formatDiagnostics;
|
|
114105
114210
|
function formatDiagnostic(diagnostic, host) {
|
|
114106
|
-
var errorMessage = ts.diagnosticCategoryName(diagnostic)
|
|
114211
|
+
var errorMessage = "".concat(ts.diagnosticCategoryName(diagnostic), " TS").concat(diagnostic.code, ": ").concat(flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine())).concat(host.getNewLine());
|
|
114107
114212
|
if (diagnostic.file) {
|
|
114108
114213
|
var _a = ts.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start), line = _a.line, character = _a.character; // TODO: GH#18217
|
|
114109
114214
|
var fileName = diagnostic.file.fileName;
|
|
114110
114215
|
var relativeFileName = ts.convertToRelativePath(fileName, host.getCurrentDirectory(), function (fileName) { return host.getCanonicalFileName(fileName); });
|
|
114111
|
-
return relativeFileName
|
|
114216
|
+
return "".concat(relativeFileName, "(").concat(line + 1, ",").concat(character + 1, "): ") + errorMessage;
|
|
114112
114217
|
}
|
|
114113
114218
|
return errorMessage;
|
|
114114
114219
|
}
|
|
@@ -114196,9 +114301,9 @@ var ts;
|
|
|
114196
114301
|
var output = "";
|
|
114197
114302
|
output += color(relativeFileName, ForegroundColorEscapeSequences.Cyan);
|
|
114198
114303
|
output += ":";
|
|
114199
|
-
output += color(""
|
|
114304
|
+
output += color("".concat(firstLine + 1), ForegroundColorEscapeSequences.Yellow);
|
|
114200
114305
|
output += ":";
|
|
114201
|
-
output += color(""
|
|
114306
|
+
output += color("".concat(firstLineChar + 1), ForegroundColorEscapeSequences.Yellow);
|
|
114202
114307
|
return output;
|
|
114203
114308
|
}
|
|
114204
114309
|
ts.formatLocation = formatLocation;
|
|
@@ -114212,7 +114317,7 @@ var ts;
|
|
|
114212
114317
|
output += " - ";
|
|
114213
114318
|
}
|
|
114214
114319
|
output += formatColorAndReset(ts.diagnosticCategoryName(diagnostic), getCategoryFormat(diagnostic.category));
|
|
114215
|
-
output += formatColorAndReset(" TS"
|
|
114320
|
+
output += formatColorAndReset(" TS".concat(diagnostic.code, ": "), ForegroundColorEscapeSequences.Grey);
|
|
114216
114321
|
output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine());
|
|
114217
114322
|
if (diagnostic.file) {
|
|
114218
114323
|
output += host.getNewLine();
|
|
@@ -114321,7 +114426,7 @@ var ts;
|
|
|
114321
114426
|
var result = void 0;
|
|
114322
114427
|
var mode = getModeForResolutionAtIndex(containingFile, i);
|
|
114323
114428
|
i++;
|
|
114324
|
-
var cacheKey = mode !== undefined ? mode
|
|
114429
|
+
var cacheKey = mode !== undefined ? "".concat(mode, "|").concat(name) : name;
|
|
114325
114430
|
if (cache.has(cacheKey)) {
|
|
114326
114431
|
result = cache.get(cacheKey);
|
|
114327
114432
|
}
|
|
@@ -114559,9 +114664,9 @@ var ts;
|
|
|
114559
114664
|
ts.Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block.code,
|
|
114560
114665
|
ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter.code,
|
|
114561
114666
|
ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter.code,
|
|
114562
|
-
ts.Diagnostics.
|
|
114667
|
+
ts.Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_module.code,
|
|
114563
114668
|
ts.Diagnostics.An_export_declaration_cannot_have_modifiers.code,
|
|
114564
|
-
ts.Diagnostics.
|
|
114669
|
+
ts.Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module.code,
|
|
114565
114670
|
ts.Diagnostics.An_import_declaration_cannot_have_modifiers.code,
|
|
114566
114671
|
ts.Diagnostics.An_object_member_cannot_be_declared_optional.code,
|
|
114567
114672
|
ts.Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element.code,
|
|
@@ -115629,7 +115734,7 @@ var ts;
|
|
|
115629
115734
|
ts.Debug.assert(!!sourceFile.bindDiagnostics);
|
|
115630
115735
|
var isJs = sourceFile.scriptKind === 1 /* JS */ || sourceFile.scriptKind === 2 /* JSX */;
|
|
115631
115736
|
var isCheckJs = isJs && ts.isCheckJsEnabledForFile(sourceFile, options);
|
|
115632
|
-
var isPlainJs =
|
|
115737
|
+
var isPlainJs = ts.isPlainJsFile(sourceFile, options.checkJs);
|
|
115633
115738
|
var isTsNoCheck = !!sourceFile.checkJsDirective && sourceFile.checkJsDirective.enabled === false;
|
|
115634
115739
|
// By default, only type-check .ts, .tsx, Deferred, plain JS, checked JS and External
|
|
115635
115740
|
// - plain JS: .js files with no // ts-check and checkJs: undefined
|
|
@@ -116510,7 +116615,7 @@ var ts;
|
|
|
116510
116615
|
path += (i === 2 ? "/" : "-") + components[i];
|
|
116511
116616
|
i++;
|
|
116512
116617
|
}
|
|
116513
|
-
var resolveFrom = ts.combinePaths(currentDirectory, "__lib_node_modules_lookup_"
|
|
116618
|
+
var resolveFrom = ts.combinePaths(currentDirectory, "__lib_node_modules_lookup_".concat(libFileName, "__.ts"));
|
|
116514
116619
|
var localOverrideModuleResult = ts.resolveModuleName("@typescript/lib-" + path, resolveFrom, { moduleResolution: ts.ModuleResolutionKind.NodeJs }, host, moduleResolutionCache);
|
|
116515
116620
|
if (localOverrideModuleResult === null || localOverrideModuleResult === void 0 ? void 0 : localOverrideModuleResult.resolvedModule) {
|
|
116516
116621
|
return localOverrideModuleResult.resolvedModule.resolvedFileName;
|
|
@@ -117331,12 +117436,12 @@ var ts;
|
|
|
117331
117436
|
}
|
|
117332
117437
|
function directoryExistsIfProjectReferenceDeclDir(dir) {
|
|
117333
117438
|
var dirPath = host.toPath(dir);
|
|
117334
|
-
var dirPathWithTrailingDirectorySeparator = ""
|
|
117439
|
+
var dirPathWithTrailingDirectorySeparator = "".concat(dirPath).concat(ts.directorySeparator);
|
|
117335
117440
|
return ts.forEachKey(setOfDeclarationDirectories, function (declDirPath) { return dirPath === declDirPath ||
|
|
117336
117441
|
// Any parent directory of declaration dir
|
|
117337
117442
|
ts.startsWith(declDirPath, dirPathWithTrailingDirectorySeparator) ||
|
|
117338
117443
|
// Any directory inside declaration dir
|
|
117339
|
-
ts.startsWith(dirPath, declDirPath
|
|
117444
|
+
ts.startsWith(dirPath, "".concat(declDirPath, "/")); });
|
|
117340
117445
|
}
|
|
117341
117446
|
function handleDirectoryCouldBeSymlink(directory) {
|
|
117342
117447
|
var _a;
|
|
@@ -117389,7 +117494,7 @@ var ts;
|
|
|
117389
117494
|
if (isFile && result) {
|
|
117390
117495
|
// Store the real path for the file'
|
|
117391
117496
|
var absolutePath = ts.getNormalizedAbsolutePath(fileOrDirectory, host.compilerHost.getCurrentDirectory());
|
|
117392
|
-
symlinkCache.setSymlinkedFile(fileOrDirectoryPath, ""
|
|
117497
|
+
symlinkCache.setSymlinkedFile(fileOrDirectoryPath, "".concat(symlinkedDirectory.real).concat(absolutePath.replace(new RegExp(directoryPath, "i"), "")));
|
|
117393
117498
|
}
|
|
117394
117499
|
return result;
|
|
117395
117500
|
}) || false;
|
|
@@ -117847,7 +117952,7 @@ var ts;
|
|
|
117847
117952
|
/*forceDtsEmit*/ true);
|
|
117848
117953
|
var firstDts_1 = ts.firstOrUndefined(emitOutput_1.outputFiles);
|
|
117849
117954
|
if (firstDts_1) {
|
|
117850
|
-
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: "
|
|
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: ".concat(ts.getAnyExtensionFromPath(firstDts_1.name), " for ").concat(firstDts_1.name, ":: All output files: ").concat(JSON.stringify(emitOutput_1.outputFiles.map(function (f) { return f.name; }))); });
|
|
117851
117956
|
latestSignature = (computeHash || ts.generateDjb2Hash)(firstDts_1.text);
|
|
117852
117957
|
if (exportedModulesMapCache && latestSignature !== prevSignature) {
|
|
117853
117958
|
updateExportedModules(sourceFile, emitOutput_1.exportedModulesFromDeclarationEmit, exportedModulesMapCache);
|
|
@@ -118355,7 +118460,7 @@ var ts;
|
|
|
118355
118460
|
return;
|
|
118356
118461
|
}
|
|
118357
118462
|
else {
|
|
118358
|
-
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: "
|
|
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: ".concat(affectedFile.fileName));
|
|
118359
118464
|
}
|
|
118360
118465
|
if (!state.compilerOptions.assumeChangesOnlyAffectDirectDependencies) {
|
|
118361
118466
|
forEachReferencingModulesOfExportOfAffectedFile(state, affectedFile, function (state, path) { return handleDtsMayChangeOf(state, path, cancellationToken, computeHash); });
|
|
@@ -119500,7 +119605,7 @@ var ts;
|
|
|
119500
119605
|
failedLookupLocation = ts.isRootedDiskPath(failedLookupLocation) ? ts.normalizePath(failedLookupLocation) : ts.getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory());
|
|
119501
119606
|
var failedLookupPathSplit = failedLookupLocationPath.split(ts.directorySeparator);
|
|
119502
119607
|
var failedLookupSplit = failedLookupLocation.split(ts.directorySeparator);
|
|
119503
|
-
ts.Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, "FailedLookup: "
|
|
119608
|
+
ts.Debug.assert(failedLookupSplit.length === failedLookupPathSplit.length, "FailedLookup: ".concat(failedLookupLocation, " failedLookupLocationPath: ").concat(failedLookupLocationPath));
|
|
119504
119609
|
if (failedLookupPathSplit.length > rootSplitLength + 1) {
|
|
119505
119610
|
// Instead of watching root, watch directory in root to avoid watching excluded directories not needed for module resolution
|
|
119506
119611
|
return {
|
|
@@ -120582,7 +120687,7 @@ var ts;
|
|
|
120582
120687
|
}
|
|
120583
120688
|
function getJSExtensionForFile(fileName, options) {
|
|
120584
120689
|
var _a;
|
|
120585
|
-
return (_a = tryGetJSExtensionForFile(fileName, options)) !== null && _a !== void 0 ? _a : ts.Debug.fail("Extension "
|
|
120690
|
+
return (_a = tryGetJSExtensionForFile(fileName, options)) !== null && _a !== void 0 ? _a : ts.Debug.fail("Extension ".concat(ts.extensionFromPath(fileName), " is unsupported:: FileName:: ").concat(fileName));
|
|
120586
120691
|
}
|
|
120587
120692
|
function tryGetJSExtensionForFile(fileName, options) {
|
|
120588
120693
|
var ext = ts.tryGetExtensionFromPath(fileName);
|
|
@@ -120685,8 +120790,8 @@ var ts;
|
|
|
120685
120790
|
return pretty ?
|
|
120686
120791
|
function (diagnostic, newLine, options) {
|
|
120687
120792
|
clearScreenIfNotWatchingForFileChanges(system, diagnostic, options);
|
|
120688
|
-
var output = "["
|
|
120689
|
-
output += ""
|
|
120793
|
+
var output = "[".concat(ts.formatColorAndReset(getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey), "] ");
|
|
120794
|
+
output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(newLine + newLine);
|
|
120690
120795
|
system.write(output);
|
|
120691
120796
|
} :
|
|
120692
120797
|
function (diagnostic, newLine, options) {
|
|
@@ -120694,8 +120799,8 @@ var ts;
|
|
|
120694
120799
|
if (!clearScreenIfNotWatchingForFileChanges(system, diagnostic, options)) {
|
|
120695
120800
|
output += newLine;
|
|
120696
120801
|
}
|
|
120697
|
-
output += getLocaleTimeString(system)
|
|
120698
|
-
output += ""
|
|
120802
|
+
output += "".concat(getLocaleTimeString(system), " - ");
|
|
120803
|
+
output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(getPlainDiagnosticFollowingNewLines(diagnostic, newLine));
|
|
120699
120804
|
system.write(output);
|
|
120700
120805
|
};
|
|
120701
120806
|
}
|
|
@@ -120718,7 +120823,7 @@ var ts;
|
|
|
120718
120823
|
.map(function (errorDiagnostic) {
|
|
120719
120824
|
if (errorDiagnostic.file === undefined)
|
|
120720
120825
|
return;
|
|
120721
|
-
return ""
|
|
120826
|
+
return "".concat(errorDiagnostic.file.fileName);
|
|
120722
120827
|
});
|
|
120723
120828
|
return filesInError.map(function (fileName) {
|
|
120724
120829
|
var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
|
|
@@ -120751,7 +120856,7 @@ var ts;
|
|
|
120751
120856
|
if (errorCount === 0)
|
|
120752
120857
|
return "";
|
|
120753
120858
|
var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
|
|
120754
|
-
var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName
|
|
120859
|
+
var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return "".concat(fileInError.fileName, ":").concat(fileInError.line); })
|
|
120755
120860
|
.filter(function (value, index, self) { return self.indexOf(value) === index; });
|
|
120756
120861
|
var firstFileReference = nonNilFiles[0] && prettyPathForFileError(nonNilFiles[0], host.getCurrentDirectory());
|
|
120757
120862
|
var d = errorCount === 1 ?
|
|
@@ -120764,7 +120869,7 @@ var ts;
|
|
|
120764
120869
|
ts.Diagnostics.Found_0_errors_in_the_same_file_starting_at_Colon_1 :
|
|
120765
120870
|
ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length === 1 ? firstFileReference : distinctFileNamesWithLines.length);
|
|
120766
120871
|
var suffix = distinctFileNamesWithLines.length > 1 ? createTabularErrorsDisplay(nonNilFiles, host) : "";
|
|
120767
|
-
return ""
|
|
120872
|
+
return "".concat(newLine).concat(ts.flattenDiagnosticMessageText(d.messageText, newLine)).concat(newLine).concat(newLine).concat(suffix);
|
|
120768
120873
|
}
|
|
120769
120874
|
ts.getErrorSummaryText = getErrorSummaryText;
|
|
120770
120875
|
function createTabularErrorsDisplay(filesInError, host) {
|
|
@@ -120787,7 +120892,7 @@ var ts;
|
|
|
120787
120892
|
" ".repeat(leftPaddingGoal - errorCountDigitsLength)
|
|
120788
120893
|
: "";
|
|
120789
120894
|
var fileRef = prettyPathForFileError(file, host.getCurrentDirectory());
|
|
120790
|
-
tabularData += ""
|
|
120895
|
+
tabularData += "".concat(leftPadding).concat(errorCount, " ").concat(fileRef, "\n");
|
|
120791
120896
|
});
|
|
120792
120897
|
return tabularData;
|
|
120793
120898
|
}
|
|
@@ -120814,9 +120919,9 @@ var ts;
|
|
|
120814
120919
|
var relativeFileName = function (fileName) { return ts.convertToRelativePath(fileName, program.getCurrentDirectory(), getCanonicalFileName); };
|
|
120815
120920
|
for (var _i = 0, _c = program.getSourceFiles(); _i < _c.length; _i++) {
|
|
120816
120921
|
var file = _c[_i];
|
|
120817
|
-
write(""
|
|
120818
|
-
(_a = reasons.get(file.path)) === null || _a === void 0 ? void 0 : _a.forEach(function (reason) { return write(" "
|
|
120819
|
-
(_b = explainIfFileIsRedirect(file, relativeFileName)) === null || _b === void 0 ? void 0 : _b.forEach(function (d) { return write(" "
|
|
120922
|
+
write("".concat(toFileName(file, relativeFileName)));
|
|
120923
|
+
(_a = reasons.get(file.path)) === null || _a === void 0 ? void 0 : _a.forEach(function (reason) { return write(" ".concat(fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText)); });
|
|
120924
|
+
(_b = explainIfFileIsRedirect(file, relativeFileName)) === null || _b === void 0 ? void 0 : _b.forEach(function (d) { return write(" ".concat(d.messageText)); });
|
|
120820
120925
|
}
|
|
120821
120926
|
}
|
|
120822
120927
|
ts.explainFiles = explainFiles;
|
|
@@ -120856,7 +120961,7 @@ var ts;
|
|
|
120856
120961
|
if (isJsonFile && !ts.endsWith(includeSpec, ".json" /* Json */))
|
|
120857
120962
|
return false;
|
|
120858
120963
|
var pattern = ts.getPatternFromSpec(includeSpec, basePath, "files");
|
|
120859
|
-
return !!pattern && ts.getRegexFromPattern("("
|
|
120964
|
+
return !!pattern && ts.getRegexFromPattern("(".concat(pattern, ")$"), useCaseSensitiveFileNames).test(fileName);
|
|
120860
120965
|
});
|
|
120861
120966
|
}
|
|
120862
120967
|
ts.getMatchedIncludeSpec = getMatchedIncludeSpec;
|
|
@@ -120865,7 +120970,7 @@ var ts;
|
|
|
120865
120970
|
var options = program.getCompilerOptions();
|
|
120866
120971
|
if (ts.isReferencedFile(reason)) {
|
|
120867
120972
|
var referenceLocation = ts.getReferencedFileLocation(function (path) { return program.getSourceFileByPath(path); }, reason);
|
|
120868
|
-
var referenceText = ts.isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : "\""
|
|
120973
|
+
var referenceText = ts.isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : "\"".concat(referenceLocation.text, "\"");
|
|
120869
120974
|
var message = void 0;
|
|
120870
120975
|
ts.Debug.assert(ts.isReferenceFileLocation(referenceLocation) || reason.kind === ts.FileIncludeKind.Import, "Only synthetic references are imports");
|
|
120871
120976
|
switch (reason.kind) {
|
|
@@ -120989,7 +121094,7 @@ var ts;
|
|
|
120989
121094
|
var currentDir_1 = program.getCurrentDirectory();
|
|
120990
121095
|
ts.forEach(emittedFiles, function (file) {
|
|
120991
121096
|
var filepath = ts.getNormalizedAbsolutePath(file, currentDir_1);
|
|
120992
|
-
write("TSFILE: "
|
|
121097
|
+
write("TSFILE: ".concat(filepath));
|
|
120993
121098
|
});
|
|
120994
121099
|
listFiles(program, write);
|
|
120995
121100
|
}
|
|
@@ -121318,7 +121423,7 @@ var ts;
|
|
|
121318
121423
|
}
|
|
121319
121424
|
var _b = ts.createWatchFactory(host, compilerOptions), watchFile = _b.watchFile, watchDirectory = _b.watchDirectory, writeLog = _b.writeLog;
|
|
121320
121425
|
var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
|
|
121321
|
-
writeLog("Current directory: "
|
|
121426
|
+
writeLog("Current directory: ".concat(currentDirectory, " CaseSensitiveFileNames: ").concat(useCaseSensitiveFileNames));
|
|
121322
121427
|
var configFileWatcher;
|
|
121323
121428
|
if (configFileName) {
|
|
121324
121429
|
configFileWatcher = watchFile(configFileName, scheduleProgramReload, ts.PollingInterval.High, watchOptions, ts.WatchType.ConfigFile);
|
|
@@ -121474,10 +121579,10 @@ var ts;
|
|
|
121474
121579
|
function createNewProgram(hasInvalidatedResolution) {
|
|
121475
121580
|
// Compile the program
|
|
121476
121581
|
writeLog("CreatingProgramWith::");
|
|
121477
|
-
writeLog(" roots: "
|
|
121478
|
-
writeLog(" options: "
|
|
121582
|
+
writeLog(" roots: ".concat(JSON.stringify(rootFileNames)));
|
|
121583
|
+
writeLog(" options: ".concat(JSON.stringify(compilerOptions)));
|
|
121479
121584
|
if (projectReferences)
|
|
121480
|
-
writeLog(" projectReferences: "
|
|
121585
|
+
writeLog(" projectReferences: ".concat(JSON.stringify(projectReferences)));
|
|
121481
121586
|
var needsUpdateInTypeRootWatch = hasChangedCompilerOptions || !getCurrentProgram();
|
|
121482
121587
|
hasChangedCompilerOptions = false;
|
|
121483
121588
|
hasChangedConfigFileParsingErrors = false;
|
|
@@ -121638,7 +121743,7 @@ var ts;
|
|
|
121638
121743
|
return resolutionCache.invalidateResolutionsOfFailedLookupLocations();
|
|
121639
121744
|
}
|
|
121640
121745
|
var pending = clearInvalidateResolutionsOfFailedLookupLocations();
|
|
121641
|
-
writeLog("Scheduling invalidateFailedLookup"
|
|
121746
|
+
writeLog("Scheduling invalidateFailedLookup".concat(pending ? ", Cancelled earlier one" : ""));
|
|
121642
121747
|
timerToInvalidateFailedLookupResolutions = host.setTimeout(invalidateResolutionsOfFailedLookup, 250);
|
|
121643
121748
|
}
|
|
121644
121749
|
function invalidateResolutionsOfFailedLookup() {
|
|
@@ -121698,7 +121803,7 @@ var ts;
|
|
|
121698
121803
|
synchronizeProgram();
|
|
121699
121804
|
}
|
|
121700
121805
|
function reloadConfigFile() {
|
|
121701
|
-
writeLog("Reloading config file: "
|
|
121806
|
+
writeLog("Reloading config file: ".concat(configFileName));
|
|
121702
121807
|
reloadLevel = ts.ConfigFileProgramReloadLevel.None;
|
|
121703
121808
|
if (cachedDirectoryStructureHost) {
|
|
121704
121809
|
cachedDirectoryStructureHost.clearCache();
|
|
@@ -121739,7 +121844,7 @@ var ts;
|
|
|
121739
121844
|
return config.parsedCommandLine;
|
|
121740
121845
|
}
|
|
121741
121846
|
}
|
|
121742
|
-
writeLog("Loading config file: "
|
|
121847
|
+
writeLog("Loading config file: ".concat(configFileName));
|
|
121743
121848
|
var parsedCommandLine = host.getParsedCommandLine ?
|
|
121744
121849
|
host.getParsedCommandLine(configFileName) :
|
|
121745
121850
|
getParsedCommandLineFromConfigFileHost(configFileName);
|
|
@@ -122043,8 +122148,8 @@ var ts;
|
|
|
122043
122148
|
*/
|
|
122044
122149
|
function createBuilderStatusReporter(system, pretty) {
|
|
122045
122150
|
return function (diagnostic) {
|
|
122046
|
-
var output = pretty ? "["
|
|
122047
|
-
output += ""
|
|
122151
|
+
var output = pretty ? "[".concat(ts.formatColorAndReset(ts.getLocaleTimeString(system), ts.ForegroundColorEscapeSequences.Grey), "] ") : "".concat(ts.getLocaleTimeString(system), " - ");
|
|
122152
|
+
output += "".concat(ts.flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)).concat(system.newLine + system.newLine);
|
|
122048
122153
|
system.write(output);
|
|
122049
122154
|
};
|
|
122050
122155
|
}
|
|
@@ -122819,7 +122924,7 @@ var ts;
|
|
|
122819
122924
|
function listEmittedFile(_a, proj, file) {
|
|
122820
122925
|
var write = _a.write;
|
|
122821
122926
|
if (write && proj.options.listEmittedFiles) {
|
|
122822
|
-
write("TSFILE: "
|
|
122927
|
+
write("TSFILE: ".concat(file));
|
|
122823
122928
|
}
|
|
122824
122929
|
}
|
|
122825
122930
|
function getOldProgram(_a, proj, parsed) {
|
|
@@ -122848,7 +122953,7 @@ var ts;
|
|
|
122848
122953
|
function buildErrors(state, resolvedPath, program, config, diagnostics, buildResult, errorType) {
|
|
122849
122954
|
var canEmitBuildInfo = !(buildResult & BuildResultFlags.SyntaxErrors) && program && !ts.outFile(program.getCompilerOptions());
|
|
122850
122955
|
reportAndStoreErrors(state, resolvedPath, diagnostics);
|
|
122851
|
-
state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: errorType
|
|
122956
|
+
state.projectStatus.set(resolvedPath, { type: ts.UpToDateStatusType.Unbuildable, reason: "".concat(errorType, " errors") });
|
|
122852
122957
|
if (canEmitBuildInfo)
|
|
122853
122958
|
return { buildResult: buildResult, step: BuildStep.EmitBuildInfo };
|
|
122854
122959
|
afterProgramDone(state, program, config);
|
|
@@ -122876,7 +122981,7 @@ var ts;
|
|
|
122876
122981
|
if (!host.fileExists(inputFile)) {
|
|
122877
122982
|
return {
|
|
122878
122983
|
type: ts.UpToDateStatusType.Unbuildable,
|
|
122879
|
-
reason: inputFile
|
|
122984
|
+
reason: "".concat(inputFile, " does not exist")
|
|
122880
122985
|
};
|
|
122881
122986
|
}
|
|
122882
122987
|
if (!force) {
|
|
@@ -123235,7 +123340,7 @@ var ts;
|
|
|
123235
123340
|
}
|
|
123236
123341
|
}
|
|
123237
123342
|
if (filesToDelete) {
|
|
123238
|
-
reportStatus(state, ts.Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0, filesToDelete.map(function (f) { return "\r\n * "
|
|
123343
|
+
reportStatus(state, ts.Diagnostics.A_non_dry_build_would_delete_the_following_files_Colon_0, filesToDelete.map(function (f) { return "\r\n * ".concat(f); }).join(""));
|
|
123239
123344
|
}
|
|
123240
123345
|
return ts.ExitStatus.Success;
|
|
123241
123346
|
}
|
|
@@ -123573,7 +123678,7 @@ var ts;
|
|
|
123573
123678
|
function nowString() {
|
|
123574
123679
|
// E.g. "12:34:56.789"
|
|
123575
123680
|
var d = new Date();
|
|
123576
|
-
return ts.padLeft(d.getHours().toString(), 2, "0")
|
|
123681
|
+
return "".concat(ts.padLeft(d.getHours().toString(), 2, "0"), ":").concat(ts.padLeft(d.getMinutes().toString(), 2, "0"), ":").concat(ts.padLeft(d.getSeconds().toString(), 2, "0"), ".").concat(ts.padLeft(d.getMilliseconds().toString(), 3, "0"));
|
|
123577
123682
|
}
|
|
123578
123683
|
server.nowString = nowString;
|
|
123579
123684
|
})(server = ts.server || (ts.server = {}));
|
|
@@ -123584,7 +123689,7 @@ var ts;
|
|
|
123584
123689
|
var JsTyping;
|
|
123585
123690
|
(function (JsTyping) {
|
|
123586
123691
|
function isTypingUpToDate(cachedTyping, availableTypingVersions) {
|
|
123587
|
-
var availableVersion = new ts.Version(ts.getProperty(availableTypingVersions, "ts"
|
|
123692
|
+
var availableVersion = new ts.Version(ts.getProperty(availableTypingVersions, "ts".concat(ts.versionMajorMinor)) || ts.getProperty(availableTypingVersions, "latest"));
|
|
123588
123693
|
return availableVersion.compareTo(cachedTyping.version) <= 0;
|
|
123589
123694
|
}
|
|
123590
123695
|
JsTyping.isTypingUpToDate = isTypingUpToDate;
|
|
@@ -123637,7 +123742,7 @@ var ts;
|
|
|
123637
123742
|
"worker_threads",
|
|
123638
123743
|
"zlib"
|
|
123639
123744
|
];
|
|
123640
|
-
JsTyping.prefixedNodeCoreModuleList = unprefixedNodeCoreModuleList.map(function (name) { return "node:"
|
|
123745
|
+
JsTyping.prefixedNodeCoreModuleList = unprefixedNodeCoreModuleList.map(function (name) { return "node:".concat(name); });
|
|
123641
123746
|
JsTyping.nodeCoreModuleList = __spreadArray(__spreadArray([], unprefixedNodeCoreModuleList, true), JsTyping.prefixedNodeCoreModuleList, true);
|
|
123642
123747
|
JsTyping.nodeCoreModules = new ts.Set(JsTyping.nodeCoreModuleList);
|
|
123643
123748
|
function nonRelativeModuleNameForTypingCache(moduleName) {
|
|
@@ -123710,7 +123815,7 @@ var ts;
|
|
|
123710
123815
|
var excludeTypingName = exclude_1[_i];
|
|
123711
123816
|
var didDelete = inferredTypings.delete(excludeTypingName);
|
|
123712
123817
|
if (didDelete && log)
|
|
123713
|
-
log("Typing for "
|
|
123818
|
+
log("Typing for ".concat(excludeTypingName, " is in exclude list, will be ignored."));
|
|
123714
123819
|
}
|
|
123715
123820
|
var newTypingNames = [];
|
|
123716
123821
|
var cachedTypingPaths = [];
|
|
@@ -123724,7 +123829,7 @@ var ts;
|
|
|
123724
123829
|
});
|
|
123725
123830
|
var result = { cachedTypingPaths: cachedTypingPaths, newTypingNames: newTypingNames, filesToWatch: filesToWatch };
|
|
123726
123831
|
if (log)
|
|
123727
|
-
log("Result: "
|
|
123832
|
+
log("Result: ".concat(JSON.stringify(result)));
|
|
123728
123833
|
return result;
|
|
123729
123834
|
function addInferredTyping(typingName) {
|
|
123730
123835
|
if (!inferredTypings.has(typingName)) {
|
|
@@ -123733,7 +123838,7 @@ var ts;
|
|
|
123733
123838
|
}
|
|
123734
123839
|
function addInferredTypings(typingNames, message) {
|
|
123735
123840
|
if (log)
|
|
123736
|
-
log(message
|
|
123841
|
+
log("".concat(message, ": ").concat(JSON.stringify(typingNames)));
|
|
123737
123842
|
ts.forEach(typingNames, addInferredTyping);
|
|
123738
123843
|
}
|
|
123739
123844
|
/**
|
|
@@ -123755,7 +123860,7 @@ var ts;
|
|
|
123755
123860
|
filesToWatch.push(manifestPath);
|
|
123756
123861
|
manifest = ts.readConfigFile(manifestPath, function (path) { return host.readFile(path); }).config;
|
|
123757
123862
|
manifestTypingNames = ts.flatMap([manifest.dependencies, manifest.devDependencies, manifest.optionalDependencies, manifest.peerDependencies], ts.getOwnKeys);
|
|
123758
|
-
addInferredTypings(manifestTypingNames, "Typing names in '"
|
|
123863
|
+
addInferredTypings(manifestTypingNames, "Typing names in '".concat(manifestPath, "' dependencies"));
|
|
123759
123864
|
}
|
|
123760
123865
|
// Now we scan the directories for typing information in
|
|
123761
123866
|
// already-installed dependencies (if present). Note that this
|
|
@@ -123799,7 +123904,7 @@ var ts;
|
|
|
123799
123904
|
!isScoped && pathComponents[pathComponents.length - 3].toLowerCase() === modulesDirName; // `node_modules/foo`
|
|
123800
123905
|
});
|
|
123801
123906
|
if (log)
|
|
123802
|
-
log("Searching for typing names in "
|
|
123907
|
+
log("Searching for typing names in ".concat(packagesFolderPath, "; all files: ").concat(JSON.stringify(dependencyManifestNames)));
|
|
123803
123908
|
// Once we have the names of things to look up, we iterate over
|
|
123804
123909
|
// and either collect their included typings, or add them to the
|
|
123805
123910
|
// list of typings we need to look up separately.
|
|
@@ -123818,12 +123923,12 @@ var ts;
|
|
|
123818
123923
|
var absolutePath = ts.getNormalizedAbsolutePath(ownTypes, ts.getDirectoryPath(normalizedFileName));
|
|
123819
123924
|
if (host.fileExists(absolutePath)) {
|
|
123820
123925
|
if (log)
|
|
123821
|
-
log(" Package '"
|
|
123926
|
+
log(" Package '".concat(manifest_1.name, "' provides its own types."));
|
|
123822
123927
|
inferredTypings.set(manifest_1.name, absolutePath);
|
|
123823
123928
|
}
|
|
123824
123929
|
else {
|
|
123825
123930
|
if (log)
|
|
123826
|
-
log(" Package '"
|
|
123931
|
+
log(" Package '".concat(manifest_1.name, "' provides its own types but they are missing."));
|
|
123827
123932
|
}
|
|
123828
123933
|
}
|
|
123829
123934
|
else {
|
|
@@ -123919,15 +124024,15 @@ var ts;
|
|
|
123919
124024
|
var kind = isScopeName ? "Scope" : "Package";
|
|
123920
124025
|
switch (result) {
|
|
123921
124026
|
case 1 /* EmptyName */:
|
|
123922
|
-
return "'"
|
|
124027
|
+
return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' cannot be empty");
|
|
123923
124028
|
case 2 /* NameTooLong */:
|
|
123924
|
-
return "'"
|
|
124029
|
+
return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' should be less than ").concat(maxPackageNameLength, " characters");
|
|
123925
124030
|
case 3 /* NameStartsWithDot */:
|
|
123926
|
-
return "'"
|
|
124031
|
+
return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' cannot start with '.'");
|
|
123927
124032
|
case 4 /* NameStartsWithUnderscore */:
|
|
123928
|
-
return "'"
|
|
124033
|
+
return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' cannot start with '_'");
|
|
123929
124034
|
case 5 /* NameContainsNonURISafeCharacters */:
|
|
123930
|
-
return "'"
|
|
124035
|
+
return "'".concat(typing, "':: ").concat(kind, " name '").concat(name, "' contains non URI safe characters");
|
|
123931
124036
|
case 0 /* Ok */:
|
|
123932
124037
|
return ts.Debug.fail(); // Shouldn't have called this.
|
|
123933
124038
|
default:
|
|
@@ -126482,7 +126587,7 @@ var ts;
|
|
|
126482
126587
|
var prefix = ts.isJSDocLink(link) ? "link"
|
|
126483
126588
|
: ts.isJSDocLinkCode(link) ? "linkcode"
|
|
126484
126589
|
: "linkplain";
|
|
126485
|
-
var parts = [linkPart("{@"
|
|
126590
|
+
var parts = [linkPart("{@".concat(prefix, " "))];
|
|
126486
126591
|
if (!link.name) {
|
|
126487
126592
|
if (link.text)
|
|
126488
126593
|
parts.push(linkTextPart(link.text));
|
|
@@ -126730,7 +126835,7 @@ var ts;
|
|
|
126730
126835
|
function getUniqueName(baseName, sourceFile) {
|
|
126731
126836
|
var nameText = baseName;
|
|
126732
126837
|
for (var i = 1; !ts.isFileLevelUniqueName(sourceFile, nameText); i++) {
|
|
126733
|
-
nameText = baseName
|
|
126838
|
+
nameText = "".concat(baseName, "_").concat(i);
|
|
126734
126839
|
}
|
|
126735
126840
|
return nameText;
|
|
126736
126841
|
}
|
|
@@ -126840,7 +126945,7 @@ var ts;
|
|
|
126840
126945
|
// Editors can pass in undefined or empty string - we want to infer the preference in those cases.
|
|
126841
126946
|
var quotePreference = getQuotePreference(sourceFile, preferences);
|
|
126842
126947
|
var quoted = JSON.stringify(text);
|
|
126843
|
-
return quotePreference === 0 /* Single */ ? "'"
|
|
126948
|
+
return quotePreference === 0 /* Single */ ? "'".concat(ts.stripQuotes(quoted).replace(/'/g, "\\'").replace(/\\"/g, '"'), "'") : quoted;
|
|
126844
126949
|
}
|
|
126845
126950
|
ts.quote = quote;
|
|
126846
126951
|
function isEqualityOperatorKind(kind) {
|
|
@@ -127224,7 +127329,7 @@ var ts;
|
|
|
127224
127329
|
var components = ts.getPathComponents(ts.getPackageNameFromTypesPackageName(fullSpecifier)).slice(1);
|
|
127225
127330
|
// Scoped packages
|
|
127226
127331
|
if (ts.startsWith(components[0], "@")) {
|
|
127227
|
-
return components[0]
|
|
127332
|
+
return "".concat(components[0], "/").concat(components[1]);
|
|
127228
127333
|
}
|
|
127229
127334
|
return components[0];
|
|
127230
127335
|
}
|
|
@@ -127351,13 +127456,13 @@ var ts;
|
|
|
127351
127456
|
}
|
|
127352
127457
|
function getSymbolParentOrFail(symbol) {
|
|
127353
127458
|
var _a;
|
|
127354
|
-
return ts.Debug.checkDefined(symbol.parent, "Symbol parent was undefined. Flags: "
|
|
127355
|
-
|
|
127459
|
+
return ts.Debug.checkDefined(symbol.parent, "Symbol parent was undefined. Flags: ".concat(ts.Debug.formatSymbolFlags(symbol.flags), ". ") +
|
|
127460
|
+
"Declarations: ".concat((_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.map(function (d) {
|
|
127356
127461
|
var kind = ts.Debug.formatSyntaxKind(d.kind);
|
|
127357
127462
|
var inJS = ts.isInJSFile(d);
|
|
127358
127463
|
var expression = d.expression;
|
|
127359
|
-
return (inJS ? "[JS]" : "") + kind + (expression ? " (expression: "
|
|
127360
|
-
}).join(", ")
|
|
127464
|
+
return (inJS ? "[JS]" : "") + kind + (expression ? " (expression: ".concat(ts.Debug.formatSyntaxKind(expression.kind), ")") : "");
|
|
127465
|
+
}).join(", "), "."));
|
|
127361
127466
|
}
|
|
127362
127467
|
/**
|
|
127363
127468
|
* Useful to check whether a string contains another string at a specific index
|
|
@@ -127618,7 +127723,7 @@ var ts;
|
|
|
127618
127723
|
: checker.tryFindAmbientModule(info.moduleName));
|
|
127619
127724
|
var symbol = info.symbol || cachedSymbol || ts.Debug.checkDefined(exportKind === 2 /* ExportEquals */
|
|
127620
127725
|
? checker.resolveExternalModuleSymbol(moduleSymbol)
|
|
127621
|
-
: checker.tryGetMemberInModuleExportsAndProperties(ts.unescapeLeadingUnderscores(info.symbolTableKey), moduleSymbol), "Could not find symbol '"
|
|
127726
|
+
: checker.tryGetMemberInModuleExportsAndProperties(ts.unescapeLeadingUnderscores(info.symbolTableKey), moduleSymbol), "Could not find symbol '".concat(info.symbolName, "' by key '").concat(info.symbolTableKey, "' in module ").concat(moduleSymbol.name));
|
|
127622
127727
|
symbols.set(id, [symbol, moduleSymbol]);
|
|
127623
127728
|
return {
|
|
127624
127729
|
symbol: symbol,
|
|
@@ -127631,7 +127736,7 @@ var ts;
|
|
|
127631
127736
|
}
|
|
127632
127737
|
function key(importedName, symbol, ambientModuleName, checker) {
|
|
127633
127738
|
var moduleKey = ambientModuleName || "";
|
|
127634
|
-
return importedName
|
|
127739
|
+
return "".concat(importedName, "|").concat(ts.getSymbolId(ts.skipAlias(symbol, checker)), "|").concat(moduleKey);
|
|
127635
127740
|
}
|
|
127636
127741
|
function parseKey(key) {
|
|
127637
127742
|
var symbolName = key.substring(0, key.indexOf("|"));
|
|
@@ -127717,7 +127822,7 @@ var ts;
|
|
|
127717
127822
|
if (autoImportProvider) {
|
|
127718
127823
|
var start = ts.timestamp();
|
|
127719
127824
|
forEachExternalModule(autoImportProvider.getTypeChecker(), autoImportProvider.getSourceFiles(), function (module, file) { return cb(module, file, autoImportProvider, /*isFromPackageJson*/ true); });
|
|
127720
|
-
(_b = host.log) === null || _b === void 0 ? void 0 : _b.call(host, "forEachExternalModuleToImportFrom autoImportProvider: "
|
|
127825
|
+
(_b = host.log) === null || _b === void 0 ? void 0 : _b.call(host, "forEachExternalModuleToImportFrom autoImportProvider: ".concat(ts.timestamp() - start));
|
|
127721
127826
|
}
|
|
127722
127827
|
}
|
|
127723
127828
|
ts.forEachExternalModuleToImportFrom = forEachExternalModuleToImportFrom;
|
|
@@ -127770,7 +127875,7 @@ var ts;
|
|
|
127770
127875
|
}
|
|
127771
127876
|
});
|
|
127772
127877
|
});
|
|
127773
|
-
(_e = host.log) === null || _e === void 0 ? void 0 : _e.call(host, "getExportInfoMap: done in "
|
|
127878
|
+
(_e = host.log) === null || _e === void 0 ? void 0 : _e.call(host, "getExportInfoMap: done in ".concat(ts.timestamp() - start, " ms"));
|
|
127774
127879
|
return cache;
|
|
127775
127880
|
}
|
|
127776
127881
|
ts.getExportInfoMap = getExportInfoMap;
|
|
@@ -128303,7 +128408,7 @@ var ts;
|
|
|
128303
128408
|
return { spans: spans, endOfLineState: 0 /* None */ };
|
|
128304
128409
|
function pushClassification(start, end, type) {
|
|
128305
128410
|
var length = end - start;
|
|
128306
|
-
ts.Debug.assert(length > 0, "Classification had non-positive length of "
|
|
128411
|
+
ts.Debug.assert(length > 0, "Classification had non-positive length of ".concat(length));
|
|
128307
128412
|
spans.push(start);
|
|
128308
128413
|
spans.push(length);
|
|
128309
128414
|
spans.push(type);
|
|
@@ -129175,7 +129280,7 @@ var ts;
|
|
|
129175
129280
|
case ".d.cts" /* Dcts */: return ".d.cts" /* dctsModifier */;
|
|
129176
129281
|
case ".cjs" /* Cjs */: return ".cjs" /* cjsModifier */;
|
|
129177
129282
|
case ".cts" /* Cts */: return ".cts" /* ctsModifier */;
|
|
129178
|
-
case ".tsbuildinfo" /* TsBuildInfo */: return ts.Debug.fail("Extension "
|
|
129283
|
+
case ".tsbuildinfo" /* TsBuildInfo */: return ts.Debug.fail("Extension ".concat(".tsbuildinfo" /* TsBuildInfo */, " is unsupported."));
|
|
129179
129284
|
case undefined: return "" /* none */;
|
|
129180
129285
|
default:
|
|
129181
129286
|
return ts.Debug.assertNever(extension);
|
|
@@ -129911,10 +130016,10 @@ var ts;
|
|
|
129911
130016
|
var resolvedFromCacheCount = 0;
|
|
129912
130017
|
var cacheAttemptCount = 0;
|
|
129913
130018
|
var result = cb({ tryResolve: tryResolve, resolutionLimitExceeded: function () { return resolutionLimitExceeded; } });
|
|
129914
|
-
var hitRateMessage = cacheAttemptCount ? " ("
|
|
129915
|
-
(_a = host.log) === null || _a === void 0 ? void 0 : _a.call(host, logPrefix
|
|
129916
|
-
(_b = host.log) === null || _b === void 0 ? void 0 : _b.call(host, logPrefix
|
|
129917
|
-
(_c = host.log) === null || _c === void 0 ? void 0 : _c.call(host, logPrefix
|
|
130019
|
+
var hitRateMessage = cacheAttemptCount ? " (".concat((resolvedFromCacheCount / cacheAttemptCount * 100).toFixed(1), "% hit rate)") : "";
|
|
130020
|
+
(_a = host.log) === null || _a === void 0 ? void 0 : _a.call(host, "".concat(logPrefix, ": resolved ").concat(resolvedCount, " module specifiers, plus ").concat(ambientCount, " ambient and ").concat(resolvedFromCacheCount, " from cache").concat(hitRateMessage));
|
|
130021
|
+
(_b = host.log) === null || _b === void 0 ? void 0 : _b.call(host, "".concat(logPrefix, ": response is ").concat(resolutionLimitExceeded ? "incomplete" : "complete"));
|
|
130022
|
+
(_c = host.log) === null || _c === void 0 ? void 0 : _c.call(host, "".concat(logPrefix, ": ").concat(ts.timestamp() - start));
|
|
129918
130023
|
return result;
|
|
129919
130024
|
function tryResolve(exportInfo, isFromAmbientModule) {
|
|
129920
130025
|
if (isFromAmbientModule) {
|
|
@@ -130247,15 +130352,15 @@ var ts;
|
|
|
130247
130352
|
var useBraces = origin && originIsSymbolMember(origin) || needsConvertPropertyAccess;
|
|
130248
130353
|
if (origin && originIsThisType(origin)) {
|
|
130249
130354
|
insertText = needsConvertPropertyAccess
|
|
130250
|
-
? "this"
|
|
130251
|
-
: "this"
|
|
130355
|
+
? "this".concat(insertQuestionDot ? "?." : "", "[").concat(quotePropertyName(sourceFile, preferences, name), "]")
|
|
130356
|
+
: "this".concat(insertQuestionDot ? "?." : ".").concat(name);
|
|
130252
130357
|
}
|
|
130253
130358
|
// We should only have needsConvertPropertyAccess if there's a property access to convert. But see #21790.
|
|
130254
130359
|
// 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.
|
|
130255
130360
|
else if ((useBraces || insertQuestionDot) && propertyAccessToConvert) {
|
|
130256
|
-
insertText = useBraces ? needsConvertPropertyAccess ? "["
|
|
130361
|
+
insertText = useBraces ? needsConvertPropertyAccess ? "[".concat(quotePropertyName(sourceFile, preferences, name), "]") : "[".concat(name, "]") : name;
|
|
130257
130362
|
if (insertQuestionDot || propertyAccessToConvert.questionDotToken) {
|
|
130258
|
-
insertText = "?."
|
|
130363
|
+
insertText = "?.".concat(insertText);
|
|
130259
130364
|
}
|
|
130260
130365
|
var dot = ts.findChildOfKind(propertyAccessToConvert, 24 /* DotToken */, sourceFile) ||
|
|
130261
130366
|
ts.findChildOfKind(propertyAccessToConvert, 28 /* QuestionDotToken */, sourceFile);
|
|
@@ -130269,7 +130374,7 @@ var ts;
|
|
|
130269
130374
|
if (isJsxInitializer) {
|
|
130270
130375
|
if (insertText === undefined)
|
|
130271
130376
|
insertText = name;
|
|
130272
|
-
insertText = "{"
|
|
130377
|
+
insertText = "{".concat(insertText, "}");
|
|
130273
130378
|
if (typeof isJsxInitializer !== "boolean") {
|
|
130274
130379
|
replacementSpan = ts.createTextSpanFromNode(isJsxInitializer, sourceFile);
|
|
130275
130380
|
}
|
|
@@ -130282,8 +130387,8 @@ var ts;
|
|
|
130282
130387
|
if (precedingToken && ts.positionIsASICandidate(precedingToken.end, precedingToken.parent, sourceFile)) {
|
|
130283
130388
|
awaitText = ";";
|
|
130284
130389
|
}
|
|
130285
|
-
awaitText += "(await "
|
|
130286
|
-
insertText = needsConvertPropertyAccess ? ""
|
|
130390
|
+
awaitText += "(await ".concat(propertyAccessToConvert.expression.getText(), ")");
|
|
130391
|
+
insertText = needsConvertPropertyAccess ? "".concat(awaitText).concat(insertText) : "".concat(awaitText).concat(insertQuestionDot ? "?." : ".").concat(insertText);
|
|
130287
130392
|
replacementSpan = ts.createTextSpanFromBounds(propertyAccessToConvert.getStart(sourceFile), propertyAccessToConvert.end);
|
|
130288
130393
|
}
|
|
130289
130394
|
if (originIsResolvedExport(origin)) {
|
|
@@ -130316,7 +130421,7 @@ var ts;
|
|
|
130316
130421
|
&& !(type.flags & 1048576 /* Union */ && ts.find(type.types, function (type) { return !!(type.flags & 528 /* BooleanLike */); }))) {
|
|
130317
130422
|
if (type.flags & 402653316 /* StringLike */ || (type.flags & 1048576 /* Union */ && ts.every(type.types, function (type) { return !!(type.flags & (402653316 /* StringLike */ | 32768 /* Undefined */)); }))) {
|
|
130318
130423
|
// If is string like or undefined use quotes
|
|
130319
|
-
insertText = ts.escapeSnippetText(name)
|
|
130424
|
+
insertText = "".concat(ts.escapeSnippetText(name), "=").concat(ts.quote(sourceFile, preferences, "$1"));
|
|
130320
130425
|
isSnippet = true;
|
|
130321
130426
|
}
|
|
130322
130427
|
else {
|
|
@@ -130325,7 +130430,7 @@ var ts;
|
|
|
130325
130430
|
}
|
|
130326
130431
|
}
|
|
130327
130432
|
if (useBraces_1) {
|
|
130328
|
-
insertText = ts.escapeSnippetText(name)
|
|
130433
|
+
insertText = "".concat(ts.escapeSnippetText(name), "={$1}");
|
|
130329
130434
|
isSnippet = true;
|
|
130330
130435
|
}
|
|
130331
130436
|
}
|
|
@@ -130610,14 +130715,14 @@ var ts;
|
|
|
130610
130715
|
var importKind = ts.codefix.getImportKind(sourceFile, exportKind, options, /*forceImportKeyword*/ true);
|
|
130611
130716
|
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);
|
|
130612
130717
|
var isImportSpecifierTypeOnly = couldBeTypeOnlyImportSpecifier(importCompletionNode, contextToken);
|
|
130613
|
-
var topLevelTypeOnlyText = isTopLevelTypeOnly ? " "
|
|
130614
|
-
var importSpecifierTypeOnlyText = isImportSpecifierTypeOnly ? ts.tokenToString(151 /* TypeKeyword */)
|
|
130718
|
+
var topLevelTypeOnlyText = isTopLevelTypeOnly ? " ".concat(ts.tokenToString(151 /* TypeKeyword */), " ") : " ";
|
|
130719
|
+
var importSpecifierTypeOnlyText = isImportSpecifierTypeOnly ? "".concat(ts.tokenToString(151 /* TypeKeyword */), " ") : "";
|
|
130615
130720
|
var suffix = useSemicolons ? ";" : "";
|
|
130616
130721
|
switch (importKind) {
|
|
130617
|
-
case 3 /* CommonJS */: return { replacementSpan: replacementSpan, insertText: "import"
|
|
130618
|
-
case 1 /* Default */: return { replacementSpan: replacementSpan, insertText: "import"
|
|
130619
|
-
case 2 /* Namespace */: return { replacementSpan: replacementSpan, insertText: "import"
|
|
130620
|
-
case 0 /* Named */: return { replacementSpan: replacementSpan, insertText: "import"
|
|
130722
|
+
case 3 /* CommonJS */: return { replacementSpan: replacementSpan, insertText: "import".concat(topLevelTypeOnlyText).concat(ts.escapeSnippetText(name)).concat(tabStop, " = require(").concat(quotedModuleSpecifier, ")").concat(suffix) };
|
|
130723
|
+
case 1 /* Default */: return { replacementSpan: replacementSpan, insertText: "import".concat(topLevelTypeOnlyText).concat(ts.escapeSnippetText(name)).concat(tabStop, " from ").concat(quotedModuleSpecifier).concat(suffix) };
|
|
130724
|
+
case 2 /* Namespace */: return { replacementSpan: replacementSpan, insertText: "import".concat(topLevelTypeOnlyText, "* as ").concat(ts.escapeSnippetText(name), " from ").concat(quotedModuleSpecifier).concat(suffix) };
|
|
130725
|
+
case 0 /* Named */: return { replacementSpan: replacementSpan, insertText: "import".concat(topLevelTypeOnlyText, "{ ").concat(importSpecifierTypeOnlyText).concat(ts.escapeSnippetText(name)).concat(tabStop, " } from ").concat(quotedModuleSpecifier).concat(suffix) };
|
|
130621
130726
|
}
|
|
130622
130727
|
}
|
|
130623
130728
|
function quotePropertyName(sourceFile, preferences, name) {
|
|
@@ -133579,7 +133684,7 @@ var ts;
|
|
|
133579
133684
|
}
|
|
133580
133685
|
function getDocumentRegistryEntry(bucketEntry, scriptKind) {
|
|
133581
133686
|
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"));
|
|
133582
|
-
ts.Debug.assert(scriptKind === undefined || !entry || entry.sourceFile.scriptKind === scriptKind, "Script kind should match provided ScriptKind:"
|
|
133687
|
+
ts.Debug.assert(scriptKind === undefined || !entry || entry.sourceFile.scriptKind === scriptKind, "Script kind should match provided ScriptKind:".concat(scriptKind, " and sourceFile.scriptKind: ").concat(entry === null || entry === void 0 ? void 0 : entry.sourceFile.scriptKind, ", !entry: ").concat(!entry));
|
|
133583
133688
|
return entry;
|
|
133584
133689
|
}
|
|
133585
133690
|
function acquireOrUpdateDocument(fileName, path, compilationSettings, key, scriptSnapshot, version, acquiring, scriptKind) {
|
|
@@ -134608,7 +134713,7 @@ var ts;
|
|
|
134608
134713
|
sourceFile: def.file,
|
|
134609
134714
|
name: def.reference.fileName,
|
|
134610
134715
|
kind: "string" /* string */,
|
|
134611
|
-
displayParts: [ts.displayPart("\""
|
|
134716
|
+
displayParts: [ts.displayPart("\"".concat(def.reference.fileName, "\""), ts.SymbolDisplayPartKind.stringLiteral)]
|
|
134612
134717
|
};
|
|
134613
134718
|
}
|
|
134614
134719
|
default:
|
|
@@ -135188,7 +135293,7 @@ var ts;
|
|
|
135188
135293
|
if (symbol.flags & 33554432 /* Transient */)
|
|
135189
135294
|
return undefined;
|
|
135190
135295
|
// Assertions for GH#21814. We should be handling SourceFile symbols in `getReferencedSymbolsForModule` instead of getting here.
|
|
135191
|
-
ts.Debug.fail("Unexpected symbol at "
|
|
135296
|
+
ts.Debug.fail("Unexpected symbol at ".concat(ts.Debug.formatSyntaxKind(node.kind), ": ").concat(ts.Debug.formatSymbol(symbol)));
|
|
135192
135297
|
}
|
|
135193
135298
|
return ts.isTypeLiteralNode(decl.parent) && ts.isUnionTypeNode(decl.parent.parent)
|
|
135194
135299
|
? checker.getPropertyOfType(checker.getTypeFromTypeNode(decl.parent.parent), symbol.name)
|
|
@@ -136473,8 +136578,8 @@ var ts;
|
|
|
136473
136578
|
var end = pos + 6; /* "static".length */
|
|
136474
136579
|
var typeChecker = program.getTypeChecker();
|
|
136475
136580
|
var symbol = typeChecker.getSymbolAtLocation(node.parent);
|
|
136476
|
-
var prefix = symbol ? typeChecker.symbolToString(symbol, node.parent)
|
|
136477
|
-
return { text: prefix
|
|
136581
|
+
var prefix = symbol ? "".concat(typeChecker.symbolToString(symbol, node.parent), " ") : "";
|
|
136582
|
+
return { text: "".concat(prefix, "static {}"), pos: pos, end: end };
|
|
136478
136583
|
}
|
|
136479
136584
|
var declName = isConstNamedExpression(node) ? node.parent.name :
|
|
136480
136585
|
ts.Debug.checkDefined(ts.getNameOfDeclaration(node), "Expected call hierarchy item to have a name");
|
|
@@ -137758,7 +137863,7 @@ var ts;
|
|
|
137758
137863
|
function getJSDocTagCompletions() {
|
|
137759
137864
|
return jsDocTagCompletionEntries || (jsDocTagCompletionEntries = ts.map(jsDocTagNames, function (tagName) {
|
|
137760
137865
|
return {
|
|
137761
|
-
name: "@"
|
|
137866
|
+
name: "@".concat(tagName),
|
|
137762
137867
|
kind: "keyword" /* keyword */,
|
|
137763
137868
|
kindModifiers: "",
|
|
137764
137869
|
sortText: ts.Completions.SortText.LocationPriority
|
|
@@ -137890,11 +137995,11 @@ var ts;
|
|
|
137890
137995
|
var name = _a.name, dotDotDotToken = _a.dotDotDotToken;
|
|
137891
137996
|
var paramName = name.kind === 79 /* Identifier */ ? name.text : "param" + i;
|
|
137892
137997
|
var type = isJavaScriptFile ? (dotDotDotToken ? "{...any} " : "{any} ") : "";
|
|
137893
|
-
return indentationStr
|
|
137998
|
+
return "".concat(indentationStr, " * @param ").concat(type).concat(paramName).concat(newLine);
|
|
137894
137999
|
}).join("");
|
|
137895
138000
|
}
|
|
137896
138001
|
function returnsDocComment(indentationStr, newLine) {
|
|
137897
|
-
return indentationStr
|
|
138002
|
+
return "".concat(indentationStr, " * @returns").concat(newLine);
|
|
137898
138003
|
}
|
|
137899
138004
|
function getCommentOwnerInfo(tokenAtPos, options) {
|
|
137900
138005
|
return ts.forEachAncestor(tokenAtPos, function (n) { return getCommentOwnerInfoWorker(n, options); });
|
|
@@ -138737,7 +138842,7 @@ var ts;
|
|
|
138737
138842
|
}
|
|
138738
138843
|
if (name) {
|
|
138739
138844
|
var text = ts.isIdentifier(name) ? name.text
|
|
138740
|
-
: ts.isElementAccessExpression(name) ? "["
|
|
138845
|
+
: ts.isElementAccessExpression(name) ? "[".concat(nodeText(name.argumentExpression), "]")
|
|
138741
138846
|
: nodeText(name);
|
|
138742
138847
|
if (text.length > 0) {
|
|
138743
138848
|
return cleanText(text);
|
|
@@ -138747,7 +138852,7 @@ var ts;
|
|
|
138747
138852
|
case 303 /* SourceFile */:
|
|
138748
138853
|
var sourceFile = node;
|
|
138749
138854
|
return ts.isExternalModule(sourceFile)
|
|
138750
|
-
? "\""
|
|
138855
|
+
? "\"".concat(ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))), "\"")
|
|
138751
138856
|
: "<global>";
|
|
138752
138857
|
case 270 /* ExportAssignment */:
|
|
138753
138858
|
return ts.isExportAssignment(node) && node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */;
|
|
@@ -138943,10 +139048,10 @@ var ts;
|
|
|
138943
139048
|
if (name !== undefined) {
|
|
138944
139049
|
name = cleanText(name);
|
|
138945
139050
|
if (name.length > maxLength) {
|
|
138946
|
-
return name
|
|
139051
|
+
return "".concat(name, " callback");
|
|
138947
139052
|
}
|
|
138948
139053
|
var args = cleanText(ts.mapDefined(parent.arguments, function (a) { return ts.isStringLiteralLike(a) ? a.getText(curSourceFile) : undefined; }).join(", "));
|
|
138949
|
-
return name
|
|
139054
|
+
return "".concat(name, "(").concat(args, ") callback");
|
|
138950
139055
|
}
|
|
138951
139056
|
}
|
|
138952
139057
|
return "<function>";
|
|
@@ -138959,7 +139064,7 @@ var ts;
|
|
|
138959
139064
|
else if (ts.isPropertyAccessExpression(expr)) {
|
|
138960
139065
|
var left = getCalledExpressionName(expr.expression);
|
|
138961
139066
|
var right = expr.name.text;
|
|
138962
|
-
return left === undefined ? right : left
|
|
139067
|
+
return left === undefined ? right : "".concat(left, ".").concat(right);
|
|
138963
139068
|
}
|
|
138964
139069
|
else {
|
|
138965
139070
|
return undefined;
|
|
@@ -141406,7 +141511,7 @@ var ts;
|
|
|
141406
141511
|
var _loop_9 = function (n) {
|
|
141407
141512
|
// If the node is not a subspan of its parent, this is a big problem.
|
|
141408
141513
|
// There have been crashes that might be caused by this violation.
|
|
141409
|
-
ts.Debug.assert(ts.rangeContainsRange(n.parent, n), "Not a subspan", function () { return "Child: "
|
|
141514
|
+
ts.Debug.assert(ts.rangeContainsRange(n.parent, n), "Not a subspan", function () { return "Child: ".concat(ts.Debug.formatSyntaxKind(n.kind), ", parent: ").concat(ts.Debug.formatSyntaxKind(n.parent.kind)); });
|
|
141410
141515
|
var argumentInfo = getImmediatelyContainingArgumentOrContextualParameterInfo(n, position, sourceFile, checker);
|
|
141411
141516
|
if (argumentInfo) {
|
|
141412
141517
|
return { value: argumentInfo };
|
|
@@ -141578,7 +141683,7 @@ var ts;
|
|
|
141578
141683
|
(function (InlayHints) {
|
|
141579
141684
|
var maxHintsLength = 30;
|
|
141580
141685
|
var leadingParameterNameCommentRegexFactory = function (name) {
|
|
141581
|
-
return new RegExp("^\\s?/\\*\\*?\\s?"
|
|
141686
|
+
return new RegExp("^\\s?/\\*\\*?\\s?".concat(name, "\\s?\\*\\/\\s?$"));
|
|
141582
141687
|
};
|
|
141583
141688
|
function shouldShowParameterNameHints(preferences) {
|
|
141584
141689
|
return preferences.includeInlayParameterNameHints === "literals" || preferences.includeInlayParameterNameHints === "all";
|
|
@@ -141642,7 +141747,7 @@ var ts;
|
|
|
141642
141747
|
}
|
|
141643
141748
|
function addParameterHints(text, position, isFirstVariadicArgument) {
|
|
141644
141749
|
result.push({
|
|
141645
|
-
text: ""
|
|
141750
|
+
text: "".concat(isFirstVariadicArgument ? "..." : "").concat(truncation(text, maxHintsLength), ":"),
|
|
141646
141751
|
position: position,
|
|
141647
141752
|
kind: "Parameter" /* Parameter */,
|
|
141648
141753
|
whitespaceAfter: true,
|
|
@@ -141650,7 +141755,7 @@ var ts;
|
|
|
141650
141755
|
}
|
|
141651
141756
|
function addTypeHints(text, position) {
|
|
141652
141757
|
result.push({
|
|
141653
|
-
text: ": "
|
|
141758
|
+
text: ": ".concat(truncation(text, maxHintsLength)),
|
|
141654
141759
|
position: position,
|
|
141655
141760
|
kind: "Type" /* Type */,
|
|
141656
141761
|
whitespaceBefore: true,
|
|
@@ -141658,7 +141763,7 @@ var ts;
|
|
|
141658
141763
|
}
|
|
141659
141764
|
function addEnumMemberValueHints(text, position) {
|
|
141660
141765
|
result.push({
|
|
141661
|
-
text: "= "
|
|
141766
|
+
text: "= ".concat(truncation(text, maxHintsLength)),
|
|
141662
141767
|
position: position,
|
|
141663
141768
|
kind: "Enum" /* Enum */,
|
|
141664
141769
|
whitespaceBefore: true,
|
|
@@ -142193,7 +142298,7 @@ var ts;
|
|
|
142193
142298
|
}
|
|
142194
142299
|
}
|
|
142195
142300
|
function getKeyFromNode(exp) {
|
|
142196
|
-
return exp.pos.toString()
|
|
142301
|
+
return "".concat(exp.pos.toString(), ":").concat(exp.end.toString());
|
|
142197
142302
|
}
|
|
142198
142303
|
function canBeConvertedToClass(node, checker) {
|
|
142199
142304
|
var _a, _b, _c, _d;
|
|
@@ -145738,6 +145843,8 @@ var ts;
|
|
|
145738
145843
|
case 179 /* ConstructorType */:
|
|
145739
145844
|
case 174 /* ConstructSignature */:
|
|
145740
145845
|
return getList(node.typeParameters) || getList(node.parameters);
|
|
145846
|
+
case 171 /* GetAccessor */:
|
|
145847
|
+
return getList(node.parameters);
|
|
145741
145848
|
case 256 /* ClassDeclaration */:
|
|
145742
145849
|
case 225 /* ClassExpression */:
|
|
145743
145850
|
case 257 /* InterfaceDeclaration */:
|
|
@@ -146340,7 +146447,7 @@ var ts;
|
|
|
146340
146447
|
var insertAtLineStart = isValidLocationToAddComment(sourceFile, startPosition);
|
|
146341
146448
|
var token = ts.getTouchingToken(sourceFile, insertAtLineStart ? startPosition : position);
|
|
146342
146449
|
var indent = sourceFile.text.slice(lineStartPosition, startPosition);
|
|
146343
|
-
var text = (insertAtLineStart ? "" : this.newLineCharacter
|
|
146450
|
+
var text = "".concat(insertAtLineStart ? "" : this.newLineCharacter, "//").concat(commentText).concat(this.newLineCharacter).concat(indent);
|
|
146344
146451
|
this.insertText(sourceFile, token.getStart(sourceFile), text);
|
|
146345
146452
|
};
|
|
146346
146453
|
ChangeTracker.prototype.insertJsdocCommentBefore = function (sourceFile, node, tag) {
|
|
@@ -146358,8 +146465,18 @@ var ts;
|
|
|
146358
146465
|
var indent = sourceFile.text.slice(startPosition, fnStart);
|
|
146359
146466
|
this.insertNodeAt(sourceFile, fnStart, tag, { preserveLeadingWhitespace: false, suffix: this.newLineCharacter + indent });
|
|
146360
146467
|
};
|
|
146468
|
+
ChangeTracker.prototype.createJSDocText = function (sourceFile, node) {
|
|
146469
|
+
var comments = ts.flatMap(node.jsDoc, function (jsDoc) {
|
|
146470
|
+
return ts.isString(jsDoc.comment) ? ts.factory.createJSDocText(jsDoc.comment) : jsDoc.comment;
|
|
146471
|
+
});
|
|
146472
|
+
var jsDoc = ts.singleOrUndefined(node.jsDoc);
|
|
146473
|
+
return jsDoc && ts.positionsAreOnSameLine(jsDoc.pos, jsDoc.end, sourceFile) && ts.length(comments) === 0 ? undefined :
|
|
146474
|
+
ts.factory.createNodeArray(ts.intersperse(comments, ts.factory.createJSDocText("\n")));
|
|
146475
|
+
};
|
|
146476
|
+
ChangeTracker.prototype.replaceJSDocComment = function (sourceFile, node, tags) {
|
|
146477
|
+
this.insertJsdocCommentBefore(sourceFile, updateJSDocHost(node), ts.factory.createJSDocComment(this.createJSDocText(sourceFile, node), ts.factory.createNodeArray(tags)));
|
|
146478
|
+
};
|
|
146361
146479
|
ChangeTracker.prototype.addJSDocTags = function (sourceFile, parent, newTags) {
|
|
146362
|
-
var comments = ts.flatMap(parent.jsDoc, function (j) { return typeof j.comment === "string" ? ts.factory.createJSDocText(j.comment) : j.comment; });
|
|
146363
146480
|
var oldTags = ts.flatMapToMutable(parent.jsDoc, function (j) { return j.tags; });
|
|
146364
146481
|
var unmergedNewTags = newTags.filter(function (newTag) { return !oldTags.some(function (tag, i) {
|
|
146365
146482
|
var merged = tryMergeJsdocTags(tag, newTag);
|
|
@@ -146367,20 +146484,10 @@ var ts;
|
|
|
146367
146484
|
oldTags[i] = merged;
|
|
146368
146485
|
return !!merged;
|
|
146369
146486
|
}); });
|
|
146370
|
-
|
|
146371
|
-
var jsDoc = ts.singleOrUndefined(parent.jsDoc);
|
|
146372
|
-
var comment = jsDoc && ts.positionsAreOnSameLine(jsDoc.pos, jsDoc.end, sourceFile) && !ts.length(comments) ? undefined :
|
|
146373
|
-
ts.factory.createNodeArray(ts.intersperse(comments, ts.factory.createJSDocText("\n")));
|
|
146374
|
-
var tag = ts.factory.createJSDocComment(comment, ts.factory.createNodeArray(tags));
|
|
146375
|
-
var host = updateJSDocHost(parent);
|
|
146376
|
-
this.insertJsdocCommentBefore(sourceFile, host, tag);
|
|
146487
|
+
this.replaceJSDocComment(sourceFile, parent, __spreadArray(__spreadArray([], oldTags, true), unmergedNewTags, true));
|
|
146377
146488
|
};
|
|
146378
146489
|
ChangeTracker.prototype.filterJSDocTags = function (sourceFile, parent, predicate) {
|
|
146379
|
-
|
|
146380
|
-
var oldTags = ts.flatMapToMutable(parent.jsDoc, function (j) { return j.tags; });
|
|
146381
|
-
var tag = ts.factory.createJSDocComment(ts.factory.createNodeArray(ts.intersperse(comments, ts.factory.createJSDocText("\n"))), ts.factory.createNodeArray(__spreadArray([], (ts.filter(oldTags, predicate) || ts.emptyArray), true)));
|
|
146382
|
-
var host = updateJSDocHost(parent);
|
|
146383
|
-
this.insertJsdocCommentBefore(sourceFile, host, tag);
|
|
146490
|
+
this.replaceJSDocComment(sourceFile, parent, ts.filter(ts.flatMapToMutable(parent.jsDoc, function (j) { return j.tags; }), predicate));
|
|
146384
146491
|
};
|
|
146385
146492
|
ChangeTracker.prototype.replaceRangeWithText = function (sourceFile, range, text) {
|
|
146386
146493
|
this.changes.push({ kind: ChangeKind.Text, sourceFile: sourceFile, range: range, text: text });
|
|
@@ -146564,7 +146671,7 @@ var ts;
|
|
|
146564
146671
|
};
|
|
146565
146672
|
ChangeTracker.prototype.getInsertNodeAfterOptions = function (sourceFile, after) {
|
|
146566
146673
|
var options = this.getInsertNodeAfterOptionsWorker(after);
|
|
146567
|
-
return __assign(__assign({}, options), { prefix: after.end === sourceFile.end && ts.isStatement(after) ? (options.prefix ? "\n"
|
|
146674
|
+
return __assign(__assign({}, options), { prefix: after.end === sourceFile.end && ts.isStatement(after) ? (options.prefix ? "\n".concat(options.prefix) : "\n") : options.prefix });
|
|
146568
146675
|
};
|
|
146569
146676
|
ChangeTracker.prototype.getInsertNodeAfterOptionsWorker = function (node) {
|
|
146570
146677
|
switch (node.kind) {
|
|
@@ -146598,7 +146705,7 @@ var ts;
|
|
|
146598
146705
|
}
|
|
146599
146706
|
else {
|
|
146600
146707
|
// `x => {}` -> `function f(x) {}`
|
|
146601
|
-
this.insertText(sourceFile, ts.first(node.parameters).getStart(sourceFile), "function "
|
|
146708
|
+
this.insertText(sourceFile, ts.first(node.parameters).getStart(sourceFile), "function ".concat(name, "("));
|
|
146602
146709
|
// Replacing full range of arrow to get rid of the leading space -- replace ` =>` with `)`
|
|
146603
146710
|
this.replaceRange(sourceFile, arrow, ts.factory.createToken(21 /* CloseParenToken */));
|
|
146604
146711
|
}
|
|
@@ -146664,7 +146771,7 @@ var ts;
|
|
|
146664
146771
|
var nextNode = containingList[index + 1];
|
|
146665
146772
|
var startPos = skipWhitespacesAndLineBreaks(sourceFile.text, nextNode.getFullStart());
|
|
146666
146773
|
// write separator and leading trivia of the next element as suffix
|
|
146667
|
-
var suffix = ""
|
|
146774
|
+
var suffix = "".concat(ts.tokenToString(nextToken.kind)).concat(sourceFile.text.substring(nextToken.end, startPos));
|
|
146668
146775
|
this.insertNodesAt(sourceFile, startPos, [newNode], { suffix: suffix });
|
|
146669
146776
|
}
|
|
146670
146777
|
}
|
|
@@ -146709,7 +146816,7 @@ var ts;
|
|
|
146709
146816
|
this.replaceRange(sourceFile, ts.createRange(insertPos), newNode, { indentation: indentation, prefix: this.newLineCharacter });
|
|
146710
146817
|
}
|
|
146711
146818
|
else {
|
|
146712
|
-
this.replaceRange(sourceFile, ts.createRange(end), newNode, { prefix: ts.tokenToString(separator)
|
|
146819
|
+
this.replaceRange(sourceFile, ts.createRange(end), newNode, { prefix: "".concat(ts.tokenToString(separator), " ") });
|
|
146713
146820
|
}
|
|
146714
146821
|
}
|
|
146715
146822
|
};
|
|
@@ -146840,7 +146947,7 @@ var ts;
|
|
|
146840
146947
|
var normalized = ts.stableSort(changesInFile, function (a, b) { return (a.range.pos - b.range.pos) || (a.range.end - b.range.end); });
|
|
146841
146948
|
var _loop_12 = function (i) {
|
|
146842
146949
|
ts.Debug.assert(normalized[i].range.end <= normalized[i + 1].range.pos, "Changes overlap", function () {
|
|
146843
|
-
return JSON.stringify(normalized[i].range)
|
|
146950
|
+
return "".concat(JSON.stringify(normalized[i].range), " and ").concat(JSON.stringify(normalized[i + 1].range));
|
|
146844
146951
|
});
|
|
146845
146952
|
};
|
|
146846
146953
|
// verify that change intervals do not overlap, except possibly at end points.
|
|
@@ -146931,7 +147038,7 @@ var ts;
|
|
|
146931
147038
|
function applyChanges(text, changes) {
|
|
146932
147039
|
for (var i = changes.length - 1; i >= 0; i--) {
|
|
146933
147040
|
var _a = changes[i], span = _a.span, newText = _a.newText;
|
|
146934
|
-
text = ""
|
|
147041
|
+
text = "".concat(text.substring(0, span.start)).concat(newText).concat(text.substring(ts.textSpanEnd(span)));
|
|
146935
147042
|
}
|
|
146936
147043
|
return text;
|
|
146937
147044
|
}
|
|
@@ -149416,7 +149523,7 @@ var ts;
|
|
|
149416
149523
|
if (!res.has(text) && (originalKeywordKind !== undefined && ts.isNonContextualKeyword(originalKeywordKind)
|
|
149417
149524
|
|| checker.resolveName(text, node, 111551 /* Value */, /*excludeGlobals*/ true))) {
|
|
149418
149525
|
// Unconditionally add an underscore in case `text` is a keyword.
|
|
149419
|
-
res.set(text, makeUniqueName("_"
|
|
149526
|
+
res.set(text, makeUniqueName("_".concat(text), identifiers));
|
|
149420
149527
|
}
|
|
149421
149528
|
});
|
|
149422
149529
|
return res;
|
|
@@ -149516,7 +149623,7 @@ var ts;
|
|
|
149516
149623
|
// `const a = require("b").c` --> `import { c as a } from "./b";
|
|
149517
149624
|
return convertedImports([makeSingleImport(name.text, propertyName, moduleSpecifier, quotePreference)]);
|
|
149518
149625
|
default:
|
|
149519
|
-
return ts.Debug.assertNever(name, "Convert to ES module got invalid syntax form "
|
|
149626
|
+
return ts.Debug.assertNever(name, "Convert to ES module got invalid syntax form ".concat(name.kind));
|
|
149520
149627
|
}
|
|
149521
149628
|
}
|
|
149522
149629
|
function convertAssignment(sourceFile, checker, assignment, changes, exports, useSitesToUnqualify) {
|
|
@@ -149567,7 +149674,7 @@ var ts;
|
|
|
149567
149674
|
case 168 /* MethodDeclaration */:
|
|
149568
149675
|
return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.factory.createToken(93 /* ExportKeyword */)], prop, useSitesToUnqualify);
|
|
149569
149676
|
default:
|
|
149570
|
-
ts.Debug.assertNever(prop, "Convert to ES6 got invalid prop kind "
|
|
149677
|
+
ts.Debug.assertNever(prop, "Convert to ES6 got invalid prop kind ".concat(prop.kind));
|
|
149571
149678
|
}
|
|
149572
149679
|
});
|
|
149573
149680
|
return statements && [statements, false];
|
|
@@ -149699,7 +149806,7 @@ var ts;
|
|
|
149699
149806
|
case 79 /* Identifier */:
|
|
149700
149807
|
return convertSingleIdentifierImport(name, moduleSpecifier, checker, identifiers, quotePreference);
|
|
149701
149808
|
default:
|
|
149702
|
-
return ts.Debug.assertNever(name, "Convert to ES module got invalid name kind "
|
|
149809
|
+
return ts.Debug.assertNever(name, "Convert to ES module got invalid name kind ".concat(name.kind));
|
|
149703
149810
|
}
|
|
149704
149811
|
}
|
|
149705
149812
|
/**
|
|
@@ -149756,7 +149863,7 @@ var ts;
|
|
|
149756
149863
|
// Identifiers helpers
|
|
149757
149864
|
function makeUniqueName(name, identifiers) {
|
|
149758
149865
|
while (identifiers.original.has(name) || identifiers.additional.has(name)) {
|
|
149759
|
-
name = "_"
|
|
149866
|
+
name = "_".concat(name);
|
|
149760
149867
|
}
|
|
149761
149868
|
identifiers.additional.add(name);
|
|
149762
149869
|
return name;
|
|
@@ -149836,7 +149943,7 @@ var ts;
|
|
|
149836
149943
|
if (!qualifiedName)
|
|
149837
149944
|
return undefined;
|
|
149838
149945
|
var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, context.sourceFile, qualifiedName); });
|
|
149839
|
-
var newText = qualifiedName.left.text
|
|
149946
|
+
var newText = "".concat(qualifiedName.left.text, "[\"").concat(qualifiedName.right.text, "\"]");
|
|
149840
149947
|
return [codefix.createCodeFixAction(fixId, changes, [ts.Diagnostics.Rewrite_as_the_indexed_access_type_0, newText], fixId, ts.Diagnostics.Rewrite_all_as_indexed_access_types)];
|
|
149841
149948
|
},
|
|
149842
149949
|
fixIds: [fixId],
|
|
@@ -150175,9 +150282,9 @@ var ts;
|
|
|
150175
150282
|
var symbolName = ts.getNameForExportedSymbol(exportedSymbol, ts.getEmitScriptTarget(compilerOptions));
|
|
150176
150283
|
var checker = program.getTypeChecker();
|
|
150177
150284
|
var symbol = checker.getMergedSymbol(ts.skipAlias(exportedSymbol, checker));
|
|
150178
|
-
var
|
|
150285
|
+
var exportInfo = getAllReExportingModules(sourceFile, symbol, moduleSymbol, symbolName, /*isJsxTagName*/ false, host, program, preferences, useAutoImportProvider);
|
|
150179
150286
|
var useRequire = shouldUseRequire(sourceFile, program);
|
|
150180
|
-
var fix = getImportFixForSymbol(sourceFile,
|
|
150287
|
+
var fix = getImportFixForSymbol(sourceFile, exportInfo, moduleSymbol, symbolName, program, /*position*/ undefined, !!isValidTypeOnlyUseSite, useRequire, host, preferences);
|
|
150181
150288
|
if (fix) {
|
|
150182
150289
|
addImport({ fixes: [fix], symbolName: symbolName, errorIdentifierText: undefined });
|
|
150183
150290
|
}
|
|
@@ -150238,7 +150345,7 @@ var ts;
|
|
|
150238
150345
|
// Excluding from fix-all
|
|
150239
150346
|
break;
|
|
150240
150347
|
default:
|
|
150241
|
-
ts.Debug.assertNever(fix, "fix wasn't never - got kind "
|
|
150348
|
+
ts.Debug.assertNever(fix, "fix wasn't never - got kind ".concat(fix.kind));
|
|
150242
150349
|
}
|
|
150243
150350
|
function reduceAddAsTypeOnlyValues(prevValue, newValue) {
|
|
150244
150351
|
// `NotAllowed` overrides `Required` because one addition of a new import might be required to be type-only
|
|
@@ -150282,7 +150389,7 @@ var ts;
|
|
|
150282
150389
|
return newEntry;
|
|
150283
150390
|
}
|
|
150284
150391
|
function newImportsKey(moduleSpecifier, topLevelTypeOnly) {
|
|
150285
|
-
return (topLevelTypeOnly ? 1 : 0
|
|
150392
|
+
return "".concat(topLevelTypeOnly ? 1 : 0, "|").concat(moduleSpecifier);
|
|
150286
150393
|
}
|
|
150287
150394
|
}
|
|
150288
150395
|
function writeFixes(changeTracker) {
|
|
@@ -150366,7 +150473,7 @@ var ts;
|
|
|
150366
150473
|
function getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, symbolName, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences) {
|
|
150367
150474
|
ts.Debug.assert(exportInfos.some(function (info) { return info.moduleSymbol === moduleSymbol || info.symbol.parent === moduleSymbol; }), "Some exportInfo should match the specified moduleSymbol");
|
|
150368
150475
|
var packageJsonImportFilter = ts.createPackageJsonImportFilter(sourceFile, preferences, host);
|
|
150369
|
-
return getBestFix(getImportFixes(exportInfos, symbolName, position, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences), sourceFile, program, packageJsonImportFilter);
|
|
150476
|
+
return getBestFix(getImportFixes(exportInfos, symbolName, position, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences), sourceFile, program, packageJsonImportFilter, host);
|
|
150370
150477
|
}
|
|
150371
150478
|
function codeFixActionToCodeAction(_a) {
|
|
150372
150479
|
var description = _a.description, changes = _a.changes, commands = _a.commands;
|
|
@@ -150426,7 +150533,7 @@ var ts;
|
|
|
150426
150533
|
/*position*/ undefined,
|
|
150427
150534
|
/*isValidTypeOnlyUseSite*/ false,
|
|
150428
150535
|
/*useRequire*/ false, exportInfo, host, preferences, fromCacheOnly), fixes = _a.fixes, computedWithoutCacheCount = _a.computedWithoutCacheCount;
|
|
150429
|
-
var result = getBestFix(fixes, importingFile, program, packageJsonImportFilter || ts.createPackageJsonImportFilter(importingFile, preferences, host));
|
|
150536
|
+
var result = getBestFix(fixes, importingFile, program, packageJsonImportFilter || ts.createPackageJsonImportFilter(importingFile, preferences, host), host);
|
|
150430
150537
|
return result && __assign(__assign({}, result), { computedWithoutCacheCount: computedWithoutCacheCount });
|
|
150431
150538
|
}
|
|
150432
150539
|
codefix.getModuleSpecifierForBestExportInfo = getModuleSpecifierForBestExportInfo;
|
|
@@ -150596,7 +150703,7 @@ var ts;
|
|
|
150596
150703
|
// 5. Literally nothing to go on
|
|
150597
150704
|
return true;
|
|
150598
150705
|
}
|
|
150599
|
-
function getNewImportFixes(program, sourceFile, position, isValidTypeOnlyUseSite, useRequire,
|
|
150706
|
+
function getNewImportFixes(program, sourceFile, position, isValidTypeOnlyUseSite, useRequire, exportInfo, host, preferences, fromCacheOnly) {
|
|
150600
150707
|
var isJs = ts.isSourceFileJS(sourceFile);
|
|
150601
150708
|
var compilerOptions = program.getCompilerOptions();
|
|
150602
150709
|
var moduleSpecifierResolutionHost = ts.createModuleSpecifierResolutionHost(program, host);
|
|
@@ -150605,7 +150712,7 @@ var ts;
|
|
|
150605
150712
|
? function (moduleSymbol) { return ({ moduleSpecifiers: ts.moduleSpecifiers.tryGetModuleSpecifiersFromCache(moduleSymbol, sourceFile, moduleSpecifierResolutionHost, preferences), computedWithoutCache: false }); }
|
|
150606
150713
|
: function (moduleSymbol, checker) { return ts.moduleSpecifiers.getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions, sourceFile, moduleSpecifierResolutionHost, preferences); };
|
|
150607
150714
|
var computedWithoutCacheCount = 0;
|
|
150608
|
-
var fixes = ts.flatMap(
|
|
150715
|
+
var fixes = ts.flatMap(exportInfo, function (exportInfo, i) {
|
|
150609
150716
|
var checker = getChecker(exportInfo.isFromPackageJson);
|
|
150610
150717
|
var _a = getModuleSpecifiers(exportInfo.moduleSymbol, checker), computedWithoutCache = _a.computedWithoutCache, moduleSpecifiers = _a.moduleSpecifiers;
|
|
150611
150718
|
var importedSymbolHasValueMeaning = !!(exportInfo.targetFlags & 111551 /* Value */);
|
|
@@ -150614,7 +150721,7 @@ var ts;
|
|
|
150614
150721
|
return moduleSpecifiers === null || moduleSpecifiers === void 0 ? void 0 : moduleSpecifiers.map(function (moduleSpecifier) {
|
|
150615
150722
|
// `position` should only be undefined at a missing jsx namespace, in which case we shouldn't be looking for pure types.
|
|
150616
150723
|
return !importedSymbolHasValueMeaning && isJs && position !== undefined
|
|
150617
|
-
? { kind: 1 /* JsdocTypeImport */, moduleSpecifier: moduleSpecifier, position: position, exportInfo: exportInfo }
|
|
150724
|
+
? { kind: 1 /* JsdocTypeImport */, moduleSpecifier: moduleSpecifier, position: position, exportInfo: exportInfo, isReExport: i > 0 }
|
|
150618
150725
|
: {
|
|
150619
150726
|
kind: 3 /* AddNew */,
|
|
150620
150727
|
moduleSpecifier: moduleSpecifier,
|
|
@@ -150622,6 +150729,7 @@ var ts;
|
|
|
150622
150729
|
useRequire: useRequire,
|
|
150623
150730
|
addAsTypeOnly: addAsTypeOnly,
|
|
150624
150731
|
exportInfo: exportInfo,
|
|
150732
|
+
isReExport: i > 0,
|
|
150625
150733
|
};
|
|
150626
150734
|
});
|
|
150627
150735
|
});
|
|
@@ -150659,12 +150767,13 @@ var ts;
|
|
|
150659
150767
|
info = getFixesInfoForNonUMDImport(context, symbolToken, useAutoImportProvider);
|
|
150660
150768
|
}
|
|
150661
150769
|
var packageJsonImportFilter = ts.createPackageJsonImportFilter(context.sourceFile, context.preferences, context.host);
|
|
150662
|
-
return info && __assign(__assign({}, info), { fixes: sortFixes(info.fixes, context.sourceFile, context.program, packageJsonImportFilter) });
|
|
150770
|
+
return info && __assign(__assign({}, info), { fixes: sortFixes(info.fixes, context.sourceFile, context.program, packageJsonImportFilter, context.host) });
|
|
150663
150771
|
}
|
|
150664
|
-
function sortFixes(fixes, sourceFile, program, packageJsonImportFilter) {
|
|
150665
|
-
|
|
150772
|
+
function sortFixes(fixes, sourceFile, program, packageJsonImportFilter, host) {
|
|
150773
|
+
var _toPath = function (fileName) { return ts.toPath(fileName, host.getCurrentDirectory(), ts.hostGetCanonicalFileName(host)); };
|
|
150774
|
+
return ts.sort(fixes, function (a, b) { return ts.compareValues(a.kind, b.kind) || compareModuleSpecifiers(a, b, sourceFile, program, packageJsonImportFilter.allowsImportingSpecifier, _toPath); });
|
|
150666
150775
|
}
|
|
150667
|
-
function getBestFix(fixes, sourceFile, program, packageJsonImportFilter) {
|
|
150776
|
+
function getBestFix(fixes, sourceFile, program, packageJsonImportFilter, host) {
|
|
150668
150777
|
if (!ts.some(fixes))
|
|
150669
150778
|
return;
|
|
150670
150779
|
// These will always be placed first if available, and are better than other kinds
|
|
@@ -150673,22 +150782,37 @@ var ts;
|
|
|
150673
150782
|
}
|
|
150674
150783
|
return fixes.reduce(function (best, fix) {
|
|
150675
150784
|
// Takes true branch of conditional if `fix` is better than `best`
|
|
150676
|
-
return compareModuleSpecifiers(fix, best, sourceFile, program, packageJsonImportFilter.allowsImportingSpecifier) === -1 /* LessThan */ ? fix : best;
|
|
150785
|
+
return compareModuleSpecifiers(fix, best, sourceFile, program, packageJsonImportFilter.allowsImportingSpecifier, function (fileName) { return ts.toPath(fileName, host.getCurrentDirectory(), ts.hostGetCanonicalFileName(host)); }) === -1 /* LessThan */ ? fix : best;
|
|
150677
150786
|
});
|
|
150678
150787
|
}
|
|
150679
150788
|
/** @returns `Comparison.LessThan` if `a` is better than `b`. */
|
|
150680
|
-
function compareModuleSpecifiers(a, b, importingFile, program, allowsImportingSpecifier) {
|
|
150789
|
+
function compareModuleSpecifiers(a, b, importingFile, program, allowsImportingSpecifier, toPath) {
|
|
150681
150790
|
if (a.kind !== 0 /* UseNamespace */ && b.kind !== 0 /* UseNamespace */) {
|
|
150682
150791
|
return ts.compareBooleans(allowsImportingSpecifier(b.moduleSpecifier), allowsImportingSpecifier(a.moduleSpecifier))
|
|
150683
150792
|
|| compareNodeCoreModuleSpecifiers(a.moduleSpecifier, b.moduleSpecifier, importingFile, program)
|
|
150684
|
-
|| ts.compareBooleans(
|
|
150793
|
+
|| ts.compareBooleans(isFixPossiblyReExportingImportingFile(a, importingFile, program.getCompilerOptions(), toPath), isFixPossiblyReExportingImportingFile(b, importingFile, program.getCompilerOptions(), toPath))
|
|
150685
150794
|
|| ts.compareNumberOfDirectorySeparators(a.moduleSpecifier, b.moduleSpecifier);
|
|
150686
150795
|
}
|
|
150687
150796
|
return 0 /* EqualTo */;
|
|
150688
150797
|
}
|
|
150689
|
-
|
|
150690
|
-
|
|
150691
|
-
|
|
150798
|
+
// This is a simple heuristic to try to avoid creating an import cycle with a barrel re-export.
|
|
150799
|
+
// E.g., do not `import { Foo } from ".."` when you could `import { Foo } from "../Foo"`.
|
|
150800
|
+
// This can produce false positives or negatives if re-exports cross into sibling directories
|
|
150801
|
+
// (e.g. `export * from "../whatever"`) or are not named "index" (we don't even try to consider
|
|
150802
|
+
// this if we're in a resolution mode where you can't drop trailing "/index" from paths).
|
|
150803
|
+
function isFixPossiblyReExportingImportingFile(fix, importingFile, compilerOptions, toPath) {
|
|
150804
|
+
var _a;
|
|
150805
|
+
if (fix.isReExport &&
|
|
150806
|
+
((_a = fix.exportInfo) === null || _a === void 0 ? void 0 : _a.moduleFileName) &&
|
|
150807
|
+
ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeJs &&
|
|
150808
|
+
isIndexFileName(fix.exportInfo.moduleFileName)) {
|
|
150809
|
+
var reExportDir = toPath(ts.getDirectoryPath(fix.exportInfo.moduleFileName));
|
|
150810
|
+
return ts.startsWith((importingFile.path), reExportDir);
|
|
150811
|
+
}
|
|
150812
|
+
return false;
|
|
150813
|
+
}
|
|
150814
|
+
function isIndexFileName(fileName) {
|
|
150815
|
+
return ts.getBaseFileName(fileName, [".js", ".jsx", ".d.ts", ".ts", ".tsx"], /*ignoreCase*/ true) === "index";
|
|
150692
150816
|
}
|
|
150693
150817
|
function compareNodeCoreModuleSpecifiers(a, b, importingFile, program) {
|
|
150694
150818
|
if (ts.startsWith(a, "node:") && !ts.startsWith(b, "node:"))
|
|
@@ -150706,9 +150830,9 @@ var ts;
|
|
|
150706
150830
|
return undefined;
|
|
150707
150831
|
var symbol = checker.getAliasedSymbol(umdSymbol);
|
|
150708
150832
|
var symbolName = umdSymbol.name;
|
|
150709
|
-
var
|
|
150833
|
+
var exportInfo = [{ symbol: umdSymbol, moduleSymbol: symbol, moduleFileName: undefined, exportKind: 3 /* UMD */, targetFlags: symbol.flags, isFromPackageJson: false }];
|
|
150710
150834
|
var useRequire = shouldUseRequire(sourceFile, program);
|
|
150711
|
-
var fixes = getImportFixes(
|
|
150835
|
+
var fixes = getImportFixes(exportInfo, symbolName, ts.isIdentifier(token) ? token.getStart(sourceFile) : undefined, /*isValidTypeOnlyUseSite*/ false, useRequire, program, sourceFile, host, preferences);
|
|
150712
150836
|
return { fixes: fixes, symbolName: symbolName, errorIdentifierText: (_b = ts.tryCast(token, ts.isIdentifier)) === null || _b === void 0 ? void 0 : _b.text };
|
|
150713
150837
|
}
|
|
150714
150838
|
function getUmdSymbol(token, checker) {
|
|
@@ -150763,7 +150887,7 @@ var ts;
|
|
|
150763
150887
|
case ts.ModuleKind.NodeNext:
|
|
150764
150888
|
return importingFile.impliedNodeFormat === ts.ModuleKind.ESNext ? 2 /* Namespace */ : 3 /* CommonJS */;
|
|
150765
150889
|
default:
|
|
150766
|
-
return ts.Debug.assertNever(moduleKind, "Unexpected moduleKind "
|
|
150890
|
+
return ts.Debug.assertNever(moduleKind, "Unexpected moduleKind ".concat(moduleKind));
|
|
150767
150891
|
}
|
|
150768
150892
|
}
|
|
150769
150893
|
function getFixesInfoForNonUMDImport(_a, symbolToken, useAutoImportProvider) {
|
|
@@ -150775,8 +150899,8 @@ var ts;
|
|
|
150775
150899
|
ts.Debug.assert(symbolName !== "default" /* Default */, "'default' isn't a legal identifier and couldn't occur here");
|
|
150776
150900
|
var isValidTypeOnlyUseSite = ts.isValidTypeOnlyAliasUseSite(symbolToken);
|
|
150777
150901
|
var useRequire = shouldUseRequire(sourceFile, program);
|
|
150778
|
-
var
|
|
150779
|
-
var fixes = ts.arrayFrom(ts.flatMapIterator(
|
|
150902
|
+
var exportInfo = getExportInfos(symbolName, ts.isJSXTagName(symbolToken), ts.getMeaningFromLocation(symbolToken), cancellationToken, sourceFile, program, useAutoImportProvider, host, preferences);
|
|
150903
|
+
var fixes = ts.arrayFrom(ts.flatMapIterator(exportInfo.entries(), function (_a) {
|
|
150780
150904
|
var _ = _a[0], exportInfos = _a[1];
|
|
150781
150905
|
return getImportFixes(exportInfos, symbolName, symbolToken.getStart(sourceFile), isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences);
|
|
150782
150906
|
}));
|
|
@@ -150886,7 +151010,7 @@ var ts;
|
|
|
150886
151010
|
switch (fix.kind) {
|
|
150887
151011
|
case 0 /* UseNamespace */:
|
|
150888
151012
|
addNamespaceQualifier(changes, sourceFile, fix);
|
|
150889
|
-
return [ts.Diagnostics.Change_0_to_1, symbolName, fix.namespacePrefix
|
|
151013
|
+
return [ts.Diagnostics.Change_0_to_1, symbolName, "".concat(fix.namespacePrefix, ".").concat(symbolName)];
|
|
150890
151014
|
case 1 /* JsdocTypeImport */:
|
|
150891
151015
|
addImportType(changes, sourceFile, fix, quotePreference);
|
|
150892
151016
|
return [ts.Diagnostics.Change_0_to_1, symbolName, getImportTypePrefix(fix.moduleSpecifier, quotePreference) + symbolName];
|
|
@@ -150917,7 +151041,7 @@ var ts;
|
|
|
150917
151041
|
: [ts.Diagnostics.Remove_type_from_import_declaration_from_0, getModuleSpecifierText(promotedDeclaration)];
|
|
150918
151042
|
}
|
|
150919
151043
|
default:
|
|
150920
|
-
return ts.Debug.assertNever(fix, "Unexpected fix kind "
|
|
151044
|
+
return ts.Debug.assertNever(fix, "Unexpected fix kind ".concat(fix.kind));
|
|
150921
151045
|
}
|
|
150922
151046
|
}
|
|
150923
151047
|
function getModuleSpecifierText(promotedDeclaration) {
|
|
@@ -151070,7 +151194,7 @@ var ts;
|
|
|
151070
151194
|
}
|
|
151071
151195
|
function getImportTypePrefix(moduleSpecifier, quotePreference) {
|
|
151072
151196
|
var quote = ts.getQuoteFromPreference(quotePreference);
|
|
151073
|
-
return "import("
|
|
151197
|
+
return "import(".concat(quote).concat(moduleSpecifier).concat(quote, ").");
|
|
151074
151198
|
}
|
|
151075
151199
|
function needsTypeOnly(_a) {
|
|
151076
151200
|
var addAsTypeOnly = _a.addAsTypeOnly;
|
|
@@ -151166,7 +151290,7 @@ var ts;
|
|
|
151166
151290
|
lastCharWasValid = isValid;
|
|
151167
151291
|
}
|
|
151168
151292
|
// Need `|| "_"` to ensure result isn't empty.
|
|
151169
|
-
return !ts.isStringANonContextualKeyword(res) ? res || "_" : "_"
|
|
151293
|
+
return !ts.isStringANonContextualKeyword(res) ? res || "_" : "_".concat(res);
|
|
151170
151294
|
}
|
|
151171
151295
|
codefix.moduleSpecifierToValidIdentifier = moduleSpecifierToValidIdentifier;
|
|
151172
151296
|
})(codefix = ts.codefix || (ts.codefix = {}));
|
|
@@ -152422,7 +152546,7 @@ var ts;
|
|
|
152422
152546
|
break;
|
|
152423
152547
|
}
|
|
152424
152548
|
default:
|
|
152425
|
-
ts.Debug.fail("Bad fixId: "
|
|
152549
|
+
ts.Debug.fail("Bad fixId: ".concat(context.fixId));
|
|
152426
152550
|
}
|
|
152427
152551
|
});
|
|
152428
152552
|
},
|
|
@@ -152870,13 +152994,102 @@ var ts;
|
|
|
152870
152994
|
if (!isValidCharacter(character)) {
|
|
152871
152995
|
return;
|
|
152872
152996
|
}
|
|
152873
|
-
var replacement = useHtmlEntity ? htmlEntity[character] : "{"
|
|
152997
|
+
var replacement = useHtmlEntity ? htmlEntity[character] : "{".concat(ts.quote(sourceFile, preferences, character), "}");
|
|
152874
152998
|
changes.replaceRangeWithText(sourceFile, { pos: start, end: start + 1 }, replacement);
|
|
152875
152999
|
}
|
|
152876
153000
|
})(codefix = ts.codefix || (ts.codefix = {}));
|
|
152877
153001
|
})(ts || (ts = {}));
|
|
152878
153002
|
/* @internal */
|
|
152879
153003
|
var ts;
|
|
153004
|
+
(function (ts) {
|
|
153005
|
+
var codefix;
|
|
153006
|
+
(function (codefix) {
|
|
153007
|
+
var deleteUnmatchedParameter = "deleteUnmatchedParameter";
|
|
153008
|
+
var renameUnmatchedParameter = "renameUnmatchedParameter";
|
|
153009
|
+
var errorCodes = [
|
|
153010
|
+
ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name.code,
|
|
153011
|
+
];
|
|
153012
|
+
codefix.registerCodeFix({
|
|
153013
|
+
fixIds: [deleteUnmatchedParameter, renameUnmatchedParameter],
|
|
153014
|
+
errorCodes: errorCodes,
|
|
153015
|
+
getCodeActions: function getCodeActionsToFixUnmatchedParameter(context) {
|
|
153016
|
+
var sourceFile = context.sourceFile, span = context.span;
|
|
153017
|
+
var actions = [];
|
|
153018
|
+
var info = getInfo(sourceFile, span.start);
|
|
153019
|
+
if (info) {
|
|
153020
|
+
ts.append(actions, getDeleteAction(context, info));
|
|
153021
|
+
ts.append(actions, getRenameAction(context, info));
|
|
153022
|
+
return actions;
|
|
153023
|
+
}
|
|
153024
|
+
return undefined;
|
|
153025
|
+
},
|
|
153026
|
+
getAllCodeActions: function getAllCodeActionsToFixUnmatchedParameter(context) {
|
|
153027
|
+
var tagsToSignature = new ts.Map();
|
|
153028
|
+
return codefix.createCombinedCodeActions(ts.textChanges.ChangeTracker.with(context, function (changes) {
|
|
153029
|
+
codefix.eachDiagnostic(context, errorCodes, function (_a) {
|
|
153030
|
+
var file = _a.file, start = _a.start;
|
|
153031
|
+
var info = getInfo(file, start);
|
|
153032
|
+
if (info) {
|
|
153033
|
+
tagsToSignature.set(info.signature, ts.append(tagsToSignature.get(info.signature), info.jsDocParameterTag));
|
|
153034
|
+
}
|
|
153035
|
+
});
|
|
153036
|
+
tagsToSignature.forEach(function (tags, signature) {
|
|
153037
|
+
if (context.fixId === deleteUnmatchedParameter) {
|
|
153038
|
+
var tagsSet_1 = new ts.Set(tags);
|
|
153039
|
+
changes.filterJSDocTags(signature.getSourceFile(), signature, function (t) { return !tagsSet_1.has(t); });
|
|
153040
|
+
}
|
|
153041
|
+
});
|
|
153042
|
+
}));
|
|
153043
|
+
}
|
|
153044
|
+
});
|
|
153045
|
+
function getDeleteAction(context, _a) {
|
|
153046
|
+
var name = _a.name, signature = _a.signature, jsDocParameterTag = _a.jsDocParameterTag;
|
|
153047
|
+
var changes = ts.textChanges.ChangeTracker.with(context, function (changeTracker) {
|
|
153048
|
+
return changeTracker.filterJSDocTags(context.sourceFile, signature, function (t) { return t !== jsDocParameterTag; });
|
|
153049
|
+
});
|
|
153050
|
+
return codefix.createCodeFixAction(deleteUnmatchedParameter, changes, [ts.Diagnostics.Delete_unused_param_tag_0, name.getText(context.sourceFile)], deleteUnmatchedParameter, ts.Diagnostics.Delete_all_unused_param_tags);
|
|
153051
|
+
}
|
|
153052
|
+
function getRenameAction(context, _a) {
|
|
153053
|
+
var name = _a.name, signature = _a.signature, jsDocParameterTag = _a.jsDocParameterTag;
|
|
153054
|
+
if (!ts.length(signature.parameters))
|
|
153055
|
+
return undefined;
|
|
153056
|
+
var sourceFile = context.sourceFile;
|
|
153057
|
+
var tags = ts.getJSDocTags(signature);
|
|
153058
|
+
var names = new ts.Set();
|
|
153059
|
+
for (var _i = 0, tags_2 = tags; _i < tags_2.length; _i++) {
|
|
153060
|
+
var tag = tags_2[_i];
|
|
153061
|
+
if (ts.isJSDocParameterTag(tag) && ts.isIdentifier(tag.name)) {
|
|
153062
|
+
names.add(tag.name.escapedText);
|
|
153063
|
+
}
|
|
153064
|
+
}
|
|
153065
|
+
// @todo - match to all available names instead to the first parameter name
|
|
153066
|
+
// @see /codeFixRenameUnmatchedParameter3.ts
|
|
153067
|
+
var parameterName = ts.firstDefined(signature.parameters, function (p) {
|
|
153068
|
+
return ts.isIdentifier(p.name) && !names.has(p.name.escapedText) ? p.name.getText(sourceFile) : undefined;
|
|
153069
|
+
});
|
|
153070
|
+
if (parameterName === undefined)
|
|
153071
|
+
return undefined;
|
|
153072
|
+
var newJSDocParameterTag = ts.factory.updateJSDocParameterTag(jsDocParameterTag, jsDocParameterTag.tagName, ts.factory.createIdentifier(parameterName), jsDocParameterTag.isBracketed, jsDocParameterTag.typeExpression, jsDocParameterTag.isNameFirst, jsDocParameterTag.comment);
|
|
153073
|
+
var changes = ts.textChanges.ChangeTracker.with(context, function (changeTracker) {
|
|
153074
|
+
return changeTracker.replaceJSDocComment(sourceFile, signature, ts.map(tags, function (t) { return t === jsDocParameterTag ? newJSDocParameterTag : t; }));
|
|
153075
|
+
});
|
|
153076
|
+
return codefix.createCodeFixActionWithoutFixAll(renameUnmatchedParameter, changes, [ts.Diagnostics.Rename_param_tag_name_0_to_1, name.getText(sourceFile), parameterName]);
|
|
153077
|
+
}
|
|
153078
|
+
function getInfo(sourceFile, pos) {
|
|
153079
|
+
var token = ts.getTokenAtPosition(sourceFile, pos);
|
|
153080
|
+
if (token.parent && ts.isJSDocParameterTag(token.parent) && ts.isIdentifier(token.parent.name)) {
|
|
153081
|
+
var jsDocParameterTag = token.parent;
|
|
153082
|
+
var signature = ts.getHostSignatureFromJSDoc(jsDocParameterTag);
|
|
153083
|
+
if (signature) {
|
|
153084
|
+
return { signature: signature, name: token.parent.name, jsDocParameterTag: jsDocParameterTag };
|
|
153085
|
+
}
|
|
153086
|
+
}
|
|
153087
|
+
return undefined;
|
|
153088
|
+
}
|
|
153089
|
+
})(codefix = ts.codefix || (ts.codefix = {}));
|
|
153090
|
+
})(ts || (ts = {}));
|
|
153091
|
+
/* @internal */
|
|
153092
|
+
var ts;
|
|
152880
153093
|
(function (ts) {
|
|
152881
153094
|
var codefix;
|
|
152882
153095
|
(function (codefix) {
|
|
@@ -153061,11 +153274,11 @@ var ts;
|
|
|
153061
153274
|
token = ts.cast(token.parent, ts.isInferTypeNode).typeParameter.name;
|
|
153062
153275
|
}
|
|
153063
153276
|
if (ts.isIdentifier(token) && canPrefix(token)) {
|
|
153064
|
-
changes.replaceNode(sourceFile, token, ts.factory.createIdentifier("_"
|
|
153277
|
+
changes.replaceNode(sourceFile, token, ts.factory.createIdentifier("_".concat(token.text)));
|
|
153065
153278
|
if (ts.isParameter(token.parent)) {
|
|
153066
153279
|
ts.getJSDocParameterTags(token.parent).forEach(function (tag) {
|
|
153067
153280
|
if (ts.isIdentifier(tag.name)) {
|
|
153068
|
-
changes.replaceNode(sourceFile, tag.name, ts.factory.createIdentifier("_"
|
|
153281
|
+
changes.replaceNode(sourceFile, tag.name, ts.factory.createIdentifier("_".concat(tag.name.text)));
|
|
153069
153282
|
}
|
|
153070
153283
|
});
|
|
153071
153284
|
}
|
|
@@ -153174,6 +153387,9 @@ var ts;
|
|
|
153174
153387
|
case 172 /* SetAccessor */:
|
|
153175
153388
|
// Setter must have a parameter
|
|
153176
153389
|
return false;
|
|
153390
|
+
case 171 /* GetAccessor */:
|
|
153391
|
+
// Getter cannot have parameters
|
|
153392
|
+
return true;
|
|
153177
153393
|
default:
|
|
153178
153394
|
return ts.Debug.failBadSyntaxKind(parent);
|
|
153179
153395
|
}
|
|
@@ -153404,7 +153620,7 @@ var ts;
|
|
|
153404
153620
|
}); }
|
|
153405
153621
|
});
|
|
153406
153622
|
function doChange(changes, sourceFile, name) {
|
|
153407
|
-
changes.replaceNodeWithText(sourceFile, name, name.text
|
|
153623
|
+
changes.replaceNodeWithText(sourceFile, name, "".concat(name.text, "()"));
|
|
153408
153624
|
}
|
|
153409
153625
|
function getCallName(sourceFile, start) {
|
|
153410
153626
|
var token = ts.getTokenAtPosition(sourceFile, start);
|
|
@@ -154528,7 +154744,7 @@ var ts;
|
|
|
154528
154744
|
var parameters = [];
|
|
154529
154745
|
var length = Math.max.apply(Math, calls.map(function (c) { return c.argumentTypes.length; }));
|
|
154530
154746
|
var _loop_16 = function (i) {
|
|
154531
|
-
var symbol = checker.createSymbol(1 /* FunctionScopedVariable */, ts.escapeLeadingUnderscores("arg"
|
|
154747
|
+
var symbol = checker.createSymbol(1 /* FunctionScopedVariable */, ts.escapeLeadingUnderscores("arg".concat(i)));
|
|
154532
154748
|
symbol.type = combineTypes(calls.map(function (call) { return call.argumentTypes[i] || checker.getUndefinedType(); }));
|
|
154533
154749
|
if (calls.some(function (call) { return call.argumentTypes[i] === undefined; })) {
|
|
154534
154750
|
symbol.flags |= 16777216 /* Optional */;
|
|
@@ -154631,7 +154847,7 @@ var ts;
|
|
|
154631
154847
|
codefix.createCodeFixActionWithoutFixAll(fixName, [codefix.createFileTextChanges(sourceFile.fileName, [
|
|
154632
154848
|
ts.createTextChange(sourceFile.checkJsDirective
|
|
154633
154849
|
? ts.createTextSpanFromBounds(sourceFile.checkJsDirective.pos, sourceFile.checkJsDirective.end)
|
|
154634
|
-
: ts.createTextSpan(0, 0), "// @ts-nocheck"
|
|
154850
|
+
: ts.createTextSpan(0, 0), "// @ts-nocheck".concat(newLineCharacter)),
|
|
154635
154851
|
])], ts.Diagnostics.Disable_checking_for_this_file),
|
|
154636
154852
|
];
|
|
154637
154853
|
if (ts.textChanges.isValidLocationToAddComment(sourceFile, span.start)) {
|
|
@@ -154897,7 +155113,7 @@ var ts;
|
|
|
154897
155113
|
var typeParameters = isJs || typeArguments === undefined
|
|
154898
155114
|
? undefined
|
|
154899
155115
|
: ts.map(typeArguments, function (_, i) {
|
|
154900
|
-
return ts.factory.createTypeParameterDeclaration(84 /* T */ + typeArguments.length - 1 <= 90 /* Z */ ? String.fromCharCode(84 /* T */ + i) : "T"
|
|
155116
|
+
return ts.factory.createTypeParameterDeclaration(84 /* T */ + typeArguments.length - 1 <= 90 /* Z */ ? String.fromCharCode(84 /* T */ + i) : "T".concat(i));
|
|
154901
155117
|
});
|
|
154902
155118
|
var parameters = createDummyParameters(args.length, names, types, /*minArgumentCount*/ undefined, isJs);
|
|
154903
155119
|
var type = isJs || contextualType === undefined
|
|
@@ -154932,7 +155148,7 @@ var ts;
|
|
|
154932
155148
|
/*decorators*/ undefined,
|
|
154933
155149
|
/*modifiers*/ undefined,
|
|
154934
155150
|
/*dotDotDotToken*/ undefined,
|
|
154935
|
-
/*name*/ names && names[i] || "arg"
|
|
155151
|
+
/*name*/ names && names[i] || "arg".concat(i),
|
|
154936
155152
|
/*questionToken*/ minArgumentCount !== undefined && i >= minArgumentCount ? ts.factory.createToken(57 /* QuestionToken */) : undefined,
|
|
154937
155153
|
/*type*/ inJs ? undefined : types && types[i] || ts.factory.createKeywordTypeNode(130 /* AnyKeyword */),
|
|
154938
155154
|
/*initializer*/ undefined);
|
|
@@ -155183,7 +155399,7 @@ var ts;
|
|
|
155183
155399
|
}
|
|
155184
155400
|
var name = declaration.name.text;
|
|
155185
155401
|
var startWithUnderscore = ts.startsWithUnderscore(name);
|
|
155186
|
-
var fieldName = createPropertyName(startWithUnderscore ? name : ts.getUniqueName("_"
|
|
155402
|
+
var fieldName = createPropertyName(startWithUnderscore ? name : ts.getUniqueName("_".concat(name), file), declaration.name);
|
|
155187
155403
|
var accessorName = createPropertyName(startWithUnderscore ? ts.getUniqueName(name.substring(1), file) : name, declaration.name);
|
|
155188
155404
|
return {
|
|
155189
155405
|
isStatic: ts.hasStaticModifier(declaration),
|
|
@@ -155784,10 +156000,12 @@ var ts;
|
|
|
155784
156000
|
});
|
|
155785
156001
|
function getInfo(sourceFile, pos) {
|
|
155786
156002
|
var token = ts.getTokenAtPosition(sourceFile, pos);
|
|
155787
|
-
var indexSignature = ts.
|
|
155788
|
-
if (
|
|
156003
|
+
var indexSignature = ts.tryCast(token.parent.parent, ts.isIndexSignatureDeclaration);
|
|
156004
|
+
if (!indexSignature)
|
|
156005
|
+
return undefined;
|
|
156006
|
+
var container = ts.isInterfaceDeclaration(indexSignature.parent) ? indexSignature.parent : ts.tryCast(indexSignature.parent.parent, ts.isTypeAliasDeclaration);
|
|
156007
|
+
if (!container)
|
|
155789
156008
|
return undefined;
|
|
155790
|
-
var container = ts.isInterfaceDeclaration(indexSignature.parent) ? indexSignature.parent : ts.cast(indexSignature.parent.parent, ts.isTypeAliasDeclaration);
|
|
155791
156009
|
return { indexSignature: indexSignature, container: container };
|
|
155792
156010
|
}
|
|
155793
156011
|
function createTypeAliasFromInterface(declaration, type) {
|
|
@@ -156220,7 +156438,7 @@ var ts;
|
|
|
156220
156438
|
changes.insertNodeAfter(exportingSourceFile, exportNode, ts.factory.createExportDefault(ts.factory.createIdentifier(exportName.text)));
|
|
156221
156439
|
break;
|
|
156222
156440
|
default:
|
|
156223
|
-
ts.Debug.fail("Unexpected exportNode kind "
|
|
156441
|
+
ts.Debug.fail("Unexpected exportNode kind ".concat(exportNode.kind));
|
|
156224
156442
|
}
|
|
156225
156443
|
}
|
|
156226
156444
|
}
|
|
@@ -156308,7 +156526,7 @@ var ts;
|
|
|
156308
156526
|
break;
|
|
156309
156527
|
}
|
|
156310
156528
|
default:
|
|
156311
|
-
ts.Debug.assertNever(parent, "Unexpected parent kind "
|
|
156529
|
+
ts.Debug.assertNever(parent, "Unexpected parent kind ".concat(parent.kind));
|
|
156312
156530
|
}
|
|
156313
156531
|
}
|
|
156314
156532
|
function makeImportSpecifier(propertyName, name) {
|
|
@@ -156891,7 +157109,7 @@ var ts;
|
|
|
156891
157109
|
var newComment = ts.displayPartsToString(parameterDocComment);
|
|
156892
157110
|
if (newComment.length) {
|
|
156893
157111
|
ts.setSyntheticLeadingComments(result, [{
|
|
156894
|
-
text: "*\n"
|
|
157112
|
+
text: "*\n".concat(newComment.split("\n").map(function (c) { return " * ".concat(c); }).join("\n"), "\n "),
|
|
156895
157113
|
kind: 3 /* MultiLineCommentTrivia */,
|
|
156896
157114
|
pos: -1,
|
|
156897
157115
|
end: -1,
|
|
@@ -157036,7 +157254,7 @@ var ts;
|
|
|
157036
157254
|
usedFunctionNames.set(description, true);
|
|
157037
157255
|
functionActions.push({
|
|
157038
157256
|
description: description,
|
|
157039
|
-
name: "function_scope_"
|
|
157257
|
+
name: "function_scope_".concat(i),
|
|
157040
157258
|
kind: extractFunctionAction.kind
|
|
157041
157259
|
});
|
|
157042
157260
|
}
|
|
@@ -157044,7 +157262,7 @@ var ts;
|
|
|
157044
157262
|
else if (!innermostErrorFunctionAction) {
|
|
157045
157263
|
innermostErrorFunctionAction = {
|
|
157046
157264
|
description: description,
|
|
157047
|
-
name: "function_scope_"
|
|
157265
|
+
name: "function_scope_".concat(i),
|
|
157048
157266
|
notApplicableReason: getStringError(functionExtraction.errors),
|
|
157049
157267
|
kind: extractFunctionAction.kind
|
|
157050
157268
|
};
|
|
@@ -157060,7 +157278,7 @@ var ts;
|
|
|
157060
157278
|
usedConstantNames.set(description_1, true);
|
|
157061
157279
|
constantActions.push({
|
|
157062
157280
|
description: description_1,
|
|
157063
|
-
name: "constant_scope_"
|
|
157281
|
+
name: "constant_scope_".concat(i),
|
|
157064
157282
|
kind: extractConstantAction.kind
|
|
157065
157283
|
});
|
|
157066
157284
|
}
|
|
@@ -157068,7 +157286,7 @@ var ts;
|
|
|
157068
157286
|
else if (!innermostErrorConstantAction) {
|
|
157069
157287
|
innermostErrorConstantAction = {
|
|
157070
157288
|
description: description,
|
|
157071
|
-
name: "constant_scope_"
|
|
157289
|
+
name: "constant_scope_".concat(i),
|
|
157072
157290
|
notApplicableReason: getStringError(constantExtraction.errors),
|
|
157073
157291
|
kind: extractConstantAction.kind
|
|
157074
157292
|
};
|
|
@@ -157652,28 +157870,28 @@ var ts;
|
|
|
157652
157870
|
case 212 /* FunctionExpression */:
|
|
157653
157871
|
case 255 /* FunctionDeclaration */:
|
|
157654
157872
|
return scope.name
|
|
157655
|
-
? "function '"
|
|
157873
|
+
? "function '".concat(scope.name.text, "'")
|
|
157656
157874
|
: ts.ANONYMOUS;
|
|
157657
157875
|
case 213 /* ArrowFunction */:
|
|
157658
157876
|
return "arrow function";
|
|
157659
157877
|
case 168 /* MethodDeclaration */:
|
|
157660
|
-
return "method '"
|
|
157878
|
+
return "method '".concat(scope.name.getText(), "'");
|
|
157661
157879
|
case 171 /* GetAccessor */:
|
|
157662
|
-
return "'get "
|
|
157880
|
+
return "'get ".concat(scope.name.getText(), "'");
|
|
157663
157881
|
case 172 /* SetAccessor */:
|
|
157664
|
-
return "'set "
|
|
157882
|
+
return "'set ".concat(scope.name.getText(), "'");
|
|
157665
157883
|
default:
|
|
157666
|
-
throw ts.Debug.assertNever(scope, "Unexpected scope kind "
|
|
157884
|
+
throw ts.Debug.assertNever(scope, "Unexpected scope kind ".concat(scope.kind));
|
|
157667
157885
|
}
|
|
157668
157886
|
}
|
|
157669
157887
|
function getDescriptionForClassLikeDeclaration(scope) {
|
|
157670
157888
|
return scope.kind === 256 /* ClassDeclaration */
|
|
157671
|
-
? scope.name ? "class '"
|
|
157672
|
-
: scope.name ? "class expression '"
|
|
157889
|
+
? scope.name ? "class '".concat(scope.name.text, "'") : "anonymous class declaration"
|
|
157890
|
+
: scope.name ? "class expression '".concat(scope.name.text, "'") : "anonymous class expression";
|
|
157673
157891
|
}
|
|
157674
157892
|
function getDescriptionForModuleLikeDeclaration(scope) {
|
|
157675
157893
|
return scope.kind === 261 /* ModuleBlock */
|
|
157676
|
-
? "namespace '"
|
|
157894
|
+
? "namespace '".concat(scope.parent.name.getText(), "'")
|
|
157677
157895
|
: scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */;
|
|
157678
157896
|
}
|
|
157679
157897
|
var SpecialScope;
|
|
@@ -159149,7 +159367,7 @@ var ts;
|
|
|
159149
159367
|
case 253 /* VariableDeclaration */:
|
|
159150
159368
|
return ts.tryCast(node.name, ts.isIdentifier);
|
|
159151
159369
|
default:
|
|
159152
|
-
return ts.Debug.assertNever(node, "Unexpected node kind "
|
|
159370
|
+
return ts.Debug.assertNever(node, "Unexpected node kind ".concat(node.kind));
|
|
159153
159371
|
}
|
|
159154
159372
|
}
|
|
159155
159373
|
function updateNamespaceLikeImport(changes, sourceFile, checker, movedSymbols, newModuleName, newModuleSpecifier, oldImportId, oldImportNode) {
|
|
@@ -159186,7 +159404,7 @@ var ts;
|
|
|
159186
159404
|
case 253 /* VariableDeclaration */:
|
|
159187
159405
|
return ts.factory.createVariableDeclaration(newNamespaceId, /*exclamationToken*/ undefined, /*type*/ undefined, createRequireCall(newModuleString));
|
|
159188
159406
|
default:
|
|
159189
|
-
return ts.Debug.assertNever(node, "Unexpected node kind "
|
|
159407
|
+
return ts.Debug.assertNever(node, "Unexpected node kind ".concat(node.kind));
|
|
159190
159408
|
}
|
|
159191
159409
|
}
|
|
159192
159410
|
function moduleSpecifierFromImport(i) {
|
|
@@ -159273,7 +159491,7 @@ var ts;
|
|
|
159273
159491
|
deleteUnusedImportsInVariableDeclaration(sourceFile, importDecl, changes, isUnused);
|
|
159274
159492
|
break;
|
|
159275
159493
|
default:
|
|
159276
|
-
ts.Debug.assertNever(importDecl, "Unexpected import decl kind "
|
|
159494
|
+
ts.Debug.assertNever(importDecl, "Unexpected import decl kind ".concat(importDecl.kind));
|
|
159277
159495
|
}
|
|
159278
159496
|
}
|
|
159279
159497
|
function deleteUnusedImportsInDeclaration(sourceFile, importDecl, changes, isUnused) {
|
|
@@ -159373,7 +159591,7 @@ var ts;
|
|
|
159373
159591
|
var name = ts.combinePaths(inDirectory, newModuleName + extension);
|
|
159374
159592
|
if (!host.fileExists(name))
|
|
159375
159593
|
return newModuleName; // TODO: GH#18217
|
|
159376
|
-
newModuleName = moduleName
|
|
159594
|
+
newModuleName = "".concat(moduleName, ".").concat(i);
|
|
159377
159595
|
}
|
|
159378
159596
|
}
|
|
159379
159597
|
function getNewModuleName(movedSymbols) {
|
|
@@ -159480,7 +159698,7 @@ var ts;
|
|
|
159480
159698
|
return name ? makeVariableStatement(name, i.type, createRequireCall(moduleSpecifier), i.parent.flags) : undefined;
|
|
159481
159699
|
}
|
|
159482
159700
|
default:
|
|
159483
|
-
return ts.Debug.assertNever(i, "Unexpected import kind "
|
|
159701
|
+
return ts.Debug.assertNever(i, "Unexpected import kind ".concat(i.kind));
|
|
159484
159702
|
}
|
|
159485
159703
|
}
|
|
159486
159704
|
function filterNamedBindings(namedBindings, keep) {
|
|
@@ -159595,7 +159813,7 @@ var ts;
|
|
|
159595
159813
|
case 200 /* ObjectBindingPattern */:
|
|
159596
159814
|
return ts.firstDefined(name.elements, function (em) { return ts.isOmittedExpression(em) ? undefined : forEachTopLevelDeclarationInBindingName(em.name, cb); });
|
|
159597
159815
|
default:
|
|
159598
|
-
return ts.Debug.assertNever(name, "Unexpected name kind "
|
|
159816
|
+
return ts.Debug.assertNever(name, "Unexpected name kind ".concat(name.kind));
|
|
159599
159817
|
}
|
|
159600
159818
|
}
|
|
159601
159819
|
function nameOfTopLevelDeclaration(d) {
|
|
@@ -159656,7 +159874,7 @@ var ts;
|
|
|
159656
159874
|
case 237 /* ExpressionStatement */:
|
|
159657
159875
|
return ts.Debug.fail(); // Shouldn't try to add 'export' keyword to `exports.x = ...`
|
|
159658
159876
|
default:
|
|
159659
|
-
return ts.Debug.assertNever(d, "Unexpected declaration kind "
|
|
159877
|
+
return ts.Debug.assertNever(d, "Unexpected declaration kind ".concat(d.kind));
|
|
159660
159878
|
}
|
|
159661
159879
|
}
|
|
159662
159880
|
function addCommonjsExport(decl) {
|
|
@@ -159678,7 +159896,7 @@ var ts;
|
|
|
159678
159896
|
case 237 /* ExpressionStatement */:
|
|
159679
159897
|
return ts.Debug.fail("Can't export an ExpressionStatement"); // Shouldn't try to add 'export' keyword to `exports.x = ...`
|
|
159680
159898
|
default:
|
|
159681
|
-
return ts.Debug.assertNever(decl, "Unexpected decl kind "
|
|
159899
|
+
return ts.Debug.assertNever(decl, "Unexpected decl kind ".concat(decl.kind));
|
|
159682
159900
|
}
|
|
159683
159901
|
}
|
|
159684
159902
|
/** Creates `exports.x = x;` */
|
|
@@ -160316,7 +160534,7 @@ var ts;
|
|
|
160316
160534
|
return [functionDeclaration.name, functionDeclaration.parent.name];
|
|
160317
160535
|
return [functionDeclaration.parent.name];
|
|
160318
160536
|
default:
|
|
160319
|
-
return ts.Debug.assertNever(functionDeclaration, "Unexpected function declaration kind "
|
|
160537
|
+
return ts.Debug.assertNever(functionDeclaration, "Unexpected function declaration kind ".concat(functionDeclaration.kind));
|
|
160320
160538
|
}
|
|
160321
160539
|
}
|
|
160322
160540
|
})(convertParamsToDestructuredObject = refactor.convertParamsToDestructuredObject || (refactor.convertParamsToDestructuredObject = {}));
|
|
@@ -161020,7 +161238,7 @@ var ts;
|
|
|
161020
161238
|
var textPos = ts.scanner.getTextPos();
|
|
161021
161239
|
if (textPos <= end) {
|
|
161022
161240
|
if (token === 79 /* Identifier */) {
|
|
161023
|
-
ts.Debug.fail("Did not expect "
|
|
161241
|
+
ts.Debug.fail("Did not expect ".concat(ts.Debug.formatSyntaxKind(parent.kind), " to have an Identifier in its trivia"));
|
|
161024
161242
|
}
|
|
161025
161243
|
nodes.push(createNode(token, pos, textPos, parent));
|
|
161026
161244
|
}
|
|
@@ -161950,7 +162168,7 @@ var ts;
|
|
|
161950
162168
|
function getValidSourceFile(fileName) {
|
|
161951
162169
|
var sourceFile = program.getSourceFile(fileName);
|
|
161952
162170
|
if (!sourceFile) {
|
|
161953
|
-
var error = new Error("Could not find source file: '"
|
|
162171
|
+
var error = new Error("Could not find source file: '".concat(fileName, "'."));
|
|
161954
162172
|
// We've been having trouble debugging this, so attach sidecar data for the tsserver log.
|
|
161955
162173
|
// See https://github.com/microsoft/TypeScript/issues/30180.
|
|
161956
162174
|
error.ProgramFiles = program.getSourceFiles().map(function (f) { return f.fileName; });
|
|
@@ -162626,7 +162844,7 @@ var ts;
|
|
|
162626
162844
|
var element = token.kind === 31 /* GreaterThanToken */ && ts.isJsxOpeningElement(token.parent) ? token.parent.parent
|
|
162627
162845
|
: ts.isJsxText(token) && ts.isJsxElement(token.parent) ? token.parent : undefined;
|
|
162628
162846
|
if (element && isUnclosedTag(element)) {
|
|
162629
|
-
return { newText: "</"
|
|
162847
|
+
return { newText: "</".concat(element.openingElement.tagName.getText(sourceFile), ">") };
|
|
162630
162848
|
}
|
|
162631
162849
|
var fragment = token.kind === 31 /* GreaterThanToken */ && ts.isJsxOpeningFragment(token.parent) ? token.parent.parent
|
|
162632
162850
|
: ts.isJsxText(token) && ts.isJsxFragment(token.parent) ? token.parent : undefined;
|
|
@@ -162732,7 +162950,7 @@ var ts;
|
|
|
162732
162950
|
pos = commentRange.end + 1;
|
|
162733
162951
|
}
|
|
162734
162952
|
else { // If it's not in a comment range, then we need to comment the uncommented portions.
|
|
162735
|
-
var newPos = text.substring(pos, textRange.end).search("("
|
|
162953
|
+
var newPos = text.substring(pos, textRange.end).search("(".concat(openMultilineRegex, ")|(").concat(closeMultilineRegex, ")"));
|
|
162736
162954
|
isCommenting = insertComment !== undefined
|
|
162737
162955
|
? insertComment
|
|
162738
162956
|
: isCommenting || !ts.isTextWhiteSpaceLike(text, pos, newPos === -1 ? textRange.end : pos + newPos); // If isCommenting is already true we don't need to check whitespace again.
|
|
@@ -163127,14 +163345,14 @@ var ts;
|
|
|
163127
163345
|
case ts.LanguageServiceMode.PartialSemantic:
|
|
163128
163346
|
invalidOperationsInPartialSemanticMode.forEach(function (key) {
|
|
163129
163347
|
return ls[key] = function () {
|
|
163130
|
-
throw new Error("LanguageService Operation: "
|
|
163348
|
+
throw new Error("LanguageService Operation: ".concat(key, " not allowed in LanguageServiceMode.PartialSemantic"));
|
|
163131
163349
|
};
|
|
163132
163350
|
});
|
|
163133
163351
|
break;
|
|
163134
163352
|
case ts.LanguageServiceMode.Syntactic:
|
|
163135
163353
|
invalidOperationsInSyntacticMode.forEach(function (key) {
|
|
163136
163354
|
return ls[key] = function () {
|
|
163137
|
-
throw new Error("LanguageService Operation: "
|
|
163355
|
+
throw new Error("LanguageService Operation: ".concat(key, " not allowed in LanguageServiceMode.Syntactic"));
|
|
163138
163356
|
};
|
|
163139
163357
|
});
|
|
163140
163358
|
break;
|
|
@@ -164116,13 +164334,13 @@ var ts;
|
|
|
164116
164334
|
var result = action();
|
|
164117
164335
|
if (logPerformance) {
|
|
164118
164336
|
var end = ts.timestamp();
|
|
164119
|
-
logger.log(actionDescription
|
|
164337
|
+
logger.log("".concat(actionDescription, " completed in ").concat(end - start, " msec"));
|
|
164120
164338
|
if (ts.isString(result)) {
|
|
164121
164339
|
var str = result;
|
|
164122
164340
|
if (str.length > 128) {
|
|
164123
164341
|
str = str.substring(0, 128) + "...";
|
|
164124
164342
|
}
|
|
164125
|
-
logger.log(" result.length="
|
|
164343
|
+
logger.log(" result.length=".concat(str.length, ", result='").concat(JSON.stringify(str), "'"));
|
|
164126
164344
|
}
|
|
164127
164345
|
}
|
|
164128
164346
|
return result;
|
|
@@ -164204,7 +164422,7 @@ var ts;
|
|
|
164204
164422
|
* Update the list of scripts known to the compiler
|
|
164205
164423
|
*/
|
|
164206
164424
|
LanguageServiceShimObject.prototype.refresh = function (throwOnError) {
|
|
164207
|
-
this.forwardJSONCall("refresh("
|
|
164425
|
+
this.forwardJSONCall("refresh(".concat(throwOnError, ")"), function () { return null; } // eslint-disable-line no-null/no-null
|
|
164208
164426
|
);
|
|
164209
164427
|
};
|
|
164210
164428
|
LanguageServiceShimObject.prototype.cleanupSemanticCache = function () {
|
|
@@ -164220,43 +164438,43 @@ var ts;
|
|
|
164220
164438
|
};
|
|
164221
164439
|
LanguageServiceShimObject.prototype.getSyntacticClassifications = function (fileName, start, length) {
|
|
164222
164440
|
var _this = this;
|
|
164223
|
-
return this.forwardJSONCall("getSyntacticClassifications('"
|
|
164441
|
+
return this.forwardJSONCall("getSyntacticClassifications('".concat(fileName, "', ").concat(start, ", ").concat(length, ")"), function () { return _this.languageService.getSyntacticClassifications(fileName, ts.createTextSpan(start, length)); });
|
|
164224
164442
|
};
|
|
164225
164443
|
LanguageServiceShimObject.prototype.getSemanticClassifications = function (fileName, start, length) {
|
|
164226
164444
|
var _this = this;
|
|
164227
|
-
return this.forwardJSONCall("getSemanticClassifications('"
|
|
164445
|
+
return this.forwardJSONCall("getSemanticClassifications('".concat(fileName, "', ").concat(start, ", ").concat(length, ")"), function () { return _this.languageService.getSemanticClassifications(fileName, ts.createTextSpan(start, length)); });
|
|
164228
164446
|
};
|
|
164229
164447
|
LanguageServiceShimObject.prototype.getEncodedSyntacticClassifications = function (fileName, start, length) {
|
|
164230
164448
|
var _this = this;
|
|
164231
|
-
return this.forwardJSONCall("getEncodedSyntacticClassifications('"
|
|
164449
|
+
return this.forwardJSONCall("getEncodedSyntacticClassifications('".concat(fileName, "', ").concat(start, ", ").concat(length, ")"),
|
|
164232
164450
|
// directly serialize the spans out to a string. This is much faster to decode
|
|
164233
164451
|
// on the managed side versus a full JSON array.
|
|
164234
164452
|
function () { return convertClassifications(_this.languageService.getEncodedSyntacticClassifications(fileName, ts.createTextSpan(start, length))); });
|
|
164235
164453
|
};
|
|
164236
164454
|
LanguageServiceShimObject.prototype.getEncodedSemanticClassifications = function (fileName, start, length) {
|
|
164237
164455
|
var _this = this;
|
|
164238
|
-
return this.forwardJSONCall("getEncodedSemanticClassifications('"
|
|
164456
|
+
return this.forwardJSONCall("getEncodedSemanticClassifications('".concat(fileName, "', ").concat(start, ", ").concat(length, ")"),
|
|
164239
164457
|
// directly serialize the spans out to a string. This is much faster to decode
|
|
164240
164458
|
// on the managed side versus a full JSON array.
|
|
164241
164459
|
function () { return convertClassifications(_this.languageService.getEncodedSemanticClassifications(fileName, ts.createTextSpan(start, length))); });
|
|
164242
164460
|
};
|
|
164243
164461
|
LanguageServiceShimObject.prototype.getSyntacticDiagnostics = function (fileName) {
|
|
164244
164462
|
var _this = this;
|
|
164245
|
-
return this.forwardJSONCall("getSyntacticDiagnostics('"
|
|
164463
|
+
return this.forwardJSONCall("getSyntacticDiagnostics('".concat(fileName, "')"), function () {
|
|
164246
164464
|
var diagnostics = _this.languageService.getSyntacticDiagnostics(fileName);
|
|
164247
164465
|
return _this.realizeDiagnostics(diagnostics);
|
|
164248
164466
|
});
|
|
164249
164467
|
};
|
|
164250
164468
|
LanguageServiceShimObject.prototype.getSemanticDiagnostics = function (fileName) {
|
|
164251
164469
|
var _this = this;
|
|
164252
|
-
return this.forwardJSONCall("getSemanticDiagnostics('"
|
|
164470
|
+
return this.forwardJSONCall("getSemanticDiagnostics('".concat(fileName, "')"), function () {
|
|
164253
164471
|
var diagnostics = _this.languageService.getSemanticDiagnostics(fileName);
|
|
164254
164472
|
return _this.realizeDiagnostics(diagnostics);
|
|
164255
164473
|
});
|
|
164256
164474
|
};
|
|
164257
164475
|
LanguageServiceShimObject.prototype.getSuggestionDiagnostics = function (fileName) {
|
|
164258
164476
|
var _this = this;
|
|
164259
|
-
return this.forwardJSONCall("getSuggestionDiagnostics('"
|
|
164477
|
+
return this.forwardJSONCall("getSuggestionDiagnostics('".concat(fileName, "')"), function () { return _this.realizeDiagnostics(_this.languageService.getSuggestionDiagnostics(fileName)); });
|
|
164260
164478
|
};
|
|
164261
164479
|
LanguageServiceShimObject.prototype.getCompilerOptionsDiagnostics = function () {
|
|
164262
164480
|
var _this = this;
|
|
@@ -164272,7 +164490,7 @@ var ts;
|
|
|
164272
164490
|
*/
|
|
164273
164491
|
LanguageServiceShimObject.prototype.getQuickInfoAtPosition = function (fileName, position) {
|
|
164274
164492
|
var _this = this;
|
|
164275
|
-
return this.forwardJSONCall("getQuickInfoAtPosition('"
|
|
164493
|
+
return this.forwardJSONCall("getQuickInfoAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getQuickInfoAtPosition(fileName, position); });
|
|
164276
164494
|
};
|
|
164277
164495
|
/// NAMEORDOTTEDNAMESPAN
|
|
164278
164496
|
/**
|
|
@@ -164281,7 +164499,7 @@ var ts;
|
|
|
164281
164499
|
*/
|
|
164282
164500
|
LanguageServiceShimObject.prototype.getNameOrDottedNameSpan = function (fileName, startPos, endPos) {
|
|
164283
164501
|
var _this = this;
|
|
164284
|
-
return this.forwardJSONCall("getNameOrDottedNameSpan('"
|
|
164502
|
+
return this.forwardJSONCall("getNameOrDottedNameSpan('".concat(fileName, "', ").concat(startPos, ", ").concat(endPos, ")"), function () { return _this.languageService.getNameOrDottedNameSpan(fileName, startPos, endPos); });
|
|
164285
164503
|
};
|
|
164286
164504
|
/**
|
|
164287
164505
|
* STATEMENTSPAN
|
|
@@ -164289,12 +164507,12 @@ var ts;
|
|
|
164289
164507
|
*/
|
|
164290
164508
|
LanguageServiceShimObject.prototype.getBreakpointStatementAtPosition = function (fileName, position) {
|
|
164291
164509
|
var _this = this;
|
|
164292
|
-
return this.forwardJSONCall("getBreakpointStatementAtPosition('"
|
|
164510
|
+
return this.forwardJSONCall("getBreakpointStatementAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getBreakpointStatementAtPosition(fileName, position); });
|
|
164293
164511
|
};
|
|
164294
164512
|
/// SIGNATUREHELP
|
|
164295
164513
|
LanguageServiceShimObject.prototype.getSignatureHelpItems = function (fileName, position, options) {
|
|
164296
164514
|
var _this = this;
|
|
164297
|
-
return this.forwardJSONCall("getSignatureHelpItems('"
|
|
164515
|
+
return this.forwardJSONCall("getSignatureHelpItems('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getSignatureHelpItems(fileName, position, options); });
|
|
164298
164516
|
};
|
|
164299
164517
|
/// GOTO DEFINITION
|
|
164300
164518
|
/**
|
|
@@ -164303,7 +164521,7 @@ var ts;
|
|
|
164303
164521
|
*/
|
|
164304
164522
|
LanguageServiceShimObject.prototype.getDefinitionAtPosition = function (fileName, position) {
|
|
164305
164523
|
var _this = this;
|
|
164306
|
-
return this.forwardJSONCall("getDefinitionAtPosition('"
|
|
164524
|
+
return this.forwardJSONCall("getDefinitionAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getDefinitionAtPosition(fileName, position); });
|
|
164307
164525
|
};
|
|
164308
164526
|
/**
|
|
164309
164527
|
* Computes the definition location and file for the symbol
|
|
@@ -164311,7 +164529,7 @@ var ts;
|
|
|
164311
164529
|
*/
|
|
164312
164530
|
LanguageServiceShimObject.prototype.getDefinitionAndBoundSpan = function (fileName, position) {
|
|
164313
164531
|
var _this = this;
|
|
164314
|
-
return this.forwardJSONCall("getDefinitionAndBoundSpan('"
|
|
164532
|
+
return this.forwardJSONCall("getDefinitionAndBoundSpan('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getDefinitionAndBoundSpan(fileName, position); });
|
|
164315
164533
|
};
|
|
164316
164534
|
/// GOTO Type
|
|
164317
164535
|
/**
|
|
@@ -164320,7 +164538,7 @@ var ts;
|
|
|
164320
164538
|
*/
|
|
164321
164539
|
LanguageServiceShimObject.prototype.getTypeDefinitionAtPosition = function (fileName, position) {
|
|
164322
164540
|
var _this = this;
|
|
164323
|
-
return this.forwardJSONCall("getTypeDefinitionAtPosition('"
|
|
164541
|
+
return this.forwardJSONCall("getTypeDefinitionAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getTypeDefinitionAtPosition(fileName, position); });
|
|
164324
164542
|
};
|
|
164325
164543
|
/// GOTO Implementation
|
|
164326
164544
|
/**
|
|
@@ -164329,37 +164547,37 @@ var ts;
|
|
|
164329
164547
|
*/
|
|
164330
164548
|
LanguageServiceShimObject.prototype.getImplementationAtPosition = function (fileName, position) {
|
|
164331
164549
|
var _this = this;
|
|
164332
|
-
return this.forwardJSONCall("getImplementationAtPosition('"
|
|
164550
|
+
return this.forwardJSONCall("getImplementationAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getImplementationAtPosition(fileName, position); });
|
|
164333
164551
|
};
|
|
164334
164552
|
LanguageServiceShimObject.prototype.getRenameInfo = function (fileName, position, options) {
|
|
164335
164553
|
var _this = this;
|
|
164336
|
-
return this.forwardJSONCall("getRenameInfo('"
|
|
164554
|
+
return this.forwardJSONCall("getRenameInfo('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getRenameInfo(fileName, position, options); });
|
|
164337
164555
|
};
|
|
164338
164556
|
LanguageServiceShimObject.prototype.getSmartSelectionRange = function (fileName, position) {
|
|
164339
164557
|
var _this = this;
|
|
164340
|
-
return this.forwardJSONCall("getSmartSelectionRange('"
|
|
164558
|
+
return this.forwardJSONCall("getSmartSelectionRange('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getSmartSelectionRange(fileName, position); });
|
|
164341
164559
|
};
|
|
164342
164560
|
LanguageServiceShimObject.prototype.findRenameLocations = function (fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename) {
|
|
164343
164561
|
var _this = this;
|
|
164344
|
-
return this.forwardJSONCall("findRenameLocations('"
|
|
164562
|
+
return this.forwardJSONCall("findRenameLocations('".concat(fileName, "', ").concat(position, ", ").concat(findInStrings, ", ").concat(findInComments, ", ").concat(providePrefixAndSuffixTextForRename, ")"), function () { return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments, providePrefixAndSuffixTextForRename); });
|
|
164345
164563
|
};
|
|
164346
164564
|
/// GET BRACE MATCHING
|
|
164347
164565
|
LanguageServiceShimObject.prototype.getBraceMatchingAtPosition = function (fileName, position) {
|
|
164348
164566
|
var _this = this;
|
|
164349
|
-
return this.forwardJSONCall("getBraceMatchingAtPosition('"
|
|
164567
|
+
return this.forwardJSONCall("getBraceMatchingAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getBraceMatchingAtPosition(fileName, position); });
|
|
164350
164568
|
};
|
|
164351
164569
|
LanguageServiceShimObject.prototype.isValidBraceCompletionAtPosition = function (fileName, position, openingBrace) {
|
|
164352
164570
|
var _this = this;
|
|
164353
|
-
return this.forwardJSONCall("isValidBraceCompletionAtPosition('"
|
|
164571
|
+
return this.forwardJSONCall("isValidBraceCompletionAtPosition('".concat(fileName, "', ").concat(position, ", ").concat(openingBrace, ")"), function () { return _this.languageService.isValidBraceCompletionAtPosition(fileName, position, openingBrace); });
|
|
164354
164572
|
};
|
|
164355
164573
|
LanguageServiceShimObject.prototype.getSpanOfEnclosingComment = function (fileName, position, onlyMultiLine) {
|
|
164356
164574
|
var _this = this;
|
|
164357
|
-
return this.forwardJSONCall("getSpanOfEnclosingComment('"
|
|
164575
|
+
return this.forwardJSONCall("getSpanOfEnclosingComment('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getSpanOfEnclosingComment(fileName, position, onlyMultiLine); });
|
|
164358
164576
|
};
|
|
164359
164577
|
/// GET SMART INDENT
|
|
164360
164578
|
LanguageServiceShimObject.prototype.getIndentationAtPosition = function (fileName, position, options /*Services.EditorOptions*/) {
|
|
164361
164579
|
var _this = this;
|
|
164362
|
-
return this.forwardJSONCall("getIndentationAtPosition('"
|
|
164580
|
+
return this.forwardJSONCall("getIndentationAtPosition('".concat(fileName, "', ").concat(position, ")"), function () {
|
|
164363
164581
|
var localOptions = JSON.parse(options);
|
|
164364
164582
|
return _this.languageService.getIndentationAtPosition(fileName, position, localOptions);
|
|
164365
164583
|
});
|
|
@@ -164367,23 +164585,23 @@ var ts;
|
|
|
164367
164585
|
/// GET REFERENCES
|
|
164368
164586
|
LanguageServiceShimObject.prototype.getReferencesAtPosition = function (fileName, position) {
|
|
164369
164587
|
var _this = this;
|
|
164370
|
-
return this.forwardJSONCall("getReferencesAtPosition('"
|
|
164588
|
+
return this.forwardJSONCall("getReferencesAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getReferencesAtPosition(fileName, position); });
|
|
164371
164589
|
};
|
|
164372
164590
|
LanguageServiceShimObject.prototype.findReferences = function (fileName, position) {
|
|
164373
164591
|
var _this = this;
|
|
164374
|
-
return this.forwardJSONCall("findReferences('"
|
|
164592
|
+
return this.forwardJSONCall("findReferences('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.findReferences(fileName, position); });
|
|
164375
164593
|
};
|
|
164376
164594
|
LanguageServiceShimObject.prototype.getFileReferences = function (fileName) {
|
|
164377
164595
|
var _this = this;
|
|
164378
|
-
return this.forwardJSONCall("getFileReferences('"
|
|
164596
|
+
return this.forwardJSONCall("getFileReferences('".concat(fileName, ")"), function () { return _this.languageService.getFileReferences(fileName); });
|
|
164379
164597
|
};
|
|
164380
164598
|
LanguageServiceShimObject.prototype.getOccurrencesAtPosition = function (fileName, position) {
|
|
164381
164599
|
var _this = this;
|
|
164382
|
-
return this.forwardJSONCall("getOccurrencesAtPosition('"
|
|
164600
|
+
return this.forwardJSONCall("getOccurrencesAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getOccurrencesAtPosition(fileName, position); });
|
|
164383
164601
|
};
|
|
164384
164602
|
LanguageServiceShimObject.prototype.getDocumentHighlights = function (fileName, position, filesToSearch) {
|
|
164385
164603
|
var _this = this;
|
|
164386
|
-
return this.forwardJSONCall("getDocumentHighlights('"
|
|
164604
|
+
return this.forwardJSONCall("getDocumentHighlights('".concat(fileName, "', ").concat(position, ")"), function () {
|
|
164387
164605
|
var results = _this.languageService.getDocumentHighlights(fileName, position, JSON.parse(filesToSearch));
|
|
164388
164606
|
// workaround for VS document highlighting issue - keep only items from the initial file
|
|
164389
164607
|
var normalizedName = ts.toFileNameLowerCase(ts.normalizeSlashes(fileName));
|
|
@@ -164398,108 +164616,108 @@ var ts;
|
|
|
164398
164616
|
*/
|
|
164399
164617
|
LanguageServiceShimObject.prototype.getCompletionsAtPosition = function (fileName, position, preferences, formattingSettings) {
|
|
164400
164618
|
var _this = this;
|
|
164401
|
-
return this.forwardJSONCall("getCompletionsAtPosition('"
|
|
164619
|
+
return this.forwardJSONCall("getCompletionsAtPosition('".concat(fileName, "', ").concat(position, ", ").concat(preferences, ", ").concat(formattingSettings, ")"), function () { return _this.languageService.getCompletionsAtPosition(fileName, position, preferences, formattingSettings); });
|
|
164402
164620
|
};
|
|
164403
164621
|
/** Get a string based representation of a completion list entry details */
|
|
164404
164622
|
LanguageServiceShimObject.prototype.getCompletionEntryDetails = function (fileName, position, entryName, formatOptions, source, preferences, data) {
|
|
164405
164623
|
var _this = this;
|
|
164406
|
-
return this.forwardJSONCall("getCompletionEntryDetails('"
|
|
164624
|
+
return this.forwardJSONCall("getCompletionEntryDetails('".concat(fileName, "', ").concat(position, ", '").concat(entryName, "')"), function () {
|
|
164407
164625
|
var localOptions = formatOptions === undefined ? undefined : JSON.parse(formatOptions);
|
|
164408
164626
|
return _this.languageService.getCompletionEntryDetails(fileName, position, entryName, localOptions, source, preferences, data);
|
|
164409
164627
|
});
|
|
164410
164628
|
};
|
|
164411
164629
|
LanguageServiceShimObject.prototype.getFormattingEditsForRange = function (fileName, start, end, options /*Services.FormatCodeOptions*/) {
|
|
164412
164630
|
var _this = this;
|
|
164413
|
-
return this.forwardJSONCall("getFormattingEditsForRange('"
|
|
164631
|
+
return this.forwardJSONCall("getFormattingEditsForRange('".concat(fileName, "', ").concat(start, ", ").concat(end, ")"), function () {
|
|
164414
164632
|
var localOptions = JSON.parse(options);
|
|
164415
164633
|
return _this.languageService.getFormattingEditsForRange(fileName, start, end, localOptions);
|
|
164416
164634
|
});
|
|
164417
164635
|
};
|
|
164418
164636
|
LanguageServiceShimObject.prototype.getFormattingEditsForDocument = function (fileName, options /*Services.FormatCodeOptions*/) {
|
|
164419
164637
|
var _this = this;
|
|
164420
|
-
return this.forwardJSONCall("getFormattingEditsForDocument('"
|
|
164638
|
+
return this.forwardJSONCall("getFormattingEditsForDocument('".concat(fileName, "')"), function () {
|
|
164421
164639
|
var localOptions = JSON.parse(options);
|
|
164422
164640
|
return _this.languageService.getFormattingEditsForDocument(fileName, localOptions);
|
|
164423
164641
|
});
|
|
164424
164642
|
};
|
|
164425
164643
|
LanguageServiceShimObject.prototype.getFormattingEditsAfterKeystroke = function (fileName, position, key, options /*Services.FormatCodeOptions*/) {
|
|
164426
164644
|
var _this = this;
|
|
164427
|
-
return this.forwardJSONCall("getFormattingEditsAfterKeystroke('"
|
|
164645
|
+
return this.forwardJSONCall("getFormattingEditsAfterKeystroke('".concat(fileName, "', ").concat(position, ", '").concat(key, "')"), function () {
|
|
164428
164646
|
var localOptions = JSON.parse(options);
|
|
164429
164647
|
return _this.languageService.getFormattingEditsAfterKeystroke(fileName, position, key, localOptions);
|
|
164430
164648
|
});
|
|
164431
164649
|
};
|
|
164432
164650
|
LanguageServiceShimObject.prototype.getDocCommentTemplateAtPosition = function (fileName, position, options) {
|
|
164433
164651
|
var _this = this;
|
|
164434
|
-
return this.forwardJSONCall("getDocCommentTemplateAtPosition('"
|
|
164652
|
+
return this.forwardJSONCall("getDocCommentTemplateAtPosition('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.getDocCommentTemplateAtPosition(fileName, position, options); });
|
|
164435
164653
|
};
|
|
164436
164654
|
/// NAVIGATE TO
|
|
164437
164655
|
/** Return a list of symbols that are interesting to navigate to */
|
|
164438
164656
|
LanguageServiceShimObject.prototype.getNavigateToItems = function (searchValue, maxResultCount, fileName) {
|
|
164439
164657
|
var _this = this;
|
|
164440
|
-
return this.forwardJSONCall("getNavigateToItems('"
|
|
164658
|
+
return this.forwardJSONCall("getNavigateToItems('".concat(searchValue, "', ").concat(maxResultCount, ", ").concat(fileName, ")"), function () { return _this.languageService.getNavigateToItems(searchValue, maxResultCount, fileName); });
|
|
164441
164659
|
};
|
|
164442
164660
|
LanguageServiceShimObject.prototype.getNavigationBarItems = function (fileName) {
|
|
164443
164661
|
var _this = this;
|
|
164444
|
-
return this.forwardJSONCall("getNavigationBarItems('"
|
|
164662
|
+
return this.forwardJSONCall("getNavigationBarItems('".concat(fileName, "')"), function () { return _this.languageService.getNavigationBarItems(fileName); });
|
|
164445
164663
|
};
|
|
164446
164664
|
LanguageServiceShimObject.prototype.getNavigationTree = function (fileName) {
|
|
164447
164665
|
var _this = this;
|
|
164448
|
-
return this.forwardJSONCall("getNavigationTree('"
|
|
164666
|
+
return this.forwardJSONCall("getNavigationTree('".concat(fileName, "')"), function () { return _this.languageService.getNavigationTree(fileName); });
|
|
164449
164667
|
};
|
|
164450
164668
|
LanguageServiceShimObject.prototype.getOutliningSpans = function (fileName) {
|
|
164451
164669
|
var _this = this;
|
|
164452
|
-
return this.forwardJSONCall("getOutliningSpans('"
|
|
164670
|
+
return this.forwardJSONCall("getOutliningSpans('".concat(fileName, "')"), function () { return _this.languageService.getOutliningSpans(fileName); });
|
|
164453
164671
|
};
|
|
164454
164672
|
LanguageServiceShimObject.prototype.getTodoComments = function (fileName, descriptors) {
|
|
164455
164673
|
var _this = this;
|
|
164456
|
-
return this.forwardJSONCall("getTodoComments('"
|
|
164674
|
+
return this.forwardJSONCall("getTodoComments('".concat(fileName, "')"), function () { return _this.languageService.getTodoComments(fileName, JSON.parse(descriptors)); });
|
|
164457
164675
|
};
|
|
164458
164676
|
/// CALL HIERARCHY
|
|
164459
164677
|
LanguageServiceShimObject.prototype.prepareCallHierarchy = function (fileName, position) {
|
|
164460
164678
|
var _this = this;
|
|
164461
|
-
return this.forwardJSONCall("prepareCallHierarchy('"
|
|
164679
|
+
return this.forwardJSONCall("prepareCallHierarchy('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.prepareCallHierarchy(fileName, position); });
|
|
164462
164680
|
};
|
|
164463
164681
|
LanguageServiceShimObject.prototype.provideCallHierarchyIncomingCalls = function (fileName, position) {
|
|
164464
164682
|
var _this = this;
|
|
164465
|
-
return this.forwardJSONCall("provideCallHierarchyIncomingCalls('"
|
|
164683
|
+
return this.forwardJSONCall("provideCallHierarchyIncomingCalls('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.provideCallHierarchyIncomingCalls(fileName, position); });
|
|
164466
164684
|
};
|
|
164467
164685
|
LanguageServiceShimObject.prototype.provideCallHierarchyOutgoingCalls = function (fileName, position) {
|
|
164468
164686
|
var _this = this;
|
|
164469
|
-
return this.forwardJSONCall("provideCallHierarchyOutgoingCalls('"
|
|
164687
|
+
return this.forwardJSONCall("provideCallHierarchyOutgoingCalls('".concat(fileName, "', ").concat(position, ")"), function () { return _this.languageService.provideCallHierarchyOutgoingCalls(fileName, position); });
|
|
164470
164688
|
};
|
|
164471
164689
|
LanguageServiceShimObject.prototype.provideInlayHints = function (fileName, span, preference) {
|
|
164472
164690
|
var _this = this;
|
|
164473
|
-
return this.forwardJSONCall("provideInlayHints('"
|
|
164691
|
+
return this.forwardJSONCall("provideInlayHints('".concat(fileName, "', '").concat(JSON.stringify(span), "', ").concat(JSON.stringify(preference), ")"), function () { return _this.languageService.provideInlayHints(fileName, span, preference); });
|
|
164474
164692
|
};
|
|
164475
164693
|
/// Emit
|
|
164476
164694
|
LanguageServiceShimObject.prototype.getEmitOutput = function (fileName) {
|
|
164477
164695
|
var _this = this;
|
|
164478
|
-
return this.forwardJSONCall("getEmitOutput('"
|
|
164696
|
+
return this.forwardJSONCall("getEmitOutput('".concat(fileName, "')"), function () {
|
|
164479
164697
|
var _a = _this.languageService.getEmitOutput(fileName), diagnostics = _a.diagnostics, rest = __rest(_a, ["diagnostics"]);
|
|
164480
164698
|
return __assign(__assign({}, rest), { diagnostics: _this.realizeDiagnostics(diagnostics) });
|
|
164481
164699
|
});
|
|
164482
164700
|
};
|
|
164483
164701
|
LanguageServiceShimObject.prototype.getEmitOutputObject = function (fileName) {
|
|
164484
164702
|
var _this = this;
|
|
164485
|
-
return forwardCall(this.logger, "getEmitOutput('"
|
|
164703
|
+
return forwardCall(this.logger, "getEmitOutput('".concat(fileName, "')"),
|
|
164486
164704
|
/*returnJson*/ false, function () { return _this.languageService.getEmitOutput(fileName); }, this.logPerformance);
|
|
164487
164705
|
};
|
|
164488
164706
|
LanguageServiceShimObject.prototype.toggleLineComment = function (fileName, textRange) {
|
|
164489
164707
|
var _this = this;
|
|
164490
|
-
return this.forwardJSONCall("toggleLineComment('"
|
|
164708
|
+
return this.forwardJSONCall("toggleLineComment('".concat(fileName, "', '").concat(JSON.stringify(textRange), "')"), function () { return _this.languageService.toggleLineComment(fileName, textRange); });
|
|
164491
164709
|
};
|
|
164492
164710
|
LanguageServiceShimObject.prototype.toggleMultilineComment = function (fileName, textRange) {
|
|
164493
164711
|
var _this = this;
|
|
164494
|
-
return this.forwardJSONCall("toggleMultilineComment('"
|
|
164712
|
+
return this.forwardJSONCall("toggleMultilineComment('".concat(fileName, "', '").concat(JSON.stringify(textRange), "')"), function () { return _this.languageService.toggleMultilineComment(fileName, textRange); });
|
|
164495
164713
|
};
|
|
164496
164714
|
LanguageServiceShimObject.prototype.commentSelection = function (fileName, textRange) {
|
|
164497
164715
|
var _this = this;
|
|
164498
|
-
return this.forwardJSONCall("commentSelection('"
|
|
164716
|
+
return this.forwardJSONCall("commentSelection('".concat(fileName, "', '").concat(JSON.stringify(textRange), "')"), function () { return _this.languageService.commentSelection(fileName, textRange); });
|
|
164499
164717
|
};
|
|
164500
164718
|
LanguageServiceShimObject.prototype.uncommentSelection = function (fileName, textRange) {
|
|
164501
164719
|
var _this = this;
|
|
164502
|
-
return this.forwardJSONCall("uncommentSelection('"
|
|
164720
|
+
return this.forwardJSONCall("uncommentSelection('".concat(fileName, "', '").concat(JSON.stringify(textRange), "')"), function () { return _this.languageService.uncommentSelection(fileName, textRange); });
|
|
164503
164721
|
};
|
|
164504
164722
|
return LanguageServiceShimObject;
|
|
164505
164723
|
}(ShimBase));
|
|
@@ -164549,7 +164767,7 @@ var ts;
|
|
|
164549
164767
|
};
|
|
164550
164768
|
CoreServicesShimObject.prototype.resolveModuleName = function (fileName, moduleName, compilerOptionsJson) {
|
|
164551
164769
|
var _this = this;
|
|
164552
|
-
return this.forwardJSONCall("resolveModuleName('"
|
|
164770
|
+
return this.forwardJSONCall("resolveModuleName('".concat(fileName, "')"), function () {
|
|
164553
164771
|
var compilerOptions = JSON.parse(compilerOptionsJson);
|
|
164554
164772
|
var result = ts.resolveModuleName(moduleName, ts.normalizeSlashes(fileName), compilerOptions, _this.host);
|
|
164555
164773
|
var resolvedFileName = result.resolvedModule ? result.resolvedModule.resolvedFileName : undefined;
|
|
@@ -164564,7 +164782,7 @@ var ts;
|
|
|
164564
164782
|
};
|
|
164565
164783
|
CoreServicesShimObject.prototype.resolveTypeReferenceDirective = function (fileName, typeReferenceDirective, compilerOptionsJson) {
|
|
164566
164784
|
var _this = this;
|
|
164567
|
-
return this.forwardJSONCall("resolveTypeReferenceDirective("
|
|
164785
|
+
return this.forwardJSONCall("resolveTypeReferenceDirective(".concat(fileName, ")"), function () {
|
|
164568
164786
|
var compilerOptions = JSON.parse(compilerOptionsJson);
|
|
164569
164787
|
var result = ts.resolveTypeReferenceDirective(typeReferenceDirective, ts.normalizeSlashes(fileName), compilerOptions, _this.host);
|
|
164570
164788
|
return {
|
|
@@ -164576,7 +164794,7 @@ var ts;
|
|
|
164576
164794
|
};
|
|
164577
164795
|
CoreServicesShimObject.prototype.getPreProcessedFileInfo = function (fileName, sourceTextSnapshot) {
|
|
164578
164796
|
var _this = this;
|
|
164579
|
-
return this.forwardJSONCall("getPreProcessedFileInfo('"
|
|
164797
|
+
return this.forwardJSONCall("getPreProcessedFileInfo('".concat(fileName, "')"), function () {
|
|
164580
164798
|
// for now treat files as JavaScript
|
|
164581
164799
|
var result = ts.preProcessFile(ts.getSnapshotText(sourceTextSnapshot), /* readImportFiles */ true, /* detectJavaScriptImports */ true);
|
|
164582
164800
|
return {
|
|
@@ -164591,7 +164809,7 @@ var ts;
|
|
|
164591
164809
|
};
|
|
164592
164810
|
CoreServicesShimObject.prototype.getAutomaticTypeDirectiveNames = function (compilerOptionsJson) {
|
|
164593
164811
|
var _this = this;
|
|
164594
|
-
return this.forwardJSONCall("getAutomaticTypeDirectiveNames('"
|
|
164812
|
+
return this.forwardJSONCall("getAutomaticTypeDirectiveNames('".concat(compilerOptionsJson, "')"), function () {
|
|
164595
164813
|
var compilerOptions = JSON.parse(compilerOptionsJson);
|
|
164596
164814
|
return ts.getAutomaticTypeDirectiveNames(compilerOptions, _this.host);
|
|
164597
164815
|
});
|
|
@@ -164613,7 +164831,7 @@ var ts;
|
|
|
164613
164831
|
};
|
|
164614
164832
|
CoreServicesShimObject.prototype.getTSConfigFileInfo = function (fileName, sourceTextSnapshot) {
|
|
164615
164833
|
var _this = this;
|
|
164616
|
-
return this.forwardJSONCall("getTSConfigFileInfo('"
|
|
164834
|
+
return this.forwardJSONCall("getTSConfigFileInfo('".concat(fileName, "')"), function () {
|
|
164617
164835
|
var result = ts.parseJsonText(fileName, ts.getSnapshotText(sourceTextSnapshot));
|
|
164618
164836
|
var normalizedFileName = ts.normalizeSlashes(fileName);
|
|
164619
164837
|
var configFile = ts.parseJsonSourceFileConfigFileContent(result, _this.host, ts.getDirectoryPath(normalizedFileName), /*existingOptions*/ {}, normalizedFileName);
|