@typescript-deploys/pr-build 5.7.0-pr-59860-2 → 5.7.0-pr-53017-15

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/typescript.js CHANGED
@@ -259,6 +259,7 @@ __export(typescript_exports, {
259
259
  canWatchAffectingLocation: () => canWatchAffectingLocation,
260
260
  canWatchAtTypes: () => canWatchAtTypes,
261
261
  canWatchDirectoryOrFile: () => canWatchDirectoryOrFile,
262
+ canWatchDirectoryOrFilePath: () => canWatchDirectoryOrFilePath,
262
263
  cartesianProduct: () => cartesianProduct,
263
264
  cast: () => cast,
264
265
  chainBundle: () => chainBundle,
@@ -591,6 +592,7 @@ __export(typescript_exports, {
591
592
  forEach: () => forEach,
592
593
  forEachAncestor: () => forEachAncestor,
593
594
  forEachAncestorDirectory: () => forEachAncestorDirectory,
595
+ forEachAncestorDirectoryStoppingAtGlobalCache: () => forEachAncestorDirectoryStoppingAtGlobalCache,
594
596
  forEachChild: () => forEachChild,
595
597
  forEachChildRecursively: () => forEachChildRecursively,
596
598
  forEachEmittedFile: () => forEachEmittedFile,
@@ -1204,7 +1206,7 @@ __export(typescript_exports, {
1204
1206
  isBooleanLiteral: () => isBooleanLiteral,
1205
1207
  isBreakOrContinueStatement: () => isBreakOrContinueStatement,
1206
1208
  isBreakStatement: () => isBreakStatement,
1207
- isBuild: () => isBuild,
1209
+ isBuildCommand: () => isBuildCommand,
1208
1210
  isBuildInfoFile: () => isBuildInfoFile,
1209
1211
  isBuilderProgram: () => isBuilderProgram,
1210
1212
  isBundle: () => isBundle,
@@ -2213,6 +2215,7 @@ __export(typescript_exports, {
2213
2215
  tryRemoveExtension: () => tryRemoveExtension,
2214
2216
  tryRemovePrefix: () => tryRemovePrefix,
2215
2217
  tryRemoveSuffix: () => tryRemoveSuffix,
2218
+ tscBuildOption: () => tscBuildOption,
2216
2219
  typeAcquisitionDeclarations: () => typeAcquisitionDeclarations,
2217
2220
  typeAliasNamePart: () => typeAliasNamePart,
2218
2221
  typeDirectiveIsEqualTo: () => typeDirectiveIsEqualTo,
@@ -2266,7 +2269,7 @@ module.exports = __toCommonJS(typescript_exports);
2266
2269
 
2267
2270
  // src/compiler/corePublic.ts
2268
2271
  var versionMajorMinor = "5.7";
2269
- var version = `${versionMajorMinor}.0-insiders.20240904`;
2272
+ var version = `${versionMajorMinor}.0-insiders.20240916`;
2270
2273
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2271
2274
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2272
2275
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -7038,43 +7041,42 @@ var InternalEmitFlags = /* @__PURE__ */ ((InternalEmitFlags3) => {
7038
7041
  InternalEmitFlags3[InternalEmitFlags3["TransformPrivateStaticElements"] = 32] = "TransformPrivateStaticElements";
7039
7042
  return InternalEmitFlags3;
7040
7043
  })(InternalEmitFlags || {});
7041
- var LanguageFeatureMinimumTarget = /* @__PURE__ */ ((LanguageFeatureMinimumTarget2) => {
7042
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["Classes"] = 2 /* ES2015 */] = "Classes";
7043
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["ForOf"] = 2 /* ES2015 */] = "ForOf";
7044
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["Generators"] = 2 /* ES2015 */] = "Generators";
7045
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["Iteration"] = 2 /* ES2015 */] = "Iteration";
7046
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["SpreadElements"] = 2 /* ES2015 */] = "SpreadElements";
7047
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["RestElements"] = 2 /* ES2015 */] = "RestElements";
7048
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["TaggedTemplates"] = 2 /* ES2015 */] = "TaggedTemplates";
7049
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["DestructuringAssignment"] = 2 /* ES2015 */] = "DestructuringAssignment";
7050
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["BindingPatterns"] = 2 /* ES2015 */] = "BindingPatterns";
7051
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["ArrowFunctions"] = 2 /* ES2015 */] = "ArrowFunctions";
7052
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["BlockScopedVariables"] = 2 /* ES2015 */] = "BlockScopedVariables";
7053
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["ObjectAssign"] = 2 /* ES2015 */] = "ObjectAssign";
7054
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["RegularExpressionFlagsUnicode"] = 2 /* ES2015 */] = "RegularExpressionFlagsUnicode";
7055
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["RegularExpressionFlagsSticky"] = 2 /* ES2015 */] = "RegularExpressionFlagsSticky";
7056
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["Exponentiation"] = 3 /* ES2016 */] = "Exponentiation";
7057
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["AsyncFunctions"] = 4 /* ES2017 */] = "AsyncFunctions";
7058
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["ForAwaitOf"] = 5 /* ES2018 */] = "ForAwaitOf";
7059
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["AsyncGenerators"] = 5 /* ES2018 */] = "AsyncGenerators";
7060
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["AsyncIteration"] = 5 /* ES2018 */] = "AsyncIteration";
7061
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["ObjectSpreadRest"] = 5 /* ES2018 */] = "ObjectSpreadRest";
7062
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["RegularExpressionFlagsDotAll"] = 5 /* ES2018 */] = "RegularExpressionFlagsDotAll";
7063
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["BindinglessCatch"] = 6 /* ES2019 */] = "BindinglessCatch";
7064
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["BigInt"] = 7 /* ES2020 */] = "BigInt";
7065
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["NullishCoalesce"] = 7 /* ES2020 */] = "NullishCoalesce";
7066
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["OptionalChaining"] = 7 /* ES2020 */] = "OptionalChaining";
7067
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["LogicalAssignment"] = 8 /* ES2021 */] = "LogicalAssignment";
7068
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["TopLevelAwait"] = 9 /* ES2022 */] = "TopLevelAwait";
7069
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["ClassFields"] = 9 /* ES2022 */] = "ClassFields";
7070
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["PrivateNamesAndClassStaticBlocks"] = 9 /* ES2022 */] = "PrivateNamesAndClassStaticBlocks";
7071
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["RegularExpressionFlagsHasIndices"] = 9 /* ES2022 */] = "RegularExpressionFlagsHasIndices";
7072
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["ShebangComments"] = 99 /* ESNext */] = "ShebangComments";
7073
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["UsingAndAwaitUsing"] = 99 /* ESNext */] = "UsingAndAwaitUsing";
7074
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["ClassAndClassElementDecorators"] = 99 /* ESNext */] = "ClassAndClassElementDecorators";
7075
- LanguageFeatureMinimumTarget2[LanguageFeatureMinimumTarget2["RegularExpressionFlagsUnicodeSets"] = 99 /* ESNext */] = "RegularExpressionFlagsUnicodeSets";
7076
- return LanguageFeatureMinimumTarget2;
7077
- })(LanguageFeatureMinimumTarget || {});
7044
+ var LanguageFeatureMinimumTarget = {
7045
+ Classes: 2 /* ES2015 */,
7046
+ ForOf: 2 /* ES2015 */,
7047
+ Generators: 2 /* ES2015 */,
7048
+ Iteration: 2 /* ES2015 */,
7049
+ SpreadElements: 2 /* ES2015 */,
7050
+ RestElements: 2 /* ES2015 */,
7051
+ TaggedTemplates: 2 /* ES2015 */,
7052
+ DestructuringAssignment: 2 /* ES2015 */,
7053
+ BindingPatterns: 2 /* ES2015 */,
7054
+ ArrowFunctions: 2 /* ES2015 */,
7055
+ BlockScopedVariables: 2 /* ES2015 */,
7056
+ ObjectAssign: 2 /* ES2015 */,
7057
+ RegularExpressionFlagsUnicode: 2 /* ES2015 */,
7058
+ RegularExpressionFlagsSticky: 2 /* ES2015 */,
7059
+ Exponentiation: 3 /* ES2016 */,
7060
+ AsyncFunctions: 4 /* ES2017 */,
7061
+ ForAwaitOf: 5 /* ES2018 */,
7062
+ AsyncGenerators: 5 /* ES2018 */,
7063
+ AsyncIteration: 5 /* ES2018 */,
7064
+ ObjectSpreadRest: 5 /* ES2018 */,
7065
+ RegularExpressionFlagsDotAll: 5 /* ES2018 */,
7066
+ BindinglessCatch: 6 /* ES2019 */,
7067
+ BigInt: 7 /* ES2020 */,
7068
+ NullishCoalesce: 7 /* ES2020 */,
7069
+ OptionalChaining: 7 /* ES2020 */,
7070
+ LogicalAssignment: 8 /* ES2021 */,
7071
+ TopLevelAwait: 9 /* ES2022 */,
7072
+ ClassFields: 9 /* ES2022 */,
7073
+ PrivateNamesAndClassStaticBlocks: 9 /* ES2022 */,
7074
+ RegularExpressionFlagsHasIndices: 9 /* ES2022 */,
7075
+ ShebangComments: 99 /* ESNext */,
7076
+ UsingAndAwaitUsing: 99 /* ESNext */,
7077
+ ClassAndClassElementDecorators: 99 /* ESNext */,
7078
+ RegularExpressionFlagsUnicodeSets: 99 /* ESNext */
7079
+ };
7078
7080
  var ExternalEmitHelpers = /* @__PURE__ */ ((ExternalEmitHelpers2) => {
7079
7081
  ExternalEmitHelpers2[ExternalEmitHelpers2["Extends"] = 1] = "Extends";
7080
7082
  ExternalEmitHelpers2[ExternalEmitHelpers2["Assign"] = 2] = "Assign";
@@ -11471,11 +11473,11 @@ var charCodeToRegExpFlag = /* @__PURE__ */ new Map([
11471
11473
  [121 /* y */, 128 /* Sticky */]
11472
11474
  ]);
11473
11475
  var regExpFlagToFirstAvailableLanguageVersion = /* @__PURE__ */ new Map([
11474
- [1 /* HasIndices */, 9 /* RegularExpressionFlagsHasIndices */],
11475
- [16 /* DotAll */, 5 /* RegularExpressionFlagsDotAll */],
11476
- [32 /* Unicode */, 2 /* RegularExpressionFlagsUnicode */],
11477
- [64 /* UnicodeSets */, 99 /* RegularExpressionFlagsUnicodeSets */],
11478
- [128 /* Sticky */, 2 /* RegularExpressionFlagsSticky */]
11476
+ [1 /* HasIndices */, LanguageFeatureMinimumTarget.RegularExpressionFlagsHasIndices],
11477
+ [16 /* DotAll */, LanguageFeatureMinimumTarget.RegularExpressionFlagsDotAll],
11478
+ [32 /* Unicode */, LanguageFeatureMinimumTarget.RegularExpressionFlagsUnicode],
11479
+ [64 /* UnicodeSets */, LanguageFeatureMinimumTarget.RegularExpressionFlagsUnicodeSets],
11480
+ [128 /* Sticky */, LanguageFeatureMinimumTarget.RegularExpressionFlagsSticky]
11479
11481
  ]);
11480
11482
  var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 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, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6e3, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 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, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43e3, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500];
11481
11483
  var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 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, 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, 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, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 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, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 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, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 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, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 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, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 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, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 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, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43e3, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 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, 65062, 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];
@@ -18744,17 +18746,15 @@ function forEachImportClauseDeclaration(node, action) {
18744
18746
  }
18745
18747
  }
