typescript 5.3.0-dev.20230921 → 5.3.0-dev.20230922
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 +88 -64
- package/lib/tsserver.js +124 -72
- package/lib/typescript.d.ts +37 -1
- package/lib/typescript.js +125 -74
- package/lib/typingsInstaller.js +45 -35
- package/package.json +2 -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,
|
|
@@ -2323,7 +2324,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2323
2324
|
|
|
2324
2325
|
// src/compiler/corePublic.ts
|
|
2325
2326
|
var versionMajorMinor = "5.3";
|
|
2326
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2327
|
+
var version = `${versionMajorMinor}.0-dev.20230922`;
|
|
2327
2328
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2328
2329
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2329
2330
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -7417,6 +7418,13 @@ var commentPragmas = {
|
|
|
7417
7418
|
kind: 4 /* MultiLine */
|
|
7418
7419
|
}
|
|
7419
7420
|
};
|
|
7421
|
+
var JSDocParsingMode = /* @__PURE__ */ ((JSDocParsingMode7) => {
|
|
7422
|
+
JSDocParsingMode7[JSDocParsingMode7["ParseAll"] = 0] = "ParseAll";
|
|
7423
|
+
JSDocParsingMode7[JSDocParsingMode7["ParseNone"] = 1] = "ParseNone";
|
|
7424
|
+
JSDocParsingMode7[JSDocParsingMode7["ParseForTypeErrors"] = 2] = "ParseForTypeErrors";
|
|
7425
|
+
JSDocParsingMode7[JSDocParsingMode7["ParseForTypeInfo"] = 3] = "ParseForTypeInfo";
|
|
7426
|
+
return JSDocParsingMode7;
|
|
7427
|
+
})(JSDocParsingMode || {});
|
|
7420
7428
|
|
|
7421
7429
|
// src/compiler/sys.ts
|
|
7422
7430
|
function generateDjb2Hash(data) {
|
|
@@ -11204,7 +11212,7 @@ var Diagnostics = {
|
|
|
11204
11212
|
Could_not_convert_to_arrow_function: diag(95151, 3 /* Message */, "Could_not_convert_to_arrow_function_95151", "Could not convert to arrow function"),
|
|
11205
11213
|
Could_not_convert_to_named_function: diag(95152, 3 /* Message */, "Could_not_convert_to_named_function_95152", "Could not convert to named function"),
|
|
11206
11214
|
Could_not_convert_to_anonymous_function: diag(95153, 3 /* Message */, "Could_not_convert_to_anonymous_function_95153", "Could not convert to anonymous function"),
|
|
11207
|
-
|
|
11215
|
+
Can_only_convert_string_concatenations_and_string_literals: diag(95154, 3 /* Message */, "Can_only_convert_string_concatenations_and_string_literals_95154", "Can only convert string concatenations and string literals"),
|
|
11208
11216
|
Selection_is_not_a_valid_statement_or_statements: diag(95155, 3 /* Message */, "Selection_is_not_a_valid_statement_or_statements_95155", "Selection is not a valid statement or statements"),
|
|
11209
11217
|
Add_missing_function_declaration_0: diag(95156, 3 /* Message */, "Add_missing_function_declaration_0_95156", "Add missing function declaration '{0}'"),
|
|
11210
11218
|
Add_all_missing_function_declarations: diag(95157, 3 /* Message */, "Add_all_missing_function_declarations_95157", "Add all missing function declarations"),
|
|
@@ -11448,7 +11456,7 @@ var unicodeESNextIdentifierStart = [65, 90, 97, 122, 170, 170, 181, 181, 186, 18
|
|
|
11448
11456
|
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];
|
|
11449
11457
|
var commentDirectiveRegExSingleLine = /^\/\/\/?\s*@(ts-expect-error|ts-ignore)/;
|
|
11450
11458
|
var commentDirectiveRegExMultiLine = /^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/;
|
|
11451
|
-
var
|
|
11459
|
+
var jsDocSeeOrLink = /@(?:see|link)/i;
|
|
11452
11460
|
function lookupInUnicodeMap(code, map2) {
|
|
11453
11461
|
if (code < map2[0]) {
|
|
11454
11462
|
return false;
|
|
@@ -11955,7 +11963,8 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
11955
11963
|
var tokenFlags;
|
|
11956
11964
|
var commentDirectives;
|
|
11957
11965
|
var inJSDocType = 0;
|
|
11958
|
-
var
|
|
11966
|
+
var scriptKind = 0 /* Unknown */;
|
|
11967
|
+
var jsDocParsingMode = 0 /* ParseAll */;
|
|
11959
11968
|
setText(text, start2, length2);
|
|
11960
11969
|
var scanner2 = {
|
|
11961
11970
|
getTokenFullStart: () => fullStartPos,
|
|
@@ -11999,14 +12008,15 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
11999
12008
|
setText,
|
|
12000
12009
|
setScriptTarget,
|
|
12001
12010
|
setLanguageVariant,
|
|
12011
|
+
setScriptKind,
|
|
12012
|
+
setJSDocParsingMode,
|
|
12002
12013
|
setOnError,
|
|
12003
12014
|
resetTokenState,
|
|
12004
12015
|
setTextPos: resetTokenState,
|
|
12005
12016
|
setInJSDocType,
|
|
12006
12017
|
tryScan,
|
|
12007
12018
|
lookAhead,
|
|
12008
|
-
scanRange
|
|
12009
|
-
setSkipNonSemanticJSDoc
|
|
12019
|
+
scanRange
|
|
12010
12020
|
};
|
|
12011
12021
|
if (Debug.isDebugging) {
|
|
12012
12022
|
Object.defineProperty(scanner2, "__debugShowCurrentPositionInText", {
|
|
@@ -12794,7 +12804,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
12794
12804
|
tokenFlags |= 1 /* PrecedingLineBreak */;
|
|
12795
12805
|
}
|
|
12796
12806
|
}
|
|
12797
|
-
if (isJSDoc2 && (
|
|
12807
|
+
if (isJSDoc2 && shouldParseJSDoc()) {
|
|
12798
12808
|
tokenFlags |= 2 /* PrecedingJSDocComment */;
|
|
12799
12809
|
}
|
|
12800
12810
|
commentDirectives = appendIfCommentDirective(commentDirectives, text.slice(lastLineStart, pos), commentDirectiveRegExMultiLine, lastLineStart);
|
|
@@ -13053,6 +13063,21 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
13053
13063
|
}
|
|
13054
13064
|
}
|
|
13055
13065
|
}
|
|
13066
|
+
function shouldParseJSDoc() {
|
|
13067
|
+
switch (jsDocParsingMode) {
|
|
13068
|
+
case 0 /* ParseAll */:
|
|
13069
|
+
return true;
|
|
13070
|
+
case 1 /* ParseNone */:
|
|
13071
|
+
return false;
|
|
13072
|
+
}
|
|
13073
|
+
if (scriptKind !== 3 /* TS */ && scriptKind !== 4 /* TSX */) {
|
|
13074
|
+
return true;
|
|
13075
|
+
}
|
|
13076
|
+
if (jsDocParsingMode === 3 /* ParseForTypeInfo */) {
|
|
13077
|
+
return false;
|
|
13078
|
+
}
|
|
13079
|
+
return jsDocSeeOrLink.test(text.slice(fullStartPos, pos));
|
|
13080
|
+
}
|
|
13056
13081
|
function reScanInvalidIdentifier() {
|
|
13057
13082
|
Debug.assert(token === 0 /* Unknown */, "'reScanInvalidIdentifier' should only be called when the current token is 'SyntaxKind.Unknown'.");
|
|
13058
13083
|
pos = tokenStart = fullStartPos;
|
|
@@ -13467,8 +13492,11 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
13467
13492
|
function setLanguageVariant(variant) {
|
|
13468
13493
|
languageVariant = variant;
|
|
13469
13494
|
}
|
|
13470
|
-
function
|
|
13471
|
-
|
|
13495
|
+
function setScriptKind(kind) {
|
|
13496
|
+
scriptKind = kind;
|
|
13497
|
+
}
|
|
13498
|
+
function setJSDocParsingMode(kind) {
|
|
13499
|
+
jsDocParsingMode = kind;
|
|
13472
13500
|
}
|
|
13473
13501
|
function resetTokenState(position) {
|
|
13474
13502
|
Debug.assert(position >= 0);
|
|
@@ -30639,7 +30667,7 @@ function gatherPossibleChildren(node) {
|
|
|
30639
30667
|
function setExternalModuleIndicator(sourceFile) {
|
|
30640
30668
|
sourceFile.externalModuleIndicator = isFileProbablyExternalModule(sourceFile);
|
|
30641
30669
|
}
|
|
30642
|
-
function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind
|
|
30670
|
+
function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind) {
|
|
30643
30671
|
var _a, _b, _c, _d;
|
|
30644
30672
|
(_a = tracing) == null ? void 0 : _a.push(
|
|
30645
30673
|
tracing.Phase.Parse,
|
|
@@ -30654,7 +30682,8 @@ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setPar
|
|
|
30654
30682
|
const {
|
|
30655
30683
|
languageVersion,
|
|
30656
30684
|
setExternalModuleIndicator: overrideSetExternalModuleIndicator,
|
|
30657
|
-
impliedNodeFormat: format
|
|
30685
|
+
impliedNodeFormat: format,
|
|
30686
|
+
jsDocParsingMode
|
|
30658
30687
|
} = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions : { languageVersion: languageVersionOrOptions };
|
|
30659
30688
|
if (languageVersion === 100 /* JSON */) {
|
|
30660
30689
|
result = Parser.parseSourceFile(
|
|
@@ -30666,7 +30695,7 @@ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setPar
|
|
|
30666
30695
|
setParentNodes,
|
|
30667
30696
|
6 /* JSON */,
|
|
30668
30697
|
noop,
|
|
30669
|
-
|
|
30698
|
+
jsDocParsingMode
|
|
30670
30699
|
);
|
|
30671
30700
|
} else {
|
|
30672
30701
|
const setIndicator = format === void 0 ? overrideSetExternalModuleIndicator : (file) => {
|
|
@@ -30682,7 +30711,7 @@ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setPar
|
|
|
30682
30711
|
setParentNodes,
|
|
30683
30712
|
scriptKind,
|
|
30684
30713
|
setIndicator,
|
|
30685
|
-
|
|
30714
|
+
jsDocParsingMode
|
|
30686
30715
|
);
|
|
30687
30716
|
}
|
|
30688
30717
|
(_c = perfLogger) == null ? void 0 : _c.logStopParseSourceFile();
|
|
@@ -30816,7 +30845,7 @@ var Parser;
|
|
|
30816
30845
|
var contextFlags;
|
|
30817
30846
|
var topLevel = true;
|
|
30818
30847
|
var parseErrorBeforeNextFinishedNode = false;
|
|
30819
|
-
function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride,
|
|
30848
|
+
function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride, jsDocParsingMode = 0 /* ParseAll */) {
|
|
30820
30849
|
var _a;
|
|
30821
30850
|
scriptKind2 = ensureScriptKind(fileName2, scriptKind2);
|
|
30822
30851
|
if (scriptKind2 === 6 /* JSON */) {
|
|
@@ -30838,9 +30867,8 @@ var Parser;
|
|
|
30838
30867
|
result2.pragmas = emptyMap;
|
|
30839
30868
|
return result2;
|
|
30840
30869
|
}
|
|
30841
|
-
|
|
30842
|
-
|
|
30843
|
-
const result = parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride || setExternalModuleIndicator, skipNonSemanticJSDoc);
|
|
30870
|
+
initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, scriptKind2, jsDocParsingMode);
|
|
30871
|
+
const result = parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride || setExternalModuleIndicator, jsDocParsingMode);
|
|
30844
30872
|
clearState();
|
|
30845
30873
|
return result;
|
|
30846
30874
|
}
|
|
@@ -30853,8 +30881,7 @@ var Parser;
|
|
|
30853
30881
|
/*syntaxCursor*/
|
|
30854
30882
|
void 0,
|
|
30855
30883
|
1 /* JS */,
|
|
30856
|
-
/*
|
|
30857
|
-
false
|
|
30884
|
+
0 /* ParseAll */
|
|
30858
30885
|
);
|
|
30859
30886
|
nextToken();
|
|
30860
30887
|
const entityName = parseEntityName(
|
|
@@ -30867,15 +30894,7 @@ var Parser;
|
|
|
30867
30894
|
}
|
|
30868
30895
|
Parser2.parseIsolatedEntityName = parseIsolatedEntityName2;
|
|
30869
30896
|
function parseJsonText2(fileName2, sourceText2, languageVersion2 = 2 /* ES2015 */, syntaxCursor2, setParentNodes = false) {
|
|
30870
|
-
initializeState(
|
|
30871
|
-
fileName2,
|
|
30872
|
-
sourceText2,
|
|
30873
|
-
languageVersion2,
|
|
30874
|
-
syntaxCursor2,
|
|
30875
|
-
6 /* JSON */,
|
|
30876
|
-
/*skipNonSemanticJSDoc*/
|
|
30877
|
-
false
|
|
30878
|
-
);
|
|
30897
|
+
initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, 6 /* JSON */, 0 /* ParseAll */);
|
|
30879
30898
|
sourceFlags = contextFlags;
|
|
30880
30899
|
nextToken();
|
|
30881
30900
|
const pos = getNodePos();
|
|
@@ -30956,7 +30975,7 @@ var Parser;
|
|
|
30956
30975
|
return result;
|
|
30957
30976
|
}
|
|
30958
30977
|
Parser2.parseJsonText = parseJsonText2;
|
|
30959
|
-
function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind,
|
|
30978
|
+
function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind, _jsDocParsingMode) {
|
|
30960
30979
|
NodeConstructor2 = objectAllocator.getNodeConstructor();
|
|
30961
30980
|
TokenConstructor2 = objectAllocator.getTokenConstructor();
|
|
30962
30981
|
IdentifierConstructor2 = objectAllocator.getIdentifierConstructor();
|
|
@@ -30992,13 +31011,15 @@ var Parser;
|
|
|
30992
31011
|
scanner2.setOnError(scanError);
|
|
30993
31012
|
scanner2.setScriptTarget(languageVersion);
|
|
30994
31013
|
scanner2.setLanguageVariant(languageVariant);
|
|
30995
|
-
scanner2.
|
|
31014
|
+
scanner2.setScriptKind(scriptKind);
|
|
31015
|
+
scanner2.setJSDocParsingMode(_jsDocParsingMode);
|
|
30996
31016
|
}
|
|
30997
31017
|
function clearState() {
|
|
30998
31018
|
scanner2.clearCommentDirectives();
|
|
30999
31019
|
scanner2.setText("");
|
|
31000
31020
|
scanner2.setOnError(void 0);
|
|
31001
|
-
scanner2.
|
|
31021
|
+
scanner2.setScriptKind(0 /* Unknown */);
|
|
31022
|
+
scanner2.setJSDocParsingMode(0 /* ParseAll */);
|
|
31002
31023
|
sourceText = void 0;
|
|
31003
31024
|
languageVersion = void 0;
|
|
31004
31025
|
syntaxCursor = void 0;
|
|
@@ -31012,7 +31033,7 @@ var Parser;
|
|
|
31012
31033
|
notParenthesizedArrow = void 0;
|
|
31013
31034
|
topLevel = true;
|
|
31014
31035
|
}
|
|
31015
|
-
function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2,
|
|
31036
|
+
function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2, jsDocParsingMode) {
|
|
31016
31037
|
const isDeclarationFile = isDeclarationFileName(fileName);
|
|
31017
31038
|
if (isDeclarationFile) {
|
|
31018
31039
|
contextFlags |= 33554432 /* Ambient */;
|
|
@@ -31031,7 +31052,7 @@ var Parser;
|
|
|
31031
31052
|
sourceFile.identifierCount = identifierCount;
|
|
31032
31053
|
sourceFile.identifiers = identifiers;
|
|
31033
31054
|
sourceFile.parseDiagnostics = attachFileToDiagnostics(parseDiagnostics, sourceFile);
|
|
31034
|
-
sourceFile.
|
|
31055
|
+
sourceFile.jsDocParsingMode = jsDocParsingMode;
|
|
31035
31056
|
if (jsDocDiagnostics) {
|
|
31036
31057
|
sourceFile.jsDocDiagnostics = attachFileToDiagnostics(jsDocDiagnostics, sourceFile);
|
|
31037
31058
|
}
|
|
@@ -36466,8 +36487,7 @@ var Parser;
|
|
|
36466
36487
|
/*syntaxCursor*/
|
|
36467
36488
|
void 0,
|
|
36468
36489
|
1 /* JS */,
|
|
36469
|
-
/*
|
|
36470
|
-
false
|
|
36490
|
+
0 /* ParseAll */
|
|
36471
36491
|
);
|
|
36472
36492
|
scanner2.setText(content, start2, length2);
|
|
36473
36493
|
currentToken = scanner2.scan();
|
|
@@ -36532,8 +36552,7 @@ var Parser;
|
|
|
36532
36552
|
/*syntaxCursor*/
|
|
36533
36553
|
void 0,
|
|
36534
36554
|
1 /* JS */,
|
|
36535
|
-
/*
|
|
36536
|
-
false
|
|
36555
|
+
0 /* ParseAll */
|
|
36537
36556
|
);
|
|
36538
36557
|
const jsDoc = doInsideOfContext(16777216 /* JSDoc */, () => parseJSDocCommentWorker(start2, length2));
|
|
36539
36558
|
const sourceFile = { languageVariant: 0 /* Standard */, text: content };
|
|
@@ -37490,7 +37509,7 @@ var IncrementalParser;
|
|
|
37490
37509
|
true,
|
|
37491
37510
|
sourceFile.scriptKind,
|
|
37492
37511
|
sourceFile.setExternalModuleIndicator,
|
|
37493
|
-
sourceFile.
|
|
37512
|
+
sourceFile.jsDocParsingMode
|
|
37494
37513
|
);
|
|
37495
37514
|
}
|
|
37496
37515
|
const incrementalSourceFile = sourceFile;
|
|
@@ -37515,7 +37534,7 @@ var IncrementalParser;
|
|
|
37515
37534
|
true,
|
|
37516
37535
|
sourceFile.scriptKind,
|
|
37517
37536
|
sourceFile.setExternalModuleIndicator,
|
|
37518
|
-
sourceFile.
|
|
37537
|
+
sourceFile.jsDocParsingMode
|
|
37519
37538
|
);
|
|
37520
37539
|
result.commentDirectives = getNewCommentDirectives(
|
|
37521
37540
|
sourceFile.commentDirectives,
|
|
@@ -42771,7 +42790,9 @@ function loadEntrypointsFromExportMap(scope, exports, state, extensions) {
|
|
|
42771
42790
|
extensionsToExtensionsArray(extensions),
|
|
42772
42791
|
/*excludes*/
|
|
42773
42792
|
void 0,
|
|
42774
|
-
[
|
|
42793
|
+
[
|
|
42794
|
+
isDeclarationFileName(target) ? target.replace("*", "**/*") : changeAnyExtension(target.replace("*", "**/*"), getDeclarationEmitExtensionForPath(target))
|
|
42795
|
+
]
|
|
42775
42796
|
).forEach((entry) => {
|
|
42776
42797
|
entrypoints = appendIfUnique(entrypoints, {
|
|
42777
42798
|
path: entry,
|
|
@@ -57899,7 +57920,28 @@ function createTypeChecker(host) {
|
|
|
57899
57920
|
}
|
|
57900
57921
|
}
|
|
57901
57922
|
}
|
|
57902
|
-
|
|
57923
|
+
let resolved = combineSymbolTables(earlySymbols, lateSymbols);
|
|
57924
|
+
if (symbol.flags & 33554432 /* Transient */ && links.cjsExportMerged && symbol.declarations) {
|
|
57925
|
+
for (const decl of symbol.declarations) {
|
|
57926
|
+
const original = getSymbolLinks(decl.symbol)[resolutionKind];
|
|
57927
|
+
if (!resolved) {
|
|
57928
|
+
resolved = original;
|
|
57929
|
+
continue;
|
|
57930
|
+
}
|
|
57931
|
+
if (!original)
|
|
57932
|
+
continue;
|
|
57933
|
+
original.forEach((s, name) => {
|
|
57934
|
+
const existing = resolved.get(name);
|
|
57935
|
+
if (!existing)
|
|
57936
|
+
resolved.set(name, s);
|
|
57937
|
+
else if (existing === s)
|
|
57938
|
+
return;
|
|
57939
|
+
else
|
|
57940
|
+
resolved.set(name, mergeSymbol(existing, s));
|
|
57941
|
+
});
|
|
57942
|
+
}
|
|
57943
|
+
}
|
|
57944
|
+
links[resolutionKind] = resolved || emptySymbols;
|
|
57903
57945
|
}
|
|
57904
57946
|
return links[resolutionKind];
|
|
57905
57947
|
}
|
|
@@ -119744,7 +119786,7 @@ function computeCommonSourceDirectoryOfFilenames(fileNames, currentDirectory, ge
|
|
|
119744
119786
|
function createCompilerHost(options, setParentNodes) {
|
|
119745
119787
|
return createCompilerHostWorker(options, setParentNodes);
|
|
119746
119788
|
}
|
|
119747
|
-
function createGetSourceFile(readFile, getCompilerOptions, setParentNodes
|
|
119789
|
+
function createGetSourceFile(readFile, getCompilerOptions, setParentNodes) {
|
|
119748
119790
|
return (fileName, languageVersionOrOptions, onError) => {
|
|
119749
119791
|
let text;
|
|
119750
119792
|
try {
|
|
@@ -119758,15 +119800,7 @@ function createGetSourceFile(readFile, getCompilerOptions, setParentNodes, skipN
|
|
|
119758
119800
|
}
|
|
119759
119801
|
text = "";
|
|
119760
119802
|
}
|
|
119761
|
-
return text !== void 0 ? createSourceFile(
|
|
119762
|
-
fileName,
|
|
119763
|
-
text,
|
|
119764
|
-
languageVersionOrOptions,
|
|
119765
|
-
setParentNodes,
|
|
119766
|
-
/*scriptKind*/
|
|
119767
|
-
void 0,
|
|
119768
|
-
skipNonSemanticJSDocParsing
|
|
119769
|
-
) : void 0;
|
|
119803
|
+
return text !== void 0 ? createSourceFile(fileName, text, languageVersionOrOptions, setParentNodes) : void 0;
|
|
119770
119804
|
};
|
|
119771
119805
|
}
|
|
119772
119806
|
function createWriteFileMeasuringIO(actualWriteFile, createDirectory, directoryExists) {
|
|
@@ -119790,7 +119824,7 @@ function createWriteFileMeasuringIO(actualWriteFile, createDirectory, directoryE
|
|
|
119790
119824
|
}
|
|
119791
119825
|
};
|
|
119792
119826
|
}
|
|
119793
|
-
function createCompilerHostWorker(options, setParentNodes,
|
|
119827
|
+
function createCompilerHostWorker(options, setParentNodes, system = sys) {
|
|
119794
119828
|
const existingDirectories = /* @__PURE__ */ new Map();
|
|
119795
119829
|
const getCanonicalFileName = createGetCanonicalFileName(system.useCaseSensitiveFileNames);
|
|
119796
119830
|
function directoryExists(directoryPath) {
|
|
@@ -119809,7 +119843,7 @@ function createCompilerHostWorker(options, setParentNodes, skipNonSemanticJSDocP
|
|
|
119809
119843
|
const newLine = getNewLineCharacter(options);
|
|
119810
119844
|
const realpath = system.realpath && ((path) => system.realpath(path));
|
|
119811
119845
|
const compilerHost = {
|
|
119812
|
-
getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes
|
|
119846
|
+
getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes),
|
|
119813
119847
|
getDefaultLibLocation,
|
|
119814
119848
|
getDefaultLibFileName: (options2) => combinePaths(getDefaultLibLocation(), getDefaultLibFileName(options2)),
|
|
119815
119849
|
writeFile: createWriteFileMeasuringIO(
|
|
@@ -122195,7 +122229,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
122195
122229
|
const result = getImpliedNodeFormatForFileWorker(getNormalizedAbsolutePath(fileName, currentDirectory), moduleResolutionCache2 == null ? void 0 : moduleResolutionCache2.getPackageJsonInfoCache(), host2, options2);
|
|
122196
122230
|
const languageVersion = getEmitScriptTarget(options2);
|
|
122197
122231
|
const setExternalModuleIndicator2 = getSetExternalModuleIndicator(options2);
|
|
122198
|
-
return typeof result === "object" ? { ...result, languageVersion, setExternalModuleIndicator: setExternalModuleIndicator2 } : { languageVersion, impliedNodeFormat: result, setExternalModuleIndicator: setExternalModuleIndicator2 };
|
|
122232
|
+
return typeof result === "object" ? { ...result, languageVersion, setExternalModuleIndicator: setExternalModuleIndicator2, jsDocParsingMode: host2.jsDocParsingMode } : { languageVersion, impliedNodeFormat: result, setExternalModuleIndicator: setExternalModuleIndicator2, jsDocParsingMode: host2.jsDocParsingMode };
|
|
122199
122233
|
}
|
|
122200
122234
|
function findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId) {
|
|
122201
122235
|
var _a2;
|
|
@@ -126940,8 +126974,7 @@ function createCompilerHostFromProgramHost(host, getCompilerOptions, directorySt
|
|
|
126940
126974
|
(fileName, encoding) => !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding),
|
|
126941
126975
|
getCompilerOptions,
|
|
126942
126976
|
/*setParentNodes*/
|
|
126943
|
-
void 0
|
|
126944
|
-
host.skipNonSemanticJSDocParsing
|
|
126977
|
+
void 0
|
|
126945
126978
|
),
|
|
126946
126979
|
getDefaultLibLocation: maybeBind(host, host.getDefaultLibLocation),
|
|
126947
126980
|
getDefaultLibFileName: (options) => host.getDefaultLibFileName(options),
|
|
@@ -126963,7 +126996,8 @@ function createCompilerHostFromProgramHost(host, getCompilerOptions, directorySt
|
|
|
126963
126996
|
getEnvironmentVariable: maybeBind(host, host.getEnvironmentVariable) || (() => ""),
|
|
126964
126997
|
createHash: maybeBind(host, host.createHash),
|
|
126965
126998
|
readDirectory: maybeBind(host, host.readDirectory),
|
|
126966
|
-
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit
|
|
126999
|
+
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
|
|
127000
|
+
jsDocParsingMode: host.jsDocParsingMode
|
|
126967
127001
|
};
|
|
126968
127002
|
return compilerHost;
|
|
126969
127003
|
}
|
|
@@ -127127,12 +127161,11 @@ function readBuilderProgram(compilerOptions, host) {
|
|
|
127127
127161
|
return void 0;
|
|
127128
127162
|
return createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, host);
|
|
127129
127163
|
}
|
|
127130
|
-
function createIncrementalCompilerHost(options, system = sys
|
|
127164
|
+
function createIncrementalCompilerHost(options, system = sys) {
|
|
127131
127165
|
const host = createCompilerHostWorker(
|
|
127132
127166
|
options,
|
|
127133
127167
|
/*setParentNodes*/
|
|
127134
127168
|
void 0,
|
|
127135
|
-
skipNonSemanticJSDocParsing,
|
|
127136
127169
|
system
|
|
127137
127170
|
);
|
|
127138
127171
|
host.createHash = maybeBind(system, system.createHash);
|
|
@@ -135056,10 +135089,10 @@ var DocumentHighlights;
|
|
|
135056
135089
|
function isDocumentRegistryEntry(entry) {
|
|
135057
135090
|
return !!entry.sourceFile;
|
|
135058
135091
|
}
|
|
135059
|
-
function createDocumentRegistry(useCaseSensitiveFileNames2, currentDirectory) {
|
|
135060
|
-
return createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory);
|
|
135092
|
+
function createDocumentRegistry(useCaseSensitiveFileNames2, currentDirectory, jsDocParsingMode) {
|
|
135093
|
+
return createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory, jsDocParsingMode);
|
|
135061
135094
|
}
|
|
135062
|
-
function createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory = "", externalCache) {
|
|
135095
|
+
function createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory = "", jsDocParsingMode, externalCache) {
|
|
135063
135096
|
const buckets = /* @__PURE__ */ new Map();
|
|
135064
135097
|
const getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames2);
|
|
135065
135098
|
function reportStats() {
|
|
@@ -135143,9 +135176,11 @@ function createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirec
|
|
|
135143
135176
|
const sourceFileOptions = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions : {
|
|
135144
135177
|
languageVersion: scriptTarget,
|
|
135145
135178
|
impliedNodeFormat: host && getImpliedNodeFormatForFile(path, (_d = (_c = (_b = (_a = host.getCompilerHost) == null ? void 0 : _a.call(host)) == null ? void 0 : _b.getModuleResolutionCache) == null ? void 0 : _c.call(_b)) == null ? void 0 : _d.getPackageJsonInfoCache(), host, compilationSettings),
|
|
135146
|
-
setExternalModuleIndicator: getSetExternalModuleIndicator(compilationSettings)
|
|
135179
|
+
setExternalModuleIndicator: getSetExternalModuleIndicator(compilationSettings),
|
|
135180
|
+
jsDocParsingMode
|
|
135147
135181
|
};
|
|
135148
135182
|
sourceFileOptions.languageVersion = scriptTarget;
|
|
135183
|
+
Debug.assertEqual(jsDocParsingMode, sourceFileOptions.jsDocParsingMode);
|
|
135149
135184
|
const oldBucketCount = buckets.size;
|
|
135150
135185
|
const keyWithMode = getDocumentRegistryBucketKeyWithMode(key, sourceFileOptions.impliedNodeFormat);
|
|
135151
135186
|
const bucket = getOrUpdate(buckets, keyWithMode, () => /* @__PURE__ */ new Map());
|
|
@@ -136566,7 +136601,8 @@ function transpileModule(input, transpileOptions) {
|
|
|
136566
136601
|
compilerHost,
|
|
136567
136602
|
options
|
|
136568
136603
|
),
|
|
136569
|
-
setExternalModuleIndicator: getSetExternalModuleIndicator(options)
|
|
136604
|
+
setExternalModuleIndicator: getSetExternalModuleIndicator(options),
|
|
136605
|
+
jsDocParsingMode: 1 /* ParseNone */
|
|
136570
136606
|
}
|
|
136571
136607
|
);
|
|
136572
136608
|
if (transpileOptions.moduleName) {
|
|
@@ -140647,12 +140683,16 @@ function getRefactorActionsToConvertToTemplateString(context) {
|
|
|
140647
140683
|
const { file, startPosition } = context;
|
|
140648
140684
|
const node = getNodeOrParentOfParentheses(file, startPosition);
|
|
140649
140685
|
const maybeBinary = getParentBinaryExpression(node);
|
|
140686
|
+
const nodeIsStringLiteral = isStringLiteral(maybeBinary);
|
|
140650
140687
|
const refactorInfo = { name: refactorName10, description: refactorDescription6, actions: [] };
|
|
140651
|
-
if (
|
|
140688
|
+
if (nodeIsStringLiteral && context.triggerReason !== "invoked") {
|
|
140689
|
+
return emptyArray;
|
|
140690
|
+
}
|
|
140691
|
+
if (isExpressionNode(maybeBinary) && (nodeIsStringLiteral || isBinaryExpression(maybeBinary) && treeToArray(maybeBinary).isValidConcatenation)) {
|
|
140652
140692
|
refactorInfo.actions.push(convertStringAction);
|
|
140653
140693
|
return [refactorInfo];
|
|
140654
140694
|
} else if (context.preferences.provideRefactorNotApplicableReason) {
|
|
140655
|
-
refactorInfo.actions.push({ ...convertStringAction, notApplicableReason: getLocaleSpecificMessage(Diagnostics.
|
|
140695
|
+
refactorInfo.actions.push({ ...convertStringAction, notApplicableReason: getLocaleSpecificMessage(Diagnostics.Can_only_convert_string_concatenations_and_string_literals) });
|
|
140656
140696
|
return [refactorInfo];
|
|
140657
140697
|
}
|
|
140658
140698
|
return emptyArray;
|
|
@@ -143757,7 +143797,9 @@ var SyntaxTreeCache = class {
|
|
|
143757
143797
|
this.host,
|
|
143758
143798
|
this.host.getCompilationSettings()
|
|
143759
143799
|
),
|
|
143760
|
-
setExternalModuleIndicator: getSetExternalModuleIndicator(this.host.getCompilationSettings())
|
|
143800
|
+
setExternalModuleIndicator: getSetExternalModuleIndicator(this.host.getCompilationSettings()),
|
|
143801
|
+
// These files are used to produce syntax-based highlighting, which reads JSDoc, so we must use ParseAll.
|
|
143802
|
+
jsDocParsingMode: 0 /* ParseAll */
|
|
143761
143803
|
};
|
|
143762
143804
|
sourceFile = createLanguageServiceSourceFile(
|
|
143763
143805
|
fileName,
|
|
@@ -143817,7 +143859,8 @@ function updateLanguageServiceSourceFile(sourceFile, scriptSnapshot, version2, t
|
|
|
143817
143859
|
const options = {
|
|
143818
143860
|
languageVersion: sourceFile.languageVersion,
|
|
143819
143861
|
impliedNodeFormat: sourceFile.impliedNodeFormat,
|
|
143820
|
-
setExternalModuleIndicator: sourceFile.setExternalModuleIndicator
|
|
143862
|
+
setExternalModuleIndicator: sourceFile.setExternalModuleIndicator,
|
|
143863
|
+
jsDocParsingMode: sourceFile.jsDocParsingMode
|
|
143821
143864
|
};
|
|
143822
143865
|
return createLanguageServiceSourceFile(
|
|
143823
143866
|
sourceFile.fileName,
|
|
@@ -144019,7 +144062,8 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
|
|
|
144019
144062
|
resolveTypeReferenceDirectiveReferences: maybeBind(host, host.resolveTypeReferenceDirectiveReferences),
|
|
144020
144063
|
resolveLibrary: maybeBind(host, host.resolveLibrary),
|
|
144021
144064
|
useSourceOfProjectReferenceRedirect: maybeBind(host, host.useSourceOfProjectReferenceRedirect),
|
|
144022
|
-
getParsedCommandLine
|
|
144065
|
+
getParsedCommandLine,
|
|
144066
|
+
jsDocParsingMode: host.jsDocParsingMode
|
|
144023
144067
|
};
|
|
144024
144068
|
const originalGetSourceFile = compilerHost.getSourceFile;
|
|
144025
144069
|
const { getSourceFileWithCache } = changeCompilerHostLikeToUseCache(
|
|
@@ -145263,6 +145307,9 @@ var LanguageServiceShimHostAdapter = class {
|
|
|
145263
145307
|
return map(typeDirectiveNames, (name) => getProperty(typeDirectivesForFile, isString(name) ? name : toFileNameLowerCase(name.fileName)));
|
|
145264
145308
|
};
|
|
145265
145309
|
}
|
|
145310
|
+
if ("jsDocParsingMode" in this.shimHost) {
|
|
145311
|
+
this.jsDocParsingMode = this.shimHost.jsDocParsingMode;
|
|
145312
|
+
}
|
|
145266
145313
|
}
|
|
145267
145314
|
log(s) {
|
|
145268
145315
|
if (this.loggingEnabled) {
|
|
@@ -161075,8 +161122,9 @@ function convertStringLiteralCompletions(completion, contextToken, sourceFile, h
|
|
|
161075
161122
|
return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: completion.hasIndexSignature, optionalReplacementSpan, entries };
|
|
161076
161123
|
}
|
|
161077
161124
|
case 2 /* Types */: {
|
|
161125
|
+
const quoteChar = contextToken.kind === 15 /* NoSubstitutionTemplateLiteral */ ? 96 /* backtick */ : startsWith(getTextOfNode(contextToken), "'") ? 39 /* singleQuote */ : 34 /* doubleQuote */;
|
|
161078
161126
|
const entries = completion.types.map((type) => ({
|
|
161079
|
-
name: type.value,
|
|
161127
|
+
name: escapeString(type.value, quoteChar),
|
|
161080
161128
|
kindModifiers: "" /* none */,
|
|
161081
161129
|
kind: "string" /* string */,
|
|
161082
161130
|
sortText: SortText.LocationPriority,
|
|
@@ -169273,7 +169321,7 @@ var changesToText;
|
|
|
169273
169321
|
const sourceFile = createSourceFile(
|
|
169274
169322
|
"any file name",
|
|
169275
169323
|
nonFormattedText,
|
|
169276
|
-
99 /* ESNext */,
|
|
169324
|
+
{ languageVersion: 99 /* ESNext */, jsDocParsingMode: 1 /* ParseNone */ },
|
|
169277
169325
|
/*setParentNodes*/
|
|
169278
169326
|
true,
|
|
169279
169327
|
scriptKind
|
|
@@ -172558,6 +172606,7 @@ __export(ts_exports2, {
|
|
|
172558
172606
|
InternalEmitFlags: () => InternalEmitFlags,
|
|
172559
172607
|
InternalSymbolName: () => InternalSymbolName,
|
|
172560
172608
|
InvalidatedProjectKind: () => InvalidatedProjectKind,
|
|
172609
|
+
JSDocParsingMode: () => JSDocParsingMode,
|
|
172561
172610
|
JsDoc: () => ts_JsDoc_exports,
|
|
172562
172611
|
JsTyping: () => ts_JsTyping_exports,
|
|
172563
172612
|
JsxEmit: () => JsxEmit,
|
|
@@ -176521,6 +176570,7 @@ var Project3 = class _Project {
|
|
|
176521
176570
|
this.directoryStructureHost = directoryStructureHost;
|
|
176522
176571
|
this.currentDirectory = this.projectService.getNormalizedAbsolutePath(currentDirectory);
|
|
176523
176572
|
this.getCanonicalFileName = this.projectService.toCanonicalFileName;
|
|
176573
|
+
this.jsDocParsingMode = this.projectService.jsDocParsingMode;
|
|
176524
176574
|
this.cancellationToken = new ThrottledCancellationToken(this.projectService.cancellationToken, this.projectService.throttleWaitMilliseconds);
|
|
176525
176575
|
if (!this.compilerOptions) {
|
|
176526
176576
|
this.compilerOptions = getDefaultCompilerOptions2();
|
|
@@ -179087,6 +179137,7 @@ var _ProjectService = class _ProjectService {
|
|
|
179087
179137
|
this.allowLocalPluginLoads = !!opts.allowLocalPluginLoads;
|
|
179088
179138
|
this.typesMapLocation = opts.typesMapLocation === void 0 ? combinePaths(getDirectoryPath(this.getExecutingFilePath()), "typesMap.json") : opts.typesMapLocation;
|
|
179089
179139
|
this.session = opts.session;
|
|
179140
|
+
this.jsDocParsingMode = opts.jsDocParsingMode;
|
|
179090
179141
|
if (opts.serverMode !== void 0) {
|
|
179091
179142
|
this.serverMode = opts.serverMode;
|
|
179092
179143
|
} else {
|
|
@@ -179112,7 +179163,7 @@ var _ProjectService = class _ProjectService {
|
|
|
179112
179163
|
hostInfo: "Unknown host",
|
|
179113
179164
|
extraFileExtensions: []
|
|
179114
179165
|
};
|
|
179115
|
-
this.documentRegistry = createDocumentRegistryInternal(this.host.useCaseSensitiveFileNames, this.currentDirectory, this);
|
|
179166
|
+
this.documentRegistry = createDocumentRegistryInternal(this.host.useCaseSensitiveFileNames, this.currentDirectory, this.jsDocParsingMode, this);
|
|
179116
179167
|
const watchLogLevel = this.logger.hasLevel(3 /* verbose */) ? 2 /* Verbose */ : this.logger.loggingEnabled() ? 1 /* TriggerOnly */ : 0 /* None */;
|
|
179117
179168
|
const log = watchLogLevel !== 0 /* None */ ? (s) => this.logger.info(s) : noop;
|
|
179118
179169
|
this.packageJsonCache = createPackageJsonCache(this);
|
|
@@ -187123,6 +187174,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
187123
187174
|
InternalEmitFlags,
|
|
187124
187175
|
InternalSymbolName,
|
|
187125
187176
|
InvalidatedProjectKind,
|
|
187177
|
+
JSDocParsingMode,
|
|
187126
187178
|
JsDoc,
|
|
187127
187179
|
JsTyping,
|
|
187128
187180
|
JsxEmit,
|