@typescript-deploys/pr-build 5.3.0-pr-55547-8 → 5.3.0-pr-55739-8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +148 -58
- package/lib/tsserver.js +179 -69
- package/lib/typescript.d.ts +16 -5
- package/lib/typescript.js +180 -71
- package/lib/typingsInstaller.js +41 -16
- package/package.json +3 -2
package/lib/tsserver.js
CHANGED
|
@@ -103,6 +103,7 @@ __export(server_exports, {
|
|
|
103
103
|
InternalEmitFlags: () => InternalEmitFlags,
|
|
104
104
|
InternalSymbolName: () => InternalSymbolName,
|
|
105
105
|
InvalidatedProjectKind: () => InvalidatedProjectKind,
|
|
106
|
+
JSDocParsingMode: () => JSDocParsingMode,
|
|
106
107
|
JsDoc: () => ts_JsDoc_exports,
|
|
107
108
|
JsTyping: () => ts_JsTyping_exports,
|
|
108
109
|
JsxEmit: () => JsxEmit,
|
|
@@ -2328,7 +2329,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2328
2329
|
|
|
2329
2330
|
// src/compiler/corePublic.ts
|
|
2330
2331
|
var versionMajorMinor = "5.3";
|
|
2331
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2332
|
+
var version = `${versionMajorMinor}.0-insiders.20230915`;
|
|
2332
2333
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2333
2334
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2334
2335
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -7422,6 +7423,12 @@ var commentPragmas = {
|
|
|
7422
7423
|
kind: 4 /* MultiLine */
|
|
7423
7424
|
}
|
|
7424
7425
|
};
|
|
7426
|
+
var JSDocParsingMode = /* @__PURE__ */ ((JSDocParsingMode8) => {
|
|
7427
|
+
JSDocParsingMode8[JSDocParsingMode8["KeepAll"] = 0] = "KeepAll";
|
|
7428
|
+
JSDocParsingMode8[JSDocParsingMode8["KeepSemanticOnly"] = 1] = "KeepSemanticOnly";
|
|
7429
|
+
JSDocParsingMode8[JSDocParsingMode8["SkipAll"] = 2] = "SkipAll";
|
|
7430
|
+
return JSDocParsingMode8;
|
|
7431
|
+
})(JSDocParsingMode || {});
|
|
7425
7432
|
|
|
7426
7433
|
// src/compiler/sys.ts
|
|
7427
7434
|
function generateDjb2Hash(data) {
|
|
@@ -11453,6 +11460,7 @@ var unicodeESNextIdentifierStart = [65, 90, 97, 122, 170, 170, 181, 181, 186, 18
|
|
|
11453
11460
|
var unicodeESNextIdentifierPart = [48, 57, 65, 90, 95, 95, 97, 122, 170, 170, 181, 181, 183, 183, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 895, 895, 902, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1519, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2045, 2045, 2048, 2093, 2112, 2139, 2144, 2154, 2208, 2228, 2230, 2237, 2259, 2273, 2275, 2403, 2406, 2415, 2417, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2556, 2556, 2558, 2558, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2809, 2815, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3072, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3162, 3168, 3171, 3174, 3183, 3200, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3328, 3331, 3333, 3340, 3342, 3344, 3346, 3396, 3398, 3400, 3402, 3406, 3412, 3415, 3423, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3558, 3567, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4969, 4977, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6e3, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6264, 6272, 6314, 6320, 6389, 6400, 6430, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6618, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6832, 6845, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7376, 7378, 7380, 7418, 7424, 7673, 7675, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42737, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43047, 43072, 43123, 43136, 43205, 43216, 43225, 43232, 43255, 43259, 43259, 43261, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43488, 43518, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65071, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66045, 66045, 66176, 66204, 66208, 66256, 66272, 66272, 66304, 66335, 66349, 66378, 66384, 66426, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66720, 66729, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68099, 68101, 68102, 68108, 68115, 68117, 68119, 68121, 68149, 68152, 68154, 68159, 68159, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68326, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68903, 68912, 68921, 69376, 69404, 69415, 69415, 69424, 69456, 69600, 69622, 69632, 69702, 69734, 69743, 69759, 69818, 69840, 69864, 69872, 69881, 69888, 69940, 69942, 69951, 69956, 69958, 69968, 70003, 70006, 70006, 70016, 70084, 70089, 70092, 70096, 70106, 70108, 70108, 70144, 70161, 70163, 70199, 70206, 70206, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70378, 70384, 70393, 70400, 70403, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70459, 70468, 70471, 70472, 70475, 70477, 70480, 70480, 70487, 70487, 70493, 70499, 70502, 70508, 70512, 70516, 70656, 70730, 70736, 70745, 70750, 70751, 70784, 70853, 70855, 70855, 70864, 70873, 71040, 71093, 71096, 71104, 71128, 71133, 71168, 71232, 71236, 71236, 71248, 71257, 71296, 71352, 71360, 71369, 71424, 71450, 71453, 71467, 71472, 71481, 71680, 71738, 71840, 71913, 71935, 71935, 72096, 72103, 72106, 72151, 72154, 72161, 72163, 72164, 72192, 72254, 72263, 72263, 72272, 72345, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72758, 72760, 72768, 72784, 72793, 72818, 72847, 72850, 72871, 72873, 72886, 72960, 72966, 72968, 72969, 72971, 73014, 73018, 73018, 73020, 73021, 73023, 73031, 73040, 73049, 73056, 73061, 73063, 73064, 73066, 73102, 73104, 73105, 73107, 73112, 73120, 73129, 73440, 73462, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92768, 92777, 92880, 92909, 92912, 92916, 92928, 92982, 92992, 92995, 93008, 93017, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94031, 94087, 94095, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 113821, 113822, 119141, 119145, 119149, 119154, 119163, 119170, 119173, 119179, 119210, 119213, 119362, 119364, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 120782, 120831, 121344, 121398, 121403, 121452, 121461, 121461, 121476, 121476, 121499, 121503, 121505, 121519, 122880, 122886, 122888, 122904, 122907, 122913, 122915, 122916, 122918, 122922, 123136, 123180, 123184, 123197, 123200, 123209, 123214, 123214, 123584, 123641, 124928, 125124, 125136, 125142, 125184, 125259, 125264, 125273, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101, 917760, 917999];
|
|
11454
11461
|
var commentDirectiveRegExSingleLine = /^\/\/\/?\s*@(ts-expect-error|ts-ignore)/;
|
|
11455
11462
|
var commentDirectiveRegExMultiLine = /^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/;
|
|
11463
|
+
var semanticJSDocTagRegEx = /@(?:see|link)/i;
|
|
11456
11464
|
function lookupInUnicodeMap(code, map2) {
|
|
11457
11465
|
if (code < map2[0]) {
|
|
11458
11466
|
return false;
|
|
@@ -11959,6 +11967,8 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
11959
11967
|
var tokenFlags;
|
|
11960
11968
|
var commentDirectives;
|
|
11961
11969
|
var inJSDocType = 0;
|
|
11970
|
+
var scriptKind = 0 /* Unknown */;
|
|
11971
|
+
var jsDocParsingMode = 0 /* KeepAll */;
|
|
11962
11972
|
setText(text, start2, length2);
|
|
11963
11973
|
var scanner2 = {
|
|
11964
11974
|
getTokenFullStart: () => fullStartPos,
|
|
@@ -12002,6 +12012,8 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
12002
12012
|
setText,
|
|
12003
12013
|
setScriptTarget,
|
|
12004
12014
|
setLanguageVariant,
|
|
12015
|
+
setScriptKind,
|
|
12016
|
+
setJSDocParsingMode,
|
|
12005
12017
|
setOnError,
|
|
12006
12018
|
resetTokenState,
|
|
12007
12019
|
setTextPos: resetTokenState,
|
|
@@ -12255,7 +12267,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
12255
12267
|
start3 = pos;
|
|
12256
12268
|
continue;
|
|
12257
12269
|
}
|
|
12258
|
-
if (
|
|
12270
|
+
if ((ch === 10 /* lineFeed */ || ch === 13 /* carriageReturn */) && !jsxAttributeString) {
|
|
12259
12271
|
result += text.substring(start3, pos);
|
|
12260
12272
|
tokenFlags |= 4 /* Unterminated */;
|
|
12261
12273
|
error2(Diagnostics.Unterminated_string_literal);
|
|
@@ -12780,9 +12792,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
12780
12792
|
}
|
|
12781
12793
|
if (text.charCodeAt(pos + 1) === 42 /* asterisk */) {
|
|
12782
12794
|
pos += 2;
|
|
12783
|
-
|
|
12784
|
-
tokenFlags |= 2 /* PrecedingJSDocComment */;
|
|
12785
|
-
}
|
|
12795
|
+
const isJSDoc2 = text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) !== 47 /* slash */;
|
|
12786
12796
|
let commentClosed = false;
|
|
12787
12797
|
let lastLineStart = tokenStart;
|
|
12788
12798
|
while (pos < end) {
|
|
@@ -12798,6 +12808,12 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
12798
12808
|
tokenFlags |= 1 /* PrecedingLineBreak */;
|
|
12799
12809
|
}
|
|
12800
12810
|
}
|
|
12811
|
+
if (isJSDoc2) {
|
|
12812
|
+
const shouldParseJSDoc = jsDocParsingMode === 2 /* SkipAll */ ? false : jsDocParsingMode === 1 /* KeepSemanticOnly */ ? scriptKind !== 3 /* TS */ && scriptKind !== 4 /* TSX */ || semanticJSDocTagRegEx.test(text.slice(fullStartPos, pos)) : true;
|
|
12813
|
+
if (shouldParseJSDoc) {
|
|
12814
|
+
tokenFlags |= 2 /* PrecedingJSDocComment */;
|
|
12815
|
+
}
|
|
12816
|
+
}
|
|
12801
12817
|
commentDirectives = appendIfCommentDirective(commentDirectives, text.slice(lastLineStart, pos), commentDirectiveRegExMultiLine, lastLineStart);
|
|
12802
12818
|
if (!commentClosed) {
|
|
12803
12819
|
error2(Diagnostics.Asterisk_Slash_expected);
|
|
@@ -13468,6 +13484,12 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
13468
13484
|
function setLanguageVariant(variant) {
|
|
13469
13485
|
languageVariant = variant;
|
|
13470
13486
|
}
|
|
13487
|
+
function setScriptKind(kind) {
|
|
13488
|
+
scriptKind = kind;
|
|
13489
|
+
}
|
|
13490
|
+
function setJSDocParsingMode(kind) {
|
|
13491
|
+
jsDocParsingMode = kind;
|
|
13492
|
+
}
|
|
13471
13493
|
function resetTokenState(position) {
|
|
13472
13494
|
Debug.assert(position >= 0);
|
|
13473
13495
|
pos = position;
|
|
@@ -19542,7 +19564,7 @@ function isRightSideOfQualifiedNameOrPropertyAccess(node) {
|
|
|
19542
19564
|
return node.parent.kind === 166 /* QualifiedName */ && node.parent.right === node || node.parent.kind === 211 /* PropertyAccessExpression */ && node.parent.name === node || node.parent.kind === 236 /* MetaProperty */ && node.parent.name === node;
|
|
19543
19565
|
}
|
|
19544
19566
|
function isRightSideOfAccessExpression(node) {
|
|
19545
|
-
return isPropertyAccessExpression(node.parent) && node.parent.name === node || isElementAccessExpression(node.parent) && node.parent.argumentExpression === node;
|
|
19567
|
+
return !!node.parent && (isPropertyAccessExpression(node.parent) && node.parent.name === node || isElementAccessExpression(node.parent) && node.parent.argumentExpression === node);
|
|
19546
19568
|
}
|
|
19547
19569
|
function isRightSideOfQualifiedNameOrPropertyAccessOrJSDocMemberName(node) {
|
|
19548
19570
|
return isQualifiedName(node.parent) && node.parent.right === node || isPropertyAccessExpression(node.parent) && node.parent.name === node || isJSDocMemberName(node.parent) && node.parent.right === node;
|
|
@@ -21474,8 +21496,9 @@ function escapeSnippetText(text) {
|
|
|
21474
21496
|
function isNumericLiteralName(name) {
|
|
21475
21497
|
return (+name).toString() === name;
|
|
21476
21498
|
}
|
|
21477
|
-
function createPropertyNameNodeForIdentifierOrLiteral(name, target, singleQuote, stringNamed) {
|
|
21478
|
-
|
|
21499
|
+
function createPropertyNameNodeForIdentifierOrLiteral(name, target, singleQuote, stringNamed, isMethod) {
|
|
21500
|
+
const isMethodNamedNew = isMethod && name === "new";
|
|
21501
|
+
return !isMethodNamedNew && isIdentifierText(name, target) ? factory.createIdentifier(name) : !stringNamed && !isMethodNamedNew && isNumericLiteralName(name) && +name >= 0 ? factory.createNumericLiteral(+name) : factory.createStringLiteral(name, !!singleQuote);
|
|
21479
21502
|
}
|
|
21480
21503
|
function isThisTypeParameter(type) {
|
|
21481
21504
|
return !!(type.flags & 262144 /* TypeParameter */ && type.isThisType);
|
|
@@ -30660,7 +30683,7 @@ function gatherPossibleChildren(node) {
|
|
|
30660
30683
|
function setExternalModuleIndicator(sourceFile) {
|
|
30661
30684
|
sourceFile.externalModuleIndicator = isFileProbablyExternalModule(sourceFile);
|
|
30662
30685
|
}
|
|
30663
|
-
function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind) {
|
|
30686
|
+
function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind, jsDocParsingMode) {
|
|
30664
30687
|
var _a, _b, _c, _d;
|
|
30665
30688
|
(_a = tracing) == null ? void 0 : _a.push(
|
|
30666
30689
|
tracing.Phase.Parse,
|
|
@@ -30686,7 +30709,8 @@ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setPar
|
|
|
30686
30709
|
void 0,
|
|
30687
30710
|
setParentNodes,
|
|
30688
30711
|
6 /* JSON */,
|
|
30689
|
-
noop
|
|
30712
|
+
noop,
|
|
30713
|
+
jsDocParsingMode
|
|
30690
30714
|
);
|
|
30691
30715
|
} else {
|
|
30692
30716
|
const setIndicator = format === void 0 ? overrideSetExternalModuleIndicator : (file) => {
|
|
@@ -30701,7 +30725,8 @@ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setPar
|
|
|
30701
30725
|
void 0,
|
|
30702
30726
|
setParentNodes,
|
|
30703
30727
|
scriptKind,
|
|
30704
|
-
setIndicator
|
|
30728
|
+
setIndicator,
|
|
30729
|
+
jsDocParsingMode
|
|
30705
30730
|
);
|
|
30706
30731
|
}
|
|
30707
30732
|
(_c = perfLogger) == null ? void 0 : _c.logStopParseSourceFile();
|
|
@@ -30835,7 +30860,7 @@ var Parser;
|
|
|
30835
30860
|
var contextFlags;
|
|
30836
30861
|
var topLevel = true;
|
|
30837
30862
|
var parseErrorBeforeNextFinishedNode = false;
|
|
30838
|
-
function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride) {
|
|
30863
|
+
function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride, jsDocParsingMode = 0 /* KeepAll */) {
|
|
30839
30864
|
var _a;
|
|
30840
30865
|
scriptKind2 = ensureScriptKind(fileName2, scriptKind2);
|
|
30841
30866
|
if (scriptKind2 === 6 /* JSON */) {
|
|
@@ -30857,8 +30882,8 @@ var Parser;
|
|
|
30857
30882
|
result2.pragmas = emptyMap;
|
|
30858
30883
|
return result2;
|
|
30859
30884
|
}
|
|
30860
|
-
initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, scriptKind2);
|
|
30861
|
-
const result = parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride || setExternalModuleIndicator);
|
|
30885
|
+
initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, scriptKind2, jsDocParsingMode);
|
|
30886
|
+
const result = parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride || setExternalModuleIndicator, jsDocParsingMode);
|
|
30862
30887
|
clearState();
|
|
30863
30888
|
return result;
|
|
30864
30889
|
}
|
|
@@ -30870,7 +30895,8 @@ var Parser;
|
|
|
30870
30895
|
languageVersion2,
|
|
30871
30896
|
/*syntaxCursor*/
|
|
30872
30897
|
void 0,
|
|
30873
|
-
1 /* JS
|
|
30898
|
+
1 /* JS */,
|
|
30899
|
+
0 /* KeepAll */
|
|
30874
30900
|
);
|
|
30875
30901
|
nextToken();
|
|
30876
30902
|
const entityName = parseEntityName(
|
|
@@ -30883,7 +30909,7 @@ var Parser;
|
|
|
30883
30909
|
}
|
|
30884
30910
|
Parser2.parseIsolatedEntityName = parseIsolatedEntityName2;
|
|
30885
30911
|
function parseJsonText2(fileName2, sourceText2, languageVersion2 = 2 /* ES2015 */, syntaxCursor2, setParentNodes = false) {
|
|
30886
|
-
initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, 6 /* JSON */);
|
|
30912
|
+
initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, 6 /* JSON */, 0 /* KeepAll */);
|
|
30887
30913
|
sourceFlags = contextFlags;
|
|
30888
30914
|
nextToken();
|
|
30889
30915
|
const pos = getNodePos();
|
|
@@ -30964,7 +30990,7 @@ var Parser;
|
|
|
30964
30990
|
return result;
|
|
30965
30991
|
}
|
|
30966
30992
|
Parser2.parseJsonText = parseJsonText2;
|
|
30967
|
-
function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind) {
|
|
30993
|
+
function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind, _jsDocParsingMode) {
|
|
30968
30994
|
NodeConstructor2 = objectAllocator.getNodeConstructor();
|
|
30969
30995
|
TokenConstructor2 = objectAllocator.getTokenConstructor();
|
|
30970
30996
|
IdentifierConstructor2 = objectAllocator.getIdentifierConstructor();
|
|
@@ -31000,11 +31026,15 @@ var Parser;
|
|
|
31000
31026
|
scanner2.setOnError(scanError);
|
|
31001
31027
|
scanner2.setScriptTarget(languageVersion);
|
|
31002
31028
|
scanner2.setLanguageVariant(languageVariant);
|
|
31029
|
+
scanner2.setScriptKind(scriptKind);
|
|
31030
|
+
scanner2.setJSDocParsingMode(_jsDocParsingMode);
|
|
31003
31031
|
}
|
|
31004
31032
|
function clearState() {
|
|
31005
31033
|
scanner2.clearCommentDirectives();
|
|
31006
31034
|
scanner2.setText("");
|
|
31007
31035
|
scanner2.setOnError(void 0);
|
|
31036
|
+
scanner2.setScriptKind(0 /* Unknown */);
|
|
31037
|
+
scanner2.setJSDocParsingMode(0 /* KeepAll */);
|
|
31008
31038
|
sourceText = void 0;
|
|
31009
31039
|
languageVersion = void 0;
|
|
31010
31040
|
syntaxCursor = void 0;
|
|
@@ -31018,7 +31048,7 @@ var Parser;
|
|
|
31018
31048
|
notParenthesizedArrow = void 0;
|
|
31019
31049
|
topLevel = true;
|
|
31020
31050
|
}
|
|
31021
|
-
function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2) {
|
|
31051
|
+
function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2, jsDocParsingMode) {
|
|
31022
31052
|
const isDeclarationFile = isDeclarationFileName(fileName);
|
|
31023
31053
|
if (isDeclarationFile) {
|
|
31024
31054
|
contextFlags |= 33554432 /* Ambient */;
|
|
@@ -31037,6 +31067,7 @@ var Parser;
|
|
|
31037
31067
|
sourceFile.identifierCount = identifierCount;
|
|
31038
31068
|
sourceFile.identifiers = identifiers;
|
|
31039
31069
|
sourceFile.parseDiagnostics = attachFileToDiagnostics(parseDiagnostics, sourceFile);
|
|
31070
|
+
sourceFile.jsDocParsingMode = jsDocParsingMode;
|
|
31040
31071
|
if (jsDocDiagnostics) {
|
|
31041
31072
|
sourceFile.jsDocDiagnostics = attachFileToDiagnostics(jsDocDiagnostics, sourceFile);
|
|
31042
31073
|
}
|
|
@@ -36470,7 +36501,8 @@ var Parser;
|
|
|
36470
36501
|
99 /* Latest */,
|
|
36471
36502
|
/*syntaxCursor*/
|
|
36472
36503
|
void 0,
|
|
36473
|
-
1 /* JS
|
|
36504
|
+
1 /* JS */,
|
|
36505
|
+
0 /* KeepAll */
|
|
36474
36506
|
);
|
|
36475
36507
|
scanner2.setText(content, start2, length2);
|
|
36476
36508
|
currentToken = scanner2.scan();
|
|
@@ -36534,7 +36566,8 @@ var Parser;
|
|
|
36534
36566
|
99 /* Latest */,
|
|
36535
36567
|
/*syntaxCursor*/
|
|
36536
36568
|
void 0,
|
|
36537
|
-
1 /* JS
|
|
36569
|
+
1 /* JS */,
|
|
36570
|
+
0 /* KeepAll */
|
|
36538
36571
|
);
|
|
36539
36572
|
const jsDoc = doInsideOfContext(16777216 /* JSDoc */, () => parseJSDocCommentWorker(start2, length2));
|
|
36540
36573
|
const sourceFile = { languageVariant: 0 /* Standard */, text: content };
|
|
@@ -37490,7 +37523,8 @@ var IncrementalParser;
|
|
|
37490
37523
|
/*setParentNodes*/
|
|
37491
37524
|
true,
|
|
37492
37525
|
sourceFile.scriptKind,
|
|
37493
|
-
sourceFile.setExternalModuleIndicator
|
|
37526
|
+
sourceFile.setExternalModuleIndicator,
|
|
37527
|
+
sourceFile.jsDocParsingMode
|
|
37494
37528
|
);
|
|
37495
37529
|
}
|
|
37496
37530
|
const incrementalSourceFile = sourceFile;
|
|
@@ -37514,7 +37548,8 @@ var IncrementalParser;
|
|
|
37514
37548
|
/*setParentNodes*/
|
|
37515
37549
|
true,
|
|
37516
37550
|
sourceFile.scriptKind,
|
|
37517
|
-
sourceFile.setExternalModuleIndicator
|
|
37551
|
+
sourceFile.setExternalModuleIndicator,
|
|
37552
|
+
sourceFile.jsDocParsingMode
|
|
37518
37553
|
);
|
|
37519
37554
|
result.commentDirectives = getNewCommentDirectives(
|
|
37520
37555
|
sourceFile.commentDirectives,
|
|
@@ -48170,20 +48205,30 @@ function createTypeChecker(host) {
|
|
|
48170
48205
|
typeHasCallOrConstructSignatures
|
|
48171
48206
|
};
|
|
48172
48207
|
function runWithoutResolvedSignatureCaching(node, fn) {
|
|
48173
|
-
const
|
|
48208
|
+
const cachedResolvedSignatures = [];
|
|
48209
|
+
const cachedTypes2 = [];
|
|
48174
48210
|
while (node) {
|
|
48175
|
-
if (isCallLikeExpression(node)) {
|
|
48211
|
+
if (isCallLikeExpression(node) || isFunctionLike(node)) {
|
|
48176
48212
|
const nodeLinks2 = getNodeLinks(node);
|
|
48177
48213
|
const resolvedSignature = nodeLinks2.resolvedSignature;
|
|
48178
|
-
|
|
48214
|
+
cachedResolvedSignatures.push([nodeLinks2, resolvedSignature]);
|
|
48179
48215
|
nodeLinks2.resolvedSignature = void 0;
|
|
48180
48216
|
}
|
|
48217
|
+
if (isFunctionLike(node)) {
|
|
48218
|
+
const symbolLinks2 = getSymbolLinks(getSymbolOfDeclaration(node));
|
|
48219
|
+
const type = symbolLinks2.type;
|
|
48220
|
+
cachedTypes2.push([symbolLinks2, type]);
|
|
48221
|
+
symbolLinks2.type = void 0;
|
|
48222
|
+
}
|
|
48181
48223
|
node = node.parent;
|
|
48182
48224
|
}
|
|
48183
48225
|
const result = fn();
|
|
48184
|
-
for (const [nodeLinks2, resolvedSignature] of
|
|
48226
|
+
for (const [nodeLinks2, resolvedSignature] of cachedResolvedSignatures) {
|
|
48185
48227
|
nodeLinks2.resolvedSignature = resolvedSignature;
|
|
48186
48228
|
}
|
|
48229
|
+
for (const [symbolLinks2, type] of cachedTypes2) {
|
|
48230
|
+
symbolLinks2.type = type;
|
|
48231
|
+
}
|
|
48187
48232
|
return result;
|
|
48188
48233
|
}
|
|
48189
48234
|
function runWithInferenceBlockedFromSourceNode(node, fn) {
|
|
@@ -53917,14 +53962,15 @@ function createTypeChecker(host) {
|
|
|
53917
53962
|
function getPropertyNameNodeForSymbol(symbol, context) {
|
|
53918
53963
|
const stringNamed = !!length(symbol.declarations) && every(symbol.declarations, isStringNamed);
|
|
53919
53964
|
const singleQuote = !!length(symbol.declarations) && every(symbol.declarations, isSingleQuotedStringNamed);
|
|
53920
|
-
const
|
|
53965
|
+
const isMethod = !!(symbol.flags & 8192 /* Method */);
|
|
53966
|
+
const fromNameType = getPropertyNameNodeForSymbolFromNameType(symbol, context, singleQuote, stringNamed, isMethod);
|
|
53921
53967
|
if (fromNameType) {
|
|
53922
53968
|
return fromNameType;
|
|
53923
53969
|
}
|
|
53924
53970
|
const rawName = unescapeLeadingUnderscores(symbol.escapedName);
|
|
53925
|
-
return createPropertyNameNodeForIdentifierOrLiteral(rawName, getEmitScriptTarget(compilerOptions), singleQuote, stringNamed);
|
|
53971
|
+
return createPropertyNameNodeForIdentifierOrLiteral(rawName, getEmitScriptTarget(compilerOptions), singleQuote, stringNamed, isMethod);
|
|
53926
53972
|
}
|
|
53927
|
-
function getPropertyNameNodeForSymbolFromNameType(symbol, context, singleQuote, stringNamed) {
|
|
53973
|
+
function getPropertyNameNodeForSymbolFromNameType(symbol, context, singleQuote, stringNamed, isMethod) {
|
|
53928
53974
|
const nameType = getSymbolLinks(symbol).nameType;
|
|
53929
53975
|
if (nameType) {
|
|
53930
53976
|
if (nameType.flags & 384 /* StringOrNumberLiteral */) {
|
|
@@ -53935,7 +53981,7 @@ function createTypeChecker(host) {
|
|
|
53935
53981
|
if (isNumericLiteralName(name) && startsWith(name, "-")) {
|
|
53936
53982
|
return factory.createComputedPropertyName(factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createNumericLiteral(Math.abs(+name))));
|
|
53937
53983
|
}
|
|
53938
|
-
return createPropertyNameNodeForIdentifierOrLiteral(name, getEmitScriptTarget(compilerOptions));
|
|
53984
|
+
return createPropertyNameNodeForIdentifierOrLiteral(name, getEmitScriptTarget(compilerOptions), singleQuote, stringNamed, isMethod);
|
|
53939
53985
|
}
|
|
53940
53986
|
if (nameType.flags & 8192 /* UniqueESSymbol */) {
|
|
53941
53987
|
return factory.createComputedPropertyName(symbolToExpression(nameType.symbol, context, 111551 /* Value */));
|
|
@@ -56038,10 +56084,6 @@ function createTypeChecker(host) {
|
|
|
56038
56084
|
const prop = getPropertyOfType(type, name);
|
|
56039
56085
|
return prop ? getTypeOfSymbol(prop) : void 0;
|
|
56040
56086
|
}
|
|
56041
|
-
function getTypeOfPropertyOrIndexSignature(type, name) {
|
|
56042
|
-
var _a;
|
|
56043
|
-
return getTypeOfPropertyOfType(type, name) || ((_a = getApplicableIndexInfoForName(type, name)) == null ? void 0 : _a.type) || unknownType;
|
|
56044
|
-
}
|
|
56045
56087
|
function getTypeOfPropertyOrIndexSignatureOfType(type, name) {
|
|
56046
56088
|
var _a;
|
|
56047
56089
|
let propType;
|
|
@@ -56180,9 +56222,14 @@ function createTypeChecker(host) {
|
|
|
56180
56222
|
function getTypeForBindingElement(declaration) {
|
|
56181
56223
|
const checkMode = declaration.dotDotDotToken ? 64 /* RestBindingElement */ : 0 /* Normal */;
|
|
56182
56224
|
const parentType = getTypeForBindingElementParent(declaration.parent.parent, checkMode);
|
|
56183
|
-
return parentType && getBindingElementTypeFromParentType(
|
|
56225
|
+
return parentType && getBindingElementTypeFromParentType(
|
|
56226
|
+
declaration,
|
|
56227
|
+
parentType,
|
|
56228
|
+
/*noTupleBoundsCheck*/
|
|
56229
|
+
false
|
|
56230
|
+
);
|
|
56184
56231
|
}
|
|
56185
|
-
function getBindingElementTypeFromParentType(declaration, parentType) {
|
|
56232
|
+
function getBindingElementTypeFromParentType(declaration, parentType, noTupleBoundsCheck) {
|
|
56186
56233
|
if (isTypeAny(parentType)) {
|
|
56187
56234
|
return parentType;
|
|
56188
56235
|
}
|
|
@@ -56221,7 +56268,7 @@ function createTypeChecker(host) {
|
|
|
56221
56268
|
type = everyType(baseConstraint, isTupleType) ? mapType(baseConstraint, (t) => sliceTupleType(t, index)) : createArrayType(elementType);
|
|
56222
56269
|
} else if (isArrayLikeType(parentType)) {
|
|
56223
56270
|
const indexType = getNumberLiteralType(index);
|
|
56224
|
-
const accessFlags = 32 /* ExpressionPosition */ | (hasDefaultValue(declaration) ? 16 /* NoTupleBoundsCheck */ : 0);
|
|
56271
|
+
const accessFlags = 32 /* ExpressionPosition */ | (noTupleBoundsCheck || hasDefaultValue(declaration) ? 16 /* NoTupleBoundsCheck */ : 0);
|
|
56225
56272
|
const declaredType = getIndexedAccessTypeOrUndefined(parentType, indexType, accessFlags, declaration.name) || errorType;
|
|
56226
56273
|
type = getFlowTypeOfDestructuring(declaration, declaredType);
|
|
56227
56274
|
} else {
|
|
@@ -62094,7 +62141,7 @@ function createTypeChecker(host) {
|
|
|
62094
62141
|
return autoType;
|
|
62095
62142
|
}
|
|
62096
62143
|
}
|
|
62097
|
-
const propType = getTypeOfSymbol(prop);
|
|
62144
|
+
const propType = accessFlags & 4 /* Writing */ ? getWriteTypeOfSymbol(prop) : getTypeOfSymbol(prop);
|
|
62098
62145
|
return accessExpression && getAssignmentTargetKind(accessExpression) !== 1 /* Definite */ ? getFlowTypeOfReference(accessExpression, propType) : accessNode && isIndexedAccessTypeNode(accessNode) && containsMissingType(propType) ? getUnionType([propType, undefinedType]) : propType;
|
|
62099
62146
|
}
|
|
62100
62147
|
if (everyType(objectType, isTupleType) && isNumericLiteralName(propName)) {
|
|
@@ -68024,7 +68071,7 @@ function createTypeChecker(host) {
|
|
|
68024
68071
|
}
|
|
68025
68072
|
const name = escapeLeadingUnderscores(t.value);
|
|
68026
68073
|
const literalProp = createSymbol(4 /* Property */, name);
|
|
68027
|
-
literalProp.links.type =
|
|
68074
|
+
literalProp.links.type = anyType;
|
|
68028
68075
|
if (t.symbol) {
|
|
68029
68076
|
literalProp.declarations = t.symbol.declarations;
|
|
68030
68077
|
literalProp.valueDeclaration = t.symbol.valueDeclaration;
|
|
@@ -70392,7 +70439,7 @@ function createTypeChecker(host) {
|
|
|
70392
70439
|
propType = removeNullable && optionalChain ? getOptionalType(propType) : propType;
|
|
70393
70440
|
const narrowedPropType = narrowType2(propType);
|
|
70394
70441
|
return filterType(type, (t) => {
|
|
70395
|
-
const discriminantType =
|
|
70442
|
+
const discriminantType = getTypeOfPropertyOrIndexSignatureOfType(t, propName) || unknownType;
|
|
70396
70443
|
return !(discriminantType.flags & 131072 /* Never */) && !(narrowedPropType.flags & 131072 /* Never */) && areTypesComparable(narrowedPropType, discriminantType);
|
|
70397
70444
|
});
|
|
70398
70445
|
}
|
|
@@ -70965,7 +71012,7 @@ function createTypeChecker(host) {
|
|
|
70965
71012
|
if (isDeclarationName(location) && isSetAccessor(location.parent) && getAnnotatedAccessorTypeNode(location.parent)) {
|
|
70966
71013
|
return getWriteTypeOfAccessors(location.parent.symbol);
|
|
70967
71014
|
}
|
|
70968
|
-
return getNonMissingTypeOfSymbol(symbol);
|
|
71015
|
+
return isRightSideOfAccessExpression(location) && isWriteAccess(location.parent) ? getWriteTypeOfSymbol(symbol) : getNonMissingTypeOfSymbol(symbol);
|
|
70969
71016
|
}
|
|
70970
71017
|
function getControlFlowContainer(node) {
|
|
70971
71018
|
return findAncestor(node.parent, (node2) => isFunctionLike(node2) && !getImmediatelyInvokedFunctionExpression(node2) || node2.kind === 268 /* ModuleBlock */ || node2.kind === 312 /* SourceFile */ || node2.kind === 172 /* PropertyDeclaration */);
|
|
@@ -71109,7 +71156,12 @@ function createTypeChecker(host) {
|
|
|
71109
71156
|
if (narrowedType.flags & 131072 /* Never */) {
|
|
71110
71157
|
return neverType;
|
|
71111
71158
|
}
|
|
71112
|
-
return getBindingElementTypeFromParentType(
|
|
71159
|
+
return getBindingElementTypeFromParentType(
|
|
71160
|
+
declaration,
|
|
71161
|
+
narrowedType,
|
|
71162
|
+
/*noTupleBoundsCheck*/
|
|
71163
|
+
true
|
|
71164
|
+
);
|
|
71113
71165
|
}
|
|
71114
71166
|
}
|
|
71115
71167
|
}
|
|
@@ -71633,6 +71685,9 @@ function createTypeChecker(host) {
|
|
|
71633
71685
|
error2(node, Diagnostics.super_can_only_be_referenced_in_a_derived_class);
|
|
71634
71686
|
return errorType;
|
|
71635
71687
|
}
|
|
71688
|
+
if (classDeclarationExtendsNull(classLikeDeclaration)) {
|
|
71689
|
+
return isCallExpression2 ? errorType : nullWideningType;
|
|
71690
|
+
}
|
|
71636
71691
|
const classType = getDeclaredTypeOfSymbol(getSymbolOfDeclaration(classLikeDeclaration));
|
|
71637
71692
|
const baseClassType = classType && getBaseTypes(classType)[0];
|
|
71638
71693
|
if (!baseClassType) {
|
|
@@ -77163,7 +77218,12 @@ function createTypeChecker(host) {
|
|
|
77163
77218
|
function assignBindingElementTypes(pattern, parentType) {
|
|
77164
77219
|
for (const element of pattern.elements) {
|
|
77165
77220
|
if (!isOmittedExpression(element)) {
|
|
77166
|
-
const type = getBindingElementTypeFromParentType(
|
|
77221
|
+
const type = getBindingElementTypeFromParentType(
|
|
77222
|
+
element,
|
|
77223
|
+
parentType,
|
|
77224
|
+
/*noTupleBoundsCheck*/
|
|
77225
|
+
false
|
|
77226
|
+
);
|
|
77167
77227
|
if (element.name.kind === 80 /* Identifier */) {
|
|
77168
77228
|
getSymbolLinks(getSymbolOfDeclaration(element)).type = type;
|
|
77169
77229
|
} else {
|
|
@@ -117815,6 +117875,16 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
117815
117875
|
increaseIndent();
|
|
117816
117876
|
shouldDecreaseIndentAfterEmit = true;
|
|
117817
117877
|
}
|
|
117878
|
+
if (shouldEmitInterveningComments && format & 60 /* DelimitersMask */ && !positionIsSynthesized(child.pos)) {
|
|
117879
|
+
const commentRange = getCommentRange(child);
|
|
117880
|
+
emitTrailingCommentsOfPosition(
|
|
117881
|
+
commentRange.pos,
|
|
117882
|
+
/*prefixSpace*/
|
|
117883
|
+
!!(format & 512 /* SpaceBetweenSiblings */),
|
|
117884
|
+
/*forceNoNewline*/
|
|
117885
|
+
true
|
|
117886
|
+
);
|
|
117887
|
+
}
|
|
117818
117888
|
writeLine(separatingLineTerminatorCount);
|
|
117819
117889
|
shouldEmitInterveningComments = false;
|
|
117820
117890
|
} else if (previousSibling && format & 512 /* SpaceBetweenSiblings */) {
|
|
@@ -119683,10 +119753,16 @@ function computeCommonSourceDirectoryOfFilenames(fileNames, currentDirectory, ge
|
|
|
119683
119753
|
}
|
|
119684
119754
|
return getPathFromPathComponents(commonPathComponents);
|
|
119685
119755
|
}
|
|
119686
|
-
function createCompilerHost(options, setParentNodes) {
|
|
119687
|
-
return createCompilerHostWorker(
|
|
119756
|
+
function createCompilerHost(options, setParentNodes, jsDocParsingMode) {
|
|
119757
|
+
return createCompilerHostWorker(
|
|
119758
|
+
options,
|
|
119759
|
+
setParentNodes,
|
|
119760
|
+
/*system*/
|
|
119761
|
+
void 0,
|
|
119762
|
+
jsDocParsingMode
|
|
119763
|
+
);
|
|
119688
119764
|
}
|
|
119689
|
-
function createGetSourceFile(readFile, getCompilerOptions, setParentNodes) {
|
|
119765
|
+
function createGetSourceFile(readFile, getCompilerOptions, setParentNodes, jsDocParsingMode) {
|
|
119690
119766
|
return (fileName, languageVersionOrOptions, onError) => {
|
|
119691
119767
|
let text;
|
|
119692
119768
|
try {
|
|
@@ -119700,7 +119776,15 @@ function createGetSourceFile(readFile, getCompilerOptions, setParentNodes) {
|
|
|
119700
119776
|
}
|
|
119701
119777
|
text = "";
|
|
119702
119778
|
}
|
|
119703
|
-
return text !== void 0 ? createSourceFile(
|
|
119779
|
+
return text !== void 0 ? createSourceFile(
|
|
119780
|
+
fileName,
|
|
119781
|
+
text,
|
|
119782
|
+
languageVersionOrOptions,
|
|
119783
|
+
setParentNodes,
|
|
119784
|
+
/*scriptKind*/
|
|
119785
|
+
void 0,
|
|
119786
|
+
jsDocParsingMode
|
|
119787
|
+
) : void 0;
|
|
119704
119788
|
};
|
|
119705
119789
|
}
|
|
119706
119790
|
function createWriteFileMeasuringIO(actualWriteFile, createDirectory, directoryExists) {
|
|
@@ -119724,7 +119808,7 @@ function createWriteFileMeasuringIO(actualWriteFile, createDirectory, directoryE
|
|
|
119724
119808
|
}
|
|
119725
119809
|
};
|
|
119726
119810
|
}
|
|
119727
|
-
function createCompilerHostWorker(options, setParentNodes, system = sys) {
|
|
119811
|
+
function createCompilerHostWorker(options, setParentNodes, system = sys, jsDocParsingMode) {
|
|
119728
119812
|
const existingDirectories = /* @__PURE__ */ new Map();
|
|
119729
119813
|
const getCanonicalFileName = createGetCanonicalFileName(system.useCaseSensitiveFileNames);
|
|
119730
119814
|
function directoryExists(directoryPath) {
|
|
@@ -119743,7 +119827,7 @@ function createCompilerHostWorker(options, setParentNodes, system = sys) {
|
|
|
119743
119827
|
const newLine = getNewLineCharacter(options);
|
|
119744
119828
|
const realpath = system.realpath && ((path) => system.realpath(path));
|
|
119745
119829
|
const compilerHost = {
|
|
119746
|
-
getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes),
|
|
119830
|
+
getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes, jsDocParsingMode),
|
|
119747
119831
|
getDefaultLibLocation,
|
|
119748
119832
|
getDefaultLibFileName: (options2) => combinePaths(getDefaultLibLocation(), getDefaultLibFileName(options2)),
|
|
119749
119833
|
writeFile: createWriteFileMeasuringIO(
|
|
@@ -125430,19 +125514,22 @@ function removeIgnoredPath(path) {
|
|
|
125430
125514
|
function perceivedOsRootLengthForWatching(pathComponents2, length2) {
|
|
125431
125515
|
if (length2 <= 1)
|
|
125432
125516
|
return 1;
|
|
125433
|
-
let
|
|
125517
|
+
let indexAfterOsRoot = 1;
|
|
125434
125518
|
let isDosStyle = pathComponents2[0].search(/[a-zA-Z]:/) === 0;
|
|
125435
125519
|
if (pathComponents2[0] !== directorySeparator && !isDosStyle && // Non dos style paths
|
|
125436
125520
|
pathComponents2[1].search(/[a-zA-Z]\$$/) === 0) {
|
|
125437
125521
|
if (length2 === 2)
|
|
125438
125522
|
return 2;
|
|
125439
|
-
|
|
125523
|
+
indexAfterOsRoot = 2;
|
|
125440
125524
|
isDosStyle = true;
|
|
125441
125525
|
}
|
|
125442
|
-
if (isDosStyle && !pathComponents2[
|
|
125443
|
-
return
|
|
125526
|
+
if (isDosStyle && !pathComponents2[indexAfterOsRoot].match(/^users$/i)) {
|
|
125527
|
+
return indexAfterOsRoot;
|
|
125444
125528
|
}
|
|
125445
|
-
|
|
125529
|
+
if (pathComponents2[indexAfterOsRoot].match(/^workspaces$/i)) {
|
|
125530
|
+
return indexAfterOsRoot + 1;
|
|
125531
|
+
}
|
|
125532
|
+
return indexAfterOsRoot + 2;
|
|
125446
125533
|
}
|
|
125447
125534
|
function canWatchDirectoryOrFile(pathComponents2, length2) {
|
|
125448
125535
|
if (length2 === void 0)
|
|
@@ -126880,7 +126967,8 @@ function createCompilerHostFromProgramHost(host, getCompilerOptions, directorySt
|
|
|
126880
126967
|
(fileName, encoding) => !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding),
|
|
126881
126968
|
getCompilerOptions,
|
|
126882
126969
|
/*setParentNodes*/
|
|
126883
|
-
void 0
|
|
126970
|
+
void 0,
|
|
126971
|
+
host.jsDocParsingMode
|
|
126884
126972
|
),
|
|
126885
126973
|
getDefaultLibLocation: maybeBind(host, host.getDefaultLibLocation),
|
|
126886
126974
|
getDefaultLibFileName: (options) => host.getDefaultLibFileName(options),
|
|
@@ -127066,12 +127154,13 @@ function readBuilderProgram(compilerOptions, host) {
|
|
|
127066
127154
|
return void 0;
|
|
127067
127155
|
return createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, host);
|
|
127068
127156
|
}
|
|
127069
|
-
function createIncrementalCompilerHost(options, system = sys) {
|
|
127157
|
+
function createIncrementalCompilerHost(options, system = sys, jsDocParsingMode) {
|
|
127070
127158
|
const host = createCompilerHostWorker(
|
|
127071
127159
|
options,
|
|
127072
127160
|
/*setParentNodes*/
|
|
127073
127161
|
void 0,
|
|
127074
|
-
system
|
|
127162
|
+
system,
|
|
127163
|
+
jsDocParsingMode
|
|
127075
127164
|
);
|
|
127076
127165
|
host.createHash = maybeBind(system, system.createHash);
|
|
127077
127166
|
host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
|
|
@@ -134994,10 +135083,10 @@ var DocumentHighlights;
|
|
|
134994
135083
|
function isDocumentRegistryEntry(entry) {
|
|
134995
135084
|
return !!entry.sourceFile;
|
|
134996
135085
|
}
|
|
134997
|
-
function createDocumentRegistry(useCaseSensitiveFileNames2, currentDirectory) {
|
|
134998
|
-
return createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory);
|
|
135086
|
+
function createDocumentRegistry(useCaseSensitiveFileNames2, currentDirectory, jsDocParsingMode) {
|
|
135087
|
+
return createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory, jsDocParsingMode);
|
|
134999
135088
|
}
|
|
135000
|
-
function createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory = "", externalCache) {
|
|
135089
|
+
function createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory = "", jsDocParsingMode, externalCache) {
|
|
135001
135090
|
const buckets = /* @__PURE__ */ new Map();
|
|
135002
135091
|
const getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames2);
|
|
135003
135092
|
function reportStats() {
|
|
@@ -135117,7 +135206,8 @@ function createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirec
|
|
|
135117
135206
|
version2,
|
|
135118
135207
|
/*setNodeParents*/
|
|
135119
135208
|
false,
|
|
135120
|
-
scriptKind
|
|
135209
|
+
scriptKind,
|
|
135210
|
+
jsDocParsingMode
|
|
135121
135211
|
);
|
|
135122
135212
|
if (externalCache) {
|
|
135123
135213
|
externalCache.setDocument(keyWithMode, path, sourceFile);
|
|
@@ -136504,7 +136594,12 @@ function transpileModule(input, transpileOptions) {
|
|
|
136504
136594
|
options
|
|
136505
136595
|
),
|
|
136506
136596
|
setExternalModuleIndicator: getSetExternalModuleIndicator(options)
|
|
136507
|
-
}
|
|
136597
|
+
},
|
|
136598
|
+
/*setParentNodes*/
|
|
136599
|
+
void 0,
|
|
136600
|
+
/*scriptKind*/
|
|
136601
|
+
void 0,
|
|
136602
|
+
2 /* SkipAll */
|
|
136508
136603
|
);
|
|
136509
136604
|
if (transpileOptions.moduleName) {
|
|
136510
136605
|
sourceFile.moduleName = transpileOptions.moduleName;
|
|
@@ -143703,7 +143798,8 @@ var SyntaxTreeCache = class {
|
|
|
143703
143798
|
version2,
|
|
143704
143799
|
/*setNodeParents*/
|
|
143705
143800
|
true,
|
|
143706
|
-
scriptKind
|
|
143801
|
+
scriptKind,
|
|
143802
|
+
this.host.jsDocParsingMode
|
|
143707
143803
|
);
|
|
143708
143804
|
} else if (this.currentFileVersion !== version2) {
|
|
143709
143805
|
const editRange = scriptSnapshot.getChangeRange(this.currentFileScriptSnapshot);
|
|
@@ -143722,8 +143818,8 @@ function setSourceFileFields(sourceFile, scriptSnapshot, version2) {
|
|
|
143722
143818
|
sourceFile.version = version2;
|
|
143723
143819
|
sourceFile.scriptSnapshot = scriptSnapshot;
|
|
143724
143820
|
}
|
|
143725
|
-
function createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTargetOrOptions, version2, setNodeParents, scriptKind) {
|
|
143726
|
-
const sourceFile = createSourceFile(fileName, getSnapshotText(scriptSnapshot), scriptTargetOrOptions, setNodeParents, scriptKind);
|
|
143821
|
+
function createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTargetOrOptions, version2, setNodeParents, scriptKind, jsDocParsingMode) {
|
|
143822
|
+
const sourceFile = createSourceFile(fileName, getSnapshotText(scriptSnapshot), scriptTargetOrOptions, setNodeParents, scriptKind, jsDocParsingMode);
|
|
143727
143823
|
setSourceFileFields(sourceFile, scriptSnapshot, version2);
|
|
143728
143824
|
return sourceFile;
|
|
143729
143825
|
}
|
|
@@ -143763,7 +143859,8 @@ function updateLanguageServiceSourceFile(sourceFile, scriptSnapshot, version2, t
|
|
|
143763
143859
|
version2,
|
|
143764
143860
|
/*setNodeParents*/
|
|
143765
143861
|
true,
|
|
143766
|
-
sourceFile.scriptKind
|
|
143862
|
+
sourceFile.scriptKind,
|
|
143863
|
+
sourceFile.jsDocParsingMode
|
|
143767
143864
|
);
|
|
143768
143865
|
}
|
|
143769
143866
|
var NoopCancellationToken = {
|
|
@@ -152883,7 +152980,15 @@ function createPropertyNameFromSymbol(symbol, target, quotePreference, checker)
|
|
|
152883
152980
|
if (prop && isComputedPropertyName(prop))
|
|
152884
152981
|
return prop;
|
|
152885
152982
|
}
|
|
152886
|
-
return createPropertyNameNodeForIdentifierOrLiteral(
|
|
152983
|
+
return createPropertyNameNodeForIdentifierOrLiteral(
|
|
152984
|
+
symbol.name,
|
|
152985
|
+
target,
|
|
152986
|
+
quotePreference === 0 /* Single */,
|
|
152987
|
+
/*stringNamed*/
|
|
152988
|
+
false,
|
|
152989
|
+
/*isMethod*/
|
|
152990
|
+
false
|
|
152991
|
+
);
|
|
152887
152992
|
}
|
|
152888
152993
|
function findScope(node) {
|
|
152889
152994
|
if (findAncestor(node, isJsxExpression)) {
|
|
@@ -168890,7 +168995,8 @@ var changesToText;
|
|
|
168890
168995
|
99 /* ESNext */,
|
|
168891
168996
|
/*setParentNodes*/
|
|
168892
168997
|
true,
|
|
168893
|
-
scriptKind
|
|
168998
|
+
scriptKind,
|
|
168999
|
+
2 /* SkipAll */
|
|
168894
169000
|
);
|
|
168895
169001
|
const changes = ts_formatting_exports.formatDocument(sourceFile, formatContext);
|
|
168896
169002
|
return applyChanges(nonFormattedText, changes) + newLineCharacter;
|
|
@@ -172172,6 +172278,7 @@ __export(ts_exports2, {
|
|
|
172172
172278
|
InternalEmitFlags: () => InternalEmitFlags,
|
|
172173
172279
|
InternalSymbolName: () => InternalSymbolName,
|
|
172174
172280
|
InvalidatedProjectKind: () => InvalidatedProjectKind,
|
|
172281
|
+
JSDocParsingMode: () => JSDocParsingMode,
|
|
172175
172282
|
JsDoc: () => ts_JsDoc_exports,
|
|
172176
172283
|
JsTyping: () => ts_JsTyping_exports,
|
|
172177
172284
|
JsxEmit: () => JsxEmit,
|
|
@@ -176140,6 +176247,7 @@ var Project3 = class _Project {
|
|
|
176140
176247
|
this.directoryStructureHost = directoryStructureHost;
|
|
176141
176248
|
this.currentDirectory = this.projectService.getNormalizedAbsolutePath(currentDirectory);
|
|
176142
176249
|
this.getCanonicalFileName = this.projectService.toCanonicalFileName;
|
|
176250
|
+
this.jsDocParsingMode = this.projectService.jsDocParsingMode;
|
|
176143
176251
|
this.cancellationToken = new ThrottledCancellationToken(this.projectService.cancellationToken, this.projectService.throttleWaitMilliseconds);
|
|
176144
176252
|
if (!this.compilerOptions) {
|
|
176145
176253
|
this.compilerOptions = getDefaultCompilerOptions2();
|
|
@@ -178698,6 +178806,7 @@ var _ProjectService = class _ProjectService {
|
|
|
178698
178806
|
this.allowLocalPluginLoads = !!opts.allowLocalPluginLoads;
|
|
178699
178807
|
this.typesMapLocation = opts.typesMapLocation === void 0 ? combinePaths(getDirectoryPath(this.getExecutingFilePath()), "typesMap.json") : opts.typesMapLocation;
|
|
178700
178808
|
this.session = opts.session;
|
|
178809
|
+
this.jsDocParsingMode = opts.jsDocParsingMode;
|
|
178701
178810
|
if (opts.serverMode !== void 0) {
|
|
178702
178811
|
this.serverMode = opts.serverMode;
|
|
178703
178812
|
} else {
|
|
@@ -178723,7 +178832,7 @@ var _ProjectService = class _ProjectService {
|
|
|
178723
178832
|
hostInfo: "Unknown host",
|
|
178724
178833
|
extraFileExtensions: []
|
|
178725
178834
|
};
|
|
178726
|
-
this.documentRegistry = createDocumentRegistryInternal(this.host.useCaseSensitiveFileNames, this.currentDirectory, this);
|
|
178835
|
+
this.documentRegistry = createDocumentRegistryInternal(this.host.useCaseSensitiveFileNames, this.currentDirectory, this.jsDocParsingMode, this);
|
|
178727
178836
|
const watchLogLevel = this.logger.hasLevel(3 /* verbose */) ? 2 /* Verbose */ : this.logger.loggingEnabled() ? 1 /* TriggerOnly */ : 0 /* None */;
|
|
178728
178837
|
const log = watchLogLevel !== 0 /* None */ ? (s) => this.logger.info(s) : noop;
|
|
178729
178838
|
this.packageJsonCache = createPackageJsonCache(this);
|
|
@@ -186734,6 +186843,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
186734
186843
|
InternalEmitFlags,
|
|
186735
186844
|
InternalSymbolName,
|
|
186736
186845
|
InvalidatedProjectKind,
|
|
186846
|
+
JSDocParsingMode,
|
|
186737
186847
|
JsDoc,
|
|
186738
186848
|
JsTyping,
|
|
186739
186849
|
JsxEmit,
|