typescript 5.3.0-dev.20230921 → 5.3.0-dev.20230923
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 +342 -227
- package/lib/tsserver.js +564 -300
- package/lib/typescript.d.ts +93 -3
- package/lib/typescript.js +564 -304
- package/lib/typingsInstaller.js +54 -47
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.3";
|
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20230923`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -6642,6 +6642,7 @@ var Diagnostics = {
|
|
|
6642
6642
|
await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(2852, 1 /* Error */, "await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_2852", "'await using' statements are only allowed within async functions and at the top levels of modules."),
|
|
6643
6643
|
await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(2853, 1 /* Error */, "await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_th_2853", "'await using' statements are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
|
|
6644
6644
|
Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(2854, 1 /* Error */, "Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_sys_2854", "Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
|
|
6645
|
+
Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super: diag(2855, 1 /* Error */, "Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super_2855", "Class field '{0}' defined by the parent class is not accessible in the child class via super."),
|
|
6645
6646
|
Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
6646
6647
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
|
6647
6648
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
|
@@ -7689,7 +7690,7 @@ var Diagnostics = {
|
|
|
7689
7690
|
Could_not_convert_to_arrow_function: diag(95151, 3 /* Message */, "Could_not_convert_to_arrow_function_95151", "Could not convert to arrow function"),
|
|
7690
7691
|
Could_not_convert_to_named_function: diag(95152, 3 /* Message */, "Could_not_convert_to_named_function_95152", "Could not convert to named function"),
|
|
7691
7692
|
Could_not_convert_to_anonymous_function: diag(95153, 3 /* Message */, "Could_not_convert_to_anonymous_function_95153", "Could not convert to anonymous function"),
|
|
7692
|
-
|
|
7693
|
+
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"),
|
|
7693
7694
|
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"),
|
|
7694
7695
|
Add_missing_function_declaration_0: diag(95156, 3 /* Message */, "Add_missing_function_declaration_0_95156", "Add missing function declaration '{0}'"),
|
|
7695
7696
|
Add_all_missing_function_declarations: diag(95157, 3 /* Message */, "Add_all_missing_function_declarations_95157", "Add all missing function declarations"),
|
|
@@ -7933,7 +7934,7 @@ var unicodeESNextIdentifierStart = [65, 90, 97, 122, 170, 170, 181, 181, 186, 18
|
|
|
7933
7934
|
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];
|
|
7934
7935
|
var commentDirectiveRegExSingleLine = /^\/\/\/?\s*@(ts-expect-error|ts-ignore)/;
|
|
7935
7936
|
var commentDirectiveRegExMultiLine = /^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/;
|
|
7936
|
-
var
|
|
7937
|
+
var jsDocSeeOrLink = /@(?:see|link)/i;
|
|
7937
7938
|
function lookupInUnicodeMap(code, map2) {
|
|
7938
7939
|
if (code < map2[0]) {
|
|
7939
7940
|
return false;
|
|
@@ -8419,7 +8420,8 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
8419
8420
|
var tokenFlags;
|
|
8420
8421
|
var commentDirectives;
|
|
8421
8422
|
var inJSDocType = 0;
|
|
8422
|
-
var
|
|
8423
|
+
var scriptKind = 0 /* Unknown */;
|
|
8424
|
+
var jsDocParsingMode = 0 /* ParseAll */;
|
|
8423
8425
|
setText(text, start, length2);
|
|
8424
8426
|
var scanner = {
|
|
8425
8427
|
getTokenFullStart: () => fullStartPos,
|
|
@@ -8463,14 +8465,15 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
8463
8465
|
setText,
|
|
8464
8466
|
setScriptTarget,
|
|
8465
8467
|
setLanguageVariant,
|
|
8468
|
+
setScriptKind,
|
|
8469
|
+
setJSDocParsingMode,
|
|
8466
8470
|
setOnError,
|
|
8467
8471
|
resetTokenState,
|
|
8468
8472
|
setTextPos: resetTokenState,
|
|
8469
8473
|
setInJSDocType,
|
|
8470
8474
|
tryScan,
|
|
8471
8475
|
lookAhead,
|
|
8472
|
-
scanRange
|
|
8473
|
-
setSkipNonSemanticJSDoc
|
|
8476
|
+
scanRange
|
|
8474
8477
|
};
|
|
8475
8478
|
if (Debug.isDebugging) {
|
|
8476
8479
|
Object.defineProperty(scanner, "__debugShowCurrentPositionInText", {
|
|
@@ -9258,7 +9261,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9258
9261
|
tokenFlags |= 1 /* PrecedingLineBreak */;
|
|
9259
9262
|
}
|
|
9260
9263
|
}
|
|
9261
|
-
if (isJSDoc2 && (
|
|
9264
|
+
if (isJSDoc2 && shouldParseJSDoc()) {
|
|
9262
9265
|
tokenFlags |= 2 /* PrecedingJSDocComment */;
|
|
9263
9266
|
}
|
|
9264
9267
|
commentDirectives = appendIfCommentDirective(commentDirectives, text.slice(lastLineStart, pos), commentDirectiveRegExMultiLine, lastLineStart);
|
|
@@ -9517,6 +9520,21 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9517
9520
|
}
|
|
9518
9521
|
}
|
|
9519
9522
|
}
|
|
9523
|
+
function shouldParseJSDoc() {
|
|
9524
|
+
switch (jsDocParsingMode) {
|
|
9525
|
+
case 0 /* ParseAll */:
|
|
9526
|
+
return true;
|
|
9527
|
+
case 1 /* ParseNone */:
|
|
9528
|
+
return false;
|
|
9529
|
+
}
|
|
9530
|
+
if (scriptKind !== 3 /* TS */ && scriptKind !== 4 /* TSX */) {
|
|
9531
|
+
return true;
|
|
9532
|
+
}
|
|
9533
|
+
if (jsDocParsingMode === 3 /* ParseForTypeInfo */) {
|
|
9534
|
+
return false;
|
|
9535
|
+
}
|
|
9536
|
+
return jsDocSeeOrLink.test(text.slice(fullStartPos, pos));
|
|
9537
|
+
}
|
|
9520
9538
|
function reScanInvalidIdentifier() {
|
|
9521
9539
|
Debug.assert(token === 0 /* Unknown */, "'reScanInvalidIdentifier' should only be called when the current token is 'SyntaxKind.Unknown'.");
|
|
9522
9540
|
pos = tokenStart = fullStartPos;
|
|
@@ -9931,8 +9949,11 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9931
9949
|
function setLanguageVariant(variant) {
|
|
9932
9950
|
languageVariant = variant;
|
|
9933
9951
|
}
|
|
9934
|
-
function
|
|
9935
|
-
|
|
9952
|
+
function setScriptKind(kind) {
|
|
9953
|
+
scriptKind = kind;
|
|
9954
|
+
}
|
|
9955
|
+
function setJSDocParsingMode(kind) {
|
|
9956
|
+
jsDocParsingMode = kind;
|
|
9936
9957
|
}
|
|
9937
9958
|
function resetTokenState(position) {
|
|
9938
9959
|
Debug.assert(position >= 0);
|
|
@@ -10785,6 +10806,9 @@ function isAccessor(node) {
|
|
|
10785
10806
|
function isAutoAccessorPropertyDeclaration(node) {
|
|
10786
10807
|
return isPropertyDeclaration(node) && hasAccessorModifier(node);
|
|
10787
10808
|
}
|
|
10809
|
+
function isClassFieldAndNotAutoAccessor(node) {
|
|
10810
|
+
return node.parent && isClassLike(node.parent) && isPropertyDeclaration(node) && !hasAccessorModifier(node);
|
|
10811
|
+
}
|
|
10788
10812
|
function isMethodOrAccessor(node) {
|
|
10789
10813
|
switch (node.kind) {
|
|
10790
10814
|
case 174 /* MethodDeclaration */:
|
|
@@ -11438,8 +11462,8 @@ function moduleResolutionIsEqualTo(oldResolution, newResolution) {
|
|
|
11438
11462
|
return oldResolution === newResolution || oldResolution.resolvedModule === newResolution.resolvedModule || !!oldResolution.resolvedModule && !!newResolution.resolvedModule && oldResolution.resolvedModule.isExternalLibraryImport === newResolution.resolvedModule.isExternalLibraryImport && oldResolution.resolvedModule.extension === newResolution.resolvedModule.extension && oldResolution.resolvedModule.resolvedFileName === newResolution.resolvedModule.resolvedFileName && oldResolution.resolvedModule.originalPath === newResolution.resolvedModule.originalPath && packageIdIsEqual(oldResolution.resolvedModule.packageId, newResolution.resolvedModule.packageId) && oldResolution.node10Result === newResolution.node10Result;
|
|
11439
11463
|
}
|
|
11440
11464
|
function createModuleNotFoundChain(sourceFile, host, moduleReference, mode, packageName) {
|
|
11441
|
-
var _a
|
|
11442
|
-
const node10Result = (
|
|
11465
|
+
var _a;
|
|
11466
|
+
const node10Result = (_a = host.getResolvedModule(sourceFile, moduleReference, mode)) == null ? void 0 : _a.node10Result;
|
|
11443
11467
|
const result = node10Result ? chainDiagnosticMessages(
|
|
11444
11468
|
/*details*/
|
|
11445
11469
|
void 0,
|
|
@@ -11481,14 +11505,14 @@ function packageIdToString(packageId) {
|
|
|
11481
11505
|
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
|
|
11482
11506
|
return oldResolution === newResolution || oldResolution.resolvedTypeReferenceDirective === newResolution.resolvedTypeReferenceDirective || !!oldResolution.resolvedTypeReferenceDirective && !!newResolution.resolvedTypeReferenceDirective && oldResolution.resolvedTypeReferenceDirective.resolvedFileName === newResolution.resolvedTypeReferenceDirective.resolvedFileName && !!oldResolution.resolvedTypeReferenceDirective.primary === !!newResolution.resolvedTypeReferenceDirective.primary && oldResolution.resolvedTypeReferenceDirective.originalPath === newResolution.resolvedTypeReferenceDirective.originalPath;
|
|
11483
11507
|
}
|
|
11484
|
-
function hasChangesInResolutions(names, newSourceFile, newResolutions,
|
|
11508
|
+
function hasChangesInResolutions(names, newSourceFile, newResolutions, getOldResolution, comparer, nameAndModeGetter) {
|
|
11485
11509
|
Debug.assert(names.length === newResolutions.length);
|
|
11486
11510
|
for (let i = 0; i < names.length; i++) {
|
|
11487
11511
|
const newResolution = newResolutions[i];
|
|
11488
11512
|
const entry = names[i];
|
|
11489
11513
|
const name = nameAndModeGetter.getName(entry);
|
|
11490
11514
|
const mode = nameAndModeGetter.getMode(entry, newSourceFile);
|
|
11491
|
-
const oldResolution =
|
|
11515
|
+
const oldResolution = getOldResolution(name, mode);
|
|
11492
11516
|
const changed = oldResolution ? !newResolution || !comparer(oldResolution, newResolution) : newResolution;
|
|
11493
11517
|
if (changed) {
|
|
11494
11518
|
return true;
|
|
@@ -16454,11 +16478,11 @@ function createSymlinkCache(cwd, getCanonicalFileName) {
|
|
|
16454
16478
|
(symlinkedDirectories || (symlinkedDirectories = /* @__PURE__ */ new Map())).set(symlinkPath, real);
|
|
16455
16479
|
}
|
|
16456
16480
|
},
|
|
16457
|
-
setSymlinksFromResolutions(
|
|
16481
|
+
setSymlinksFromResolutions(forEachResolvedModule, forEachResolvedTypeReferenceDirective, typeReferenceDirectives) {
|
|
16458
16482
|
Debug.assert(!hasProcessedResolutions);
|
|
16459
16483
|
hasProcessedResolutions = true;
|
|
16460
|
-
|
|
16461
|
-
|
|
16484
|
+
forEachResolvedModule((resolution) => processResolution(this, resolution.resolvedModule));
|
|
16485
|
+
forEachResolvedTypeReferenceDirective((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective));
|
|
16462
16486
|
typeReferenceDirectives.forEach((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective));
|
|
16463
16487
|
},
|
|
16464
16488
|
hasProcessedResolutions: () => hasProcessedResolutions
|
|
@@ -26269,7 +26293,7 @@ function gatherPossibleChildren(node) {
|
|
|
26269
26293
|
function setExternalModuleIndicator(sourceFile) {
|
|
26270
26294
|
sourceFile.externalModuleIndicator = isFileProbablyExternalModule(sourceFile);
|
|
26271
26295
|
}
|
|
26272
|
-
function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind
|
|
26296
|
+
function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind) {
|
|
26273
26297
|
var _a, _b, _c, _d;
|
|
26274
26298
|
(_a = tracing) == null ? void 0 : _a.push(
|
|
26275
26299
|
tracing.Phase.Parse,
|
|
@@ -26284,7 +26308,8 @@ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setPar
|
|
|
26284
26308
|
const {
|
|
26285
26309
|
languageVersion,
|
|
26286
26310
|
setExternalModuleIndicator: overrideSetExternalModuleIndicator,
|
|
26287
|
-
impliedNodeFormat: format
|
|
26311
|
+
impliedNodeFormat: format,
|
|
26312
|
+
jsDocParsingMode
|
|
26288
26313
|
} = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions : { languageVersion: languageVersionOrOptions };
|
|
26289
26314
|
if (languageVersion === 100 /* JSON */) {
|
|
26290
26315
|
result = Parser.parseSourceFile(
|
|
@@ -26296,7 +26321,7 @@ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setPar
|
|
|
26296
26321
|
setParentNodes,
|
|
26297
26322
|
6 /* JSON */,
|
|
26298
26323
|
noop,
|
|
26299
|
-
|
|
26324
|
+
jsDocParsingMode
|
|
26300
26325
|
);
|
|
26301
26326
|
} else {
|
|
26302
26327
|
const setIndicator = format === void 0 ? overrideSetExternalModuleIndicator : (file) => {
|
|
@@ -26312,7 +26337,7 @@ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setPar
|
|
|
26312
26337
|
setParentNodes,
|
|
26313
26338
|
scriptKind,
|
|
26314
26339
|
setIndicator,
|
|
26315
|
-
|
|
26340
|
+
jsDocParsingMode
|
|
26316
26341
|
);
|
|
26317
26342
|
}
|
|
26318
26343
|
(_c = perfLogger) == null ? void 0 : _c.logStopParseSourceFile();
|
|
@@ -26431,7 +26456,7 @@ var Parser;
|
|
|
26431
26456
|
var contextFlags;
|
|
26432
26457
|
var topLevel = true;
|
|
26433
26458
|
var parseErrorBeforeNextFinishedNode = false;
|
|
26434
|
-
function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride,
|
|
26459
|
+
function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride, jsDocParsingMode = 0 /* ParseAll */) {
|
|
26435
26460
|
var _a;
|
|
26436
26461
|
scriptKind2 = ensureScriptKind(fileName2, scriptKind2);
|
|
26437
26462
|
if (scriptKind2 === 6 /* JSON */) {
|
|
@@ -26453,9 +26478,8 @@ var Parser;
|
|
|
26453
26478
|
result2.pragmas = emptyMap;
|
|
26454
26479
|
return result2;
|
|
26455
26480
|
}
|
|
26456
|
-
|
|
26457
|
-
|
|
26458
|
-
const result = parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride || setExternalModuleIndicator, skipNonSemanticJSDoc);
|
|
26481
|
+
initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, scriptKind2, jsDocParsingMode);
|
|
26482
|
+
const result = parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride || setExternalModuleIndicator, jsDocParsingMode);
|
|
26459
26483
|
clearState();
|
|
26460
26484
|
return result;
|
|
26461
26485
|
}
|
|
@@ -26468,8 +26492,7 @@ var Parser;
|
|
|
26468
26492
|
/*syntaxCursor*/
|
|
26469
26493
|
void 0,
|
|
26470
26494
|
1 /* JS */,
|
|
26471
|
-
/*
|
|
26472
|
-
false
|
|
26495
|
+
0 /* ParseAll */
|
|
26473
26496
|
);
|
|
26474
26497
|
nextToken();
|
|
26475
26498
|
const entityName = parseEntityName(
|
|
@@ -26482,15 +26505,7 @@ var Parser;
|
|
|
26482
26505
|
}
|
|
26483
26506
|
Parser2.parseIsolatedEntityName = parseIsolatedEntityName2;
|
|
26484
26507
|
function parseJsonText2(fileName2, sourceText2, languageVersion2 = 2 /* ES2015 */, syntaxCursor2, setParentNodes = false) {
|
|
26485
|
-
initializeState(
|
|
26486
|
-
fileName2,
|
|
26487
|
-
sourceText2,
|
|
26488
|
-
languageVersion2,
|
|
26489
|
-
syntaxCursor2,
|
|
26490
|
-
6 /* JSON */,
|
|
26491
|
-
/*skipNonSemanticJSDoc*/
|
|
26492
|
-
false
|
|
26493
|
-
);
|
|
26508
|
+
initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, 6 /* JSON */, 0 /* ParseAll */);
|
|
26494
26509
|
sourceFlags = contextFlags;
|
|
26495
26510
|
nextToken();
|
|
26496
26511
|
const pos = getNodePos();
|
|
@@ -26571,7 +26586,7 @@ var Parser;
|
|
|
26571
26586
|
return result;
|
|
26572
26587
|
}
|
|
26573
26588
|
Parser2.parseJsonText = parseJsonText2;
|
|
26574
|
-
function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind,
|
|
26589
|
+
function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind, _jsDocParsingMode) {
|
|
26575
26590
|
NodeConstructor2 = objectAllocator.getNodeConstructor();
|
|
26576
26591
|
TokenConstructor2 = objectAllocator.getTokenConstructor();
|
|
26577
26592
|
IdentifierConstructor2 = objectAllocator.getIdentifierConstructor();
|
|
@@ -26607,13 +26622,15 @@ var Parser;
|
|
|
26607
26622
|
scanner.setOnError(scanError);
|
|
26608
26623
|
scanner.setScriptTarget(languageVersion);
|
|
26609
26624
|
scanner.setLanguageVariant(languageVariant);
|
|
26610
|
-
scanner.
|
|
26625
|
+
scanner.setScriptKind(scriptKind);
|
|
26626
|
+
scanner.setJSDocParsingMode(_jsDocParsingMode);
|
|
26611
26627
|
}
|
|
26612
26628
|
function clearState() {
|
|
26613
26629
|
scanner.clearCommentDirectives();
|
|
26614
26630
|
scanner.setText("");
|
|
26615
26631
|
scanner.setOnError(void 0);
|
|
26616
|
-
scanner.
|
|
26632
|
+
scanner.setScriptKind(0 /* Unknown */);
|
|
26633
|
+
scanner.setJSDocParsingMode(0 /* ParseAll */);
|
|
26617
26634
|
sourceText = void 0;
|
|
26618
26635
|
languageVersion = void 0;
|
|
26619
26636
|
syntaxCursor = void 0;
|
|
@@ -26627,7 +26644,7 @@ var Parser;
|
|
|
26627
26644
|
notParenthesizedArrow = void 0;
|
|
26628
26645
|
topLevel = true;
|
|
26629
26646
|
}
|
|
26630
|
-
function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2,
|
|
26647
|
+
function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2, jsDocParsingMode) {
|
|
26631
26648
|
const isDeclarationFile = isDeclarationFileName(fileName);
|
|
26632
26649
|
if (isDeclarationFile) {
|
|
26633
26650
|
contextFlags |= 33554432 /* Ambient */;
|
|
@@ -26646,7 +26663,7 @@ var Parser;
|
|
|
26646
26663
|
sourceFile.identifierCount = identifierCount;
|
|
26647
26664
|
sourceFile.identifiers = identifiers;
|
|
26648
26665
|
sourceFile.parseDiagnostics = attachFileToDiagnostics(parseDiagnostics, sourceFile);
|
|
26649
|
-
sourceFile.
|
|
26666
|
+
sourceFile.jsDocParsingMode = jsDocParsingMode;
|
|
26650
26667
|
if (jsDocDiagnostics) {
|
|
26651
26668
|
sourceFile.jsDocDiagnostics = attachFileToDiagnostics(jsDocDiagnostics, sourceFile);
|
|
26652
26669
|
}
|
|
@@ -32081,8 +32098,7 @@ var Parser;
|
|
|
32081
32098
|
/*syntaxCursor*/
|
|
32082
32099
|
void 0,
|
|
32083
32100
|
1 /* JS */,
|
|
32084
|
-
/*
|
|
32085
|
-
false
|
|
32101
|
+
0 /* ParseAll */
|
|
32086
32102
|
);
|
|
32087
32103
|
scanner.setText(content, start, length2);
|
|
32088
32104
|
currentToken = scanner.scan();
|
|
@@ -32147,8 +32163,7 @@ var Parser;
|
|
|
32147
32163
|
/*syntaxCursor*/
|
|
32148
32164
|
void 0,
|
|
32149
32165
|
1 /* JS */,
|
|
32150
|
-
/*
|
|
32151
|
-
false
|
|
32166
|
+
0 /* ParseAll */
|
|
32152
32167
|
);
|
|
32153
32168
|
const jsDoc = doInsideOfContext(16777216 /* JSDoc */, () => parseJSDocCommentWorker(start, length2));
|
|
32154
32169
|
const sourceFile = { languageVariant: 0 /* Standard */, text: content };
|
|
@@ -33105,7 +33120,7 @@ var IncrementalParser;
|
|
|
33105
33120
|
true,
|
|
33106
33121
|
sourceFile.scriptKind,
|
|
33107
33122
|
sourceFile.setExternalModuleIndicator,
|
|
33108
|
-
sourceFile.
|
|
33123
|
+
sourceFile.jsDocParsingMode
|
|
33109
33124
|
);
|
|
33110
33125
|
}
|
|
33111
33126
|
const incrementalSourceFile = sourceFile;
|
|
@@ -33130,7 +33145,7 @@ var IncrementalParser;
|
|
|
33130
33145
|
true,
|
|
33131
33146
|
sourceFile.scriptKind,
|
|
33132
33147
|
sourceFile.setExternalModuleIndicator,
|
|
33133
|
-
sourceFile.
|
|
33148
|
+
sourceFile.jsDocParsingMode
|
|
33134
33149
|
);
|
|
33135
33150
|
result.commentDirectives = getNewCommentDirectives(
|
|
33136
33151
|
sourceFile.commentDirectives,
|
|
@@ -46287,7 +46302,7 @@ function createTypeChecker(host) {
|
|
|
46287
46302
|
return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) : void 0;
|
|
46288
46303
|
}
|
|
46289
46304
|
function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) {
|
|
46290
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k
|
|
46305
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
46291
46306
|
if (startsWith(moduleReference, "@types/")) {
|
|
46292
46307
|
const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
|
|
46293
46308
|
const withoutAtTypePrefix = removePrefix(moduleReference, "@types/");
|
|
@@ -46305,7 +46320,7 @@ function createTypeChecker(host) {
|
|
|
46305
46320
|
const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = findAncestor(location, isImportCall)) == null ? void 0 : _a.arguments[0]) || ((_b = findAncestor(location, isImportDeclaration)) == null ? void 0 : _b.moduleSpecifier) || ((_c = findAncestor(location, isExternalModuleImportEqualsDeclaration)) == null ? void 0 : _c.moduleReference.expression) || ((_d = findAncestor(location, isExportDeclaration)) == null ? void 0 : _d.moduleSpecifier) || ((_e = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _e.name) || ((_f = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _f.argument.literal);
|
|
46306
46321
|
const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
|
|
46307
46322
|
const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
|
|
46308
|
-
const resolvedModule = (
|
|
46323
|
+
const resolvedModule = (_g = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _g.resolvedModule;
|
|
46309
46324
|
const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule, currentSourceFile);
|
|
46310
46325
|
const sourceFile = resolvedModule && (!resolutionDiagnostic || resolutionDiagnostic === Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set) && host.getSourceFile(resolvedModule.resolvedFileName);
|
|
46311
46326
|
if (sourceFile) {
|
|
@@ -46313,7 +46328,7 @@ function createTypeChecker(host) {
|
|
|
46313
46328
|
error(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName);
|
|
46314
46329
|
}
|
|
46315
46330
|
if (resolvedModule.resolvedUsingTsExtension && isDeclarationFileName(moduleReference)) {
|
|
46316
|
-
const importOrExport = ((
|
|
46331
|
+
const importOrExport = ((_h = findAncestor(location, isImportDeclaration)) == null ? void 0 : _h.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
|
|
46317
46332
|
if (importOrExport && !importOrExport.isTypeOnly || findAncestor(location, isImportCall)) {
|
|
46318
46333
|
error(
|
|
46319
46334
|
errorNode,
|
|
@@ -46322,7 +46337,7 @@ function createTypeChecker(host) {
|
|
|
46322
46337
|
);
|
|
46323
46338
|
}
|
|
46324
46339
|
} else if (resolvedModule.resolvedUsingTsExtension && !shouldAllowImportingTsExtension(compilerOptions, currentSourceFile.fileName)) {
|
|
46325
|
-
const importOrExport = ((
|
|
46340
|
+
const importOrExport = ((_i = findAncestor(location, isImportDeclaration)) == null ? void 0 : _i.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
|
|
46326
46341
|
if (!((importOrExport == null ? void 0 : importOrExport.isTypeOnly) || findAncestor(location, isImportTypeNode))) {
|
|
46327
46342
|
const tsExtension = Debug.checkDefined(tryExtractTSExtension(moduleReference));
|
|
46328
46343
|
error(errorNode, Diagnostics.An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled, tsExtension);
|
|
@@ -46343,7 +46358,7 @@ function createTypeChecker(host) {
|
|
|
46343
46358
|
if (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */) {
|
|
46344
46359
|
const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
|
|
46345
46360
|
const overrideClauseHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l));
|
|
46346
|
-
const overrideClause = overrideClauseHost && isImportTypeNode(overrideClauseHost) ? (
|
|
46361
|
+
const overrideClause = overrideClauseHost && isImportTypeNode(overrideClauseHost) ? (_j = overrideClauseHost.assertions) == null ? void 0 : _j.assertClause : overrideClauseHost == null ? void 0 : overrideClauseHost.assertClause;
|
|
46347
46362
|
if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !getResolutionModeOverrideForClause(overrideClause)) {
|
|
46348
46363
|
if (findAncestor(location, isImportEqualsDeclaration)) {
|
|
46349
46364
|
error(errorNode, Diagnostics.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead, moduleReference);
|
|
@@ -46450,7 +46465,7 @@ function createTypeChecker(host) {
|
|
|
46450
46465
|
error(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
|
|
46451
46466
|
} else if (mode === 99 /* ESNext */ && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) {
|
|
46452
46467
|
const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path));
|
|
46453
|
-
const suggestedExt = (
|
|
46468
|
+
const suggestedExt = (_k = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))) == null ? void 0 : _k[1];
|
|
46454
46469
|
if (suggestedExt) {
|
|
46455
46470
|
error(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0, moduleReference + suggestedExt);
|
|
46456
46471
|
} else {
|
|
@@ -53208,7 +53223,28 @@ function createTypeChecker(host) {
|
|
|
53208
53223
|
}
|
|
53209
53224
|
}
|
|
53210
53225
|
}
|
|
53211
|
-
|
|
53226
|
+
let resolved = combineSymbolTables(earlySymbols, lateSymbols);
|
|
53227
|
+
if (symbol.flags & 33554432 /* Transient */ && links.cjsExportMerged && symbol.declarations) {
|
|
53228
|
+
for (const decl of symbol.declarations) {
|
|
53229
|
+
const original = getSymbolLinks(decl.symbol)[resolutionKind];
|
|
53230
|
+
if (!resolved) {
|
|
53231
|
+
resolved = original;
|
|
53232
|
+
continue;
|
|
53233
|
+
}
|
|
53234
|
+
if (!original)
|
|
53235
|
+
continue;
|
|
53236
|
+
original.forEach((s, name) => {
|
|
53237
|
+
const existing = resolved.get(name);
|
|
53238
|
+
if (!existing)
|
|
53239
|
+
resolved.set(name, s);
|
|
53240
|
+
else if (existing === s)
|
|
53241
|
+
return;
|
|
53242
|
+
else
|
|
53243
|
+
resolved.set(name, mergeSymbol(existing, s));
|
|
53244
|
+
});
|
|
53245
|
+
}
|
|
53246
|
+
}
|
|
53247
|
+
links[resolutionKind] = resolved || emptySymbols;
|
|
53212
53248
|
}
|
|
53213
53249
|
return links[resolutionKind];
|
|
53214
53250
|
}
|
|
@@ -69103,6 +69139,7 @@ function createTypeChecker(host) {
|
|
|
69103
69139
|
return checkPropertyAccessibilityAtLocation(node, isSuper, writing, type, prop, errorNode);
|
|
69104
69140
|
}
|
|
69105
69141
|
function checkPropertyAccessibilityAtLocation(location, isSuper, writing, containingType, prop, errorNode) {
|
|
69142
|
+
var _a;
|
|
69106
69143
|
const flags = getDeclarationModifierFlagsFromSymbol(prop, writing);
|
|
69107
69144
|
if (isSuper) {
|
|
69108
69145
|
if (languageVersion < 2 /* ES2015 */) {
|
|
@@ -69119,6 +69156,12 @@ function createTypeChecker(host) {
|
|
|
69119
69156
|
}
|
|
69120
69157
|
return false;
|
|
69121
69158
|
}
|
|
69159
|
+
if (!(flags & 32 /* Static */) && ((_a = prop.declarations) == null ? void 0 : _a.some(isClassFieldAndNotAutoAccessor))) {
|
|
69160
|
+
if (errorNode) {
|
|
69161
|
+
error(errorNode, Diagnostics.Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super, symbolToString(prop));
|
|
69162
|
+
}
|
|
69163
|
+
return false;
|
|
69164
|
+
}
|
|
69122
69165
|
}
|
|
69123
69166
|
if (flags & 256 /* Abstract */ && symbolHasNonMethodDeclaration(prop) && (isThisProperty(location) || isThisInitializedObjectBindingExpression(location) || isObjectBindingPattern(location.parent) && isThisInitializedDeclaration(location.parent.parent))) {
|
|
69124
69167
|
const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop));
|
|
@@ -69524,11 +69567,17 @@ function createTypeChecker(host) {
|
|
|
69524
69567
|
return getFlowTypeOfAccessExpression(node, prop, propType, right, checkMode);
|
|
69525
69568
|
}
|
|
69526
69569
|
function isUncheckedJSSuggestion(node, suggestion, excludeClasses) {
|
|
69570
|
+
var _a;
|
|
69527
69571
|
const file = getSourceFileOfNode(node);
|
|
69528
69572
|
if (file) {
|
|
69529
69573
|
if (compilerOptions.checkJs === void 0 && file.checkJsDirective === void 0 && (file.scriptKind === 1 /* JS */ || file.scriptKind === 2 /* JSX */)) {
|
|
69530
69574
|
const declarationFile = forEach(suggestion == null ? void 0 : suggestion.declarations, getSourceFileOfNode);
|
|
69531
|
-
|
|
69575
|
+
const suggestionHasNoExtendsOrDecorators = !(suggestion == null ? void 0 : suggestion.valueDeclaration) || !isClassLike(suggestion.valueDeclaration) || ((_a = suggestion.valueDeclaration.heritageClauses) == null ? void 0 : _a.length) || classOrConstructorParameterIsDecorated(
|
|
69576
|
+
/*useLegacyDecorators*/
|
|
69577
|
+
false,
|
|
69578
|
+
suggestion.valueDeclaration
|
|
69579
|
+
);
|
|
69580
|
+
return !(file !== declarationFile && !!declarationFile && isGlobalSourceFile(declarationFile)) && !(excludeClasses && suggestion && suggestion.flags & 32 /* Class */ && suggestionHasNoExtendsOrDecorators) && !(!!node && excludeClasses && isPropertyAccessExpression(node) && node.expression.kind === 110 /* ThisKeyword */ && suggestionHasNoExtendsOrDecorators);
|
|
69532
69581
|
}
|
|
69533
69582
|
}
|
|
69534
69583
|
return false;
|
|
@@ -109234,6 +109283,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
109234
109283
|
inlineSourceMap: compilerOptions.inlineSourceMap,
|
|
109235
109284
|
extendedDiagnostics: compilerOptions.extendedDiagnostics,
|
|
109236
109285
|
onlyPrintJsDocStyle: true,
|
|
109286
|
+
omitBraceSourceMapPositions: true,
|
|
109237
109287
|
writeBundleFileInfo: !!bundleBuildInfo,
|
|
109238
109288
|
recordInternalSection: !!bundleBuildInfo,
|
|
109239
109289
|
relativeToBuildInfo
|
|
@@ -109644,6 +109694,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
109644
109694
|
onAfterEmitToken
|
|
109645
109695
|
} = handlers;
|
|
109646
109696
|
var extendedDiagnostics = !!printerOptions.extendedDiagnostics;
|
|
109697
|
+
var omitBraceSourcePositions = !!printerOptions.omitBraceSourceMapPositions;
|
|
109647
109698
|
var newLine = getNewLineCharacter(printerOptions);
|
|
109648
109699
|
var moduleKind = getEmitModuleKind(printerOptions);
|
|
109649
109700
|
var bundledHelpers = /* @__PURE__ */ new Map();
|
|
@@ -111639,7 +111690,11 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
111639
111690
|
decreaseIndent();
|
|
111640
111691
|
}
|
|
111641
111692
|
}
|
|
111642
|
-
|
|
111693
|
+
if (!omitBraceSourcePositions && (token === 19 /* OpenBraceToken */ || token === 20 /* CloseBraceToken */)) {
|
|
111694
|
+
pos = writeToken(token, pos, writer2, contextNode);
|
|
111695
|
+
} else {
|
|
111696
|
+
pos = writeTokenText(token, writer2, pos);
|
|
111697
|
+
}
|
|
111643
111698
|
if (isSimilarNode && contextNode.end !== pos) {
|
|
111644
111699
|
const isJsxExprContext = contextNode.kind === 294 /* JsxExpression */;
|
|
111645
111700
|
emitTrailingCommentsOfPosition(
|
|
@@ -114848,7 +114903,7 @@ function computeCommonSourceDirectoryOfFilenames(fileNames, currentDirectory, ge
|
|
|
114848
114903
|
function createCompilerHost(options, setParentNodes) {
|
|
114849
114904
|
return createCompilerHostWorker(options, setParentNodes);
|
|
114850
114905
|
}
|
|
114851
|
-
function createGetSourceFile(readFile, getCompilerOptions, setParentNodes
|
|
114906
|
+
function createGetSourceFile(readFile, getCompilerOptions, setParentNodes) {
|
|
114852
114907
|
return (fileName, languageVersionOrOptions, onError) => {
|
|
114853
114908
|
let text;
|
|
114854
114909
|
try {
|
|
@@ -114862,15 +114917,7 @@ function createGetSourceFile(readFile, getCompilerOptions, setParentNodes, skipN
|
|
|
114862
114917
|
}
|
|
114863
114918
|
text = "";
|
|
114864
114919
|
}
|
|
114865
|
-
return text !== void 0 ? createSourceFile(
|
|
114866
|
-
fileName,
|
|
114867
|
-
text,
|
|
114868
|
-
languageVersionOrOptions,
|
|
114869
|
-
setParentNodes,
|
|
114870
|
-
/*scriptKind*/
|
|
114871
|
-
void 0,
|
|
114872
|
-
skipNonSemanticJSDocParsing2
|
|
114873
|
-
) : void 0;
|
|
114920
|
+
return text !== void 0 ? createSourceFile(fileName, text, languageVersionOrOptions, setParentNodes) : void 0;
|
|
114874
114921
|
};
|
|
114875
114922
|
}
|
|
114876
114923
|
function createWriteFileMeasuringIO(actualWriteFile, createDirectory, directoryExists) {
|
|
@@ -114894,7 +114941,7 @@ function createWriteFileMeasuringIO(actualWriteFile, createDirectory, directoryE
|
|
|
114894
114941
|
}
|
|
114895
114942
|
};
|
|
114896
114943
|
}
|
|
114897
|
-
function createCompilerHostWorker(options, setParentNodes,
|
|
114944
|
+
function createCompilerHostWorker(options, setParentNodes, system = sys) {
|
|
114898
114945
|
const existingDirectories = /* @__PURE__ */ new Map();
|
|
114899
114946
|
const getCanonicalFileName = createGetCanonicalFileName(system.useCaseSensitiveFileNames);
|
|
114900
114947
|
function directoryExists(directoryPath) {
|
|
@@ -114913,7 +114960,7 @@ function createCompilerHostWorker(options, setParentNodes, skipNonSemanticJSDocP
|
|
|
114913
114960
|
const newLine = getNewLineCharacter(options);
|
|
114914
114961
|
const realpath = system.realpath && ((path) => system.realpath(path));
|
|
114915
114962
|
const compilerHost = {
|
|
114916
|
-
getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes
|
|
114963
|
+
getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes),
|
|
114917
114964
|
getDefaultLibLocation,
|
|
114918
114965
|
getDefaultLibFileName: (options2) => combinePaths(getDefaultLibLocation(), getDefaultLibFileName(options2)),
|
|
114919
114966
|
writeFile: createWriteFileMeasuringIO(
|
|
@@ -115370,14 +115417,14 @@ function isReferenceFileLocation(location) {
|
|
|
115370
115417
|
return location.pos !== void 0;
|
|
115371
115418
|
}
|
|
115372
115419
|
function getReferencedFileLocation(program, ref) {
|
|
115373
|
-
var _a, _b, _c, _d
|
|
115420
|
+
var _a, _b, _c, _d;
|
|
115374
115421
|
const file = Debug.checkDefined(program.getSourceFileByPath(ref.file));
|
|
115375
115422
|
const { kind, index } = ref;
|
|
115376
115423
|
let pos, end, packageId, resolutionMode;
|
|
115377
115424
|
switch (kind) {
|
|
115378
115425
|
case 3 /* Import */:
|
|
115379
115426
|
const importLiteral = getModuleNameStringLiteralAt(file, index);
|
|
115380
|
-
packageId = (
|
|
115427
|
+
packageId = (_b = (_a = program.getResolvedModule(file, importLiteral.text, getModeForResolutionAtIndex(file, index))) == null ? void 0 : _a.resolvedModule) == null ? void 0 : _b.packageId;
|
|
115381
115428
|
if (importLiteral.pos === -1)
|
|
115382
115429
|
return { file, packageId, text: importLiteral.text };
|
|
115383
115430
|
pos = skipTrivia(file.text, importLiteral.pos);
|
|
@@ -115388,7 +115435,7 @@ function getReferencedFileLocation(program, ref) {
|
|
|
115388
115435
|
break;
|
|
115389
115436
|
case 5 /* TypeReferenceDirective */:
|
|
115390
115437
|
({ pos, end, resolutionMode } = file.typeReferenceDirectives[index]);
|
|
115391
|
-
packageId = (
|
|
115438
|
+
packageId = (_d = (_c = program.getResolvedTypeReferenceDirective(file, toFileNameLowerCase(file.typeReferenceDirectives[index].fileName), resolutionMode || file.impliedNodeFormat)) == null ? void 0 : _c.resolvedTypeReferenceDirective) == null ? void 0 : _d.packageId;
|
|
115392
115439
|
break;
|
|
115393
115440
|
case 7 /* LibReferenceDirective */:
|
|
115394
115441
|
({ pos, end } = file.libReferenceDirectives[index]);
|
|
@@ -115916,6 +115963,10 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
115916
115963
|
resolvedModules,
|
|
115917
115964
|
resolvedTypeReferenceDirectiveNames,
|
|
115918
115965
|
resolvedLibReferences,
|
|
115966
|
+
getResolvedModule,
|
|
115967
|
+
getResolvedTypeReferenceDirective,
|
|
115968
|
+
forEachResolvedModule,
|
|
115969
|
+
forEachResolvedTypeReferenceDirective,
|
|
115919
115970
|
getCurrentPackagesMap: () => packageMap,
|
|
115920
115971
|
typesPackageExists,
|
|
115921
115972
|
packageBundlesTypes,
|
|
@@ -115959,19 +116010,35 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
115959
116010
|
measure("Program", "beforeProgram", "afterProgram");
|
|
115960
116011
|
(_p = tracing) == null ? void 0 : _p.pop();
|
|
115961
116012
|
return program;
|
|
116013
|
+
function getResolvedModule(file, moduleName, mode) {
|
|
116014
|
+
var _a2;
|
|
116015
|
+
return (_a2 = resolvedModules == null ? void 0 : resolvedModules.get(file.path)) == null ? void 0 : _a2.get(moduleName, mode);
|
|
116016
|
+
}
|
|
116017
|
+
function getResolvedTypeReferenceDirective(file, typeDirectiveName, mode) {
|
|
116018
|
+
var _a2;
|
|
116019
|
+
return (_a2 = resolvedTypeReferenceDirectiveNames == null ? void 0 : resolvedTypeReferenceDirectiveNames.get(file.path)) == null ? void 0 : _a2.get(typeDirectiveName, mode);
|
|
116020
|
+
}
|
|
116021
|
+
function forEachResolvedModule(callback, file) {
|
|
116022
|
+
forEachResolution(resolvedModules, callback, file);
|
|
116023
|
+
}
|
|
116024
|
+
function forEachResolvedTypeReferenceDirective(callback, file) {
|
|
116025
|
+
forEachResolution(resolvedTypeReferenceDirectiveNames, callback, file);
|
|
116026
|
+
}
|
|
116027
|
+
function forEachResolution(resolutionCache, callback, file) {
|
|
116028
|
+
var _a2;
|
|
116029
|
+
if (file)
|
|
116030
|
+
(_a2 = resolutionCache == null ? void 0 : resolutionCache.get(file.path)) == null ? void 0 : _a2.forEach((resolution, name, mode) => callback(resolution, name, mode, file.path));
|
|
116031
|
+
else
|
|
116032
|
+
resolutionCache == null ? void 0 : resolutionCache.forEach((resolutions, filePath) => resolutions.forEach((resolution, name, mode) => callback(resolution, name, mode, filePath)));
|
|
116033
|
+
}
|
|
115962
116034
|
function getPackagesMap() {
|
|
115963
116035
|
if (packageMap)
|
|
115964
116036
|
return packageMap;
|
|
115965
116037
|
packageMap = /* @__PURE__ */ new Map();
|
|
115966
|
-
|
|
115967
|
-
(
|
|
115968
|
-
|
|
115969
|
-
|
|
115970
|
-
if (resolvedModule == null ? void 0 : resolvedModule.packageId)
|
|
115971
|
-
packageMap.set(resolvedModule.packageId.name, resolvedModule.extension === ".d.ts" /* Dts */ || !!packageMap.get(resolvedModule.packageId.name));
|
|
115972
|
-
});
|
|
115973
|
-
}
|
|
115974
|
-
);
|
|
116038
|
+
forEachResolvedModule(({ resolvedModule }) => {
|
|
116039
|
+
if (resolvedModule == null ? void 0 : resolvedModule.packageId)
|
|
116040
|
+
packageMap.set(resolvedModule.packageId.name, resolvedModule.extension === ".d.ts" /* Dts */ || !!packageMap.get(resolvedModule.packageId.name));
|
|
116041
|
+
});
|
|
115975
116042
|
return packageMap;
|
|
115976
116043
|
}
|
|
115977
116044
|
function typesPackageExists(packageName) {
|
|
@@ -116103,7 +116170,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116103
116170
|
return classifiableNames;
|
|
116104
116171
|
}
|
|
116105
116172
|
function resolveModuleNamesReusingOldState(moduleNames, file) {
|
|
116106
|
-
var _a2, _b2;
|
|
116107
116173
|
if (structureIsReused === 0 /* Not */ && !file.ambientModuleNames.length) {
|
|
116108
116174
|
return resolveModuleNamesWorker(
|
|
116109
116175
|
moduleNames,
|
|
@@ -116121,7 +116187,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116121
116187
|
const moduleName = moduleNames[i];
|
|
116122
116188
|
if (file === oldSourceFile && !hasInvalidatedResolutions(file.path)) {
|
|
116123
116189
|
const mode = getModeForUsageLocation(file, moduleName);
|
|
116124
|
-
const oldResolution =
|
|
116190
|
+
const oldResolution = oldProgram == null ? void 0 : oldProgram.getResolvedModule(file, moduleName.text, mode);
|
|
116125
116191
|
if (oldResolution == null ? void 0 : oldResolution.resolvedModule) {
|
|
116126
116192
|
if (isTraceEnabled(options, host)) {
|
|
116127
116193
|
trace(
|
|
@@ -116168,8 +116234,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116168
116234
|
Debug.assert(j === resolutions.length);
|
|
116169
116235
|
return result;
|
|
116170
116236
|
function moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName) {
|
|
116171
|
-
var
|
|
116172
|
-
const resolutionToFile = (
|
|
116237
|
+
var _a2;
|
|
116238
|
+
const resolutionToFile = (_a2 = oldProgram == null ? void 0 : oldProgram.getResolvedModule(file, moduleName.text, getModeForUsageLocation(file, moduleName))) == null ? void 0 : _a2.resolvedModule;
|
|
116173
116239
|
const resolvedFile = resolutionToFile && oldProgram.getSourceFile(resolutionToFile.resolvedFileName);
|
|
116174
116240
|
if (resolutionToFile && resolvedFile) {
|
|
116175
116241
|
return false;
|
|
@@ -116185,7 +116251,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116185
116251
|
}
|
|
116186
116252
|
}
|
|
116187
116253
|
function resolveTypeReferenceDirectiveNamesReusingOldState(typeDirectiveNames, containingFile) {
|
|
116188
|
-
var _a2
|
|
116254
|
+
var _a2;
|
|
116189
116255
|
if (structureIsReused === 0 /* Not */) {
|
|
116190
116256
|
return resolveTypeReferenceDirectiveNamesWorker(
|
|
116191
116257
|
typeDirectiveNames,
|
|
@@ -116205,7 +116271,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116205
116271
|
if (canReuseResolutions) {
|
|
116206
116272
|
const typeDirectiveName = getTypeReferenceResolutionName(entry);
|
|
116207
116273
|
const mode = getModeForFileReference(entry, containingSourceFile == null ? void 0 : containingSourceFile.impliedNodeFormat);
|
|
116208
|
-
const oldResolution =
|
|
116274
|
+
const oldResolution = !isString(containingFile) ? oldProgram == null ? void 0 : oldProgram.getResolvedTypeReferenceDirective(containingFile, typeDirectiveName, mode) : (_a2 = oldProgram == null ? void 0 : oldProgram.getAutomaticTypeDirectiveResolutions()) == null ? void 0 : _a2.get(typeDirectiveName, mode);
|
|
116209
116275
|
if (oldResolution == null ? void 0 : oldResolution.resolvedTypeReferenceDirective) {
|
|
116210
116276
|
if (isTraceEnabled(options, host)) {
|
|
116211
116277
|
trace(
|
|
@@ -116265,7 +116331,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116265
116331
|
);
|
|
116266
116332
|
}
|
|
116267
116333
|
function tryReuseStructureFromOldProgram() {
|
|
116268
|
-
var _a2
|
|
116334
|
+
var _a2;
|
|
116269
116335
|
if (!oldProgram) {
|
|
116270
116336
|
return 0 /* Not */;
|
|
116271
116337
|
}
|
|
@@ -116385,20 +116451,29 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116385
116451
|
const moduleNames = getModuleNames(newSourceFile);
|
|
116386
116452
|
const resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFile);
|
|
116387
116453
|
(resolvedModulesProcessing ?? (resolvedModulesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, resolutions);
|
|
116388
|
-
const
|
|
116389
|
-
|
|
116454
|
+
const resolutionsChanged = hasChangesInResolutions(
|
|
116455
|
+
moduleNames,
|
|
116456
|
+
newSourceFile,
|
|
116457
|
+
resolutions,
|
|
116458
|
+
(name, mode) => oldProgram.getResolvedModule(newSourceFile, name, mode),
|
|
116459
|
+
moduleResolutionIsEqualTo,
|
|
116460
|
+
moduleResolutionNameAndModeGetter
|
|
116461
|
+
);
|
|
116390
116462
|
if (resolutionsChanged)
|
|
116391
116463
|
structureIsReused = 1 /* SafeModules */;
|
|
116392
116464
|
const typesReferenceDirectives = newSourceFile.typeReferenceDirectives;
|
|
116393
116465
|
const typeReferenceResolutions = resolveTypeReferenceDirectiveNamesReusingOldState(typesReferenceDirectives, newSourceFile);
|
|
116394
116466
|
(resolvedTypeReferenceDirectiveNamesProcessing ?? (resolvedTypeReferenceDirectiveNamesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, typeReferenceResolutions);
|
|
116395
|
-
const
|
|
116396
|
-
|
|
116397
|
-
|
|
116467
|
+
const typeReferenceResolutionsChanged = hasChangesInResolutions(
|
|
116468
|
+
typesReferenceDirectives,
|
|
116469
|
+
newSourceFile,
|
|
116470
|
+
typeReferenceResolutions,
|
|
116471
|
+
(name, mode) => oldProgram == null ? void 0 : oldProgram.getResolvedTypeReferenceDirective(newSourceFile, name, mode),
|
|
116472
|
+
typeDirectiveIsEqualTo,
|
|
116473
|
+
typeReferenceResolutionNameAndModeGetter
|
|
116474
|
+
);
|
|
116475
|
+
if (typeReferenceResolutionsChanged)
|
|
116398
116476
|
structureIsReused = 1 /* SafeModules */;
|
|
116399
|
-
} else if (oldTypeResolutions) {
|
|
116400
|
-
(resolvedTypeReferenceDirectiveNamesProcessing ?? (resolvedTypeReferenceDirectiveNamesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, oldTypeResolutions);
|
|
116401
|
-
}
|
|
116402
116477
|
}
|
|
116403
116478
|
if (structureIsReused !== 2 /* Completely */) {
|
|
116404
116479
|
return structureIsReused;
|
|
@@ -117268,7 +117343,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
117268
117343
|
const result = getImpliedNodeFormatForFileWorker(getNormalizedAbsolutePath(fileName, currentDirectory), moduleResolutionCache2 == null ? void 0 : moduleResolutionCache2.getPackageJsonInfoCache(), host2, options2);
|
|
117269
117344
|
const languageVersion = getEmitScriptTarget(options2);
|
|
117270
117345
|
const setExternalModuleIndicator2 = getSetExternalModuleIndicator(options2);
|
|
117271
|
-
return typeof result === "object" ? { ...result, languageVersion, setExternalModuleIndicator: setExternalModuleIndicator2 } : { languageVersion, impliedNodeFormat: result, setExternalModuleIndicator: setExternalModuleIndicator2 };
|
|
117346
|
+
return typeof result === "object" ? { ...result, languageVersion, setExternalModuleIndicator: setExternalModuleIndicator2, jsDocParsingMode: host2.jsDocParsingMode } : { languageVersion, impliedNodeFormat: result, setExternalModuleIndicator: setExternalModuleIndicator2, jsDocParsingMode: host2.jsDocParsingMode };
|
|
117272
117347
|
}
|
|
117273
117348
|
function findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId) {
|
|
117274
117349
|
var _a2;
|
|
@@ -118545,7 +118620,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
118545
118620
|
symlinks = createSymlinkCache(currentDirectory, getCanonicalFileName);
|
|
118546
118621
|
}
|
|
118547
118622
|
if (files && !symlinks.hasProcessedResolutions()) {
|
|
118548
|
-
symlinks.setSymlinksFromResolutions(
|
|
118623
|
+
symlinks.setSymlinksFromResolutions(forEachResolvedModule, forEachResolvedTypeReferenceDirective, automaticTypeDirectiveResolutions);
|
|
118549
118624
|
}
|
|
118550
118625
|
return symlinks;
|
|
118551
118626
|
}
|
|
@@ -118899,7 +118974,6 @@ var BuilderState;
|
|
|
118899
118974
|
return toPath(program.getProjectReferenceRedirect(fileName) || fileName, sourceFileDirectory, getCanonicalFileName);
|
|
118900
118975
|
}
|
|
118901
118976
|
function getReferencedFiles(program, sourceFile, getCanonicalFileName) {
|
|
118902
|
-
var _a;
|
|
118903
118977
|
let referencedFiles;
|
|
118904
118978
|
if (sourceFile.imports && sourceFile.imports.length > 0) {
|
|
118905
118979
|
const checker = program.getTypeChecker();
|
|
@@ -118915,17 +118989,14 @@ var BuilderState;
|
|
|
118915
118989
|
addReferencedFile(referencedPath);
|
|
118916
118990
|
}
|
|
118917
118991
|
}
|
|
118918
|
-
|
|
118919
|
-
|
|
118920
|
-
|
|
118921
|
-
|
|
118922
|
-
|
|
118923
|
-
|
|
118924
|
-
|
|
118925
|
-
|
|
118926
|
-
addReferencedFile(typeFilePath);
|
|
118927
|
-
});
|
|
118928
|
-
}
|
|
118992
|
+
program.forEachResolvedTypeReferenceDirective(({ resolvedTypeReferenceDirective }) => {
|
|
118993
|
+
if (!resolvedTypeReferenceDirective) {
|
|
118994
|
+
return;
|
|
118995
|
+
}
|
|
118996
|
+
const fileName = resolvedTypeReferenceDirective.resolvedFileName;
|
|
118997
|
+
const typeFilePath = getReferencedFileFromFileName(program, fileName, sourceFileDirectory, getCanonicalFileName);
|
|
118998
|
+
addReferencedFile(typeFilePath);
|
|
118999
|
+
}, sourceFile);
|
|
118929
119000
|
if (sourceFile.moduleAugmentations.length) {
|
|
118930
119001
|
const checker = program.getTypeChecker();
|
|
118931
119002
|
for (const moduleName of sourceFile.moduleAugmentations) {
|
|
@@ -120643,6 +120714,47 @@ function getRootDirectoryOfResolutionCache(rootDirForResolution, getCurrentDirec
|
|
|
120643
120714
|
const normalized = getNormalizedAbsolutePath(rootDirForResolution, getCurrentDirectory());
|
|
120644
120715
|
return !isDiskPathRoot(normalized) ? removeTrailingDirectorySeparator(normalized) : normalized;
|
|
120645
120716
|
}
|
|
120717
|
+
function createModuleResolutionLoaderUsingGlobalCache(containingFile, redirectedReference, options, resolutionHost, moduleResolutionCache) {
|
|
120718
|
+
return {
|
|
120719
|
+
nameAndMode: moduleResolutionNameAndModeGetter,
|
|
120720
|
+
resolve: (moduleName, resoluionMode) => resolveModuleNameUsingGlobalCache(
|
|
120721
|
+
resolutionHost,
|
|
120722
|
+
moduleResolutionCache,
|
|
120723
|
+
moduleName,
|
|
120724
|
+
containingFile,
|
|
120725
|
+
options,
|
|
120726
|
+
redirectedReference,
|
|
120727
|
+
resoluionMode
|
|
120728
|
+
)
|
|
120729
|
+
};
|
|
120730
|
+
}
|
|
120731
|
+
function resolveModuleNameUsingGlobalCache(resolutionHost, moduleResolutionCache, moduleName, containingFile, compilerOptions, redirectedReference, mode) {
|
|
120732
|
+
var _a;
|
|
120733
|
+
const host = ((_a = resolutionHost.getCompilerHost) == null ? void 0 : _a.call(resolutionHost)) || resolutionHost;
|
|
120734
|
+
const primaryResult = resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference, mode);
|
|
120735
|
+
if (!resolutionHost.getGlobalCache) {
|
|
120736
|
+
return primaryResult;
|
|
120737
|
+
}
|
|
120738
|
+
const globalCache = resolutionHost.getGlobalCache();
|
|
120739
|
+
if (globalCache !== void 0 && !isExternalModuleNameRelative(moduleName) && !(primaryResult.resolvedModule && extensionIsTS(primaryResult.resolvedModule.extension))) {
|
|
120740
|
+
const { resolvedModule, failedLookupLocations, affectingLocations, resolutionDiagnostics } = loadModuleFromGlobalCache(
|
|
120741
|
+
Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName),
|
|
120742
|
+
resolutionHost.projectName,
|
|
120743
|
+
compilerOptions,
|
|
120744
|
+
host,
|
|
120745
|
+
globalCache,
|
|
120746
|
+
moduleResolutionCache
|
|
120747
|
+
);
|
|
120748
|
+
if (resolvedModule) {
|
|
120749
|
+
primaryResult.resolvedModule = resolvedModule;
|
|
120750
|
+
primaryResult.failedLookupLocations = updateResolutionField(primaryResult.failedLookupLocations, failedLookupLocations);
|
|
120751
|
+
primaryResult.affectingLocations = updateResolutionField(primaryResult.affectingLocations, affectingLocations);
|
|
120752
|
+
primaryResult.resolutionDiagnostics = updateResolutionField(primaryResult.resolutionDiagnostics, resolutionDiagnostics);
|
|
120753
|
+
return primaryResult;
|
|
120754
|
+
}
|
|
120755
|
+
}
|
|
120756
|
+
return primaryResult;
|
|
120757
|
+
}
|
|
120646
120758
|
function createResolutionCache(resolutionHost, rootDirForResolution, logChangesWhenResolvingModule) {
|
|
120647
120759
|
let filesWithChangedSetOfUnresolvedImports;
|
|
120648
120760
|
let filesWithInvalidatedResolutions;
|
|
@@ -120689,6 +120801,16 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
120689
120801
|
const rootPathComponents = getPathComponents(rootPath);
|
|
120690
120802
|
const typeRootsWatches = /* @__PURE__ */ new Map();
|
|
120691
120803
|
return {
|
|
120804
|
+
rootDirForResolution,
|
|
120805
|
+
resolvedModuleNames,
|
|
120806
|
+
resolvedTypeReferenceDirectives,
|
|
120807
|
+
resolvedLibraries,
|
|
120808
|
+
resolvedFileToResolution,
|
|
120809
|
+
resolutionsWithFailedLookups,
|
|
120810
|
+
resolutionsWithOnlyAffectingLocations,
|
|
120811
|
+
directoryWatchesOfFailedLookups,
|
|
120812
|
+
fileWatchesOfAffectingLocations,
|
|
120813
|
+
watchFailedLookupLocationsOfExternalModuleResolutions,
|
|
120692
120814
|
getModuleResolutionCache: () => moduleResolutionCache,
|
|
120693
120815
|
startRecordingFilesWithChangedResolutions,
|
|
120694
120816
|
finishRecordingFilesWithChangedResolutions,
|
|
@@ -120791,7 +120913,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
120791
120913
|
if (!((_a = newProgram == null ? void 0 : newProgram.resolvedLibReferences) == null ? void 0 : _a.has(libFileName))) {
|
|
120792
120914
|
stopWatchFailedLookupLocationOfResolution(
|
|
120793
120915
|
resolution,
|
|
120794
|
-
resolutionHost.toPath(getInferredLibraryNameResolveFrom(
|
|
120916
|
+
resolutionHost.toPath(getInferredLibraryNameResolveFrom(resolutionHost.getCompilationSettings(), getCurrentDirectory(), libFileName)),
|
|
120795
120917
|
getResolvedModule
|
|
120796
120918
|
);
|
|
120797
120919
|
resolvedLibraries.delete(libFileName);
|
|
@@ -120833,58 +120955,22 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
120833
120955
|
}
|
|
120834
120956
|
});
|
|
120835
120957
|
}
|
|
120836
|
-
directoryWatchesOfFailedLookups.forEach(
|
|
120837
|
-
|
|
120838
|
-
directoryWatchesOfFailedLookups.delete(path);
|
|
120839
|
-
watcher.watcher.close();
|
|
120840
|
-
}
|
|
120841
|
-
});
|
|
120842
|
-
fileWatchesOfAffectingLocations.forEach((watcher, path) => {
|
|
120843
|
-
if (watcher.files === 0 && watcher.resolutions === 0) {
|
|
120844
|
-
fileWatchesOfAffectingLocations.delete(path);
|
|
120845
|
-
watcher.watcher.close();
|
|
120846
|
-
}
|
|
120847
|
-
});
|
|
120958
|
+
directoryWatchesOfFailedLookups.forEach(closeDirectoryWatchesOfFailedLookup);
|
|
120959
|
+
fileWatchesOfAffectingLocations.forEach(closeFileWatcherOfAffectingLocation);
|
|
120848
120960
|
hasChangedAutomaticTypeDirectiveNames = false;
|
|
120849
120961
|
}
|
|
120850
|
-
function
|
|
120851
|
-
|
|
120852
|
-
|
|
120853
|
-
|
|
120854
|
-
if (!resolutionHost.getGlobalCache) {
|
|
120855
|
-
return primaryResult;
|
|
120856
|
-
}
|
|
120857
|
-
const globalCache = resolutionHost.getGlobalCache();
|
|
120858
|
-
if (globalCache !== void 0 && !isExternalModuleNameRelative(moduleName) && !(primaryResult.resolvedModule && extensionIsTS(primaryResult.resolvedModule.extension))) {
|
|
120859
|
-
const { resolvedModule, failedLookupLocations, affectingLocations, resolutionDiagnostics } = loadModuleFromGlobalCache(
|
|
120860
|
-
Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName),
|
|
120861
|
-
resolutionHost.projectName,
|
|
120862
|
-
compilerOptions,
|
|
120863
|
-
host,
|
|
120864
|
-
globalCache,
|
|
120865
|
-
moduleResolutionCache
|
|
120866
|
-
);
|
|
120867
|
-
if (resolvedModule) {
|
|
120868
|
-
primaryResult.resolvedModule = resolvedModule;
|
|
120869
|
-
primaryResult.failedLookupLocations = updateResolutionField(primaryResult.failedLookupLocations, failedLookupLocations);
|
|
120870
|
-
primaryResult.affectingLocations = updateResolutionField(primaryResult.affectingLocations, affectingLocations);
|
|
120871
|
-
primaryResult.resolutionDiagnostics = updateResolutionField(primaryResult.resolutionDiagnostics, resolutionDiagnostics);
|
|
120872
|
-
return primaryResult;
|
|
120873
|
-
}
|
|
120962
|
+
function closeDirectoryWatchesOfFailedLookup(watcher, path) {
|
|
120963
|
+
if (watcher.refCount === 0) {
|
|
120964
|
+
directoryWatchesOfFailedLookups.delete(path);
|
|
120965
|
+
watcher.watcher.close();
|
|
120874
120966
|
}
|
|
120875
|
-
return primaryResult;
|
|
120876
120967
|
}
|
|
120877
|
-
function
|
|
120878
|
-
|
|
120879
|
-
|
|
120880
|
-
|
|
120881
|
-
|
|
120882
|
-
|
|
120883
|
-
options,
|
|
120884
|
-
redirectedReference,
|
|
120885
|
-
resoluionMode
|
|
120886
|
-
)
|
|
120887
|
-
};
|
|
120968
|
+
function closeFileWatcherOfAffectingLocation(watcher, path) {
|
|
120969
|
+
var _a;
|
|
120970
|
+
if (watcher.files === 0 && watcher.resolutions === 0 && !((_a = watcher.symlinks) == null ? void 0 : _a.size)) {
|
|
120971
|
+
fileWatchesOfAffectingLocations.delete(path);
|
|
120972
|
+
watcher.watcher.close();
|
|
120973
|
+
}
|
|
120888
120974
|
}
|
|
120889
120975
|
function resolveNamesWithLocalCache({
|
|
120890
120976
|
entries,
|
|
@@ -120921,9 +121007,11 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
120921
121007
|
resolutionHost.onDiscoveredSymlink();
|
|
120922
121008
|
}
|
|
120923
121009
|
resolutionsInFile.set(name, mode, resolution);
|
|
120924
|
-
|
|
120925
|
-
|
|
120926
|
-
|
|
121010
|
+
if (resolution !== existingResolution) {
|
|
121011
|
+
watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName, deferWatchingNonRelativeResolution);
|
|
121012
|
+
if (existingResolution) {
|
|
121013
|
+
stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolutionWithResolvedFileName);
|
|
121014
|
+
}
|
|
120927
121015
|
}
|
|
120928
121016
|
if (logChanges && filesWithChangedSetOfUnresolvedImports && !resolutionIsEqualTo(existingResolution, resolution)) {
|
|
120929
121017
|
filesWithChangedSetOfUnresolvedImports.push(path);
|
|
@@ -121012,10 +121100,12 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121012
121100
|
options,
|
|
121013
121101
|
reusedNames,
|
|
121014
121102
|
perFileCache: resolvedModuleNames,
|
|
121015
|
-
loader:
|
|
121103
|
+
loader: createModuleResolutionLoaderUsingGlobalCache(
|
|
121016
121104
|
containingFile,
|
|
121017
121105
|
redirectedReference,
|
|
121018
|
-
options
|
|
121106
|
+
options,
|
|
121107
|
+
resolutionHost,
|
|
121108
|
+
moduleResolutionCache
|
|
121019
121109
|
),
|
|
121020
121110
|
getResolutionWithResolvedFileName: getResolvedModule,
|
|
121021
121111
|
shouldRetryResolution: (resolution) => !resolution.resolvedModule || !resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension),
|
|
@@ -121069,7 +121159,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121069
121159
|
);
|
|
121070
121160
|
if (resolution && !resolution.isInvalidated)
|
|
121071
121161
|
return resolution;
|
|
121072
|
-
return
|
|
121162
|
+
return resolveModuleNameUsingGlobalCache(resolutionHost, moduleResolutionCache, moduleName, containingFile, resolutionHost.getCompilationSettings());
|
|
121073
121163
|
}
|
|
121074
121164
|
function isNodeModulesAtTypesDirectory(dirPath) {
|
|
121075
121165
|
return endsWith(dirPath, "/node_modules/@types");
|
|
@@ -121169,52 +121259,63 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121169
121259
|
return;
|
|
121170
121260
|
}
|
|
121171
121261
|
let locationToWatch = affectingLocation;
|
|
121262
|
+
let isSymlink = false;
|
|
121263
|
+
let symlinkWatcher;
|
|
121172
121264
|
if (resolutionHost.realpath) {
|
|
121173
121265
|
locationToWatch = resolutionHost.realpath(affectingLocation);
|
|
121174
121266
|
if (affectingLocation !== locationToWatch) {
|
|
121175
|
-
|
|
121176
|
-
|
|
121177
|
-
|
|
121178
|
-
|
|
121179
|
-
|
|
121180
|
-
|
|
121181
|
-
|
|
121182
|
-
|
|
121183
|
-
|
|
121184
|
-
|
|
121185
|
-
|
|
121186
|
-
|
|
121187
|
-
|
|
121188
|
-
|
|
121189
|
-
|
|
121190
|
-
|
|
121191
|
-
|
|
121192
|
-
|
|
121193
|
-
|
|
121194
|
-
|
|
121195
|
-
|
|
121196
|
-
|
|
121197
|
-
|
|
121198
|
-
|
|
121199
|
-
|
|
121200
|
-
|
|
121201
|
-
|
|
121202
|
-
|
|
121203
|
-
|
|
121204
|
-
|
|
121205
|
-
|
|
121206
|
-
|
|
121207
|
-
|
|
121208
|
-
|
|
121209
|
-
|
|
121210
|
-
|
|
121211
|
-
|
|
121212
|
-
|
|
121213
|
-
if (affectingLocation !== locationToWatch) {
|
|
121267
|
+
isSymlink = true;
|
|
121268
|
+
symlinkWatcher = fileWatchesOfAffectingLocations.get(locationToWatch);
|
|
121269
|
+
}
|
|
121270
|
+
}
|
|
121271
|
+
const resolutions = forResolution ? 1 : 0;
|
|
121272
|
+
const files = forResolution ? 0 : 1;
|
|
121273
|
+
if (!isSymlink || !symlinkWatcher) {
|
|
121274
|
+
const watcher = {
|
|
121275
|
+
watcher: canWatchAffectingLocation(resolutionHost.toPath(locationToWatch)) ? resolutionHost.watchAffectingFileLocation(locationToWatch, (fileName, eventKind) => {
|
|
121276
|
+
cachedDirectoryStructureHost == null ? void 0 : cachedDirectoryStructureHost.addOrDeleteFile(fileName, resolutionHost.toPath(locationToWatch), eventKind);
|
|
121277
|
+
invalidateAffectingFileWatcher(locationToWatch, moduleResolutionCache.getPackageJsonInfoCache().getInternalMap());
|
|
121278
|
+
resolutionHost.scheduleInvalidateResolutionsOfFailedLookupLocations();
|
|
121279
|
+
}) : noopFileWatcher,
|
|
121280
|
+
resolutions: isSymlink ? 0 : resolutions,
|
|
121281
|
+
files: isSymlink ? 0 : files,
|
|
121282
|
+
symlinks: void 0
|
|
121283
|
+
};
|
|
121284
|
+
fileWatchesOfAffectingLocations.set(locationToWatch, watcher);
|
|
121285
|
+
if (isSymlink)
|
|
121286
|
+
symlinkWatcher = watcher;
|
|
121287
|
+
}
|
|
121288
|
+
if (isSymlink) {
|
|
121289
|
+
Debug.assert(!!symlinkWatcher);
|
|
121290
|
+
const watcher = {
|
|
121291
|
+
watcher: {
|
|
121292
|
+
close: () => {
|
|
121293
|
+
var _a;
|
|
121294
|
+
const symlinkWatcher2 = fileWatchesOfAffectingLocations.get(locationToWatch);
|
|
121295
|
+
if (((_a = symlinkWatcher2 == null ? void 0 : symlinkWatcher2.symlinks) == null ? void 0 : _a.delete(affectingLocation)) && !symlinkWatcher2.symlinks.size && !symlinkWatcher2.resolutions && !symlinkWatcher2.files) {
|
|
121296
|
+
fileWatchesOfAffectingLocations.delete(locationToWatch);
|
|
121297
|
+
symlinkWatcher2.watcher.close();
|
|
121298
|
+
}
|
|
121299
|
+
}
|
|
121300
|
+
},
|
|
121301
|
+
resolutions,
|
|
121302
|
+
files,
|
|
121303
|
+
symlinks: void 0
|
|
121304
|
+
};
|
|
121214
121305
|
fileWatchesOfAffectingLocations.set(affectingLocation, watcher);
|
|
121215
|
-
|
|
121306
|
+
(symlinkWatcher.symlinks ?? (symlinkWatcher.symlinks = /* @__PURE__ */ new Set())).add(affectingLocation);
|
|
121216
121307
|
}
|
|
121217
121308
|
}
|
|
121309
|
+
function invalidateAffectingFileWatcher(path, packageJsonMap) {
|
|
121310
|
+
var _a;
|
|
121311
|
+
const watcher = fileWatchesOfAffectingLocations.get(path);
|
|
121312
|
+
if (watcher == null ? void 0 : watcher.resolutions)
|
|
121313
|
+
(affectingPathChecks ?? (affectingPathChecks = /* @__PURE__ */ new Set())).add(path);
|
|
121314
|
+
if (watcher == null ? void 0 : watcher.files)
|
|
121315
|
+
(affectingPathChecksForFile ?? (affectingPathChecksForFile = /* @__PURE__ */ new Set())).add(path);
|
|
121316
|
+
(_a = watcher == null ? void 0 : watcher.symlinks) == null ? void 0 : _a.forEach((path2) => invalidateAffectingFileWatcher(path2, packageJsonMap));
|
|
121317
|
+
packageJsonMap == null ? void 0 : packageJsonMap.delete(resolutionHost.toPath(path));
|
|
121318
|
+
}
|
|
121218
121319
|
function watchFailedLookupLocationOfNonRelativeModuleResolutions(resolutions, name) {
|
|
121219
121320
|
const program = resolutionHost.getCurrentProgram();
|
|
121220
121321
|
if (!program || !program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(name)) {
|
|
@@ -121236,7 +121337,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121236
121337
|
directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir, dirPath, nonRecursive), refCount: 1, nonRecursive });
|
|
121237
121338
|
}
|
|
121238
121339
|
}
|
|
121239
|
-
function stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot) {
|
|
121340
|
+
function stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot, syncDirWatcherRemove) {
|
|
121240
121341
|
const failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation);
|
|
121241
121342
|
const toWatch = getDirectoryToWatchFailedLookupLocation(
|
|
121242
121343
|
failedLookupLocation,
|
|
@@ -121251,12 +121352,12 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121251
121352
|
if (dirPath === rootPath) {
|
|
121252
121353
|
removeAtRoot = true;
|
|
121253
121354
|
} else {
|
|
121254
|
-
removeDirectoryWatcher(dirPath);
|
|
121355
|
+
removeDirectoryWatcher(dirPath, syncDirWatcherRemove);
|
|
121255
121356
|
}
|
|
121256
121357
|
}
|
|
121257
121358
|
return removeAtRoot;
|
|
121258
121359
|
}
|
|
121259
|
-
function stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName) {
|
|
121360
|
+
function stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName, syncDirWatcherRemove) {
|
|
121260
121361
|
Debug.checkDefined(resolution.files).delete(filePath);
|
|
121261
121362
|
resolution.refCount--;
|
|
121262
121363
|
if (resolution.refCount) {
|
|
@@ -121274,13 +121375,13 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121274
121375
|
let removeAtRoot = false;
|
|
121275
121376
|
if (failedLookupLocations) {
|
|
121276
121377
|
for (const failedLookupLocation of failedLookupLocations) {
|
|
121277
|
-
removeAtRoot = stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot);
|
|
121378
|
+
removeAtRoot = stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot, syncDirWatcherRemove);
|
|
121278
121379
|
}
|
|
121279
121380
|
}
|
|
121280
121381
|
if (node10Result)
|
|
121281
|
-
removeAtRoot = stopWatchFailedLookupLocation(node10Result, removeAtRoot);
|
|
121382
|
+
removeAtRoot = stopWatchFailedLookupLocation(node10Result, removeAtRoot, syncDirWatcherRemove);
|
|
121282
121383
|
if (removeAtRoot)
|
|
121283
|
-
removeDirectoryWatcher(rootPath);
|
|
121384
|
+
removeDirectoryWatcher(rootPath, syncDirWatcherRemove);
|
|
121284
121385
|
} else if (affectingLocations == null ? void 0 : affectingLocations.length) {
|
|
121285
121386
|
resolutionsWithOnlyAffectingLocations.delete(resolution);
|
|
121286
121387
|
}
|
|
@@ -121288,12 +121389,16 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121288
121389
|
for (const affectingLocation of affectingLocations) {
|
|
121289
121390
|
const watcher = fileWatchesOfAffectingLocations.get(affectingLocation);
|
|
121290
121391
|
watcher.resolutions--;
|
|
121392
|
+
if (syncDirWatcherRemove)
|
|
121393
|
+
closeFileWatcherOfAffectingLocation(watcher, affectingLocation);
|
|
121291
121394
|
}
|
|
121292
121395
|
}
|
|
121293
121396
|
}
|
|
121294
|
-
function removeDirectoryWatcher(dirPath) {
|
|
121397
|
+
function removeDirectoryWatcher(dirPath, syncDirWatcherRemove) {
|
|
121295
121398
|
const dirWatcher = directoryWatchesOfFailedLookups.get(dirPath);
|
|
121296
121399
|
dirWatcher.refCount--;
|
|
121400
|
+
if (syncDirWatcherRemove)
|
|
121401
|
+
closeDirectoryWatchesOfFailedLookup(dirWatcher, dirPath);
|
|
121297
121402
|
}
|
|
121298
121403
|
function createDirectoryWatcher(directory, dirPath, nonRecursive) {
|
|
121299
121404
|
return resolutionHost.watchDirectoryOfFailedLookupLocation(directory, (fileOrDirectory) => {
|
|
@@ -121304,10 +121409,17 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121304
121409
|
scheduleInvalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath);
|
|
121305
121410
|
}, nonRecursive ? 0 /* None */ : 1 /* Recursive */);
|
|
121306
121411
|
}
|
|
121307
|
-
function removeResolutionsOfFileFromCache(cache, filePath, getResolutionWithResolvedFileName) {
|
|
121412
|
+
function removeResolutionsOfFileFromCache(cache, filePath, getResolutionWithResolvedFileName, syncDirWatcherRemove) {
|
|
121308
121413
|
const resolutions = cache.get(filePath);
|
|
121309
121414
|
if (resolutions) {
|
|
121310
|
-
resolutions.forEach(
|
|
121415
|
+
resolutions.forEach(
|
|
121416
|
+
(resolution) => stopWatchFailedLookupLocationOfResolution(
|
|
121417
|
+
resolution,
|
|
121418
|
+
filePath,
|
|
121419
|
+
getResolutionWithResolvedFileName,
|
|
121420
|
+
syncDirWatcherRemove
|
|
121421
|
+
)
|
|
121422
|
+
);
|
|
121311
121423
|
cache.delete(filePath);
|
|
121312
121424
|
}
|
|
121313
121425
|
}
|
|
@@ -121322,9 +121434,9 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121322
121434
|
return;
|
|
121323
121435
|
resolvedProjectReference.commandLine.fileNames.forEach((f) => removeResolutionsOfFile(resolutionHost.toPath(f)));
|
|
121324
121436
|
}
|
|
121325
|
-
function removeResolutionsOfFile(filePath) {
|
|
121326
|
-
removeResolutionsOfFileFromCache(resolvedModuleNames, filePath, getResolvedModule);
|
|
121327
|
-
removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath, getResolvedTypeReferenceDirective);
|
|
121437
|
+
function removeResolutionsOfFile(filePath, syncDirWatcherRemove) {
|
|
121438
|
+
removeResolutionsOfFileFromCache(resolvedModuleNames, filePath, getResolvedModule, syncDirWatcherRemove);
|
|
121439
|
+
removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath, getResolvedTypeReferenceDirective, syncDirWatcherRemove);
|
|
121328
121440
|
}
|
|
121329
121441
|
function invalidateResolutions(resolutions, canInvalidate) {
|
|
121330
121442
|
if (!resolutions)
|
|
@@ -121978,8 +122090,7 @@ function createCompilerHostFromProgramHost(host, getCompilerOptions, directorySt
|
|
|
121978
122090
|
(fileName, encoding) => !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding),
|
|
121979
122091
|
getCompilerOptions,
|
|
121980
122092
|
/*setParentNodes*/
|
|
121981
|
-
void 0
|
|
121982
|
-
host.skipNonSemanticJSDocParsing
|
|
122093
|
+
void 0
|
|
121983
122094
|
),
|
|
121984
122095
|
getDefaultLibLocation: maybeBind(host, host.getDefaultLibLocation),
|
|
121985
122096
|
getDefaultLibFileName: (options) => host.getDefaultLibFileName(options),
|
|
@@ -122001,7 +122112,8 @@ function createCompilerHostFromProgramHost(host, getCompilerOptions, directorySt
|
|
|
122001
122112
|
getEnvironmentVariable: maybeBind(host, host.getEnvironmentVariable) || (() => ""),
|
|
122002
122113
|
createHash: maybeBind(host, host.createHash),
|
|
122003
122114
|
readDirectory: maybeBind(host, host.readDirectory),
|
|
122004
|
-
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit
|
|
122115
|
+
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
|
|
122116
|
+
jsDocParsingMode: host.jsDocParsingMode
|
|
122005
122117
|
};
|
|
122006
122118
|
return compilerHost;
|
|
122007
122119
|
}
|
|
@@ -122165,12 +122277,11 @@ function readBuilderProgram(compilerOptions, host) {
|
|
|
122165
122277
|
return void 0;
|
|
122166
122278
|
return createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, host);
|
|
122167
122279
|
}
|
|
122168
|
-
function createIncrementalCompilerHost(options, system = sys
|
|
122280
|
+
function createIncrementalCompilerHost(options, system = sys) {
|
|
122169
122281
|
const host = createCompilerHostWorker(
|
|
122170
122282
|
options,
|
|
122171
122283
|
/*setParentNodes*/
|
|
122172
122284
|
void 0,
|
|
122173
|
-
skipNonSemanticJSDocParsing2,
|
|
122174
122285
|
system
|
|
122175
122286
|
);
|
|
122176
122287
|
host.createHash = maybeBind(system, system.createHash);
|
|
@@ -122287,7 +122398,7 @@ function createWatchProgram(host) {
|
|
|
122287
122398
|
watchConfigFileWildCardDirectories();
|
|
122288
122399
|
if (configFileName)
|
|
122289
122400
|
updateExtendedConfigFilesWatches(toPath3(configFileName), compilerOptions, watchOptions, WatchType.ExtendedConfigFile);
|
|
122290
|
-
return configFileName ? { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, close } : { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, updateRootFileNames, close };
|
|
122401
|
+
return configFileName ? { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, close, getResolutionCache } : { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, updateRootFileNames, close, getResolutionCache };
|
|
122291
122402
|
function close() {
|
|
122292
122403
|
clearInvalidateResolutionsOfFailedLookupLocations();
|
|
122293
122404
|
resolutionCache.clear();
|
|
@@ -122327,6 +122438,9 @@ function createWatchProgram(host) {
|
|
|
122327
122438
|
parsedConfigs = void 0;
|
|
122328
122439
|
}
|
|
122329
122440
|
}
|
|
122441
|
+
function getResolutionCache() {
|
|
122442
|
+
return resolutionCache;
|
|
122443
|
+
}
|
|
122330
122444
|
function getCurrentBuilderProgram() {
|
|
122331
122445
|
return builderProgram;
|
|
122332
122446
|
}
|
|
@@ -125500,7 +125614,7 @@ function reportWatchModeWithoutSysSupport(sys2, reportDiagnostic) {
|
|
|
125500
125614
|
}
|
|
125501
125615
|
return false;
|
|
125502
125616
|
}
|
|
125503
|
-
var
|
|
125617
|
+
var defaultJSDocParsingMode = 2 /* ParseForTypeErrors */;
|
|
125504
125618
|
function performBuild(sys2, cb, buildOptions, watchOptions, projects, errors) {
|
|
125505
125619
|
const reportDiagnostic = updateReportDiagnostic(
|
|
125506
125620
|
sys2,
|
|
@@ -125539,7 +125653,7 @@ function performBuild(sys2, cb, buildOptions, watchOptions, projects, errors) {
|
|
|
125539
125653
|
createBuilderStatusReporter(sys2, shouldBePretty(sys2, buildOptions)),
|
|
125540
125654
|
createWatchStatusReporter2(sys2, buildOptions)
|
|
125541
125655
|
);
|
|
125542
|
-
buildHost2.
|
|
125656
|
+
buildHost2.jsDocParsingMode = defaultJSDocParsingMode;
|
|
125543
125657
|
const solutionPerformance2 = enableSolutionPerformance(sys2, buildOptions);
|
|
125544
125658
|
updateSolutionBuilderHost(sys2, cb, buildHost2, solutionPerformance2);
|
|
125545
125659
|
const onWatchStatusChange = buildHost2.onWatchStatusChange;
|
|
@@ -125564,7 +125678,7 @@ function performBuild(sys2, cb, buildOptions, watchOptions, projects, errors) {
|
|
|
125564
125678
|
createBuilderStatusReporter(sys2, shouldBePretty(sys2, buildOptions)),
|
|
125565
125679
|
createReportErrorSummary(sys2, buildOptions)
|
|
125566
125680
|
);
|
|
125567
|
-
buildHost.
|
|
125681
|
+
buildHost.jsDocParsingMode = defaultJSDocParsingMode;
|
|
125568
125682
|
const solutionPerformance = enableSolutionPerformance(sys2, buildOptions);
|
|
125569
125683
|
updateSolutionBuilderHost(sys2, cb, buildHost, solutionPerformance);
|
|
125570
125684
|
const builder = createSolutionBuilder(buildHost, projects, buildOptions);
|
|
@@ -125582,9 +125696,9 @@ function performCompilation(sys2, cb, reportDiagnostic, config) {
|
|
|
125582
125696
|
options,
|
|
125583
125697
|
/*setParentNodes*/
|
|
125584
125698
|
void 0,
|
|
125585
|
-
skipNonSemanticJSDocParsing,
|
|
125586
125699
|
sys2
|
|
125587
125700
|
);
|
|
125701
|
+
host.jsDocParsingMode = defaultJSDocParsingMode;
|
|
125588
125702
|
const currentDirectory = host.getCurrentDirectory();
|
|
125589
125703
|
const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames());
|
|
125590
125704
|
changeCompilerHostLikeToUseCache(host, (fileName) => toPath(fileName, currentDirectory, getCanonicalFileName));
|
|
@@ -125625,7 +125739,8 @@ function performIncrementalCompilation2(sys2, cb, reportDiagnostic, config) {
|
|
|
125625
125739
|
/*isBuildMode*/
|
|
125626
125740
|
false
|
|
125627
125741
|
);
|
|
125628
|
-
const host = createIncrementalCompilerHost(options, sys2
|
|
125742
|
+
const host = createIncrementalCompilerHost(options, sys2);
|
|
125743
|
+
host.jsDocParsingMode = defaultJSDocParsingMode;
|
|
125629
125744
|
const exitStatus = performIncrementalCompilation({
|
|
125630
125745
|
host,
|
|
125631
125746
|
system: sys2,
|
|
@@ -125680,7 +125795,7 @@ function updateCreateProgram(sys2, host, isBuildMode) {
|
|
|
125680
125795
|
};
|
|
125681
125796
|
}
|
|
125682
125797
|
function updateWatchCompilationHost(sys2, cb, watchCompilerHost) {
|
|
125683
|
-
watchCompilerHost.
|
|
125798
|
+
watchCompilerHost.jsDocParsingMode = defaultJSDocParsingMode;
|
|
125684
125799
|
updateCreateProgram(
|
|
125685
125800
|
sys2,
|
|
125686
125801
|
watchCompilerHost,
|