18746
18748
  function hasQuestionToken(node) {
18747
- if (node) {
18748
- switch (node.kind) {
18749
- case 169 /* Parameter */:
18750
- case 174 /* MethodDeclaration */:
18751
- case 173 /* MethodSignature */:
18752
- case 304 /* ShorthandPropertyAssignment */:
18753
- case 303 /* PropertyAssignment */:
18754
- case 172 /* PropertyDeclaration */:
18755
- case 171 /* PropertySignature */:
18756
- return node.questionToken !== void 0;
18757
- }
18749
+ switch (node.kind) {
18750
+ case 169 /* Parameter */:
18751
+ case 174 /* MethodDeclaration */:
18752
+ case 173 /* MethodSignature */:
18753
+ case 304 /* ShorthandPropertyAssignment */:
18754
+ case 303 /* PropertyAssignment */:
18755
+ case 172 /* PropertyDeclaration */:
18756
+ case 171 /* PropertySignature */:
18757
+ return node.questionToken !== void 0;
18758
18758
  }
18759
18759
  return false;
18760
18760
  }
@@ -21668,7 +21668,7 @@ function importSyntaxAffectsModuleResolution(options) {
21668
21668
  function createComputedCompilerOptions(options) {
21669
21669
  return options;
21670
21670
  }
21671
- var computedOptions = createComputedCompilerOptions({
21671
+ var _computedOptions = createComputedCompilerOptions({
21672
21672
  target: {
21673
21673
  dependencies: ["module"],
21674
21674
  computeValue: (compilerOptions) => {
@@ -21679,7 +21679,7 @@ var computedOptions = createComputedCompilerOptions({
21679
21679
  module: {
21680
21680
  dependencies: ["target"],
21681
21681
  computeValue: (compilerOptions) => {
21682
- return typeof compilerOptions.module === "number" ? compilerOptions.module : computedOptions.target.computeValue(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
21682
+ return typeof compilerOptions.module === "number" ? compilerOptions.module : _computedOptions.target.computeValue(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
21683
21683
  }
21684
21684
  },
21685
21685
  moduleResolution: {
@@ -21687,7 +21687,7 @@ var computedOptions = createComputedCompilerOptions({
21687
21687
  computeValue: (compilerOptions) => {
21688
21688
  let moduleResolution = compilerOptions.moduleResolution;
21689
21689
  if (moduleResolution === void 0) {
21690
- switch (computedOptions.module.computeValue(compilerOptions)) {
21690
+ switch (_computedOptions.module.computeValue(compilerOptions)) {
21691
21691
  case 1 /* CommonJS */:
21692
21692
  moduleResolution = 2 /* Node10 */;
21693
21693
  break;
@@ -21711,7 +21711,7 @@ var computedOptions = createComputedCompilerOptions({
21711
21711
  moduleDetection: {
21712
21712
  dependencies: ["module", "target"],
21713
21713
  computeValue: (compilerOptions) => {
21714
- return compilerOptions.moduleDetection || (computedOptions.module.computeValue(compilerOptions) === 100 /* Node16 */ || computedOptions.module.computeValue(compilerOptions) === 199 /* NodeNext */ ? 3 /* Force */ : 2 /* Auto */);
21714
+ return compilerOptions.moduleDetection || (_computedOptions.module.computeValue(compilerOptions) === 100 /* Node16 */ || _computedOptions.module.computeValue(compilerOptions) === 199 /* NodeNext */ ? 3 /* Force */ : 2 /* Auto */);
21715
21715
  }
21716
21716
  },
21717
21717
  isolatedModules: {
@@ -21726,7 +21726,7 @@ var computedOptions = createComputedCompilerOptions({
21726
21726
  if (compilerOptions.esModuleInterop !== void 0) {
21727
21727
  return compilerOptions.esModuleInterop;
21728
21728
  }
21729
- switch (computedOptions.module.computeValue(compilerOptions)) {
21729
+ switch (_computedOptions.module.computeValue(compilerOptions)) {
21730
21730
  case 100 /* Node16 */:
21731
21731
  case 199 /* NodeNext */:
21732
21732
  case 200 /* Preserve */:
@@ -21741,13 +21741,13 @@ var computedOptions = createComputedCompilerOptions({
21741
21741
  if (compilerOptions.allowSyntheticDefaultImports !== void 0) {
21742
21742
  return compilerOptions.allowSyntheticDefaultImports;
21743
21743
  }
21744
- return computedOptions.esModuleInterop.computeValue(compilerOptions) || computedOptions.module.computeValue(compilerOptions) === 4 /* System */ || computedOptions.moduleResolution.computeValue(compilerOptions) === 100 /* Bundler */;
21744
+ return _computedOptions.esModuleInterop.computeValue(compilerOptions) || _computedOptions.module.computeValue(compilerOptions) === 4 /* System */ || _computedOptions.moduleResolution.computeValue(compilerOptions) === 100 /* Bundler */;
21745
21745
  }
21746
21746
  },
21747
21747
  resolvePackageJsonExports: {
21748
21748
  dependencies: ["moduleResolution"],
21749
21749
  computeValue: (compilerOptions) => {
21750
- const moduleResolution = computedOptions.moduleResolution.computeValue(compilerOptions);
21750
+ const moduleResolution = _computedOptions.moduleResolution.computeValue(compilerOptions);
21751
21751
  if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
21752
21752
  return false;
21753
21753
  }
@@ -21766,7 +21766,7 @@ var computedOptions = createComputedCompilerOptions({
21766
21766
  resolvePackageJsonImports: {
21767
21767
  dependencies: ["moduleResolution", "resolvePackageJsonExports"],
21768
21768
  computeValue: (compilerOptions) => {
21769
- const moduleResolution = computedOptions.moduleResolution.computeValue(compilerOptions);
21769
+ const moduleResolution = _computedOptions.moduleResolution.computeValue(compilerOptions);
21770
21770
  if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
21771
21771
  return false;
21772
21772
  }
@@ -21788,7 +21788,7 @@ var computedOptions = createComputedCompilerOptions({
21788
21788
  if (compilerOptions.resolveJsonModule !== void 0) {
21789
21789
  return compilerOptions.resolveJsonModule;
21790
21790
  }
21791
- return computedOptions.moduleResolution.computeValue(compilerOptions) === 100 /* Bundler */;
21791
+ return _computedOptions.moduleResolution.computeValue(compilerOptions) === 100 /* Bundler */;
21792
21792
  }
21793
21793
  },
21794
21794
  declaration: {
@@ -21800,7 +21800,7 @@ var computedOptions = createComputedCompilerOptions({
21800
21800
  preserveConstEnums: {
21801
21801
  dependencies: ["isolatedModules", "verbatimModuleSyntax"],
21802
21802
  computeValue: (compilerOptions) => {
21803
- return !!(compilerOptions.preserveConstEnums || computedOptions.isolatedModules.computeValue(compilerOptions));
21803
+ return !!(compilerOptions.preserveConstEnums || _computedOptions.isolatedModules.computeValue(compilerOptions));
21804
21804
  }
21805
21805
  },
21806
21806
  incremental: {
@@ -21812,7 +21812,7 @@ var computedOptions = createComputedCompilerOptions({
21812
21812
  declarationMap: {
21813
21813
  dependencies: ["declaration", "composite"],
21814
21814
  computeValue: (compilerOptions) => {
21815
- return !!(compilerOptions.declarationMap && computedOptions.declaration.computeValue(compilerOptions));
21815
+ return !!(compilerOptions.declarationMap && _computedOptions.declaration.computeValue(compilerOptions));
21816
21816
  }
21817
21817
  },
21818
21818
  allowJs: {
@@ -21824,7 +21824,7 @@ var computedOptions = createComputedCompilerOptions({
21824
21824
  useDefineForClassFields: {
21825
21825
  dependencies: ["target", "module"],
21826
21826
  computeValue: (compilerOptions) => {
21827
- return compilerOptions.useDefineForClassFields === void 0 ? computedOptions.target.computeValue(compilerOptions) >= 9 /* ES2022 */ : compilerOptions.useDefineForClassFields;
21827
+ return compilerOptions.useDefineForClassFields === void 0 ? _computedOptions.target.computeValue(compilerOptions) >= 9 /* ES2022 */ : compilerOptions.useDefineForClassFields;
21828
21828
  }
21829
21829
  },
21830
21830
  noImplicitAny: {
@@ -21882,22 +21882,23 @@ var computedOptions = createComputedCompilerOptions({
21882
21882
  }
21883
21883
  }
21884
21884
  });
21885
- var getEmitScriptTarget = computedOptions.target.computeValue;
21886
- var getEmitModuleKind = computedOptions.module.computeValue;
21887
- var getEmitModuleResolutionKind = computedOptions.moduleResolution.computeValue;
21888
- var getEmitModuleDetectionKind = computedOptions.moduleDetection.computeValue;
21889
- var getIsolatedModules = computedOptions.isolatedModules.computeValue;
21890
- var getESModuleInterop = computedOptions.esModuleInterop.computeValue;
21891
- var getAllowSyntheticDefaultImports = computedOptions.allowSyntheticDefaultImports.computeValue;
21892
- var getResolvePackageJsonExports = computedOptions.resolvePackageJsonExports.computeValue;
21893
- var getResolvePackageJsonImports = computedOptions.resolvePackageJsonImports.computeValue;
21894
- var getResolveJsonModule = computedOptions.resolveJsonModule.computeValue;
21895
- var getEmitDeclarations = computedOptions.declaration.computeValue;
21896
- var shouldPreserveConstEnums = computedOptions.preserveConstEnums.computeValue;
21897
- var isIncrementalCompilation = computedOptions.incremental.computeValue;
21898
- var getAreDeclarationMapsEnabled = computedOptions.declarationMap.computeValue;
21899
- var getAllowJSCompilerOption = computedOptions.allowJs.computeValue;
21900
- var getUseDefineForClassFields = computedOptions.useDefineForClassFields.computeValue;
21885
+ var computedOptions = _computedOptions;
21886
+ var getEmitScriptTarget = _computedOptions.target.computeValue;
21887
+ var getEmitModuleKind = _computedOptions.module.computeValue;
21888
+ var getEmitModuleResolutionKind = _computedOptions.moduleResolution.computeValue;
21889
+ var getEmitModuleDetectionKind = _computedOptions.moduleDetection.computeValue;
21890
+ var getIsolatedModules = _computedOptions.isolatedModules.computeValue;
21891
+ var getESModuleInterop = _computedOptions.esModuleInterop.computeValue;
21892
+ var getAllowSyntheticDefaultImports = _computedOptions.allowSyntheticDefaultImports.computeValue;
21893
+ var getResolvePackageJsonExports = _computedOptions.resolvePackageJsonExports.computeValue;
21894
+ var getResolvePackageJsonImports = _computedOptions.resolvePackageJsonImports.computeValue;
21895
+ var getResolveJsonModule = _computedOptions.resolveJsonModule.computeValue;
21896
+ var getEmitDeclarations = _computedOptions.declaration.computeValue;
21897
+ var shouldPreserveConstEnums = _computedOptions.preserveConstEnums.computeValue;
21898
+ var isIncrementalCompilation = _computedOptions.incremental.computeValue;
21899
+ var getAreDeclarationMapsEnabled = _computedOptions.declarationMap.computeValue;
21900
+ var getAllowJSCompilerOption = _computedOptions.allowJs.computeValue;
21901
+ var getUseDefineForClassFields = _computedOptions.useDefineForClassFields.computeValue;
21901
21902
  function emitModuleKindIsNonNodeESM(moduleKind) {
21902
21903
  return moduleKind >= 5 /* ES2015 */ && moduleKind <= 99 /* ESNext */;
21903
21904
  }
@@ -31282,23 +31283,21 @@ function hasRecordedExternalHelpers(sourceFile) {
31282
31283
  }
31283
31284
  function createExternalHelpersImportDeclarationIfNeeded(nodeFactory, helperFactory, sourceFile, compilerOptions, hasExportStarsToExportValues, hasImportStar, hasImportDefault) {
31284
31285
  if (compilerOptions.importHelpers && isEffectiveExternalModule(sourceFile, compilerOptions)) {
31285
- let namedBindings;
31286
31286
  const moduleKind = getEmitModuleKind(compilerOptions);
31287
- if (moduleKind >= 5 /* ES2015 */ && moduleKind <= 99 /* ESNext */ || getImpliedNodeFormatForEmitWorker(sourceFile, compilerOptions) === 99 /* ESNext */) {
31288
- const helpers = getEmitHelpers(sourceFile);
31287
+ const impliedModuleKind = getImpliedNodeFormatForEmitWorker(sourceFile, compilerOptions);
31288
+ const helpers = getImportedHelpers(sourceFile);
31289
+ if (moduleKind >= 5 /* ES2015 */ && moduleKind <= 99 /* ESNext */ || impliedModuleKind === 99 /* ESNext */ || impliedModuleKind === void 0 && moduleKind === 200 /* Preserve */) {
31289
31290
  if (helpers) {
31290
31291
  const helperNames = [];
31291
31292
  for (const helper of helpers) {
31292
- if (!helper.scoped) {
31293
- const importName = helper.importName;
31294
- if (importName) {
31295
- pushIfUnique(helperNames, importName);
31296
- }
31293
+ const importName = helper.importName;
31294
+ if (importName) {
31295
+ pushIfUnique(helperNames, importName);
31297
31296
  }
31298
31297
  }
31299
31298
  if (some(helperNames)) {
31300
31299
  helperNames.sort(compareStringsCaseSensitive);
31301
- namedBindings = nodeFactory.createNamedImports(
31300
+ const namedBindings = nodeFactory.createNamedImports(
31302
31301
  map(helperNames, (name) => isFileLevelUniqueName(sourceFile, name) ? nodeFactory.createImportSpecifier(
31303
31302
  /*isTypeOnly*/
31304
31303
  false,
@@ -31315,57 +31314,54 @@ function createExternalHelpersImportDeclarationIfNeeded(nodeFactory, helperFacto
31315
31314
  const parseNode = getOriginalNode(sourceFile, isSourceFile);
31316
31315
  const emitNode = getOrCreateEmitNode(parseNode);
31317
31316
  emitNode.externalHelpers = true;
31317
+ const externalHelpersImportDeclaration = nodeFactory.createImportDeclaration(
31318
+ /*modifiers*/
31319
+ void 0,
31320
+ nodeFactory.createImportClause(
31321
+ /*isTypeOnly*/
31322
+ false,
31323
+ /*name*/
31324
+ void 0,
31325
+ namedBindings
31326
+ ),
31327
+ nodeFactory.createStringLiteral(externalHelpersModuleNameText),
31328
+ /*attributes*/
31329
+ void 0
31330
+ );
31331
+ addInternalEmitFlags(externalHelpersImportDeclaration, 2 /* NeverApplyImportHelper */);
31332
+ return externalHelpersImportDeclaration;
31318
31333
  }
31319
31334
  }
31320
31335
  } else {
31321
- const externalHelpersModuleName = getOrCreateExternalHelpersModuleNameIfNeeded(nodeFactory, sourceFile, compilerOptions, hasExportStarsToExportValues, hasImportStar || hasImportDefault);
31336
+ const externalHelpersModuleName = getOrCreateExternalHelpersModuleNameIfNeeded(nodeFactory, sourceFile, compilerOptions, helpers, hasExportStarsToExportValues, hasImportStar || hasImportDefault);
31322
31337
  if (externalHelpersModuleName) {
31323
- namedBindings = nodeFactory.createNamespaceImport(externalHelpersModuleName);
31324
- }
31325
- }
31326
- if (namedBindings) {
31327
- const externalHelpersImportDeclaration = nodeFactory.createImportDeclaration(
31328
- /*modifiers*/
31329
- void 0,
31330
- nodeFactory.createImportClause(
31338
+ const externalHelpersImportDeclaration = nodeFactory.createImportEqualsDeclaration(
31339
+ /*modifiers*/
31340
+ void 0,
31331
31341
  /*isTypeOnly*/
31332
31342
  false,
31333
- /*name*/
31334
- void 0,
31335
- namedBindings
31336
- ),
31337
- nodeFactory.createStringLiteral(externalHelpersModuleNameText),
31338
- /*attributes*/
31339
- void 0
31340
- );
31341
- addInternalEmitFlags(externalHelpersImportDeclaration, 2 /* NeverApplyImportHelper */);
31342
- return externalHelpersImportDeclaration;
31343
+ externalHelpersModuleName,
31344
+ nodeFactory.createExternalModuleReference(nodeFactory.createStringLiteral(externalHelpersModuleNameText))
31345
+ );
31346
+ addInternalEmitFlags(externalHelpersImportDeclaration, 2 /* NeverApplyImportHelper */);
31347
+ return externalHelpersImportDeclaration;
31348
+ }
31343
31349
  }
31344
31350
  }
31345
31351
  }
31346
- function getOrCreateExternalHelpersModuleNameIfNeeded(factory2, node, compilerOptions, hasExportStarsToExportValues, hasImportStarOrImportDefault) {
31347
- if (compilerOptions.importHelpers && isEffectiveExternalModule(node, compilerOptions)) {
31348
- const externalHelpersModuleName = getExternalHelpersModuleName(node);
31349
- if (externalHelpersModuleName) {
31350
- return externalHelpersModuleName;
31351
- }
31352
- let create = (hasExportStarsToExportValues || getESModuleInterop(compilerOptions) && hasImportStarOrImportDefault) && getEmitModuleFormatOfFileWorker(node, compilerOptions) < 4 /* System */;
31353
- if (!create) {
31354
- const helpers = getEmitHelpers(node);
31355
- if (helpers) {
31356
- for (const helper of helpers) {
31357
- if (!helper.scoped) {
31358
- create = true;
31359
- break;
31360
- }
31361
- }
31362
- }
31363
- }
31364
- if (create) {
31365
- const parseNode = getOriginalNode(node, isSourceFile);
31366
- const emitNode = getOrCreateEmitNode(parseNode);
31367
- return emitNode.externalHelpersModuleName || (emitNode.externalHelpersModuleName = factory2.createUniqueName(externalHelpersModuleNameText));
31368
- }
31352
+ function getImportedHelpers(sourceFile) {
31353
+ return filter(getEmitHelpers(sourceFile), (helper) => !helper.scoped);
31354
+ }
31355
+ function getOrCreateExternalHelpersModuleNameIfNeeded(factory2, node, compilerOptions, helpers, hasExportStarsToExportValues, hasImportStarOrImportDefault) {
31356
+ const externalHelpersModuleName = getExternalHelpersModuleName(node);
31357
+ if (externalHelpersModuleName) {
31358
+ return externalHelpersModuleName;
31359
+ }
31360
+ const create = some(helpers) || (hasExportStarsToExportValues || getESModuleInterop(compilerOptions) && hasImportStarOrImportDefault) && getEmitModuleFormatOfFileWorker(node, compilerOptions) < 4 /* System */;
31361
+ if (create) {
31362
+ const parseNode = getOriginalNode(node, isSourceFile);
31363
+ const emitNode = getOrCreateEmitNode(parseNode);
31364
+ return emitNode.externalHelpersModuleName || (emitNode.externalHelpersModuleName = factory2.createUniqueName(externalHelpersModuleNameText));
31369
31365
  }
31370
31366
  }
31371
31367
  function getLocalNameForExternalImport(factory2, node, sourceFile) {
@@ -40542,15 +40538,6 @@ var commandOptionsWithoutBuild = [
40542
40538
  paramType: Diagnostics.FILE_OR_DIRECTORY,
40543
40539
  description: Diagnostics.Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json
40544
40540
  },
40545
- {
40546
- name: "build",
40547
- type: "boolean",
40548
- shortName: "b",
40549
- showInSimplifiedHelpView: true,
40550
- category: Diagnostics.Command_line_Options,
40551
- description: Diagnostics.Build_one_or_more_projects_and_their_dependencies_if_out_of_date,
40552
- defaultValueDescription: false
40553
- },
40554
40541
  {
40555
40542
  name: "showConfig",
40556
40543
  type: "boolean",
@@ -41535,7 +41522,17 @@ var commandLineOptionOfCustomType = optionDeclarations.filter(isCommandLineOptio
41535
41522
  function isCommandLineOptionOfCustomType(option) {
41536
41523
  return !isString(option.type);
41537
41524
  }
41525
+ var tscBuildOption = {
41526
+ name: "build",
41527
+ type: "boolean",
41528
+ shortName: "b",
41529
+ showInSimplifiedHelpView: true,
41530
+ category: Diagnostics.Command_line_Options,
41531
+ description: Diagnostics.Build_one_or_more_projects_and_their_dependencies_if_out_of_date,
41532
+ defaultValueDescription: false
41533
+ };
41538
41534
  var optionsForBuild = [
41535
+ tscBuildOption,
41539
41536
  {
41540
41537
  name: "verbose",
41541
41538
  shortName: "v",
@@ -41674,8 +41671,14 @@ function getOptionName(option) {
41674
41671
  }
41675
41672
  function createUnknownOptionError(unknownOption, diagnostics, unknownOptionErrorText, node, sourceFile) {
41676
41673
  var _a;
41677
- if ((_a = diagnostics.alternateMode) == null ? void 0 : _a.getOptionsNameMap().optionsNameMap.has(unknownOption.toLowerCase())) {
41678
- return createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, node, diagnostics.alternateMode.diagnostic, unknownOption);
41674
+ const otherOption = (_a = diagnostics.alternateMode) == null ? void 0 : _a.getOptionsNameMap().optionsNameMap.get(unknownOption.toLowerCase());
41675
+ if (otherOption) {
41676
+ return createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(
41677
+ sourceFile,
41678
+ node,
41679
+ otherOption !== tscBuildOption ? diagnostics.alternateMode.diagnostic : Diagnostics.Option_build_must_be_the_first_command_line_argument,
41680
+ unknownOption
41681
+ );
41679
41682
  }
41680
41683
  const possibleOption = getSpellingSuggestion(unknownOption, diagnostics.optionDeclarations, getOptionName);
41681
41684
  return possibleOption ? createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, node, diagnostics.unknownDidYouMeanDiagnostic, unknownOptionErrorText || unknownOption, possibleOption.name) : createDiagnosticForNodeInSourceFileOrCompilerDiagnostic(sourceFile, node, diagnostics.unknownOptionDiagnostic, unknownOptionErrorText || unknownOption);
@@ -41864,10 +41867,10 @@ var buildOptionsDidYouMeanDiagnostics = {
41864
41867
  unknownDidYouMeanDiagnostic: Diagnostics.Unknown_build_option_0_Did_you_mean_1,
41865
41868
  optionTypeMismatchDiagnostic: Diagnostics.Build_option_0_requires_a_value_of_type_1
41866
41869
  };
41867
- function parseBuildCommand(args) {
41870
+ function parseBuildCommand(commandLine) {
41868
41871
  const { options, watchOptions, fileNames: projects, errors } = parseCommandLineWorker(
41869
41872
  buildOptionsDidYouMeanDiagnostics,
41870
- args
41873
+ commandLine
41871
41874
  );
41872
41875
  const buildOptions = options;
41873
41876
  if (projects.length === 0) {
@@ -42810,7 +42813,7 @@ function parseConfig(json, sourceFile, host, basePath, configFileName, resolutio
42810
42813
  if (ownConfig.raw.compileOnSave === void 0 && result.compileOnSave) ownConfig.raw.compileOnSave = result.compileOnSave;
42811
42814
  if (sourceFile && result.extendedSourceFiles) sourceFile.extendedSourceFiles = arrayFrom(result.extendedSourceFiles.keys());
42812
42815
  ownConfig.options = assign(result.options, ownConfig.options);
42813
- ownConfig.watchOptions = ownConfig.watchOptions && result.watchOptions ? assign(result.watchOptions, ownConfig.watchOptions) : ownConfig.watchOptions || result.watchOptions;
42816
+ ownConfig.watchOptions = ownConfig.watchOptions && result.watchOptions ? assignWatchOptions(result, ownConfig.watchOptions) : ownConfig.watchOptions || result.watchOptions;
42814
42817
  }
42815
42818
  return ownConfig;
42816
42819
  function applyExtendedConfig(result, extendedConfigPath) {
@@ -42834,9 +42837,14 @@ function parseConfig(json, sourceFile, host, basePath, configFileName, resolutio
42834
42837
  result.compileOnSave = extendsRaw.compileOnSave;
42835
42838
  }
42836
42839
  assign(result.options, extendedConfig.options);
42837
- result.watchOptions = result.watchOptions && extendedConfig.watchOptions ? assign({}, result.watchOptions, extendedConfig.watchOptions) : result.watchOptions || extendedConfig.watchOptions;
42840
+ result.watchOptions = result.watchOptions && extendedConfig.watchOptions ? assignWatchOptions(result, extendedConfig.watchOptions) : result.watchOptions || extendedConfig.watchOptions;
42838
42841
  }
42839
42842
  }
42843
+ function assignWatchOptions(result, watchOptions) {
42844
+ if (result.watchOptionsCopied) return assign(result.watchOptions, watchOptions);
42845
+ result.watchOptionsCopied = true;
42846
+ return assign({}, result.watchOptions, watchOptions);
42847
+ }
42840
42848
  }
42841
42849
  function parseOwnConfigOfJson(json, host, basePath, configFileName, errors) {
42842
42850
  if (hasProperty(json, "excludes")) {
@@ -43879,7 +43887,7 @@ function getConditions(options, resolutionMode) {
43879
43887
  }
43880
43888
  function resolvePackageNameToPackageJson(packageName, containingDirectory, options, host, cache) {
43881
43889
  const moduleResolutionState = getTemporaryModuleResolutionState(cache == null ? void 0 : cache.getPackageJsonInfoCache(), host, options);
43882
- return forEachAncestorDirectory(containingDirectory, (ancestorDirectory) => {
43890
+ return forEachAncestorDirectoryStoppingAtGlobalCache(host, containingDirectory, (ancestorDirectory) => {
43883
43891
  if (getBaseFileName(ancestorDirectory) !== "node_modules") {
43884
43892
  const nodeModulesFolder = combinePaths(ancestorDirectory, "node_modules");
43885
43893
  const candidate = combinePaths(nodeModulesFolder, packageName);
@@ -45011,7 +45019,8 @@ function getTemporaryModuleResolutionState(packageJsonInfoCache, host, options)
45011
45019
  };
45012
45020
  }
45013
45021
  function getPackageScopeForPath(directory, state) {
45014
- return forEachAncestorDirectory(
45022
+ return forEachAncestorDirectoryStoppingAtGlobalCache(
45023
+ state.host,
45015
45024
  directory,
45016
45025
  (dir) => getPackageJsonInfo(
45017
45026
  dir,
@@ -45316,13 +45325,13 @@ function comparePatternKeys(a, b) {
45316
45325
  const bPatternIndex = b.indexOf("*");
45317
45326
  const baseLenA = aPatternIndex === -1 ? a.length : aPatternIndex + 1;
45318
45327
  const baseLenB = bPatternIndex === -1 ? b.length : bPatternIndex + 1;
45319
- if (baseLenA > baseLenB) return -1;
45320
- if (baseLenB > baseLenA) return 1;
45321
- if (aPatternIndex === -1) return 1;
45322
- if (bPatternIndex === -1) return -1;
45323
- if (a.length > b.length) return -1;
45324
- if (b.length > a.length) return 1;
45325
- return 0;
45328
+ if (baseLenA > baseLenB) return -1 /* LessThan */;
45329
+ if (baseLenB > baseLenA) return 1 /* GreaterThan */;
45330
+ if (aPatternIndex === -1) return 1 /* GreaterThan */;
45331
+ if (bPatternIndex === -1) return -1 /* LessThan */;
45332
+ if (a.length > b.length) return -1 /* LessThan */;
45333
+ if (b.length > a.length) return 1 /* GreaterThan */;
45334
+ return 0 /* EqualTo */;
45326
45335
  }
45327
45336
  function loadModuleFromImportsOrExports(extensions, state, cache, redirectedReference, moduleName, lookupTable, scope, isImports) {
45328
45337
  const loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, moduleName, scope, isImports);
@@ -45650,17 +45659,30 @@ function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName,
45650
45659
  return lookup(secondaryExtensions);
45651
45660
  }
45652
45661
  function lookup(extensions2) {
45653
- return forEachAncestorDirectory(normalizeSlashes(directory), (ancestorDirectory) => {
45654
- if (getBaseFileName(ancestorDirectory) !== "node_modules") {
45655
- const resolutionFromCache = tryFindNonRelativeModuleNameInCache(cache, moduleName, mode, ancestorDirectory, redirectedReference, state);
45656
- if (resolutionFromCache) {
45657
- return resolutionFromCache;
45662
+ return forEachAncestorDirectoryStoppingAtGlobalCache(
45663
+ state.host,
45664
+ normalizeSlashes(directory),
45665
+ (ancestorDirectory) => {
45666
+ if (getBaseFileName(ancestorDirectory) !== "node_modules") {
45667
+ const resolutionFromCache = tryFindNonRelativeModuleNameInCache(cache, moduleName, mode, ancestorDirectory, redirectedReference, state);
45668
+ if (resolutionFromCache) {
45669
+ return resolutionFromCache;
45670
+ }
45671
+ return toSearchResult(loadModuleFromImmediateNodeModulesDirectory(extensions2, moduleName, ancestorDirectory, state, typesScopeOnly, cache, redirectedReference));
45658
45672
  }
45659
- return toSearchResult(loadModuleFromImmediateNodeModulesDirectory(extensions2, moduleName, ancestorDirectory, state, typesScopeOnly, cache, redirectedReference));
45660
45673
  }
45661
- });
45674
+ );
45662
45675
  }
45663
45676
  }
45677
+ function forEachAncestorDirectoryStoppingAtGlobalCache(host, directory, callback) {
45678
+ var _a;
45679
+ const globalCache = (_a = host == null ? void 0 : host.getGlobalTypingsCacheLocation) == null ? void 0 : _a.call(host);
45680
+ return forEachAncestorDirectory(directory, (ancestorDirectory) => {
45681
+ const result = callback(ancestorDirectory);
45682
+ if (result !== void 0) return result;
45683
+ if (ancestorDirectory === globalCache) return false;
45684
+ }) || void 0;
45685
+ }
45664
45686
  function loadModuleFromImmediateNodeModulesDirectory(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) {
45665
45687
  const nodeModulesFolder = combinePaths(directory, "node_modules");
45666
45688
  const nodeModulesFolderExists = directoryProbablyExists(nodeModulesFolder, state.host);
@@ -45856,28 +45878,32 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
45856
45878
  return { value: resolvedUsingSettings };
45857
45879
  }
45858
45880
  if (!isExternalModuleNameRelative(moduleName)) {
45859
- const resolved2 = forEachAncestorDirectory(containingDirectory, (directory) => {
45860
- const resolutionFromCache = tryFindNonRelativeModuleNameInCache(
45861
- cache,
45862
- moduleName,
45863
- /*mode*/
45864
- void 0,
45865
- directory,
45866
- redirectedReference,
45867
- state
45868
- );
45869
- if (resolutionFromCache) {
45870
- return resolutionFromCache;
45881
+ const resolved2 = forEachAncestorDirectoryStoppingAtGlobalCache(
45882
+ state.host,
45883
+ containingDirectory,
45884
+ (directory) => {
45885
+ const resolutionFromCache = tryFindNonRelativeModuleNameInCache(
45886
+ cache,
45887
+ moduleName,
45888
+ /*mode*/
45889
+ void 0,
45890
+ directory,
45891
+ redirectedReference,
45892
+ state
45893
+ );
45894
+ if (resolutionFromCache) {
45895
+ return resolutionFromCache;
45896
+ }
45897
+ const searchName = normalizePath(combinePaths(directory, moduleName));
45898
+ return toSearchResult(loadModuleFromFileNoPackageId(
45899
+ extensions,
45900
+ searchName,
45901
+ /*onlyRecordFailures*/
45902
+ false,
45903
+ state
45904
+ ));
45871
45905
  }
45872
- const searchName = normalizePath(combinePaths(directory, moduleName));
45873
- return toSearchResult(loadModuleFromFileNoPackageId(
45874
- extensions,
45875
- searchName,
45876
- /*onlyRecordFailures*/
45877
- false,
45878
- state
45879
- ));
45880
- });
45906
+ );
45881
45907
  if (resolved2) return resolved2;
45882
45908
  if (extensions & (1 /* TypeScript */ | 4 /* Declaration */)) {
45883
45909
  let resolved3 = loadModuleFromNearestNodeModulesDirectoryTypesScope(moduleName, containingDirectory, state);
@@ -45920,7 +45946,7 @@ function resolveFromTypeRoot(moduleName, state) {
45920
45946
  }
45921
45947
  }
45922
45948
  function shouldAllowImportingTsExtension(compilerOptions, fromFileName) {
45923
- return !!compilerOptions.allowImportingTsExtensions || fromFileName && isDeclarationFileName(fromFileName);
45949
+ return !!compilerOptions.allowImportingTsExtensions || !!fromFileName && isDeclarationFileName(fromFileName);
45924
45950
  }
45925
45951
  function loadModuleFromGlobalCache(moduleName, projectName, compilerOptions, host, globalCache, packageJsonInfoCache) {
45926
45952
  const traceEnabled = isTraceEnabled(compilerOptions, host);
@@ -49502,9 +49528,11 @@ function getNearestAncestorDirectoryWithPackageJson(host, fileName) {
49502
49528
  if (host.getNearestAncestorDirectoryWithPackageJson) {
49503
49529
  return host.getNearestAncestorDirectoryWithPackageJson(fileName);
49504
49530
  }
49505
- return forEachAncestorDirectory(fileName, (directory) => {
49506
- return host.fileExists(combinePaths(directory, "package.json")) ? directory : void 0;
49507
- });
49531
+ return forEachAncestorDirectoryStoppingAtGlobalCache(
49532
+ host,
49533
+ fileName,
49534
+ (directory) => host.fileExists(combinePaths(directory, "package.json")) ? directory : void 0
49535
+ );
49508
49536
  }
49509
49537
  function forEachFileNameOfModule(importingFileName, importedFileName, host, preferSymlinks, cb) {
49510
49538
  var _a;
@@ -49522,25 +49550,29 @@ function forEachFileNameOfModule(importingFileName, importedFileName, host, pref
49522
49550
  }
49523
49551
  const symlinkedDirectories = (_a = host.getSymlinkCache) == null ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath();
49524
49552
  const fullImportedFileName = getNormalizedAbsolutePath(importedFileName, cwd);
49525
- const result = symlinkedDirectories && forEachAncestorDirectory(getDirectoryPath(fullImportedFileName), (realPathDirectory) => {
49526
- const symlinkDirectories = symlinkedDirectories.get(ensureTrailingDirectorySeparator(toPath(realPathDirectory, cwd, getCanonicalFileName)));
49527
- if (!symlinkDirectories) return void 0;
49528
- if (startsWithDirectory(importingFileName, realPathDirectory, getCanonicalFileName)) {
49529
- return false;
49530
- }
49531
- return forEach(targets, (target) => {
49532
- if (!startsWithDirectory(target, realPathDirectory, getCanonicalFileName)) {
49533
- return;
49534
- }
49535
- const relative = getRelativePathFromDirectory(realPathDirectory, target, getCanonicalFileName);
49536
- for (const symlinkDirectory of symlinkDirectories) {
49537
- const option = resolvePath(symlinkDirectory, relative);
49538
- const result2 = cb(option, target === referenceRedirect);
49539
- shouldFilterIgnoredPaths = true;
49540
- if (result2) return result2;
49553
+ const result = symlinkedDirectories && forEachAncestorDirectoryStoppingAtGlobalCache(
49554
+ host,
49555
+ getDirectoryPath(fullImportedFileName),
49556
+ (realPathDirectory) => {
49557
+ const symlinkDirectories = symlinkedDirectories.get(ensureTrailingDirectorySeparator(toPath(realPathDirectory, cwd, getCanonicalFileName)));
49558
+ if (!symlinkDirectories) return void 0;
49559
+ if (startsWithDirectory(importingFileName, realPathDirectory, getCanonicalFileName)) {
49560
+ return false;
49541
49561
  }
49542
- });
49543
- });
49562
+ return forEach(targets, (target) => {
49563
+ if (!startsWithDirectory(target, realPathDirectory, getCanonicalFileName)) {
49564
+ return;
49565
+ }
49566
+ const relative = getRelativePathFromDirectory(realPathDirectory, target, getCanonicalFileName);
49567
+ for (const symlinkDirectory of symlinkDirectories) {
49568
+ const option = resolvePath(symlinkDirectory, relative);
49569
+ const result2 = cb(option, target === referenceRedirect);
49570
+ shouldFilterIgnoredPaths = true;
49571
+ if (result2) return result2;
49572
+ }
49573
+ });
49574
+ }
49575
+ );
49544
49576
  return result || (preferSymlinks ? forEach(targets, (p) => shouldFilterIgnoredPaths && containsIgnoredPath(p) ? void 0 : cb(p, p === referenceRedirect)) : void 0);
49545
49577
  }
49546
49578
  function getAllModulePaths(info, importedFileName, host, preferences, compilerOptions, options = {}) {
@@ -50439,6 +50471,7 @@ function createTypeChecker(host) {
50439
50471
  getBaseTypeOfLiteralType,
50440
50472
  getWidenedType,
50441
50473
  getWidenedLiteralType,
50474
+ fillMissingTypeArguments,
50442
50475
  getTypeFromTypeNode: (nodeIn) => {
50443
50476
  const node = getParseTreeNode(nodeIn, isTypeNode);
50444
50477
  return node ? getTypeFromTypeNode(node) : errorType;
@@ -60970,20 +61003,11 @@ function createTypeChecker(host) {
60970
61003
  return type;
60971
61004
  }
60972
61005
  function isLateBindableName(node) {
60973
- return isLateBindableAST(node) && isTypeUsableAsPropertyName(isComputedPropertyName(node) ? checkComputedPropertyName(node) : checkExpressionCached(node.argumentExpression));
60974
- }
60975
- function isLateBindableIndexSignature(node) {
60976
- return isLateBindableAST(node) && isTypeUsableAsIndexSignature(isComputedPropertyName(node) ? checkComputedPropertyName(node) : checkExpressionCached(node.argumentExpression));
60977
- }
60978
- function isLateBindableAST(node) {
60979
61006
  if (!isComputedPropertyName(node) && !isElementAccessExpression(node)) {
60980
61007
  return false;
60981
61008
  }
60982
61009
  const expr = isComputedPropertyName(node) ? node.expression : node.argumentExpression;
60983
- return isEntityNameExpression(expr);
60984
- }
60985
- function isTypeUsableAsIndexSignature(type) {
60986
- return isTypeAssignableTo(type, stringNumberSymbolType);
61010
+ return isEntityNameExpression(expr) && isTypeUsableAsPropertyName(isComputedPropertyName(node) ? checkComputedPropertyName(node) : checkExpressionCached(expr));
60987
61011
  }
60988
61012
  function isLateBoundName(name) {
60989
61013
  return name.charCodeAt(0) === 95 /* _ */ && name.charCodeAt(1) === 95 /* _ */ && name.charCodeAt(2) === 64 /* at */;
@@ -60992,10 +61016,6 @@ function createTypeChecker(host) {
60992
61016
  const name = getNameOfDeclaration(node);
60993
61017
  return !!name && isLateBindableName(name);
60994
61018
  }
60995
- function hasLateBindableIndexSignature(node) {
60996
- const name = getNameOfDeclaration(node);
60997
- return !!name && isLateBindableIndexSignature(name);
60998
- }
60999
61019
  function hasBindableName(node) {
61000
61020
  return !hasDynamicName(node) || hasLateBindableName(node);
61001
61021
  }
@@ -61049,24 +61069,6 @@ function createTypeChecker(host) {
61049
61069
  }
61050
61070
  return links.resolvedSymbol;
61051
61071
  }
61052
- function lateBindIndexSignature(parent2, earlySymbols, lateSymbols, decl) {
61053
- let indexSymbol = lateSymbols.get("__index" /* Index */);
61054
- if (!indexSymbol) {
61055
- const early = earlySymbols == null ? void 0 : earlySymbols.get("__index" /* Index */);
61056
- if (!early) {
61057
- indexSymbol = createSymbol(0 /* None */, "__index" /* Index */, 4096 /* Late */);
61058
- } else {
61059
- indexSymbol = cloneSymbol(early);
61060
- indexSymbol.links.checkFlags |= 4096 /* Late */;
61061
- }
61062
- lateSymbols.set("__index" /* Index */, indexSymbol);
61063
- }
61064
- if (!indexSymbol.declarations) {
61065
- indexSymbol.declarations = [decl];
61066
- } else if (!decl.symbol.isReplaceableByMethod) {
61067
- indexSymbol.declarations.push(decl);
61068
- }
61069
- }
61070
61072
  function getResolvedMembersOrExportsOfSymbol(symbol, resolutionKind) {
61071
61073
  const links = getSymbolLinks(symbol);
61072
61074
  if (!links[resolutionKind]) {
@@ -61081,8 +61083,6 @@ function createTypeChecker(host) {
61081
61083
  if (isStatic2 === hasStaticModifier(member)) {
61082
61084
  if (hasLateBindableName(member)) {
61083
61085
  lateBindMember(symbol, earlySymbols, lateSymbols, member);
61084
- } else if (hasLateBindableIndexSignature(member)) {
61085
- lateBindIndexSignature(symbol, earlySymbols, lateSymbols, member);
61086
61086
  }
61087
61087
  }
61088
61088
  }
@@ -63346,7 +63346,7 @@ function createTypeChecker(host) {
63346
63346
  return signature.isolatedSignatureType;
63347
63347
  }
63348
63348
  function getIndexSymbol(symbol) {
63349
- return symbol.members ? getIndexSymbolFromSymbolTable(getMembersOfSymbol(symbol)) : void 0;
63349
+ return symbol.members ? getIndexSymbolFromSymbolTable(symbol.members) : void 0;
63350
63350
  }
63351
63351
  function getIndexSymbolFromSymbolTable(symbolTable) {
63352
63352
  return symbolTable.get("__index" /* Index */);
@@ -63362,25 +63362,15 @@ function createTypeChecker(host) {
63362
63362
  if (indexSymbol.declarations) {
63363
63363
  const indexInfos = [];
63364
63364
  for (const declaration of indexSymbol.declarations) {
63365
- if (isIndexSignatureDeclaration(declaration)) {
63366
- if (declaration.parameters.length === 1) {
63367
- const parameter = declaration.parameters[0];
63368
- if (parameter.type) {
63369
- forEachType(getTypeFromTypeNode(parameter.type), (keyType) => {
63370
- if (isValidIndexKeyType(keyType) && !findIndexInfo(indexInfos, keyType)) {
63371
- indexInfos.push(createIndexInfo(keyType, declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, hasEffectiveModifier(declaration, 8 /* Readonly */), declaration));
63372
- }
63373
- });
63374
- }
63365
+ if (declaration.parameters.length === 1) {
63366
+ const parameter = declaration.parameters[0];
63367
+ if (parameter.type) {
63368
+ forEachType(getTypeFromTypeNode(parameter.type), (keyType) => {
63369
+ if (isValidIndexKeyType(keyType) && !findIndexInfo(indexInfos, keyType)) {
63370
+ indexInfos.push(createIndexInfo(keyType, declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, hasEffectiveModifier(declaration, 8 /* Readonly */), declaration));
63371
+ }
63372
+ });
63375
63373
  }
63376
- } else if (hasLateBindableIndexSignature(declaration)) {
63377
- const declName = isBinaryExpression(declaration) ? declaration.left : declaration.name;
63378
- const keyType = isElementAccessExpression(declName) ? checkExpressionCached(declName.argumentExpression) : checkComputedPropertyName(declName);
63379
- forEachType(keyType, (keyType2) => {
63380
- if (isValidIndexKeyType(keyType2) && !findIndexInfo(indexInfos, keyType2)) {
63381
- indexInfos.push(createIndexInfo(keyType2, getTypeOfVariableOrParameterOrProperty(declaration.symbol), hasEffectiveModifier(declaration, 8 /* Readonly */)));
63382
- }
63383
- });
63384
63374
  }
63385
63375
  }
63386
63376
  return indexInfos;
@@ -71554,7 +71544,8 @@ function createTypeChecker(host) {
71554
71544
  priority: void 0,
71555
71545
  topLevel: true,
71556
71546
  isFixed: false,
71557
- impliedArity: void 0
71547
+ impliedArity: void 0,
71548
+ indexes: void 0
71558
71549
  };
71559
71550
  }
71560
71551
  function cloneInferenceInfo(inference) {
@@ -71566,7 +71557,8 @@ function createTypeChecker(host) {
71566
71557
  priority: inference.priority,
71567
71558
  topLevel: inference.topLevel,
71568
71559
  isFixed: inference.isFixed,
71569
- impliedArity: inference.impliedArity
71560
+ impliedArity: inference.impliedArity,
71561
+ indexes: inference.indexes && inference.indexes.slice()
71570
71562
  };
71571
71563
  }
71572
71564
  function cloneInferredPartOfContext(context) {
@@ -71684,7 +71676,7 @@ function createTypeChecker(host) {
71684
71676
  const templateType = getTemplateTypeFromMappedType(target);
71685
71677
  const inference = createInferenceInfo(typeParameter);
71686
71678
  inferTypes([inference], sourceType, templateType);
71687
- return getTypeFromInference(inference) || unknownType;
71679
+ return getTypeFromInference(inference) || (inference.indexes ? getIntersectionType(inference.indexes) : unknownType);
71688
71680
  }
71689
71681
  function inferReverseMappedType(source, target, constraint) {
71690
71682
  const cacheKey = source.id + "," + target.id + "," + constraint.id;
@@ -72031,6 +72023,24 @@ function createTypeChecker(host) {
72031
72023
  } else if (source.flags & 8388608 /* IndexedAccess */ && target.flags & 8388608 /* IndexedAccess */) {
72032
72024
  inferFromTypes(source.objectType, target.objectType);
72033
72025
  inferFromTypes(source.indexType, target.indexType);
72026
+ } else if (!(priority & 1 /* NakedTypeVariable */) && target.flags & 8388608 /* IndexedAccess */) {
72027
+ if (isFromInferenceBlockedSource(source)) {
72028
+ return;
72029
+ }
72030
+ const inference = getInferenceInfoForType(getActualTypeVariable(target.objectType));
72031
+ if (inference) {
72032
+ if (getObjectFlags(source) & 262144 /* NonInferrableType */ || source === nonInferrableAnyType) {
72033
+ return;
72034
+ }
72035
+ if (!inference.isFixed) {
72036
+ const inferenceTypeSymbol = getGlobalSymbol("PartialInference", 788968 /* Type */, Diagnostics.Cannot_find_global_type_0);
72037
+ const inferenceType = inferenceTypeSymbol && getDeclaredTypeOfSymbol(inferenceTypeSymbol);
72038
+ if (inferenceType && inferenceType !== unknownType) {
72039
+ const mapper = createTypeMapper(getSymbolLinks(inferenceTypeSymbol).typeParameters, [source, target.indexType]);
72040
+ inference.indexes = append(inference.indexes, instantiateType(inferenceType, mapper));
72041
+ }
72042
+ }
72043
+ }
72034
72044
  } else if (source.flags & 268435456 /* StringMapping */ && target.flags & 268435456 /* StringMapping */) {
72035
72045
  if (source.symbol === target.symbol) {
72036
72046
  inferFromTypes(source.type, target.type);
@@ -72534,6 +72544,51 @@ function createTypeChecker(host) {
72534
72544
  const preferCovariantType = inferredCovariantType && (!inferredContravariantType || !(inferredCovariantType.flags & (131072 /* Never */ | 1 /* Any */)) && some(inference.contraCandidates, (t) => isTypeAssignableTo(inferredCovariantType, t)) && every(context.inferences, (other) => other !== inference && getConstraintOfTypeParameter(other.typeParameter) !== inference.typeParameter || every(other.candidates, (t) => isTypeAssignableTo(t, inferredCovariantType))));
72535
72545
  inferredType = preferCovariantType ? inferredCovariantType : inferredContravariantType;
72536
72546
  fallbackType = preferCovariantType ? inferredContravariantType : inferredCovariantType;
72547
+ } else if (inference.indexes) {
72548
+ let aggregateInference = getIntersectionType(inference.indexes);
72549
+ const constraint2 = getConstraintOfTypeParameter(inference.typeParameter);
72550
+ if (constraint2) {
72551
+ const instantiatedConstraint = instantiateType(constraint2, context.nonFixingMapper);
72552
+ if (instantiatedConstraint.flags & 1048576 /* Union */ && !context.compareTypes(aggregateInference, getTypeWithThisArgument(instantiatedConstraint, aggregateInference))) {
72553
+ const discriminantProps = findDiscriminantProperties(getPropertiesOfType(aggregateInference), instantiatedConstraint);
72554
+ if (discriminantProps) {
72555
+ let match;
72556
+ findDiscriminant:
72557
+ for (const p of discriminantProps) {
72558
+ const candidatePropType = getTypeOfPropertyOfType(aggregateInference, p.escapedName);
72559
+ for (const type of instantiatedConstraint.types) {
72560
+ const propType = getTypeOfPropertyOfType(type, p.escapedName);
72561
+ if (propType && candidatePropType && checkTypeAssignableTo(
72562
+ candidatePropType,
72563
+ propType,
72564
+ /*errorNode*/
72565
+ void 0
72566
+ )) {
72567
+ if (match && match !== type) {
72568
+ match = void 0;
72569
+ break findDiscriminant;
72570
+ } else {
72571
+ match = type;
72572
+ }
72573
+ }
72574
+ }
72575
+ }
72576
+ if (match) {
72577
+ aggregateInference = getSpreadType(
72578
+ match,
72579
+ aggregateInference,
72580
+ /*symbol*/
72581
+ void 0,
72582
+ /*propegatedFlags*/
72583
+ 0,
72584
+ /*readonly*/
72585
+ false
72586
+ );
72587
+ }
72588
+ }
72589
+ }
72590
+ }
72591
+ inferredType = aggregateInference;
72537
72592
  } else if (context.flags & 1 /* NoDefault */) {
72538
72593
  inferredType = silentNeverType;
72539
72594
  } else {
@@ -77113,7 +77168,7 @@ function createTypeChecker(host) {
77113
77168
  return globalRegExpType;
77114
77169
  }
77115
77170
  function checkSpreadExpression(node, checkMode) {
77116
- if (languageVersion < 2 /* SpreadElements */) {
77171
+ if (languageVersion < LanguageFeatureMinimumTarget.SpreadElements) {
77117
77172
  checkExternalEmitHelpers(node, compilerOptions.downlevelIteration ? 1536 /* SpreadIncludes */ : 1024 /* SpreadArray */);
77118
77173
  }
77119
77174
  const arrayOrIterableType = checkExpression(node.expression, checkMode);
@@ -77147,7 +77202,7 @@ function createTypeChecker(host) {
77147
77202
  for (let i = 0; i < elementCount; i++) {
77148
77203
  const e = elements[i];
77149
77204
  if (e.kind === 230 /* SpreadElement */) {
77150
- if (languageVersion < 2 /* SpreadElements */) {
77205
+ if (languageVersion < LanguageFeatureMinimumTarget.SpreadElements) {
77151
77206
  checkExternalEmitHelpers(e, compilerOptions.downlevelIteration ? 1536 /* SpreadIncludes */ : 1024 /* SpreadArray */);
77152
77207
  }
77153
77208
  const spreadType = checkExpression(e.expression, checkMode, forceTuple);
@@ -77372,7 +77427,7 @@ function createTypeChecker(host) {
77372
77427
  addIntraExpressionInferenceSite(inferenceContext, inferenceNode, type);
77373
77428
  }
77374
77429
  } else if (memberDecl.kind === 305 /* SpreadAssignment */) {
77375
- if (languageVersion < 2 /* ObjectAssign */) {
77430
+ if (languageVersion < LanguageFeatureMinimumTarget.ObjectAssign) {
77376
77431
  checkExternalEmitHelpers(memberDecl, 2 /* Assign */);
77377
77432
  }
77378
77433
  if (propertiesArray.length > 0) {
@@ -78349,7 +78404,7 @@ function createTypeChecker(host) {
78349
78404
  const isAnyLike = isTypeAny(apparentType) || apparentType === silentNeverType;
78350
78405
  let prop;
78351
78406
  if (isPrivateIdentifier(right)) {
78352
- if (languageVersion < 9 /* PrivateNamesAndClassStaticBlocks */ || languageVersion < 99 /* ClassAndClassElementDecorators */ || !useDefineForClassFields) {
78407
+ if (languageVersion < LanguageFeatureMinimumTarget.PrivateNamesAndClassStaticBlocks || languageVersion < LanguageFeatureMinimumTarget.ClassAndClassElementDecorators || !useDefineForClassFields) {
78353
78408
  if (assignmentKind !== 0 /* None */) {
78354
78409
  checkExternalEmitHelpers(node, 1048576 /* ClassPrivateFieldSet */);
78355
78410
  }
@@ -80966,7 +81021,7 @@ function createTypeChecker(host) {
80966
81021
  }
80967
81022
  function checkTaggedTemplateExpression(node) {
80968
81023
  if (!checkGrammarTaggedTemplateChain(node)) checkGrammarTypeArguments(node, node.typeArguments);
80969
- if (languageVersion < 2 /* TaggedTemplates */) {
81024
+ if (languageVersion < LanguageFeatureMinimumTarget.TaggedTemplates) {
80970
81025
  checkExternalEmitHelpers(node, 262144 /* MakeTemplateObject */);
80971
81026
  }
80972
81027
  const signature = getResolvedSignature(node);
@@ -82678,7 +82733,7 @@ function createTypeChecker(host) {
82678
82733
  return silentNeverType;
82679
82734
  }
82680
82735
  if (isPrivateIdentifier(left)) {
82681
- if (languageVersion < 9 /* PrivateNamesAndClassStaticBlocks */ || languageVersion < 99 /* ClassAndClassElementDecorators */ || !useDefineForClassFields) {
82736
+ if (languageVersion < LanguageFeatureMinimumTarget.PrivateNamesAndClassStaticBlocks || languageVersion < LanguageFeatureMinimumTarget.ClassAndClassElementDecorators || !useDefineForClassFields) {
82682
82737
  checkExternalEmitHelpers(left, 2097152 /* ClassPrivateFieldIn */);
82683
82738
  }
82684
82739
  if (!getNodeLinks(left).resolvedSymbol && getContainingClass(left)) {
@@ -82739,7 +82794,7 @@ function createTypeChecker(host) {
82739
82794
  if (propertyIndex < properties.length - 1) {
82740
82795
  error2(property, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern);
82741
82796
  } else {
82742
- if (languageVersion < 5 /* ObjectSpreadRest */) {
82797
+ if (languageVersion < LanguageFeatureMinimumTarget.ObjectSpreadRest) {
82743
82798
  checkExternalEmitHelpers(property, 4 /* Rest */);
82744
82799
  }
82745
82800
  const nonRestNames = [];
@@ -82760,7 +82815,7 @@ function createTypeChecker(host) {
82760
82815
  }
82761
82816
  function checkArrayLiteralAssignment(node, sourceType, checkMode) {
82762
82817
  const elements = node.elements;
82763
- if (languageVersion < 2 /* DestructuringAssignment */ && compilerOptions.downlevelIteration) {
82818
+ if (languageVersion < LanguageFeatureMinimumTarget.DestructuringAssignment && compilerOptions.downlevelIteration) {
82764
82819
  checkExternalEmitHelpers(node, 512 /* Read */);
82765
82820
  }
82766
82821
  const possiblyOutOfBoundsType = checkIteratedTypeOrElementType(65 /* Destructuring */ | 128 /* PossiblyOutOfBounds */, sourceType, undefinedType, node) || errorType;
@@ -83534,10 +83589,10 @@ function createTypeChecker(host) {
83534
83589
  }
83535
83590
  const isAsync = (functionFlags & 2 /* Async */) !== 0;
83536
83591
  if (node.asteriskToken) {
83537
- if (isAsync && languageVersion < 5 /* AsyncGenerators */) {
83592
+ if (isAsync && languageVersion < LanguageFeatureMinimumTarget.AsyncGenerators) {
83538
83593
  checkExternalEmitHelpers(node, 26624 /* AsyncDelegatorIncludes */);
83539
83594
  }
83540
- if (!isAsync && languageVersion < 2 /* Generators */ && compilerOptions.downlevelIteration) {
83595
+ if (!isAsync && languageVersion < LanguageFeatureMinimumTarget.Generators && compilerOptions.downlevelIteration) {
83541
83596
  checkExternalEmitHelpers(node, 256 /* Values */);
83542
83597
  }
83543
83598
  }
@@ -84367,13 +84422,13 @@ function createTypeChecker(host) {
84367
84422
  }
84368
84423
  const functionFlags = getFunctionFlags(node);
84369
84424
  if (!(functionFlags & 4 /* Invalid */)) {
84370
- if ((functionFlags & 3 /* AsyncGenerator */) === 3 /* AsyncGenerator */ && languageVersion < 5 /* AsyncGenerators */) {
84425
+ if ((functionFlags & 3 /* AsyncGenerator */) === 3 /* AsyncGenerator */ && languageVersion < LanguageFeatureMinimumTarget.AsyncGenerators) {
84371
84426
  checkExternalEmitHelpers(node, 6144 /* AsyncGeneratorIncludes */);
84372
84427
  }
84373
- if ((functionFlags & 3 /* AsyncGenerator */) === 2 /* Async */ && languageVersion < 4 /* AsyncFunctions */) {
84428
+ if ((functionFlags & 3 /* AsyncGenerator */) === 2 /* Async */ && languageVersion < LanguageFeatureMinimumTarget.AsyncFunctions) {
84374
84429
  checkExternalEmitHelpers(node, 64 /* Awaiter */);
84375
84430
  }
84376
- if ((functionFlags & 3 /* AsyncGenerator */) !== 0 /* Normal */ && languageVersion < 2 /* Generators */) {
84431
+ if ((functionFlags & 3 /* AsyncGenerator */) !== 0 /* Normal */ && languageVersion < LanguageFeatureMinimumTarget.Generators) {
84377
84432
  checkExternalEmitHelpers(node, 128 /* Generator */);
84378
84433
  }
84379
84434
  }
@@ -84556,17 +84611,15 @@ function createTypeChecker(host) {
84556
84611
  if (indexSymbol == null ? void 0 : indexSymbol.declarations) {
84557
84612
  const indexSignatureMap = /* @__PURE__ */ new Map();
84558
84613
  for (const declaration of indexSymbol.declarations) {
84559
- if (isIndexSignatureDeclaration(declaration)) {
84560
- if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
84561
- forEachType(getTypeFromTypeNode(declaration.parameters[0].type), (type) => {
84562
- const entry = indexSignatureMap.get(getTypeId(type));
84563
- if (entry) {
84564
- entry.declarations.push(declaration);
84565
- } else {
84566
- indexSignatureMap.set(getTypeId(type), { type, declarations: [declaration] });
84567
- }
84568
- });
84569
- }
84614
+ if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
84615
+ forEachType(getTypeFromTypeNode(declaration.parameters[0].type), (type) => {
84616
+ const entry = indexSignatureMap.get(getTypeId(type));
84617
+ if (entry) {
84618
+ entry.declarations.push(declaration);
84619
+ } else {
84620
+ indexSignatureMap.set(getTypeId(type), { type, declarations: [declaration] });
84621
+ }
84622
+ });
84570
84623
  }
84571
84624
  }
84572
84625
  indexSignatureMap.forEach((entry) => {
@@ -84608,7 +84661,7 @@ function createTypeChecker(host) {
84608
84661
  }
84609
84662
  function setNodeLinksForPrivateIdentifierScope(node) {
84610
84663
  if (isPrivateIdentifier(node.name)) {
84611
- if (languageVersion < 9 /* PrivateNamesAndClassStaticBlocks */ || languageVersion < 99 /* ClassAndClassElementDecorators */ || !useDefineForClassFields) {
84664
+ if (languageVersion < LanguageFeatureMinimumTarget.PrivateNamesAndClassStaticBlocks || languageVersion < LanguageFeatureMinimumTarget.ClassAndClassElementDecorators || !useDefineForClassFields) {
84612
84665
  for (let lexicalScope = getEnclosingBlockScopeContainer(node); !!lexicalScope; lexicalScope = getEnclosingBlockScopeContainer(lexicalScope)) {
84613
84666
  getNodeLinks(lexicalScope).flags |= 1048576 /* ContainsClassWithPrivateIdentifiers */;
84614
84667
  }
@@ -85748,7 +85801,7 @@ function createTypeChecker(host) {
85748
85801
  if (node.kind === 169 /* Parameter */) {
85749
85802
  checkExternalEmitHelpers(firstDecorator, 32 /* Param */);
85750
85803
  }
85751
- } else if (languageVersion < 99 /* ClassAndClassElementDecorators */) {
85804
+ } else if (languageVersion < LanguageFeatureMinimumTarget.ClassAndClassElementDecorators) {
85752
85805
  checkExternalEmitHelpers(firstDecorator, 8 /* ESDecorateAndRunInitializers */);
85753
85806
  if (isClassDeclaration(node)) {
85754
85807
  if (!node.name) {
@@ -86414,7 +86467,7 @@ function createTypeChecker(host) {
86414
86467
  potentialUnusedRenamedBindingElementsInTypes.push(node);
86415
86468
  return;
86416
86469
  }
86417
- if (isObjectBindingPattern(node.parent) && node.dotDotDotToken && languageVersion < 5 /* ObjectSpreadRest */) {
86470
+ if (isObjectBindingPattern(node.parent) && node.dotDotDotToken && languageVersion < LanguageFeatureMinimumTarget.ObjectSpreadRest) {
86418
86471
  checkExternalEmitHelpers(node, 4 /* Rest */);
86419
86472
  }
86420
86473
  if (node.propertyName && node.propertyName.kind === 167 /* ComputedPropertyName */) {
@@ -86450,7 +86503,7 @@ function createTypeChecker(host) {
86450
86503
  }
86451
86504
  }
86452
86505
  if (isBindingPattern(node.name)) {
86453
- if (node.name.kind === 207 /* ArrayBindingPattern */ && languageVersion < 2 /* BindingPatterns */ && compilerOptions.downlevelIteration) {
86506
+ if (node.name.kind === 207 /* ArrayBindingPattern */ && languageVersion < LanguageFeatureMinimumTarget.BindingPatterns && compilerOptions.downlevelIteration) {
86454
86507
  checkExternalEmitHelpers(node, 512 /* Read */);
86455
86508
  }
86456
86509
  forEach(node.name.elements, checkSourceElement);
@@ -86604,7 +86657,7 @@ function createTypeChecker(host) {
86604
86657
  }
86605
86658
  function checkVariableDeclarationList(node) {
86606
86659
  const blockScopeKind = getCombinedNodeFlags(node) & 7 /* BlockScoped */;
86607
- if ((blockScopeKind === 4 /* Using */ || blockScopeKind === 6 /* AwaitUsing */) && languageVersion < 99 /* UsingAndAwaitUsing */) {
86660
+ if ((blockScopeKind === 4 /* Using */ || blockScopeKind === 6 /* AwaitUsing */) && languageVersion < LanguageFeatureMinimumTarget.UsingAndAwaitUsing) {
86608
86661
  checkExternalEmitHelpers(node, 16777216 /* AddDisposableResourceAndDisposeResources */);
86609
86662
  }
86610
86663
  forEach(node.declarations, checkSourceElement);
@@ -86818,11 +86871,11 @@ function createTypeChecker(host) {
86818
86871
  grammarErrorOnNode(node.awaitModifier, Diagnostics.for_await_loops_cannot_be_used_inside_a_class_static_block);
86819
86872
  } else {
86820
86873
  const functionFlags = getFunctionFlags(container);
86821
- if ((functionFlags & (4 /* Invalid */ | 2 /* Async */)) === 2 /* Async */ && languageVersion < 5 /* ForAwaitOf */) {
86874
+ if ((functionFlags & (4 /* Invalid */ | 2 /* Async */)) === 2 /* Async */ && languageVersion < LanguageFeatureMinimumTarget.ForAwaitOf) {
86822
86875
  checkExternalEmitHelpers(node, 16384 /* ForAwaitOfIncludes */);
86823
86876
  }
86824
86877
  }
86825
- } else if (compilerOptions.downlevelIteration && languageVersion < 2 /* ForOf */) {
86878
+ } else if (compilerOptions.downlevelIteration && languageVersion < LanguageFeatureMinimumTarget.ForOf) {
86826
86879
  checkExternalEmitHelpers(node, 256 /* ForOfIncludes */);
86827
86880
  }
86828
86881
  if (node.initializer.kind === 261 /* VariableDeclarationList */) {
@@ -87863,12 +87916,12 @@ function createTypeChecker(host) {
87863
87916
  return true;
87864
87917
  }
87865
87918
  function getFirstTransformableStaticClassElement(node) {
87866
- const willTransformStaticElementsOfDecoratedClass = !legacyDecorators && languageVersion < 99 /* ClassAndClassElementDecorators */ && classOrConstructorParameterIsDecorated(
87919
+ const willTransformStaticElementsOfDecoratedClass = !legacyDecorators && languageVersion < LanguageFeatureMinimumTarget.ClassAndClassElementDecorators && classOrConstructorParameterIsDecorated(
87867
87920
  /*useLegacyDecorators*/
87868
87921
  false,
87869
87922
  node
87870
87923
  );
87871
- const willTransformPrivateElementsOrClassStaticBlocks = languageVersion < 9 /* PrivateNamesAndClassStaticBlocks */ || languageVersion < 99 /* ClassAndClassElementDecorators */;
87924
+ const willTransformPrivateElementsOrClassStaticBlocks = languageVersion < LanguageFeatureMinimumTarget.PrivateNamesAndClassStaticBlocks || languageVersion < LanguageFeatureMinimumTarget.ClassAndClassElementDecorators;
87872
87925
  const willTransformInitializers = !emitStandardClassFields;
87873
87926
  if (willTransformStaticElementsOfDecoratedClass || willTransformPrivateElementsOrClassStaticBlocks) {
87874
87927
  for (const member of node.members) {
@@ -87895,7 +87948,7 @@ function createTypeChecker(host) {
87895
87948
  if (node.name) return;
87896
87949
  const parent2 = walkUpOuterExpressions(node);
87897
87950
  if (!isNamedEvaluationSource(parent2)) return;
87898
- const willTransformESDecorators = !legacyDecorators && languageVersion < 99 /* ClassAndClassElementDecorators */;
87951
+ const willTransformESDecorators = !legacyDecorators && languageVersion < LanguageFeatureMinimumTarget.ClassAndClassElementDecorators;
87899
87952
  let location;
87900
87953
  if (willTransformESDecorators && classOrConstructorParameterIsDecorated(
87901
87954
  /*useLegacyDecorators*/
@@ -87955,7 +88008,7 @@ function createTypeChecker(host) {
87955
88008
  const baseTypeNode = getEffectiveBaseTypeNode(node);
87956
88009
  if (baseTypeNode) {
87957
88010
  forEach(baseTypeNode.typeArguments, checkSourceElement);
87958
- if (languageVersion < 2 /* Classes */) {
88011
+ if (languageVersion < LanguageFeatureMinimumTarget.Classes) {
87959
88012
  checkExternalEmitHelpers(baseTypeNode.parent, 1 /* Extends */);
87960
88013
  }
87961
88014
  const extendsNode = getClassExtendsHeritageElement(node);
@@ -91474,29 +91527,7 @@ function createTypeChecker(host) {
91474
91527
  return !sym.exports ? [] : nodeBuilder.symbolTableToDeclarationStatements(sym.exports, node, flags, internalFlags, tracker);
91475
91528
  },
91476
91529
  isImportRequiredByAugmentation,
91477
- isDefinitelyReferenceToGlobalSymbolObject,
91478
- createLateBoundIndexSignatures: (cls, enclosing, flags, internalFlags, tracker) => {
91479
- const sym = cls.symbol;
91480
- const staticInfos = getIndexInfosOfType(getTypeOfSymbol(sym));
91481
- const instanceIndexSymbol = getIndexSymbol(sym);
91482
- const instanceInfos = instanceIndexSymbol && getIndexInfosOfIndexSymbol(instanceIndexSymbol);
91483
- let result;
91484
- for (const infoList of [staticInfos, instanceInfos]) {
91485
- if (!length(infoList)) continue;
91486
- result || (result = []);
91487
- for (const info of infoList) {
91488
- if (info.declaration) continue;
91489
- const node = nodeBuilder.indexInfoToIndexSignatureDeclaration(info, enclosing, flags, internalFlags, tracker);
91490
- if (node && infoList === staticInfos) {
91491
- (node.modifiers || (node.modifiers = factory.createNodeArray())).unshift(factory.createModifier(126 /* StaticKeyword */));
91492
- }
91493
- if (node) {
91494
- result.push(node);
91495
- }
91496
- }
91497
- }
91498
- return result;
91499
- }
91530
+ isDefinitelyReferenceToGlobalSymbolObject
91500
91531
  };
91501
91532
  function isImportRequiredByAugmentation(node) {
91502
91533
  const file = getSourceFileOfNode(node);
@@ -93396,7 +93427,8 @@ function createBasicNodeBuilderModuleSpecifierResolutionHost(host) {
93396
93427
  getFileIncludeReasons: () => host.getFileIncludeReasons(),
93397
93428
  readFile: host.readFile ? (fileName) => host.readFile(fileName) : void 0,
93398
93429
  getDefaultResolutionModeForFile: (file) => host.getDefaultResolutionModeForFile(file),
93399
- getModeForResolutionAtIndex: (file, index) => host.getModeForResolutionAtIndex(file, index)
93430
+ getModeForResolutionAtIndex: (file, index) => host.getModeForResolutionAtIndex(file, index),
93431
+ getGlobalTypingsCacheLocation: maybeBind(host, host.getGlobalTypingsCacheLocation)
93400
93432
  };
93401
93433
  }
93402
93434
  var SymbolTrackerImpl = class _SymbolTrackerImpl {
@@ -115987,6 +116019,7 @@ function transformECMAScriptModule(context) {
115987
116019
  context.onSubstituteNode = onSubstituteNode;
115988
116020
  context.enableEmitNotification(307 /* SourceFile */);
115989
116021
  context.enableSubstitution(80 /* Identifier */);
116022
+ const noSubstitution = /* @__PURE__ */ new Set();
115990
116023
  let helperNameSubstitutions;
115991
116024
  let currentSourceFile;
115992
116025
  let importRequireStatements;
@@ -116021,7 +116054,7 @@ function transformECMAScriptModule(context) {
116021
116054
  if (externalHelpersImportDeclaration) {
116022
116055
  const statements = [];
116023
116056
  const statementOffset = factory2.copyPrologue(node.statements, statements);
116024
- append(statements, externalHelpersImportDeclaration);
116057
+ addRange(statements, visitArray([externalHelpersImportDeclaration], visitor, isStatement));
116025
116058
  addRange(statements, visitNodes2(node.statements, visitor, isStatement, statementOffset));
116026
116059
  return factory2.updateSourceFile(
116027
116060
  node,
@@ -116236,7 +116269,9 @@ function transformECMAScriptModule(context) {
116236
116269
  if ((isExternalModule(node) || getIsolatedModules(compilerOptions)) && compilerOptions.importHelpers) {
116237
116270
  helperNameSubstitutions = /* @__PURE__ */ new Map();
116238
116271
  }
116272
+ currentSourceFile = node;
116239
116273
  previousOnEmitNode(hint, node, emitCallback);
116274
+ currentSourceFile = void 0;
116240
116275
  helperNameSubstitutions = void 0;
116241
116276
  } else {
116242
116277
  previousOnEmitNode(hint, node, emitCallback);
@@ -116244,18 +116279,29 @@ function transformECMAScriptModule(context) {
116244
116279
  }
116245
116280
  function onSubstituteNode(hint, node) {
116246
116281
  node = previousOnSubstituteNode(hint, node);
116247
- if (helperNameSubstitutions && isIdentifier(node) && getEmitFlags(node) & 8192 /* HelperName */) {
116282
+ if (node.id && noSubstitution.has(node.id)) {
116283
+ return node;
116284
+ }
116285
+ if (isIdentifier(node) && getEmitFlags(node) & 8192 /* HelperName */) {
116248
116286
  return substituteHelperName(node);
116249
116287
  }
116250
116288
  return node;
116251
116289
  }
116252
116290
  function substituteHelperName(node) {
116253
- const name = idText(node);
116254
- let substitution = helperNameSubstitutions.get(name);
116255
- if (!substitution) {
116256
- helperNameSubstitutions.set(name, substitution = factory2.createUniqueName(name, 16 /* Optimistic */ | 32 /* FileLevel */));
116291
+ const externalHelpersModuleName = currentSourceFile && getExternalHelpersModuleName(currentSourceFile);
116292
+ if (externalHelpersModuleName) {
116293
+ noSubstitution.add(getNodeId(node));
116294
+ return factory2.createPropertyAccessExpression(externalHelpersModuleName, node);
116257
116295
  }
116258
- return substitution;
116296
+ if (helperNameSubstitutions) {
116297
+ const name = idText(node);
116298
+ let substitution = helperNameSubstitutions.get(name);
116299
+ if (!substitution) {
116300
+ helperNameSubstitutions.set(name, substitution = factory2.createUniqueName(name, 16 /* Optimistic */ | 32 /* FileLevel */));
116301
+ }
116302
+ return substitution;
116303
+ }
116304
+ return node;
116259
116305
  }
116260
116306
  }
116261
116307
 
@@ -118148,8 +118194,7 @@ function transformDeclarations(context) {
118148
118194
  void 0
118149
118195
  )
118150
118196
  ] : void 0;
118151
- const lateIndexes = resolver.createLateBoundIndexSignatures(input, enclosingDeclaration, declarationEmitNodeBuilderFlags, declarationEmitInternalNodeBuilderFlags, symbolTracker);
118152
- const memberNodes = concatenate(concatenate(concatenate(privateIdentifier, lateIndexes), parameterProperties), visitNodes2(input.members, visitDeclarationSubtree, isClassElement));
118197
+ const memberNodes = concatenate(concatenate(privateIdentifier, parameterProperties), visitNodes2(input.members, visitDeclarationSubtree, isClassElement));
118153
118198
  const members = factory2.createNodeArray(memberNodes);
118154
118199
  const extendsClause = getEffectiveBaseTypeNode(input);
118155
118200
  if (extendsClause && !isEntityNameExpression(extendsClause.expression) && extendsClause.expression.kind !== 106 /* NullKeyword */) {
@@ -119465,8 +119510,7 @@ var notImplementedResolver = {
119465
119510
  isBindingCapturedByNode: notImplemented,
119466
119511
  getDeclarationStatementsForSourceFile: notImplemented,
119467
119512
  isImportRequiredByAugmentation: notImplemented,
119468
- isDefinitelyReferenceToGlobalSymbolObject: notImplemented,
119469
- createLateBoundIndexSignatures: notImplemented
119513
+ isDefinitelyReferenceToGlobalSymbolObject: notImplemented
119470
119514
  };
119471
119515
  var createPrinterWithDefaults = /* @__PURE__ */ memoize(() => createPrinter({}));
119472
119516
  var createPrinterWithRemoveComments = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true }));
@@ -125577,7 +125621,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
125577
125621
  getCanonicalFileName,
125578
125622
  getFileIncludeReasons: () => fileReasons,
125579
125623
  structureIsReused,
125580
- writeFile: writeFile2
125624
+ writeFile: writeFile2,
125625
+ getGlobalTypingsCacheLocation: maybeBind(host, host.getGlobalTypingsCacheLocation)
125581
125626
  };
125582
125627
  onProgramCreateComplete();
125583
125628
  verifyCompilerOptions();
@@ -126143,7 +126188,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
126143
126188
  getFileIncludeReasons: program.getFileIncludeReasons,
126144
126189
  createHash: maybeBind(host, host.createHash),
126145
126190
  getModuleResolutionCache: () => program.getModuleResolutionCache(),
126146
- trace: maybeBind(host, host.trace)
126191
+ trace: maybeBind(host, host.trace),
126192
+ getGlobalTypingsCacheLocation: program.getGlobalTypingsCacheLocation
126147
126193
  };
126148
126194
  }
126149
126195
  function writeFile2(fileName, text, writeByteOrderMark, onError, sourceFiles, data) {
@@ -130510,6 +130556,9 @@ function canWatchDirectoryOrFile(pathComponents2, length2) {
130510
130556
  const perceivedOsRootLength = perceivedOsRootLengthForWatching(pathComponents2, length2);
130511
130557
  return length2 > perceivedOsRootLength + 1;
130512
130558
  }
130559
+ function canWatchDirectoryOrFilePath(path) {
130560
+ return canWatchDirectoryOrFile(getPathComponents(path));
130561
+ }
130513
130562
  function canWatchAtTypes(atTypes) {
130514
130563
  return canWatchAffectedPackageJsonOrNodeModulesOfAtTypes(getDirectoryPath(atTypes));
130515
130564
  }
@@ -130521,12 +130570,12 @@ function isInDirectoryPath(dirComponents, fileOrDirComponents) {
130521
130570
  return true;
130522
130571
  }
130523
130572
  function canWatchAffectedPackageJsonOrNodeModulesOfAtTypes(fileOrDirPath) {
130524
- return canWatchDirectoryOrFile(getPathComponents(fileOrDirPath));
130573
+ return canWatchDirectoryOrFilePath(fileOrDirPath);
130525
130574
  }
130526
130575
  function canWatchAffectingLocation(filePath) {
130527
130576
  return canWatchAffectedPackageJsonOrNodeModulesOfAtTypes(filePath);
130528
130577
  }
130529
- function getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath, rootDir, rootPath, rootPathComponents, getCurrentDirectory, preferNonRecursiveWatch) {
130578
+ function getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath, rootDir, rootPath, rootPathComponents, isRootWatchable, getCurrentDirectory, preferNonRecursiveWatch) {
130530
130579
  const failedLookupPathComponents = getPathComponents(failedLookupLocationPath);
130531
130580
  failedLookupLocation = isRootedDiskPath(failedLookupLocation) ? normalizePath(failedLookupLocation) : getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory());
130532
130581
  const failedLookupComponents = getPathComponents(failedLookupLocation);
@@ -130535,7 +130584,7 @@ function getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLoo
130535
130584
  const nodeModulesIndex = failedLookupPathComponents.indexOf("node_modules");
130536
130585
  if (nodeModulesIndex !== -1 && nodeModulesIndex + 1 <= perceivedOsRootLength + 1) return void 0;
130537
130586
  const lastNodeModulesIndex = failedLookupPathComponents.lastIndexOf("node_modules");
130538
- if (isInDirectoryPath(rootPathComponents, failedLookupPathComponents)) {
130587
+ if (isRootWatchable && isInDirectoryPath(rootPathComponents, failedLookupPathComponents)) {
130539
130588
  if (failedLookupPathComponents.length > rootPathComponents.length + 1) {
130540
130589
  return getDirectoryOfFailedLookupWatch(
130541
130590
  failedLookupComponents,
@@ -130607,9 +130656,9 @@ function getDirectoryOfFailedLookupWatch(dirComponents, dirPathComponents, lengt
130607
130656
  packageDirPath: packageDirLength !== void 0 ? getPathFromPathComponents(dirPathComponents, packageDirLength) : void 0
130608
130657
  };
130609
130658
  }
130610
- function getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath, rootPath, rootPathComponents, getCurrentDirectory, preferNonRecursiveWatch, filterCustomPath) {
130659
+ function getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath, rootPath, rootPathComponents, isRootWatchable, getCurrentDirectory, preferNonRecursiveWatch, filterCustomPath) {
130611
130660
  const typeRootPathComponents = getPathComponents(typeRootPath);
130612
- if (isInDirectoryPath(rootPathComponents, typeRootPathComponents)) {
130661
+ if (isRootWatchable && isInDirectoryPath(rootPathComponents, typeRootPathComponents)) {
130613
130662
  return rootPath;
130614
130663
  }
130615
130664
  typeRoot = isRootedDiskPath(typeRoot) ? normalizePath(typeRoot) : getNormalizedAbsolutePath(typeRoot, getCurrentDirectory());
@@ -130650,10 +130699,10 @@ function createModuleResolutionLoaderUsingGlobalCache(containingFile, redirected
130650
130699
  function resolveModuleNameUsingGlobalCache(resolutionHost, moduleResolutionCache, moduleName, containingFile, compilerOptions, redirectedReference, mode) {
130651
130700
  const host = getModuleResolutionHost(resolutionHost);
130652
130701
  const primaryResult = resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference, mode);
130653
- if (!resolutionHost.getGlobalCache) {
130702
+ if (!resolutionHost.getGlobalTypingsCacheLocation) {
130654
130703
  return primaryResult;
130655
130704
  }
130656
- const globalCache = resolutionHost.getGlobalCache();
130705
+ const globalCache = resolutionHost.getGlobalTypingsCacheLocation();
130657
130706
  if (globalCache !== void 0 && !isExternalModuleNameRelative(moduleName) && !(primaryResult.resolvedModule && extensionIsTS(primaryResult.resolvedModule.extension))) {
130658
130707
  const { resolvedModule, failedLookupLocations, affectingLocations, resolutionDiagnostics } = loadModuleFromGlobalCache(
130659
130708
  Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName),
@@ -130717,6 +130766,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
130717
130766
  const rootDir = getRootDirectoryOfResolutionCache(rootDirForResolution, getCurrentDirectory);
130718
130767
  const rootPath = resolutionHost.toPath(rootDir);
130719
130768
  const rootPathComponents = getPathComponents(rootPath);
130769
+ const isRootWatchable = canWatchDirectoryOrFile(rootPathComponents);
130720
130770
  const isSymlinkCache = /* @__PURE__ */ new Map();
130721
130771
  const packageDirWatchers = /* @__PURE__ */ new Map();
130722
130772
  const dirPathToSymlinkPackageRefCount = /* @__PURE__ */ new Map();
@@ -131128,6 +131178,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
131128
131178
  rootDir,
131129
131179
  rootPath,
131130
131180
  rootPathComponents,
131181
+ isRootWatchable,
131131
131182
  getCurrentDirectory,
131132
131183
  resolutionHost.preferNonRecursiveWatch
131133
131184
  );
@@ -131316,6 +131367,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
131316
131367
  rootDir,
131317
131368
  rootPath,
131318
131369
  rootPathComponents,
131370
+ isRootWatchable,
131319
131371
  getCurrentDirectory,
131320
131372
  resolutionHost.preferNonRecursiveWatch
131321
131373
  );
@@ -131459,6 +131511,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
131459
131511
  return false;
131460
131512
  }
131461
131513
  (failedLookupChecks || (failedLookupChecks = /* @__PURE__ */ new Set())).add(fileOrDirectoryPath);
131514
+ (startsWithPathChecks || (startsWithPathChecks = /* @__PURE__ */ new Set())).add(fileOrDirectoryPath);
131462
131515
  const packagePath = parseNodeModuleFromPath(
131463
131516
  fileOrDirectoryPath,
131464
131517
  /*isFolder*/
@@ -131540,6 +131593,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
131540
131593
  resolutionHost.toPath(typeRoot),
131541
131594
  rootPath,
131542
131595
  rootPathComponents,
131596
+ isRootWatchable,
131543
131597
  getCurrentDirectory,
131544
131598
  resolutionHost.preferNonRecursiveWatch,
131545
131599
  (dirPath2) => directoryWatchesOfFailedLookups.has(dirPath2) || dirPathToSymlinkPackageRefCount.has(dirPath2)
@@ -132297,6 +132351,7 @@ function createWatchProgram(host) {
132297
132351
  let updateLevel;
132298
132352
  let missingFilesMap;
132299
132353
  let watchedWildcardDirectories;
132354
+ let staleWatches = /* @__PURE__ */ new Map([[void 0, void 0]]);
132300
132355
  let timerToUpdateProgram;
132301
132356
  let timerToInvalidateFailedLookupResolutions;
132302
132357
  let parsedConfigs;
@@ -132385,8 +132440,6 @@ function createWatchProgram(host) {
132385
132440
  const customHasInvalidLibResolutions = host.resolveLibrary ? maybeBind(host, host.hasInvalidatedLibResolutions) || returnTrue : returnFalse;
132386
132441
  builderProgram = readBuilderProgram(compilerOptions, compilerHost);
132387
132442
  synchronizeProgram();
132388
- watchConfigFileWildCardDirectories();
132389
- if (configFileName) updateExtendedConfigFilesWatches(toPath3(configFileName), compilerOptions, watchOptions, WatchType.ExtendedConfigFile);
132390
132443
  return configFileName ? { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, close, getResolutionCache } : { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, updateRootFileNames, close, getResolutionCache };
132391
132444
  function close() {
132392
132445
  clearInvalidateResolutionsOfFailedLookupLocations();
@@ -132489,6 +132542,16 @@ function createWatchProgram(host) {
132489
132542
  compilerHost.directoryExists = originalDirectoryExists;
132490
132543
  compilerHost.createDirectory = originalCreateDirectory;
132491
132544
  compilerHost.writeFile = originalWriteFile;
132545
+ staleWatches == null ? void 0 : staleWatches.forEach((configFile, configPath) => {
132546
+ if (!configPath) {
132547
+ watchConfigFileWildCardDirectories();
132548
+ if (configFileName) updateExtendedConfigFilesWatches(toPath3(configFileName), compilerOptions, watchOptions, WatchType.ExtendedConfigFile);
132549
+ } else {
132550
+ const config = parsedConfigs == null ? void 0 : parsedConfigs.get(configPath);
132551
+ if (config) watchReferencedProject(configFile, configPath, config);
132552
+ }
132553
+ });
132554
+ staleWatches = void 0;
132492
132555
  return builderProgram;
132493
132556
  }
132494
132557
  function createNewProgram(hasInvalidatedResolutions, hasInvalidatedLibResolutions) {
@@ -132695,9 +132758,8 @@ function createWatchProgram(host) {
132695
132758
  }
132696
132759
  parseConfigFile2();
132697
132760
  hasChangedCompilerOptions = true;
132761
+ (staleWatches ?? (staleWatches = /* @__PURE__ */ new Map())).set(void 0, void 0);
132698
132762
  synchronizeProgram();
132699
- watchConfigFileWildCardDirectories();
132700
- updateExtendedConfigFilesWatches(toPath3(configFileName), compilerOptions, watchOptions, WatchType.ExtendedConfigFile);
132701
132763
  }
132702
132764
  function parseConfigFile2() {
132703
132765
  Debug.assert(configFileName);
@@ -132749,7 +132811,7 @@ function createWatchProgram(host) {
132749
132811
  } else {
132750
132812
  (parsedConfigs || (parsedConfigs = /* @__PURE__ */ new Map())).set(configPath, config = { parsedCommandLine });
132751
132813
  }
132752
- watchReferencedProject(configFileName2, configPath, config);
132814
+ (staleWatches ?? (staleWatches = /* @__PURE__ */ new Map())).set(configPath, configFileName2);
132753
132815
  return parsedCommandLine;
132754
132816
  }
132755
132817
  function getParsedCommandLineFromConfigFileHost(configFileName2) {
@@ -134766,7 +134828,7 @@ function shouldBePretty(sys2, options) {
134766
134828
  return options.pretty;
134767
134829
  }
134768
134830
  function getOptionsForHelp(commandLine) {
134769
- return !!commandLine.options.all ? toSorted(optionDeclarations, (a, b) => compareStringsCaseInsensitive(a.name, b.name)) : filter(optionDeclarations.slice(), (v) => !!v.showInSimplifiedHelpView);
134831
+ return !!commandLine.options.all ? toSorted(optionDeclarations.concat(tscBuildOption), (a, b) => compareStringsCaseInsensitive(a.name, b.name)) : filter(optionDeclarations.concat(tscBuildOption), (v) => !!v.showInSimplifiedHelpView);
134770
134832
  }
134771
134833
  function printVersion(sys2) {
134772
134834
  sys2.write(getDiagnosticText(Diagnostics.Version_0, version) + sys2.newLine);
@@ -135090,7 +135152,7 @@ function printAllHelp(sys2, compilerOptions, buildOptions, watchOptions) {
135090
135152
  output = [...output, ...generateSectionOptionsOutput(
135091
135153
  sys2,
135092
135154
  getDiagnosticText(Diagnostics.BUILD_OPTIONS),
135093
- buildOptions,
135155
+ filter(buildOptions, (option) => option !== tscBuildOption),
135094
135156
  /*subCategory*/
135095
135157
  false,
135096
135158
  formatMessage(Diagnostics.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0, "https://aka.ms/tsc-composite-builds")
@@ -135104,7 +135166,7 @@ function printBuildHelp(sys2, buildOptions) {
135104
135166
  output = [...output, ...generateSectionOptionsOutput(
135105
135167
  sys2,
135106
135168
  getDiagnosticText(Diagnostics.BUILD_OPTIONS),
135107
- buildOptions,
135169
+ filter(buildOptions, (option) => option !== tscBuildOption),
135108
135170
  /*subCategory*/
135109
135171
  false,
135110
135172
  formatMessage(Diagnostics.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0, "https://aka.ms/tsc-composite-builds")
@@ -135141,10 +135203,6 @@ function printHelp(sys2, commandLine) {
135141
135203
  }
135142
135204
  function executeCommandLineWorker(sys2, cb, commandLine) {
135143
135205
  let reportDiagnostic = createDiagnosticReporter(sys2);
135144
- if (commandLine.options.build) {
135145
- reportDiagnostic(createCompilerDiagnostic(Diagnostics.Option_build_must_be_the_first_command_line_argument));
135146
- return sys2.exit(1 /* DiagnosticsPresent_OutputsSkipped */);
135147
- }
135148
135206
  let configFileName;
135149
135207
  if (commandLine.options.locale) {
135150
135208
  validateLocaleAndSetLanguage(commandLine.options.locale, sys2, commandLine.errors);
@@ -135290,16 +135348,16 @@ function executeCommandLineWorker(sys2, cb, commandLine) {
135290
135348
  }
135291
135349
  }
135292
135350
  }
135293
- function isBuild(commandLineArgs) {
135351
+ function isBuildCommand(commandLineArgs) {
135294
135352
  if (commandLineArgs.length > 0 && commandLineArgs[0].charCodeAt(0) === 45 /* minus */) {
135295
135353
  const firstOption = commandLineArgs[0].slice(commandLineArgs[0].charCodeAt(1) === 45 /* minus */ ? 2 : 1).toLowerCase();
135296
- return firstOption === "build" || firstOption === "b";
135354
+ return firstOption === tscBuildOption.name || firstOption === tscBuildOption.shortName;
135297
135355
  }
135298
135356
  return false;
135299
135357
  }
135300
135358
  function executeCommandLine(system, cb, commandLineArgs) {
135301
- if (isBuild(commandLineArgs)) {
135302
- const { buildOptions, watchOptions, projects, errors } = parseBuildCommand(commandLineArgs.slice(1));
135359
+ if (isBuildCommand(commandLineArgs)) {
135360
+ const { buildOptions, watchOptions, projects, errors } = parseBuildCommand(commandLineArgs);
135303
135361
  if (buildOptions.generateCpuProfile && system.enableCPUProfiler) {
135304
135362
  system.enableCPUProfiler(buildOptions.generateCpuProfile, () => performBuild(
135305
135363
  system,
@@ -139136,28 +139194,33 @@ function tryAndIgnoreErrors(cb) {
139136
139194
  function tryIOAndConsumeErrors(host, toApply, ...args) {
139137
139195
  return tryAndIgnoreErrors(() => toApply && toApply.apply(host, args));
139138
139196
  }
139139
- function findPackageJsons(startDirectory, host, stopDirectory) {
139197
+ function findPackageJsons(startDirectory, host) {
139140
139198
  const paths = [];
139141
- forEachAncestorDirectory(startDirectory, (ancestor) => {
139142
- if (ancestor === stopDirectory) {
139143
- return true;
139144
- }
139145
- const currentConfigPath = combinePaths(ancestor, "package.json");
139146
- if (tryFileExists(host, currentConfigPath)) {
139147
- paths.push(currentConfigPath);
139199
+ forEachAncestorDirectoryStoppingAtGlobalCache(
139200
+ host,
139201
+ startDirectory,
139202
+ (ancestor) => {
139203
+ const currentConfigPath = combinePaths(ancestor, "package.json");
139204
+ if (tryFileExists(host, currentConfigPath)) {
139205
+ paths.push(currentConfigPath);
139206
+ }
139148
139207
  }
139149
- });
139208
+ );
139150
139209
  return paths;
139151
139210
  }
139152
139211
  function findPackageJson(directory, host) {
139153
139212
  let packageJson;
139154
- forEachAncestorDirectory(directory, (ancestor) => {
139155
- if (ancestor === "node_modules") return true;
139156
- packageJson = findConfigFile(ancestor, (f) => tryFileExists(host, f), "package.json");
139157
- if (packageJson) {
139158
- return true;
139213
+ forEachAncestorDirectoryStoppingAtGlobalCache(
139214
+ host,
139215
+ directory,
139216
+ (ancestor) => {
139217
+ if (ancestor === "node_modules") return true;
139218
+ packageJson = findConfigFile(ancestor, (f) => tryFileExists(host, f), "package.json");
139219
+ if (packageJson) {
139220
+ return true;
139221
+ }
139159
139222
  }
139160
- });
139223
+ );
139161
139224
  return packageJson;
139162
139225
  }
139163
139226
  function getPackageJsonsVisibleToFile(fileName, host) {
@@ -139165,15 +139228,19 @@ function getPackageJsonsVisibleToFile(fileName, host) {
139165
139228
  return [];
139166
139229
  }
139167
139230
  const packageJsons = [];
139168
- forEachAncestorDirectory(getDirectoryPath(fileName), (ancestor) => {
139169
- const packageJsonFileName = combinePaths(ancestor, "package.json");
139170
- if (host.fileExists(packageJsonFileName)) {
139171
- const info = createPackageJsonInfo(packageJsonFileName, host);
139172
- if (info) {
139173
- packageJsons.push(info);
139231
+ forEachAncestorDirectoryStoppingAtGlobalCache(
139232
+ host,
139233
+ getDirectoryPath(fileName),
139234
+ (ancestor) => {
139235
+ const packageJsonFileName = combinePaths(ancestor, "package.json");
139236
+ if (host.fileExists(packageJsonFileName)) {
139237
+ const info = createPackageJsonInfo(packageJsonFileName, host);
139238
+ if (info) {
139239
+ packageJsons.push(info);
139240
+ }
139174
139241
  }
139175
139242
  }
139176
- });
139243
+ );
139177
139244
  return packageJsons;
139178
139245
  }
139179
139246
  function createPackageJsonInfo(fileName, host) {
@@ -139860,7 +139927,13 @@ function isImportable(program, fromFile, toFile, toModule, preferences, packageJ
139860
139927
  false,
139861
139928
  (toPath3) => {
139862
139929
  const file = program.getSourceFile(toPath3);
139863
- return (file === toFile || !file) && isImportablePath(fromFile.fileName, toPath3, getCanonicalFileName, globalTypingsCache);
139930
+ return (file === toFile || !file) && isImportablePath(
139931
+ fromFile.fileName,
139932
+ toPath3,
139933
+ getCanonicalFileName,
139934
+ globalTypingsCache,
139935
+ moduleSpecifierResolutionHost
139936
+ );
139864
139937
  }
139865
139938
  );
139866
139939
  if (packageJsonFilter) {
@@ -139873,8 +139946,12 @@ function isImportable(program, fromFile, toFile, toModule, preferences, packageJ
139873
139946
  function fileContainsPackageImport(sourceFile, packageName) {
139874
139947
  return sourceFile.imports && sourceFile.imports.some((i) => i.text === packageName || i.text.startsWith(packageName + "/"));
139875
139948
  }
139876
- function isImportablePath(fromPath, toPath3, getCanonicalFileName, globalCachePath) {
139877
- const toNodeModules = forEachAncestorDirectory(toPath3, (ancestor) => getBaseFileName(ancestor) === "node_modules" ? ancestor : void 0);
139949
+ function isImportablePath(fromPath, toPath3, getCanonicalFileName, globalCachePath, host) {
139950
+ const toNodeModules = forEachAncestorDirectoryStoppingAtGlobalCache(
139951
+ host,
139952
+ toPath3,
139953
+ (ancestor) => getBaseFileName(ancestor) === "node_modules" ? ancestor : void 0
139954
+ );
139878
139955
  const toNodeModulesParent = toNodeModules && getDirectoryPath(getCanonicalFileName(toNodeModules));
139879
139956
  return toNodeModulesParent === void 0 || startsWith(getCanonicalFileName(fromPath), toNodeModulesParent) || !!globalCachePath && startsWith(getCanonicalFileName(globalCachePath), toNodeModulesParent);
139880
139957
  }
@@ -139945,13 +140022,17 @@ function getIsExcluded(excludePatterns, host) {
139945
140022
  if (excludePatterns.some((p) => p.test(fileName))) return true;
139946
140023
  if ((realpathsWithSymlinks == null ? void 0 : realpathsWithSymlinks.size) && pathContainsNodeModules(fileName)) {
139947
140024
  let dir = getDirectoryPath(fileName);
139948
- return forEachAncestorDirectory(getDirectoryPath(path), (dirPath) => {
139949
- const symlinks = realpathsWithSymlinks.get(ensureTrailingDirectorySeparator(dirPath));
139950
- if (symlinks) {
139951
- return symlinks.some((s) => excludePatterns.some((p) => p.test(fileName.replace(dir, s))));
140025
+ return forEachAncestorDirectoryStoppingAtGlobalCache(
140026
+ host,
140027
+ getDirectoryPath(path),
140028
+ (dirPath) => {
140029
+ const symlinks = realpathsWithSymlinks.get(ensureTrailingDirectorySeparator(dirPath));
140030
+ if (symlinks) {
140031
+ return symlinks.some((s) => excludePatterns.some((p) => p.test(fileName.replace(dir, s))));
140032
+ }
140033
+ dir = getDirectoryPath(dir);
139952
140034
  }
139953
- dir = getDirectoryPath(dir);
139954
- }) ?? false;
140035
+ ) ?? false;
139955
140036
  }
139956
140037
  return false;
139957
140038
  };
@@ -150326,7 +150407,8 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
150326
150407
  resolveLibrary: maybeBind(host, host.resolveLibrary),
150327
150408
  useSourceOfProjectReferenceRedirect: maybeBind(host, host.useSourceOfProjectReferenceRedirect),
150328
150409
  getParsedCommandLine,
150329
- jsDocParsingMode: host.jsDocParsingMode
150410
+ jsDocParsingMode: host.jsDocParsingMode,
150411
+ getGlobalTypingsCacheLocation: maybeBind(host, host.getGlobalTypingsCacheLocation)
150330
150412
  };
150331
150413
  const originalGetSourceFile = compilerHost.getSourceFile;
150332
150414
  const { getSourceFileWithCache } = changeCompilerHostLikeToUseCache(
@@ -152638,8 +152720,10 @@ __export(ts_codefix_exports, {
152638
152720
  setJsonCompilerOptionValue: () => setJsonCompilerOptionValue,
152639
152721
  setJsonCompilerOptionValues: () => setJsonCompilerOptionValues,
152640
152722
  tryGetAutoImportableReferenceFromTypeNode: () => tryGetAutoImportableReferenceFromTypeNode,
152723
+ typeNodeToAutoImportableTypeNode: () => typeNodeToAutoImportableTypeNode,
152641
152724
  typePredicateToAutoImportableTypeNode: () => typePredicateToAutoImportableTypeNode,
152642
- typeToAutoImportableTypeNode: () => typeToAutoImportableTypeNode
152725
+ typeToAutoImportableTypeNode: () => typeToAutoImportableTypeNode,
152726
+ typeToMinimizedReferenceType: () => typeToMinimizedReferenceType
152643
152727
  });
152644
152728
 
152645
152729
  // src/services/codeFixProvider.ts
@@ -155830,9 +155914,19 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre
155830
155914
  );
155831
155915
  if (fix) {
155832
155916
  const localName = ((_b = tryCast(referenceImport == null ? void 0 : referenceImport.name, isIdentifier)) == null ? void 0 : _b.text) ?? symbolName2;
155917
+ let addAsTypeOnly;
155918
+ let propertyName;
155833
155919
  if (referenceImport && isTypeOnlyImportDeclaration(referenceImport) && (fix.kind === 3 /* AddNew */ || fix.kind === 2 /* AddToExisting */) && fix.addAsTypeOnly === 1 /* Allowed */) {
155834
- fix = { ...fix, addAsTypeOnly: 2 /* Required */ };
155920
+ addAsTypeOnly = 2 /* Required */;
155921
+ }
155922
+ if (exportedSymbol.name !== localName) {
155923
+ propertyName = exportedSymbol.name;
155835
155924
  }
155925
+ fix = {
155926
+ ...fix,
155927
+ ...addAsTypeOnly === void 0 ? {} : { addAsTypeOnly },
155928
+ ...propertyName === void 0 ? {} : { propertyName }
155929
+ };
155836
155930
  addImport({ fix, symbolName: localName ?? symbolName2, errorIdentifierText: void 0 });
155837
155931
  }
155838
155932
  }
@@ -155898,7 +155992,7 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre
155898
155992
  removeExisting.add(declaration);
155899
155993
  }
155900
155994
  function addImport(info) {
155901
- var _a, _b;
155995
+ var _a, _b, _c;
155902
155996
  const { fix, symbolName: symbolName2 } = info;
155903
155997
  switch (fix.kind) {
155904
155998
  case 0 /* UseNamespace */:
@@ -155908,40 +156002,40 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre
155908
156002
  importType.push(fix);
155909
156003
  break;
155910
156004
  case 2 /* AddToExisting */: {
155911
- const { importClauseOrBindingPattern, importKind, addAsTypeOnly } = fix;
156005
+ const { importClauseOrBindingPattern, importKind, addAsTypeOnly, propertyName } = fix;
155912
156006
  let entry = addToExisting.get(importClauseOrBindingPattern);
155913
156007
  if (!entry) {
155914
156008
  addToExisting.set(importClauseOrBindingPattern, entry = { importClauseOrBindingPattern, defaultImport: void 0, namedImports: /* @__PURE__ */ new Map() });
155915
156009
  }
155916
156010
  if (importKind === 0 /* Named */) {
155917
- const prevValue = entry == null ? void 0 : entry.namedImports.get(symbolName2);
155918
- entry.namedImports.set(symbolName2, reduceAddAsTypeOnlyValues(prevValue, addAsTypeOnly));
156011
+ const prevTypeOnly = (_a = entry == null ? void 0 : entry.namedImports.get(symbolName2)) == null ? void 0 : _a.addAsTypeOnly;
156012
+ entry.namedImports.set(symbolName2, { addAsTypeOnly: reduceAddAsTypeOnlyValues(prevTypeOnly, addAsTypeOnly), propertyName });
155919
156013
  } else {
155920
156014
  Debug.assert(entry.defaultImport === void 0 || entry.defaultImport.name === symbolName2, "(Add to Existing) Default import should be missing or match symbolName");
155921
156015
  entry.defaultImport = {
155922
156016
  name: symbolName2,
155923
- addAsTypeOnly: reduceAddAsTypeOnlyValues((_a = entry.defaultImport) == null ? void 0 : _a.addAsTypeOnly, addAsTypeOnly)
156017
+ addAsTypeOnly: reduceAddAsTypeOnlyValues((_b = entry.defaultImport) == null ? void 0 : _b.addAsTypeOnly, addAsTypeOnly)
155924
156018
  };
155925
156019
  }
155926
156020
  break;
155927
156021
  }
155928
156022
  case 3 /* AddNew */: {
155929
- const { moduleSpecifier, importKind, useRequire, addAsTypeOnly } = fix;
156023
+ const { moduleSpecifier, importKind, useRequire, addAsTypeOnly, propertyName } = fix;
155930
156024
  const entry = getNewImportEntry(moduleSpecifier, importKind, useRequire, addAsTypeOnly);
155931
156025
  Debug.assert(entry.useRequire === useRequire, "(Add new) Tried to add an `import` and a `require` for the same module");
155932
156026
  switch (importKind) {
155933
156027
  case 1 /* Default */:
155934
156028
  Debug.assert(entry.defaultImport === void 0 || entry.defaultImport.name === symbolName2, "(Add new) Default import should be missing or match symbolName");
155935
- entry.defaultImport = { name: symbolName2, addAsTypeOnly: reduceAddAsTypeOnlyValues((_b = entry.defaultImport) == null ? void 0 : _b.addAsTypeOnly, addAsTypeOnly) };
156029
+ entry.defaultImport = { name: symbolName2, addAsTypeOnly: reduceAddAsTypeOnlyValues((_c = entry.defaultImport) == null ? void 0 : _c.addAsTypeOnly, addAsTypeOnly) };
155936
156030
  break;
155937
156031
  case 0 /* Named */:
155938
156032
  const prevValue = (entry.namedImports || (entry.namedImports = /* @__PURE__ */ new Map())).get(symbolName2);
155939
- entry.namedImports.set(symbolName2, reduceAddAsTypeOnlyValues(prevValue, addAsTypeOnly));
156033
+ entry.namedImports.set(symbolName2, [reduceAddAsTypeOnlyValues(prevValue, addAsTypeOnly), propertyName]);
155940
156034
  break;
155941
156035
  case 3 /* CommonJS */:
155942
156036
  if (compilerOptions.verbatimModuleSyntax) {
155943
156037
  const prevValue2 = (entry.namedImports || (entry.namedImports = /* @__PURE__ */ new Map())).get(symbolName2);
155944
- entry.namedImports.set(symbolName2, reduceAddAsTypeOnlyValues(prevValue2, addAsTypeOnly));
156038
+ entry.namedImports.set(symbolName2, [reduceAddAsTypeOnlyValues(prevValue2, addAsTypeOnly), propertyName]);
155945
156039
  } else {
155946
156040
  Debug.assert(entry.namespaceLikeImport === void 0 || entry.namespaceLikeImport.name === symbolName2, "Namespacelike import shoudl be missing or match symbolName");
155947
156041
  entry.namespaceLikeImport = { importKind, name: symbolName2, addAsTypeOnly };
@@ -156095,7 +156189,7 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre
156095
156189
  sourceFile,
156096
156190
  importClauseOrBindingPattern,
156097
156191
  defaultImport,
156098
- arrayFrom(namedImports.entries(), ([name, addAsTypeOnly]) => ({ addAsTypeOnly, name })),
156192
+ arrayFrom(namedImports.entries(), ([name, { addAsTypeOnly, propertyName }]) => ({ addAsTypeOnly, propertyName, name })),
156099
156193
  importSpecifiersToRemoveWhileAdding,
156100
156194
  preferences
156101
156195
  );
@@ -156108,7 +156202,7 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre
156108
156202
  moduleSpecifier,
156109
156203
  quotePreference,
156110
156204
  defaultImport,
156111
- namedImports && arrayFrom(namedImports.entries(), ([name, addAsTypeOnly]) => ({ addAsTypeOnly, name })),
156205
+ namedImports && arrayFrom(namedImports.entries(), ([name, [addAsTypeOnly, propertyName]]) => ({ addAsTypeOnly, propertyName, name })),
156112
156206
  namespaceLikeImport,
156113
156207
  compilerOptions,
156114
156208
  preferences
@@ -157008,8 +157102,7 @@ function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImpor
157008
157102
  ...namedImports.map((i) => factory.createBindingElement(
157009
157103
  /*dotDotDotToken*/
157010
157104
  void 0,
157011
- /*propertyName*/
157012
- void 0,
157105
+ i.propertyName,
157013
157106
  i.name
157014
157107
  ))
157015
157108
  ])
@@ -157020,12 +157113,7 @@ function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImpor
157020
157113
  addElementToBindingPattern(clause, defaultImport.name, "default");
157021
157114
  }
157022
157115
  for (const specifier of namedImports) {
157023
- addElementToBindingPattern(
157024
- clause,
157025
- specifier.name,
157026
- /*propertyName*/
157027
- void 0
157028
- );
157116
+ addElementToBindingPattern(clause, specifier.name, specifier.propertyName);
157029
157117
  }
157030
157118
  return;
157031
157119
  }
@@ -157041,8 +157129,7 @@ function doAddExistingFix(changes, sourceFile, clause, defaultImport, namedImpor
157041
157129
  namedImports.map(
157042
157130
  (namedImport) => factory.createImportSpecifier(
157043
157131
  (!clause.isTypeOnly || promoteFromTypeOnly2) && shouldUseTypeOnly(namedImport, preferences),
157044
- /*propertyName*/
157045
- void 0,
157132
+ namedImport.propertyName === void 0 ? void 0 : factory.createIdentifier(namedImport.propertyName),
157046
157133
  factory.createIdentifier(namedImport.name)
157047
157134
  )
157048
157135
  ),
@@ -157137,8 +157224,7 @@ function getNewImports(moduleSpecifier, quotePreference, defaultImport, namedImp
157137
157224
  namedImports == null ? void 0 : namedImports.map(
157138
157225
  (namedImport) => factory.createImportSpecifier(
157139
157226
  !topLevelTypeOnly && shouldUseTypeOnly(namedImport, preferences),
157140
- /*propertyName*/
157141
- void 0,
157227
+ namedImport.propertyName === void 0 ? void 0 : factory.createIdentifier(namedImport.propertyName),
157142
157228
  factory.createIdentifier(namedImport.name)
157143
157229
  )
157144
157230
  ),
@@ -157176,11 +157262,10 @@ function getNewRequires(moduleSpecifier, quotePreference, defaultImport, namedIm
157176
157262
  const quotedModuleSpecifier = makeStringLiteral(moduleSpecifier, quotePreference);
157177
157263
  let statements;
157178
157264
  if (defaultImport || (namedImports == null ? void 0 : namedImports.length)) {
157179
- const bindingElements = (namedImports == null ? void 0 : namedImports.map(({ name }) => factory.createBindingElement(
157265
+ const bindingElements = (namedImports == null ? void 0 : namedImports.map(({ name, propertyName }) => factory.createBindingElement(
157180
157266
  /*dotDotDotToken*/
157181
157267
  void 0,
157182
- /*propertyName*/
157183
- void 0,
157268
+ propertyName,
157184
157269
  name
157185
157270
  ))) || [];
157186
157271
  if (defaultImport) {
@@ -161014,7 +161099,7 @@ function withContext(context, typePrintMode, cb) {
161014
161099
  }
161015
161100
  function typeToTypeNode2(type, enclosingDeclaration, flags = 0 /* None */) {
161016
161101
  let isTruncated = false;
161017
- const result2 = typeToAutoImportableTypeNode(typeChecker, importAdder, type, enclosingDeclaration, scriptTarget, declarationEmitNodeBuilderFlags2 | flags, declarationEmitInternalNodeBuilderFlags2, {
161102
+ const minimizedTypeNode = typeToMinimizedReferenceType(typeChecker, type, enclosingDeclaration, declarationEmitNodeBuilderFlags2 | flags, declarationEmitInternalNodeBuilderFlags2, {
161018
161103
  moduleResolverHost: program,
161019
161104
  trackSymbol() {
161020
161105
  return true;
@@ -161023,6 +161108,10 @@ function withContext(context, typePrintMode, cb) {
161023
161108
  isTruncated = true;
161024
161109
  }
161025
161110
  });
161111
+ if (!minimizedTypeNode) {
161112
+ return void 0;
161113
+ }
161114
+ const result2 = typeNodeToAutoImportableTypeNode(minimizedTypeNode, importAdder, scriptTarget);
161026
161115
  return isTruncated ? factory.createKeywordTypeNode(133 /* AnyKeyword */) : result2;
161027
161116
  }
161028
161117
  function typePredicateToTypeNode(typePredicate, enclosingDeclaration, flags = 0 /* None */) {
@@ -162726,7 +162815,13 @@ function createTypeParameterName(index) {
162726
162815
  return 84 /* T */ + index <= 90 /* Z */ ? String.fromCharCode(84 /* T */ + index) : `T${index}`;
162727
162816
  }
162728
162817
  function typeToAutoImportableTypeNode(checker, importAdder, type, contextNode, scriptTarget, flags, internalFlags, tracker) {
162729
- let typeNode = checker.typeToTypeNode(type, contextNode, flags, internalFlags, tracker);
162818
+ const typeNode = checker.typeToTypeNode(type, contextNode, flags, internalFlags, tracker);
162819
+ if (!typeNode) {
162820
+ return void 0;
162821
+ }
162822
+ return typeNodeToAutoImportableTypeNode(typeNode, importAdder, scriptTarget);
162823
+ }
162824
+ function typeNodeToAutoImportableTypeNode(typeNode, importAdder, scriptTarget) {
162730
162825
  if (typeNode && isImportTypeNode(typeNode)) {
162731
162826
  const importableReference = tryGetAutoImportableReferenceFromTypeNode(typeNode, scriptTarget);
162732
162827
  if (importableReference) {
@@ -162736,6 +162831,42 @@ function typeToAutoImportableTypeNode(checker, importAdder, type, contextNode, s
162736
162831
  }
162737
162832
  return getSynthesizedDeepClone(typeNode);
162738
162833
  }
162834
+ function endOfRequiredTypeParameters(checker, type) {
162835
+ Debug.assert(type.typeArguments);
162836
+ const fullTypeArguments = type.typeArguments;
162837
+ const target = type.target;
162838
+ for (let cutoff = 0; cutoff < fullTypeArguments.length; cutoff++) {
162839
+ const typeArguments = fullTypeArguments.slice(0, cutoff);
162840
+ const filledIn = checker.fillMissingTypeArguments(
162841
+ typeArguments,
162842
+ target.typeParameters,
162843
+ cutoff,
162844
+ /*isJavaScriptImplicitAny*/
162845
+ false
162846
+ );
162847
+ if (filledIn.every((fill, i) => fill === fullTypeArguments[i])) {
162848
+ return cutoff;
162849
+ }
162850
+ }
162851
+ return fullTypeArguments.length;
162852
+ }
162853
+ function typeToMinimizedReferenceType(checker, type, contextNode, flags, internalFlags, tracker) {
162854
+ let typeNode = checker.typeToTypeNode(type, contextNode, flags, internalFlags, tracker);
162855
+ if (!typeNode) {
162856
+ return void 0;
162857
+ }
162858
+ if (isTypeReferenceNode(typeNode)) {
162859
+ const genericType = type;
162860
+ if (genericType.typeArguments && typeNode.typeArguments) {
162861
+ const cutoff = endOfRequiredTypeParameters(checker, genericType);
162862
+ if (cutoff < typeNode.typeArguments.length) {
162863
+ const newTypeArguments = factory.createNodeArray(typeNode.typeArguments.slice(0, cutoff));
162864
+ typeNode = factory.updateTypeReferenceNode(typeNode, typeNode.typeName, newTypeArguments);
162865
+ }
162866
+ }
162867
+ }
162868
+ return typeNode;
162869
+ }
162739
162870
  function typePredicateToAutoImportableTypeNode(checker, importAdder, typePredicate, contextNode, scriptTarget, flags, internalFlags, tracker) {
162740
162871
  let typePredicateNode = checker.typePredicateToTypePredicateNode(typePredicate, contextNode, flags, internalFlags, tracker);
162741
162872
  if ((typePredicateNode == null ? void 0 : typePredicateNode.type) && isImportTypeNode(typePredicateNode.type)) {
@@ -165724,7 +165855,7 @@ function getSourceFromOrigin(origin) {
165724
165855
  }
165725
165856
  function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, contextToken, location, position, sourceFile, host, program, target, log, kind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, jsxIdentifierExpected, isJsxInitializer, importStatementCompletion, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap, isJsxIdentifierExpected, isRightOfOpenTag, includeSymbol = false) {
165726
165857
  const start = timestamp();
165727
- const variableOrParameterDeclaration = getVariableOrParameterDeclaration(contextToken, location);
165858
+ const closestSymbolDeclaration = getClosestSymbolDeclaration(contextToken, location);
165728
165859
  const useSemicolons = probablyUsesSemicolons(sourceFile);
165729
165860
  const typeChecker = program.getTypeChecker();
165730
165861
  const uniques = /* @__PURE__ */ new Map();
@@ -165794,15 +165925,26 @@ function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, con
165794
165925
  if (isExportAssignment(location.parent)) {
165795
165926
  return true;
165796
165927
  }
165797
- if (tryCast(variableOrParameterDeclaration, isVariableDeclaration) && symbol.valueDeclaration === variableOrParameterDeclaration) {
165928
+ if (tryCast(closestSymbolDeclaration, isVariableDeclaration) && symbol.valueDeclaration === closestSymbolDeclaration) {
165798
165929
  return false;
165799
165930
  }
165800
165931
  const symbolDeclaration = symbol.valueDeclaration ?? ((_a = symbol.declarations) == null ? void 0 : _a[0]);
165801
- if (variableOrParameterDeclaration && symbolDeclaration && (isTypeParameterDeclaration(variableOrParameterDeclaration) && isTypeParameterDeclaration(symbolDeclaration) || isParameter(variableOrParameterDeclaration) && isParameter(symbolDeclaration))) {
165802
- const symbolDeclarationPos = symbolDeclaration.pos;
165803
- const parameters = isParameter(variableOrParameterDeclaration) ? variableOrParameterDeclaration.parent.parameters : isInferTypeNode(variableOrParameterDeclaration.parent) ? void 0 : variableOrParameterDeclaration.parent.typeParameters;
165804
- if (symbolDeclarationPos >= variableOrParameterDeclaration.pos && parameters && symbolDeclarationPos < parameters.end) {
165805
- return false;
165932
+ if (closestSymbolDeclaration && symbolDeclaration) {
165933
+ if (isParameter(closestSymbolDeclaration) && isParameter(symbolDeclaration)) {
165934
+ const parameters = closestSymbolDeclaration.parent.parameters;
165935
+ if (symbolDeclaration.pos >= closestSymbolDeclaration.pos && symbolDeclaration.pos < parameters.end) {
165936
+ return false;
165937
+ }
165938
+ } else if (isTypeParameterDeclaration(closestSymbolDeclaration) && isTypeParameterDeclaration(symbolDeclaration)) {
165939
+ if (closestSymbolDeclaration === symbolDeclaration && (contextToken == null ? void 0 : contextToken.kind) === 96 /* ExtendsKeyword */) {
165940
+ return false;
165941
+ }
165942
+ if (isInTypeParameterDefault(contextToken) && !isInferTypeNode(closestSymbolDeclaration.parent)) {
165943
+ const typeParameters = closestSymbolDeclaration.parent.typeParameters;
165944
+ if (typeParameters && symbolDeclaration.pos >= closestSymbolDeclaration.pos && symbolDeclaration.pos < typeParameters.end) {
165945
+ return false;
165946
+ }
165947
+ }
165806
165948
  }
165807
165949
  }
165808
165950
  const symbolOrigin = skipAlias(symbol, typeChecker);
@@ -168085,11 +168227,28 @@ function isModuleSpecifierMissingOrEmpty(specifier) {
168085
168227
  if (nodeIsMissing(specifier)) return true;
168086
168228
  return !((_a = tryCast(isExternalModuleReference(specifier) ? specifier.expression : specifier, isStringLiteralLike)) == null ? void 0 : _a.text);
168087
168229
  }
168088
- function getVariableOrParameterDeclaration(contextToken, location) {
168230
+ function getClosestSymbolDeclaration(contextToken, location) {
168089
168231
  if (!contextToken) return;
168090
- const possiblyParameterDeclaration = findAncestor(contextToken, (node) => isFunctionBlock(node) || isArrowFunctionBody(node) || isBindingPattern(node) ? "quit" : (isParameter(node) || isTypeParameterDeclaration(node)) && !isIndexSignatureDeclaration(node.parent));
168091
- const possiblyVariableDeclaration = findAncestor(location, (node) => isFunctionBlock(node) || isArrowFunctionBody(node) || isBindingPattern(node) ? "quit" : isVariableDeclaration(node));
168092
- return possiblyParameterDeclaration || possiblyVariableDeclaration;
168232
+ let closestDeclaration = findAncestor(contextToken, (node) => isFunctionBlock(node) || isArrowFunctionBody(node) || isBindingPattern(node) ? "quit" : (isParameter(node) || isTypeParameterDeclaration(node)) && !isIndexSignatureDeclaration(node.parent));
168233
+ if (!closestDeclaration) {
168234
+ closestDeclaration = findAncestor(location, (node) => isFunctionBlock(node) || isArrowFunctionBody(node) || isBindingPattern(node) ? "quit" : isVariableDeclaration(node));
168235
+ }
168236
+ return closestDeclaration;
168237
+ }
168238
+ function isInTypeParameterDefault(contextToken) {
168239
+ if (!contextToken) {
168240
+ return false;
168241
+ }
168242
+ let node = contextToken;
168243
+ let parent2 = contextToken.parent;
168244
+ while (parent2) {
168245
+ if (isTypeParameterDeclaration(parent2)) {
168246
+ return parent2.default === node || node.kind === 64 /* EqualsToken */;
168247
+ }
168248
+ node = parent2;
168249
+ parent2 = parent2.parent;
168250
+ }
168251
+ return false;
168093
168252
  }
168094
168253
  function isArrowFunctionBody(node) {
168095
168254
  return node.parent && isArrowFunction(node.parent) && (node.parent.body === node || // const a = () => /**/;
@@ -168855,7 +169014,7 @@ function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, mode, p
168855
169014
  return nodeModulesDirectoryLookup(ancestor);
168856
169015
  };
168857
169016
  }
168858
- forEachAncestorDirectory(scriptPath, ancestorLookup);
169017
+ forEachAncestorDirectoryStoppingAtGlobalCache(host, scriptPath, ancestorLookup);
168859
169018
  }
168860
169019
  }
168861
169020
  return arrayFrom(result.values());
@@ -180473,6 +180632,7 @@ __export(ts_exports2, {
180473
180632
  canWatchAffectingLocation: () => canWatchAffectingLocation,
180474
180633
  canWatchAtTypes: () => canWatchAtTypes,
180475
180634
  canWatchDirectoryOrFile: () => canWatchDirectoryOrFile,
180635
+ canWatchDirectoryOrFilePath: () => canWatchDirectoryOrFilePath,
180476
180636
  cartesianProduct: () => cartesianProduct,
180477
180637
  cast: () => cast,
180478
180638
  chainBundle: () => chainBundle,
@@ -180805,6 +180965,7 @@ __export(ts_exports2, {
180805
180965
  forEach: () => forEach,
180806
180966
  forEachAncestor: () => forEachAncestor,
180807
180967
  forEachAncestorDirectory: () => forEachAncestorDirectory,
180968
+ forEachAncestorDirectoryStoppingAtGlobalCache: () => forEachAncestorDirectoryStoppingAtGlobalCache,
180808
180969
  forEachChild: () => forEachChild,
180809
180970
  forEachChildRecursively: () => forEachChildRecursively,
180810
180971
  forEachEmittedFile: () => forEachEmittedFile,
@@ -181418,7 +181579,7 @@ __export(ts_exports2, {
181418
181579
  isBooleanLiteral: () => isBooleanLiteral,
181419
181580
  isBreakOrContinueStatement: () => isBreakOrContinueStatement,
181420
181581
  isBreakStatement: () => isBreakStatement,
181421
- isBuild: () => isBuild,
181582
+ isBuildCommand: () => isBuildCommand,
181422
181583
  isBuildInfoFile: () => isBuildInfoFile,
181423
181584
  isBuilderProgram: () => isBuilderProgram,
181424
181585
  isBundle: () => isBundle,
@@ -182427,6 +182588,7 @@ __export(ts_exports2, {
182427
182588
  tryRemoveExtension: () => tryRemoveExtension,
182428
182589
  tryRemovePrefix: () => tryRemovePrefix,
182429
182590
  tryRemoveSuffix: () => tryRemoveSuffix,
182591
+ tscBuildOption: () => tscBuildOption,
182430
182592
  typeAcquisitionDeclarations: () => typeAcquisitionDeclarations,
182431
182593
  typeAliasNamePart: () => typeAliasNamePart,
182432
182594
  typeDirectiveIsEqualTo: () => typeDirectiveIsEqualTo,
@@ -182652,6 +182814,7 @@ __export(ts_server_exports3, {
182652
182814
  formatDiagnosticToProtocol: () => formatDiagnosticToProtocol,
182653
182815
  formatMessage: () => formatMessage2,
182654
182816
  getBaseConfigFileName: () => getBaseConfigFileName,
182817
+ getDetailWatchInfo: () => getDetailWatchInfo,
182655
182818
  getLocationInNewDocument: () => getLocationInNewDocument,
182656
182819
  hasArgument: () => hasArgument,
182657
182820
  hasNoTypeScriptSource: () => hasNoTypeScriptSource,
@@ -184070,10 +184233,9 @@ function unresolvedImportsChanged(imports1, imports2) {
184070
184233
  }
184071
184234
  var Project2 = class _Project {
184072
184235
  /** @internal */
184073
- constructor(projectName, projectKind, projectService, documentRegistry, hasExplicitListOfFiles, lastFileExceededProgramSize, compilerOptions, compileOnSaveEnabled, watchOptions, directoryStructureHost, currentDirectory) {
184236
+ constructor(projectName, projectKind, projectService, hasExplicitListOfFiles, lastFileExceededProgramSize, compilerOptions, compileOnSaveEnabled, watchOptions, directoryStructureHost, currentDirectory) {
184074
184237
  this.projectKind = projectKind;
184075
184238
  this.projectService = projectService;
184076
- this.documentRegistry = documentRegistry;
184077
184239
  this.compilerOptions = compilerOptions;
184078
184240
  this.compileOnSaveEnabled = compileOnSaveEnabled;
184079
184241
  this.watchOptions = watchOptions;
@@ -184166,7 +184328,11 @@ var Project2 = class _Project {
184166
184328
  /*logChangesWhenResolvingModule*/
184167
184329
  true
184168
184330
  );
184169
- this.languageService = createLanguageService(this, this.documentRegistry, this.projectService.serverMode);
184331
+ this.languageService = createLanguageService(
184332
+ this,
184333
+ this.projectService.documentRegistry,
184334
+ this.projectService.serverMode
184335
+ );
184170
184336
  if (lastFileExceededProgramSize) {
184171
184337
  this.disableLanguageService(lastFileExceededProgramSize);
184172
184338
  }
@@ -184240,7 +184406,7 @@ var Project2 = class _Project {
184240
184406
  }
184241
184407
  /** @internal */
184242
184408
  getGlobalTypingsCacheLocation() {
184243
- return this.getGlobalCache();
184409
+ return this.getTypeAcquisition().enable ? this.projectService.typingsInstaller.globalTypingsCacheLocation : void 0;
184244
184410
  }
184245
184411
  /** @internal */
184246
184412
  getSymlinkCache() {
@@ -184455,10 +184621,6 @@ var Project2 = class _Project {
184455
184621
  this.projectService.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(this);
184456
184622
  }
184457
184623
  /** @internal */
184458
- getGlobalCache() {
184459
- return this.getTypeAcquisition().enable ? this.projectService.typingsInstaller.globalTypingsCacheLocation : void 0;
184460
- }
184461
- /** @internal */
184462
184624
  fileIsOpen(filePath) {
184463
184625
  return this.projectService.openFiles.has(filePath);
184464
184626
  }
@@ -184988,14 +185150,15 @@ var Project2 = class _Project {
184988
185150
  const canonicalPath = this.toPath(path);
184989
185151
  toRemove.delete(canonicalPath);
184990
185152
  if (!this.typingWatchers.has(canonicalPath)) {
185153
+ const watchType = typingsWatcherType === "FileWatcher" /* FileWatcher */ ? WatchType.TypingInstallerLocationFile : WatchType.TypingInstallerLocationDirectory;
184991
185154
  this.typingWatchers.set(
184992
185155
  canonicalPath,
184993
- typingsWatcherType === "FileWatcher" /* FileWatcher */ ? this.projectService.watchFactory.watchFile(
185156
+ canWatchDirectoryOrFilePath(canonicalPath) ? typingsWatcherType === "FileWatcher" /* FileWatcher */ ? this.projectService.watchFactory.watchFile(
184994
185157
  path,
184995
185158
  () => !this.typingWatchers.isInvoked ? this.onTypingInstallerWatchInvoke() : this.writeLog(`TypingWatchers already invoked`),
184996
185159
  2e3 /* High */,
184997
185160
  this.projectService.getWatchOptions(this),
184998
- WatchType.TypingInstallerLocationFile,
185161
+ watchType,
184999
185162
  this
185000
185163
  ) : this.projectService.watchFactory.watchDirectory(
185001
185164
  path,
@@ -185007,9 +185170,9 @@ var Project2 = class _Project {
185007
185170
  },
185008
185171
  1 /* Recursive */,
185009
185172
  this.projectService.getWatchOptions(this),
185010
- WatchType.TypingInstallerLocationDirectory,
185173
+ watchType,
185011
185174
  this
185012
- )
185175
+ ) : (this.writeLog(`Skipping watcher creation at ${path}:: ${getDetailWatchInfo(watchType, this)}`), noopFileWatcher)
185013
185176
  );
185014
185177
  }
185015
185178
  };
@@ -185551,7 +185714,7 @@ var Project2 = class _Project {
185551
185714
  }
185552
185715
  /** @internal */
185553
185716
  getNearestAncestorDirectoryWithPackageJson(fileName) {
185554
- return this.projectService.getNearestAncestorDirectoryWithPackageJson(fileName);
185717
+ return this.projectService.getNearestAncestorDirectoryWithPackageJson(fileName, this);
185555
185718
  }
185556
185719
  /** @internal */
185557
185720
  getPackageJsonsForAutoImport(rootDir) {
@@ -185622,7 +185785,11 @@ var Project2 = class _Project {
185622
185785
  if (dependencySelection) {
185623
185786
  (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "getPackageJsonAutoImportProvider");
185624
185787
  const start = timestamp();
185625
- this.autoImportProviderHost = AutoImportProviderProject.create(dependencySelection, this, this.getHostForAutoImportProvider(), this.documentRegistry) ?? false;
185788
+ this.autoImportProviderHost = AutoImportProviderProject.create(
185789
+ dependencySelection,
185790
+ this,
185791
+ this.getHostForAutoImportProvider()
185792
+ ) ?? false;
185626
185793
  if (this.autoImportProviderHost) {
185627
185794
  updateProjectIfDirty(this.autoImportProviderHost);
185628
185795
  this.sendPerformanceEvent("CreatePackageJsonAutoImportProvider", timestamp() - start);
@@ -185649,11 +185816,12 @@ var Project2 = class _Project {
185649
185816
  /** @internal */
185650
185817
  getNoDtsResolutionProject(rootFile) {
185651
185818
  Debug.assert(this.projectService.serverMode === 0 /* Semantic */);
185652
- if (!this.noDtsResolutionProject) {
185653
- this.noDtsResolutionProject = new AuxiliaryProject(this.projectService, this.documentRegistry, this.getCompilerOptionsForNoDtsResolutionProject(), this.currentDirectory);
185654
- }
185819
+ this.noDtsResolutionProject ?? (this.noDtsResolutionProject = new AuxiliaryProject(this));
185655
185820
  if (this.noDtsResolutionProject.rootFile !== rootFile) {
185656
- this.projectService.setFileNamesOfAutpImportProviderOrAuxillaryProject(this.noDtsResolutionProject, [rootFile]);
185821
+ this.projectService.setFileNamesOfAutoImportProviderOrAuxillaryProject(
185822
+ this.noDtsResolutionProject,
185823
+ [rootFile]
185824
+ );
185657
185825
  this.noDtsResolutionProject.rootFile = rootFile;
185658
185826
  }
185659
185827
  return this.noDtsResolutionProject;
@@ -185672,6 +185840,7 @@ var Project2 = class _Project {
185672
185840
  (_d = this.getScriptInfo(rootFile)) == null ? void 0 : _d.editContent(0, updatedText.length, originalText);
185673
185841
  }
185674
185842
  }
185843
+ /** @internal */
185675
185844
  getCompilerOptionsForNoDtsResolutionProject() {
185676
185845
  return {
185677
185846
  ...this.getCompilerOptions(),
@@ -185714,15 +185883,13 @@ function extractUnresolvedImportsFromSourceFile(program, file, ambientModules, c
185714
185883
  }
185715
185884
  var InferredProject2 = class extends Project2 {
185716
185885
  /** @internal */
185717
- constructor(projectService, documentRegistry, compilerOptions, watchOptions, projectRootPath, currentDirectory, typeAcquisition) {
185886
+ constructor(projectService, compilerOptions, watchOptions, projectRootPath, currentDirectory, typeAcquisition) {
185718
185887
  super(
185719
185888
  projectService.newInferredProjectName(),
185720
185889
  0 /* Inferred */,
185721
185890
  projectService,
185722
- documentRegistry,
185723
- // TODO: GH#18217
185724
- /*files*/
185725
- void 0,
185891
+ /*hasExplicitListOfFiles*/
185892
+ false,
185726
185893
  /*lastFileExceededProgramSize*/
185727
185894
  void 0,
185728
185895
  compilerOptions,
@@ -185807,23 +185974,22 @@ var InferredProject2 = class extends Project2 {
185807
185974
  }
185808
185975
  };
185809
185976
  var AuxiliaryProject = class extends Project2 {
185810
- constructor(projectService, documentRegistry, compilerOptions, currentDirectory) {
185977
+ constructor(hostProject) {
185811
185978
  super(
185812
- projectService.newAuxiliaryProjectName(),
185979
+ hostProject.projectService.newAuxiliaryProjectName(),
185813
185980
  4 /* Auxiliary */,
185814
- projectService,
185815
- documentRegistry,
185981
+ hostProject.projectService,
185816
185982
  /*hasExplicitListOfFiles*/
185817
185983
  false,
185818
185984
  /*lastFileExceededProgramSize*/
185819
185985
  void 0,
185820
- compilerOptions,
185986
+ hostProject.getCompilerOptionsForNoDtsResolutionProject(),
185821
185987
  /*compileOnSaveEnabled*/
185822
185988
  false,
185823
185989
  /*watchOptions*/
185824
185990
  void 0,
185825
- projectService.host,
185826
- currentDirectory
185991
+ hostProject.projectService.host,
185992
+ hostProject.currentDirectory
185827
185993
  );
185828
185994
  }
185829
185995
  isOrphan() {
@@ -185835,12 +186001,11 @@ var AuxiliaryProject = class extends Project2 {
185835
186001
  };
185836
186002
  var _AutoImportProviderProject = class _AutoImportProviderProject extends Project2 {
185837
186003
  /** @internal */
185838
- constructor(hostProject, initialRootNames, documentRegistry, compilerOptions) {
186004
+ constructor(hostProject, initialRootNames, compilerOptions) {
185839
186005
  super(
185840
186006
  hostProject.projectService.newAutoImportProviderProjectName(),
185841
186007
  3 /* AutoImportProvider */,
185842
186008
  hostProject.projectService,
185843
- documentRegistry,
185844
186009
  /*hasExplicitListOfFiles*/
185845
186010
  false,
185846
186011
  /*lastFileExceededProgramSize*/
@@ -186001,7 +186166,7 @@ var _AutoImportProviderProject = class _AutoImportProviderProject extends Projec
186001
186166
  }
186002
186167
  }
186003
186168
  /** @internal */
186004
- static create(dependencySelection, hostProject, host, documentRegistry) {
186169
+ static create(dependencySelection, hostProject, host) {
186005
186170
  if (dependencySelection === 0 /* Off */) {
186006
186171
  return void 0;
186007
186172
  }
@@ -186013,7 +186178,7 @@ var _AutoImportProviderProject = class _AutoImportProviderProject extends Projec
186013
186178
  if (!rootNames.length) {
186014
186179
  return void 0;
186015
186180
  }
186016
- return new _AutoImportProviderProject(hostProject, rootNames, documentRegistry, compilerOptions);
186181
+ return new _AutoImportProviderProject(hostProject, rootNames, compilerOptions);
186017
186182
  }
186018
186183
  /** @internal */
186019
186184
  isEmpty() {
@@ -186033,7 +186198,7 @@ var _AutoImportProviderProject = class _AutoImportProviderProject extends Projec
186033
186198
  this.getCompilationSettings()
186034
186199
  );
186035
186200
  }
186036
- this.projectService.setFileNamesOfAutpImportProviderOrAuxillaryProject(this, rootFileNames);
186201
+ this.projectService.setFileNamesOfAutoImportProviderOrAuxillaryProject(this, rootFileNames);
186037
186202
  this.rootFileNames = rootFileNames;
186038
186203
  const oldProgram = this.getCurrentProgram();
186039
186204
  const hasSameSetOfFiles = super.updateGraph();
@@ -186102,12 +186267,11 @@ _AutoImportProviderProject.compilerOptionsOverrides = {
186102
186267
  var AutoImportProviderProject = _AutoImportProviderProject;
186103
186268
  var ConfiguredProject2 = class extends Project2 {
186104
186269
  /** @internal */
186105
- constructor(configFileName, canonicalConfigFilePath, projectService, documentRegistry, cachedDirectoryStructureHost, pendingUpdateReason) {
186270
+ constructor(configFileName, canonicalConfigFilePath, projectService, cachedDirectoryStructureHost, pendingUpdateReason) {
186106
186271
  super(
186107
186272
  configFileName,
186108
186273
  1 /* Configured */,
186109
186274
  projectService,
186110
- documentRegistry,
186111
186275
  /*hasExplicitListOfFiles*/
186112
186276
  false,
186113
186277
  /*lastFileExceededProgramSize*/
@@ -186307,12 +186471,11 @@ var ConfiguredProject2 = class extends Project2 {
186307
186471
  };
186308
186472
  var ExternalProject = class extends Project2 {
186309
186473
  /** @internal */
186310
- constructor(externalProjectName, projectService, documentRegistry, compilerOptions, lastFileExceededProgramSize, compileOnSaveEnabled, projectFilePath, watchOptions) {
186474
+ constructor(externalProjectName, projectService, compilerOptions, lastFileExceededProgramSize, compileOnSaveEnabled, projectFilePath, watchOptions) {
186311
186475
  super(
186312
186476
  externalProjectName,
186313
186477
  2 /* External */,
186314
186478
  projectService,
186315
- documentRegistry,
186316
186479
  /*hasExplicitListOfFiles*/
186317
186480
  true,
186318
186481
  lastFileExceededProgramSize,
@@ -186935,7 +187098,12 @@ var _ProjectService = class _ProjectService {
186935
187098
  hostInfo: "Unknown host",
186936
187099
  extraFileExtensions: []
186937
187100
  };
186938
- this.documentRegistry = createDocumentRegistryInternal(this.host.useCaseSensitiveFileNames, this.currentDirectory, this.jsDocParsingMode, this);
187101
+ this.documentRegistry = createDocumentRegistryInternal(
187102
+ this.host.useCaseSensitiveFileNames,
187103
+ this.currentDirectory,
187104
+ this.jsDocParsingMode,
187105
+ this
187106
+ );
186939
187107
  const watchLogLevel = this.logger.hasLevel(3 /* verbose */) ? 2 /* Verbose */ : this.logger.loggingEnabled() ? 1 /* TriggerOnly */ : 0 /* None */;
186940
187108
  const log = watchLogLevel !== 0 /* None */ ? (s) => this.logger.info(s) : noop;
186941
187109
  this.packageJsonCache = createPackageJsonCache(this);
@@ -187707,7 +187875,7 @@ var _ProjectService = class _ProjectService {
187707
187875
  Debug.checkDefined(configFileExistenceInfo.watcher);
187708
187876
  if ((_c = configFileExistenceInfo.openFilesImpactedByConfigFile) == null ? void 0 : _c.size) {
187709
187877
  if (configFileExistenceInfo.inferredProjectRoots) {
187710
- if (!canWatchDirectoryOrFile(getPathComponents(getDirectoryPath(canonicalConfigFilePath)))) {
187878
+ if (!canWatchDirectoryOrFilePath(getDirectoryPath(canonicalConfigFilePath))) {
187711
187879
  configFileExistenceInfo.watcher.close();
187712
187880
  configFileExistenceInfo.watcher = noopConfigFileWatcher;
187713
187881
  }
@@ -187770,7 +187938,7 @@ var _ProjectService = class _ProjectService {
187770
187938
  configFileExistenceInfo.inferredProjectRoots = (configFileExistenceInfo.inferredProjectRoots ?? 0) + 1;
187771
187939
  }
187772
187940
  (configFileExistenceInfo.openFilesImpactedByConfigFile ?? (configFileExistenceInfo.openFilesImpactedByConfigFile = /* @__PURE__ */ new Set())).add(info.path);
187773
- configFileExistenceInfo.watcher || (configFileExistenceInfo.watcher = canWatchDirectoryOrFile(getPathComponents(getDirectoryPath(canonicalConfigFilePath))) ? this.watchFactory.watchFile(
187941
+ configFileExistenceInfo.watcher || (configFileExistenceInfo.watcher = canWatchDirectoryOrFilePath(getDirectoryPath(canonicalConfigFilePath)) ? this.watchFactory.watchFile(
187774
187942
  configFileName,
187775
187943
  (_filename, eventKind) => this.onConfigFileChanged(configFileName, canonicalConfigFilePath, eventKind),
187776
187944
  2e3 /* High */,
@@ -187919,7 +188087,6 @@ var _ProjectService = class _ProjectService {
187919
188087
  const project = new ExternalProject(
187920
188088
  projectFileName,
187921
188089
  this,
187922
- this.documentRegistry,
187923
188090
  compilerOptions,
187924
188091
  /*lastFileExceededProgramSize*/
187925
188092
  this.getFilenameForExceededTotalSizeLimitForNonTsFiles(projectFileName, compilerOptions, files, externalFilePropertyReader),
@@ -188008,7 +188175,6 @@ var _ProjectService = class _ProjectService {
188008
188175
  configFileName,
188009
188176
  canonicalConfigFilePath,
188010
188177
  this,
188011
- this.documentRegistry,
188012
188178
  configFileExistenceInfo.config.cachedDirectoryStructureHost,
188013
188179
  reason
188014
188180
  );
@@ -188285,7 +188451,7 @@ var _ProjectService = class _ProjectService {
188285
188451
  return fileNames;
188286
188452
  }
188287
188453
  /** @internal */
188288
- setFileNamesOfAutpImportProviderOrAuxillaryProject(project, fileNames) {
188454
+ setFileNamesOfAutoImportProviderOrAuxillaryProject(project, fileNames) {
188289
188455
  this.updateNonInferredProjectFiles(project, fileNames, fileNamePropertyReader);
188290
188456
  }
188291
188457
  /** @internal */
@@ -188375,9 +188541,11 @@ var _ProjectService = class _ProjectService {
188375
188541
  return this.inferredProjects[0];
188376
188542
  }
188377
188543
  return this.createInferredProject(
188378
- "",
188544
+ this.currentDirectory,
188379
188545
  /*isSingleInferredProject*/
188380
- true
188546
+ true,
188547
+ /*projectRootPath*/
188548
+ void 0
188381
188549
  );
188382
188550
  }
188383
188551
  getOrCreateSingleInferredWithoutProjectRoot(currentDirectory) {
@@ -188388,7 +188556,13 @@ var _ProjectService = class _ProjectService {
188388
188556
  return inferredProject;
188389
188557
  }
188390
188558
  }
188391
- return this.createInferredProject(currentDirectory);
188559
+ return this.createInferredProject(
188560
+ currentDirectory,
188561
+ /*isSingleInferredProject*/
188562
+ false,
188563
+ /*projectRootPath*/
188564
+ void 0
188565
+ );
188392
188566
  }
188393
188567
  createInferredProject(currentDirectory, isSingleInferredProject, projectRootPath) {
188394
188568
  const compilerOptions = projectRootPath && this.compilerOptionsForInferredProjectsPerProjectRoot.get(projectRootPath) || this.compilerOptionsForInferredProjects;
@@ -188405,7 +188579,14 @@ var _ProjectService = class _ProjectService {
188405
188579
  typeAcquisition = this.typeAcquisitionForInferredProjects;
188406
188580
  }
188407
188581
  watchOptionsAndErrors = watchOptionsAndErrors || void 0;
188408
- const project = new InferredProject2(this, this.documentRegistry, compilerOptions, watchOptionsAndErrors == null ? void 0 : watchOptionsAndErrors.watchOptions, projectRootPath, currentDirectory, typeAcquisition);
188582
+ const project = new InferredProject2(
188583
+ this,
188584
+ compilerOptions,
188585
+ watchOptionsAndErrors == null ? void 0 : watchOptionsAndErrors.watchOptions,
188586
+ projectRootPath,
188587
+ currentDirectory,
188588
+ typeAcquisition
188589
+ );
188409
188590
  project.setProjectErrors(watchOptionsAndErrors == null ? void 0 : watchOptionsAndErrors.errors);
188410
188591
  if (isSingleInferredProject) {
188411
188592
  this.inferredProjects.unshift(project);
@@ -189910,7 +190091,7 @@ Dynamic files must always be opened with service's current directory or service
189910
190091
  switch (packageJsonCache.directoryHasPackageJson(directory)) {
189911
190092
  // Sync and check same directory again
189912
190093
  case 3 /* Maybe */:
189913
- packageJsonCache.searchDirectoryAndAncestors(directory);
190094
+ packageJsonCache.searchDirectoryAndAncestors(directory, project);
189914
190095
  return processDirectory(directory);
189915
190096
  // Check package.json
189916
190097
  case -1 /* True */:
@@ -189923,21 +190104,29 @@ Dynamic files must always be opened with service's current directory or service
189923
190104
  return true;
189924
190105
  }
189925
190106
  };
189926
- forEachAncestorDirectory(getDirectoryPath(fileName), processDirectory);
190107
+ forEachAncestorDirectoryStoppingAtGlobalCache(
190108
+ project,
190109
+ getDirectoryPath(fileName),
190110
+ processDirectory
190111
+ );
189927
190112
  return result;
189928
190113
  }
189929
190114
  /** @internal */
189930
- getNearestAncestorDirectoryWithPackageJson(fileName) {
189931
- return forEachAncestorDirectory(fileName, (directory) => {
189932
- switch (this.packageJsonCache.directoryHasPackageJson(directory)) {
189933
- case -1 /* True */:
189934
- return directory;
189935
- case 0 /* False */:
189936
- return void 0;
189937
- case 3 /* Maybe */:
189938
- return this.host.fileExists(combinePaths(directory, "package.json")) ? directory : void 0;
190115
+ getNearestAncestorDirectoryWithPackageJson(fileName, project) {
190116
+ return forEachAncestorDirectoryStoppingAtGlobalCache(
190117
+ project,
190118
+ fileName,
190119
+ (directory) => {
190120
+ switch (this.packageJsonCache.directoryHasPackageJson(directory)) {
190121
+ case -1 /* True */:
190122
+ return directory;
190123
+ case 0 /* False */:
190124
+ return void 0;
190125
+ case 3 /* Maybe */:
190126
+ return this.host.fileExists(combinePaths(directory, "package.json")) ? directory : void 0;
190127
+ }
189939
190128
  }
189940
- });
190129
+ );
189941
190130
  }
189942
190131
  watchPackageJsonFile(file, path, project) {
189943
190132
  Debug.assert(project !== void 0);
@@ -190150,19 +190339,23 @@ function createPackageJsonCache(host) {
190150
190339
  return packageJsons.get(host.toPath(combinePaths(directory, "package.json"))) || void 0;
190151
190340
  },
190152
190341
  directoryHasPackageJson: (directory) => directoryHasPackageJson(host.toPath(directory)),
190153
- searchDirectoryAndAncestors: (directory) => {
190154
- forEachAncestorDirectory(directory, (ancestor) => {
190155
- const ancestorPath = host.toPath(ancestor);
190156
- if (directoryHasPackageJson(ancestorPath) !== 3 /* Maybe */) {
190157
- return true;
190158
- }
190159
- const packageJsonFileName = combinePaths(ancestor, "package.json");
190160
- if (tryFileExists(host, packageJsonFileName)) {
190161
- addOrUpdate(packageJsonFileName, combinePaths(ancestorPath, "package.json"));
190162
- } else {
190163
- directoriesWithoutPackageJson.set(ancestorPath, true);
190342
+ searchDirectoryAndAncestors: (directory, project) => {
190343
+ forEachAncestorDirectoryStoppingAtGlobalCache(
190344
+ project,
190345
+ directory,
190346
+ (ancestor) => {
190347
+ const ancestorPath = host.toPath(ancestor);
190348
+ if (directoryHasPackageJson(ancestorPath) !== 3 /* Maybe */) {
190349
+ return true;
190350
+ }
190351
+ const packageJsonFileName = combinePaths(ancestor, "package.json");
190352
+ if (tryFileExists(host, packageJsonFileName)) {
190353
+ addOrUpdate(packageJsonFileName, combinePaths(ancestorPath, "package.json"));
190354
+ } else {
190355
+ directoriesWithoutPackageJson.set(ancestorPath, true);
190356
+ }
190164
190357
  }
190165
- });
190358
+ );
190166
190359
  }
190167
190360
  };
190168
190361
  function addOrUpdate(fileName, path) {
@@ -194565,6 +194758,7 @@ __export(ts_server_exports4, {
194565
194758
  formatDiagnosticToProtocol: () => formatDiagnosticToProtocol,
194566
194759
  formatMessage: () => formatMessage2,
194567
194760
  getBaseConfigFileName: () => getBaseConfigFileName,
194761
+ getDetailWatchInfo: () => getDetailWatchInfo,
194568
194762
  getLocationInNewDocument: () => getLocationInNewDocument,
194569
194763
  hasArgument: () => hasArgument,
194570
194764
  hasNoTypeScriptSource: () => hasNoTypeScriptSource,
@@ -194837,6 +195031,7 @@ if (typeof console !== "undefined") {
194837
195031
  canWatchAffectingLocation,
194838
195032
  canWatchAtTypes,
194839
195033
  canWatchDirectoryOrFile,
195034
+ canWatchDirectoryOrFilePath,
194840
195035
  cartesianProduct,
194841
195036
  cast,
194842
195037
  chainBundle,
@@ -195169,6 +195364,7 @@ if (typeof console !== "undefined") {
195169
195364
  forEach,
195170
195365
  forEachAncestor,
195171
195366
  forEachAncestorDirectory,
195367
+ forEachAncestorDirectoryStoppingAtGlobalCache,
195172
195368
  forEachChild,
195173
195369
  forEachChildRecursively,
195174
195370
  forEachEmittedFile,
@@ -195782,7 +195978,7 @@ if (typeof console !== "undefined") {
195782
195978
  isBooleanLiteral,
195783
195979
  isBreakOrContinueStatement,
195784
195980
  isBreakStatement,
195785
- isBuild,
195981
+ isBuildCommand,
195786
195982
  isBuildInfoFile,
195787
195983
  isBuilderProgram,
195788
195984
  isBundle,
@@ -196791,6 +196987,7 @@ if (typeof console !== "undefined") {
196791
196987
  tryRemoveExtension,
196792
196988
  tryRemovePrefix,
196793
196989
  tryRemoveSuffix,
196990
+ tscBuildOption,
196794
196991
  typeAcquisitionDeclarations,
196795
196992
  typeAliasNamePart,
196796
196993
  typeDirectiveIsEqualTo,