typescript 5.3.0-dev.20230921 → 5.3.0-dev.20230923

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/typescript.js CHANGED
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.3";
38
- version = `${versionMajorMinor}.0-dev.20230921`;
38
+ version = `${versionMajorMinor}.0-dev.20230923`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -3497,7 +3497,7 @@ ${lanes.join("\n")}
3497
3497
  const name = DiagnosticCategory[d.category];
3498
3498
  return lowerCase ? name.toLowerCase() : name;
3499
3499
  }
3500
- var SyntaxKind, NodeFlags, ModifierFlags, JsxFlags, RelationComparisonResult, GeneratedIdentifierFlags, TokenFlags, FlowFlags, CommentDirectiveType, OperationCanceledException, FileIncludeKind, FilePreprocessingDiagnosticsKind, EmitOnly, StructureIsReused, ExitStatus, MemberOverrideStatus, UnionReduction, ContextFlags, NodeBuilderFlags, TypeFormatFlags, SymbolFormatFlags, SymbolAccessibility, SyntheticSymbolKind, TypePredicateKind, TypeReferenceSerializationKind, SymbolFlags, EnumKind, CheckFlags, InternalSymbolName, NodeCheckFlags, TypeFlags, ObjectFlags, VarianceFlags, ElementFlags, AccessFlags, IndexFlags, JsxReferenceKind, SignatureKind, SignatureFlags, IndexKind, TypeMapKind, InferencePriority, InferenceFlags, Ternary, AssignmentDeclarationKind, DiagnosticCategory, ModuleResolutionKind, ModuleDetectionKind, WatchFileKind, WatchDirectoryKind, PollingWatchKind, ModuleKind, JsxEmit, ImportsNotUsedAsValues, NewLineKind, ScriptKind, ScriptTarget, LanguageVariant, WatchDirectoryFlags, CharacterCodes, Extension, TransformFlags, SnippetKind, EmitFlags, InternalEmitFlags, ExternalEmitHelpers, EmitHint, OuterExpressionKinds, LexicalEnvironmentFlags, BundleFileSectionKind, ListFormat, PragmaKindFlags, commentPragmas;
3500
+ var SyntaxKind, NodeFlags, ModifierFlags, JsxFlags, RelationComparisonResult, GeneratedIdentifierFlags, TokenFlags, FlowFlags, CommentDirectiveType, OperationCanceledException, FileIncludeKind, FilePreprocessingDiagnosticsKind, EmitOnly, StructureIsReused, ExitStatus, MemberOverrideStatus, UnionReduction, ContextFlags, NodeBuilderFlags, TypeFormatFlags, SymbolFormatFlags, SymbolAccessibility, SyntheticSymbolKind, TypePredicateKind, TypeReferenceSerializationKind, SymbolFlags, EnumKind, CheckFlags, InternalSymbolName, NodeCheckFlags, TypeFlags, ObjectFlags, VarianceFlags, ElementFlags, AccessFlags, IndexFlags, JsxReferenceKind, SignatureKind, SignatureFlags, IndexKind, TypeMapKind, InferencePriority, InferenceFlags, Ternary, AssignmentDeclarationKind, DiagnosticCategory, ModuleResolutionKind, ModuleDetectionKind, WatchFileKind, WatchDirectoryKind, PollingWatchKind, ModuleKind, JsxEmit, ImportsNotUsedAsValues, NewLineKind, ScriptKind, ScriptTarget, LanguageVariant, WatchDirectoryFlags, CharacterCodes, Extension, TransformFlags, SnippetKind, EmitFlags, InternalEmitFlags, ExternalEmitHelpers, EmitHint, OuterExpressionKinds, LexicalEnvironmentFlags, BundleFileSectionKind, ListFormat, PragmaKindFlags, commentPragmas, JSDocParsingMode;
3501
3501
  var init_types = __esm({
3502
3502
  "src/compiler/types.ts"() {
3503
3503
  "use strict";
@@ -5183,6 +5183,13 @@ ${lanes.join("\n")}
5183
5183
  kind: 4 /* MultiLine */
5184
5184
  }
5185
5185
  };
5186
+ JSDocParsingMode = /* @__PURE__ */ ((JSDocParsingMode7) => {
5187
+ JSDocParsingMode7[JSDocParsingMode7["ParseAll"] = 0] = "ParseAll";
5188
+ JSDocParsingMode7[JSDocParsingMode7["ParseNone"] = 1] = "ParseNone";
5189
+ JSDocParsingMode7[JSDocParsingMode7["ParseForTypeErrors"] = 2] = "ParseForTypeErrors";
5190
+ JSDocParsingMode7[JSDocParsingMode7["ParseForTypeInfo"] = 3] = "ParseForTypeInfo";
5191
+ return JSDocParsingMode7;
5192
+ })(JSDocParsingMode || {});
5186
5193
  }
5187
5194
  });
5188
5195
 
@@ -7944,6 +7951,7 @@ ${lanes.join("\n")}
7944
7951
  await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(2852, 1 /* Error */, "await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_2852", "'await using' statements are only allowed within async functions and at the top levels of modules."),
7945
7952
  await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(2853, 1 /* Error */, "await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_th_2853", "'await using' statements are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
7946
7953
  Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(2854, 1 /* Error */, "Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_sys_2854", "Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
7954
+ Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super: diag(2855, 1 /* Error */, "Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super_2855", "Class field '{0}' defined by the parent class is not accessible in the child class via super."),
7947
7955
  Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
7948
7956
  Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
7949
7957
  Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
@@ -8991,7 +8999,7 @@ ${lanes.join("\n")}
8991
8999
  Could_not_convert_to_arrow_function: diag(95151, 3 /* Message */, "Could_not_convert_to_arrow_function_95151", "Could not convert to arrow function"),
8992
9000
  Could_not_convert_to_named_function: diag(95152, 3 /* Message */, "Could_not_convert_to_named_function_95152", "Could not convert to named function"),
8993
9001
  Could_not_convert_to_anonymous_function: diag(95153, 3 /* Message */, "Could_not_convert_to_anonymous_function_95153", "Could not convert to anonymous function"),
8994
- Can_only_convert_string_concatenation: diag(95154, 3 /* Message */, "Can_only_convert_string_concatenation_95154", "Can only convert string concatenation"),
9002
+ Can_only_convert_string_concatenations_and_string_literals: diag(95154, 3 /* Message */, "Can_only_convert_string_concatenations_and_string_literals_95154", "Can only convert string concatenations and string literals"),
8995
9003
  Selection_is_not_a_valid_statement_or_statements: diag(95155, 3 /* Message */, "Selection_is_not_a_valid_statement_or_statements_95155", "Selection is not a valid statement or statements"),
8996
9004
  Add_missing_function_declaration_0: diag(95156, 3 /* Message */, "Add_missing_function_declaration_0_95156", "Add missing function declaration '{0}'"),
8997
9005
  Add_all_missing_function_declarations: diag(95157, 3 /* Message */, "Add_all_missing_function_declarations_95157", "Add all missing function declarations"),
@@ -9582,7 +9590,8 @@ ${lanes.join("\n")}
9582
9590
  var tokenFlags;
9583
9591
  var commentDirectives;
9584
9592
  var inJSDocType = 0;
9585
- var skipNonSemanticJSDoc = false;
9593
+ var scriptKind = 0 /* Unknown */;
9594
+ var jsDocParsingMode = 0 /* ParseAll */;
9586
9595
  setText(text, start, length2);
9587
9596
  var scanner2 = {
9588
9597
  getTokenFullStart: () => fullStartPos,
@@ -9626,14 +9635,15 @@ ${lanes.join("\n")}
9626
9635
  setText,
9627
9636
  setScriptTarget,
9628
9637
  setLanguageVariant,
9638
+ setScriptKind,
9639
+ setJSDocParsingMode,
9629
9640
  setOnError,
9630
9641
  resetTokenState,
9631
9642
  setTextPos: resetTokenState,
9632
9643
  setInJSDocType,
9633
9644
  tryScan,
9634
9645
  lookAhead,
9635
- scanRange,
9636
- setSkipNonSemanticJSDoc
9646
+ scanRange
9637
9647
  };
9638
9648
  if (Debug.isDebugging) {
9639
9649
  Object.defineProperty(scanner2, "__debugShowCurrentPositionInText", {
@@ -10421,7 +10431,7 @@ ${lanes.join("\n")}
10421
10431
  tokenFlags |= 1 /* PrecedingLineBreak */;
10422
10432
  }
10423
10433
  }
10424
- if (isJSDoc2 && (!skipNonSemanticJSDoc || semanticJSDocTagRegEx.test(text.slice(fullStartPos, pos)))) {
10434
+ if (isJSDoc2 && shouldParseJSDoc()) {
10425
10435
  tokenFlags |= 2 /* PrecedingJSDocComment */;
10426
10436
  }
10427
10437
  commentDirectives = appendIfCommentDirective(commentDirectives, text.slice(lastLineStart, pos), commentDirectiveRegExMultiLine, lastLineStart);
@@ -10680,6 +10690,21 @@ ${lanes.join("\n")}
10680
10690
  }
10681
10691
  }
10682
10692
  }
10693
+ function shouldParseJSDoc() {
10694
+ switch (jsDocParsingMode) {
10695
+ case 0 /* ParseAll */:
10696
+ return true;
10697
+ case 1 /* ParseNone */:
10698
+ return false;
10699
+ }
10700
+ if (scriptKind !== 3 /* TS */ && scriptKind !== 4 /* TSX */) {
10701
+ return true;
10702
+ }
10703
+ if (jsDocParsingMode === 3 /* ParseForTypeInfo */) {
10704
+ return false;
10705
+ }
10706
+ return jsDocSeeOrLink.test(text.slice(fullStartPos, pos));
10707
+ }
10683
10708
  function reScanInvalidIdentifier() {
10684
10709
  Debug.assert(token === 0 /* Unknown */, "'reScanInvalidIdentifier' should only be called when the current token is 'SyntaxKind.Unknown'.");
10685
10710
  pos = tokenStart = fullStartPos;
@@ -11094,8 +11119,11 @@ ${lanes.join("\n")}
11094
11119
  function setLanguageVariant(variant) {
11095
11120
  languageVariant = variant;
11096
11121
  }
11097
- function setSkipNonSemanticJSDoc(skip) {
11098
- skipNonSemanticJSDoc = skip;
11122
+ function setScriptKind(kind) {
11123
+ scriptKind = kind;
11124
+ }
11125
+ function setJSDocParsingMode(kind) {
11126
+ jsDocParsingMode = kind;
11099
11127
  }
11100
11128
  function resetTokenState(position) {
11101
11129
  Debug.assert(position >= 0);
@@ -11131,7 +11159,7 @@ ${lanes.join("\n")}
11131
11159
  function utf16EncodeAsString(codePoint) {
11132
11160
  return utf16EncodeAsStringWorker(codePoint);
11133
11161
  }
11134
- var textToKeywordObj, textToKeyword, textToToken, unicodeES3IdentifierStart, unicodeES3IdentifierPart, unicodeES5IdentifierStart, unicodeES5IdentifierPart, unicodeESNextIdentifierStart, unicodeESNextIdentifierPart, commentDirectiveRegExSingleLine, commentDirectiveRegExMultiLine, semanticJSDocTagRegEx, tokenStrings, mergeConflictMarkerLength, shebangTriviaRegex, utf16EncodeAsStringWorker;
11162
+ var textToKeywordObj, textToKeyword, textToToken, unicodeES3IdentifierStart, unicodeES3IdentifierPart, unicodeES5IdentifierStart, unicodeES5IdentifierPart, unicodeESNextIdentifierStart, unicodeESNextIdentifierPart, commentDirectiveRegExSingleLine, commentDirectiveRegExMultiLine, jsDocSeeOrLink, tokenStrings, mergeConflictMarkerLength, shebangTriviaRegex, utf16EncodeAsStringWorker;
11135
11163
  var init_scanner = __esm({
11136
11164
  "src/compiler/scanner.ts"() {
11137
11165
  "use strict";
@@ -11294,7 +11322,7 @@ ${lanes.join("\n")}
11294
11322
  unicodeESNextIdentifierPart = [48, 57, 65, 90, 95, 95, 97, 122, 170, 170, 181, 181, 183, 183, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 895, 895, 902, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1519, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2045, 2045, 2048, 2093, 2112, 2139, 2144, 2154, 2208, 2228, 2230, 2237, 2259, 2273, 2275, 2403, 2406, 2415, 2417, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2556, 2556, 2558, 2558, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2809, 2815, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3072, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3162, 3168, 3171, 3174, 3183, 3200, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3328, 3331, 3333, 3340, 3342, 3344, 3346, 3396, 3398, 3400, 3402, 3406, 3412, 3415, 3423, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3558, 3567, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4969, 4977, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6e3, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6264, 6272, 6314, 6320, 6389, 6400, 6430, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6618, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6832, 6845, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7376, 7378, 7380, 7418, 7424, 7673, 7675, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42737, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43047, 43072, 43123, 43136, 43205, 43216, 43225, 43232, 43255, 43259, 43259, 43261, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43488, 43518, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65071, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66045, 66045, 66176, 66204, 66208, 66256, 66272, 66272, 66304, 66335, 66349, 66378, 66384, 66426, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66720, 66729, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68099, 68101, 68102, 68108, 68115, 68117, 68119, 68121, 68149, 68152, 68154, 68159, 68159, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68326, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68903, 68912, 68921, 69376, 69404, 69415, 69415, 69424, 69456, 69600, 69622, 69632, 69702, 69734, 69743, 69759, 69818, 69840, 69864, 69872, 69881, 69888, 69940, 69942, 69951, 69956, 69958, 69968, 70003, 70006, 70006, 70016, 70084, 70089, 70092, 70096, 70106, 70108, 70108, 70144, 70161, 70163, 70199, 70206, 70206, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70378, 70384, 70393, 70400, 70403, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70459, 70468, 70471, 70472, 70475, 70477, 70480, 70480, 70487, 70487, 70493, 70499, 70502, 70508, 70512, 70516, 70656, 70730, 70736, 70745, 70750, 70751, 70784, 70853, 70855, 70855, 70864, 70873, 71040, 71093, 71096, 71104, 71128, 71133, 71168, 71232, 71236, 71236, 71248, 71257, 71296, 71352, 71360, 71369, 71424, 71450, 71453, 71467, 71472, 71481, 71680, 71738, 71840, 71913, 71935, 71935, 72096, 72103, 72106, 72151, 72154, 72161, 72163, 72164, 72192, 72254, 72263, 72263, 72272, 72345, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72758, 72760, 72768, 72784, 72793, 72818, 72847, 72850, 72871, 72873, 72886, 72960, 72966, 72968, 72969, 72971, 73014, 73018, 73018, 73020, 73021, 73023, 73031, 73040, 73049, 73056, 73061, 73063, 73064, 73066, 73102, 73104, 73105, 73107, 73112, 73120, 73129, 73440, 73462, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92768, 92777, 92880, 92909, 92912, 92916, 92928, 92982, 92992, 92995, 93008, 93017, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94031, 94087, 94095, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 113821, 113822, 119141, 119145, 119149, 119154, 119163, 119170, 119173, 119179, 119210, 119213, 119362, 119364, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 120782, 120831, 121344, 121398, 121403, 121452, 121461, 121461, 121476, 121476, 121499, 121503, 121505, 121519, 122880, 122886, 122888, 122904, 122907, 122913, 122915, 122916, 122918, 122922, 123136, 123180, 123184, 123197, 123200, 123209, 123214, 123214, 123584, 123641, 124928, 125124, 125136, 125142, 125184, 125259, 125264, 125273, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101, 917760, 917999];
11295
11323
  commentDirectiveRegExSingleLine = /^\/\/\/?\s*@(ts-expect-error|ts-ignore)/;
11296
11324
  commentDirectiveRegExMultiLine = /^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/;
11297
- semanticJSDocTagRegEx = /@(?:see|link)/i;
11325
+ jsDocSeeOrLink = /@(?:see|link)/i;
11298
11326
  tokenStrings = makeReverseMap(textToToken);
11299
11327
  mergeConflictMarkerLength = "<<<<<<<".length;
11300
11328
  shebangTriviaRegex = /^#!.*/;
@@ -12237,6 +12265,9 @@ ${lanes.join("\n")}
12237
12265
  function isAutoAccessorPropertyDeclaration(node) {
12238
12266
  return isPropertyDeclaration(node) && hasAccessorModifier(node);
12239
12267
  }
12268
+ function isClassFieldAndNotAutoAccessor(node) {
12269
+ return node.parent && isClassLike(node.parent) && isPropertyDeclaration(node) && !hasAccessorModifier(node);
12270
+ }
12240
12271
  function isMethodOrAccessor(node) {
12241
12272
  switch (node.kind) {
12242
12273
  case 174 /* MethodDeclaration */:
@@ -12943,8 +12974,8 @@ ${lanes.join("\n")}
12943
12974
  return oldResolution === newResolution || oldResolution.resolvedModule === newResolution.resolvedModule || !!oldResolution.resolvedModule && !!newResolution.resolvedModule && oldResolution.resolvedModule.isExternalLibraryImport === newResolution.resolvedModule.isExternalLibraryImport && oldResolution.resolvedModule.extension === newResolution.resolvedModule.extension && oldResolution.resolvedModule.resolvedFileName === newResolution.resolvedModule.resolvedFileName && oldResolution.resolvedModule.originalPath === newResolution.resolvedModule.originalPath && packageIdIsEqual(oldResolution.resolvedModule.packageId, newResolution.resolvedModule.packageId) && oldResolution.node10Result === newResolution.node10Result;
12944
12975
  }
12945
12976
  function createModuleNotFoundChain(sourceFile, host, moduleReference, mode, packageName) {
12946
- var _a, _b, _c;
12947
- const node10Result = (_c = (_b = (_a = host.resolvedModules) == null ? void 0 : _a.get(sourceFile.path)) == null ? void 0 : _b.get(moduleReference, mode)) == null ? void 0 : _c.node10Result;
12977
+ var _a;
12978
+ const node10Result = (_a = host.getResolvedModule(sourceFile, moduleReference, mode)) == null ? void 0 : _a.node10Result;
12948
12979
  const result = node10Result ? chainDiagnosticMessages(
12949
12980
  /*details*/
12950
12981
  void 0,
@@ -12986,14 +13017,14 @@ ${lanes.join("\n")}
12986
13017
  function typeDirectiveIsEqualTo(oldResolution, newResolution) {
12987
13018
  return oldResolution === newResolution || oldResolution.resolvedTypeReferenceDirective === newResolution.resolvedTypeReferenceDirective || !!oldResolution.resolvedTypeReferenceDirective && !!newResolution.resolvedTypeReferenceDirective && oldResolution.resolvedTypeReferenceDirective.resolvedFileName === newResolution.resolvedTypeReferenceDirective.resolvedFileName && !!oldResolution.resolvedTypeReferenceDirective.primary === !!newResolution.resolvedTypeReferenceDirective.primary && oldResolution.resolvedTypeReferenceDirective.originalPath === newResolution.resolvedTypeReferenceDirective.originalPath;
12988
13019
  }
12989
- function hasChangesInResolutions(names, newSourceFile, newResolutions, oldResolutions, comparer, nameAndModeGetter) {
13020
+ function hasChangesInResolutions(names, newSourceFile, newResolutions, getOldResolution, comparer, nameAndModeGetter) {
12990
13021
  Debug.assert(names.length === newResolutions.length);
12991
13022
  for (let i = 0; i < names.length; i++) {
12992
13023
  const newResolution = newResolutions[i];
12993
13024
  const entry = names[i];
12994
13025
  const name = nameAndModeGetter.getName(entry);
12995
13026
  const mode = nameAndModeGetter.getMode(entry, newSourceFile);
12996
- const oldResolution = oldResolutions && oldResolutions.get(name, mode);
13027
+ const oldResolution = getOldResolution(name, mode);
12997
13028
  const changed = oldResolution ? !newResolution || !comparer(oldResolution, newResolution) : newResolution;
12998
13029
  if (changed) {
12999
13030
  return true;
@@ -17887,11 +17918,11 @@ ${lanes.join("\n")}
17887
17918
  (symlinkedDirectories || (symlinkedDirectories = /* @__PURE__ */ new Map())).set(symlinkPath, real);
17888
17919
  }
17889
17920
  },
17890
- setSymlinksFromResolutions(resolvedModules, resolvedTypeReferenceDirectiveNames, typeReferenceDirectives) {
17921
+ setSymlinksFromResolutions(forEachResolvedModule, forEachResolvedTypeReferenceDirective, typeReferenceDirectives) {
17891
17922
  Debug.assert(!hasProcessedResolutions);
17892
17923
  hasProcessedResolutions = true;
17893
- resolvedModules == null ? void 0 : resolvedModules.forEach((cache) => cache.forEach((resolution) => processResolution(this, resolution.resolvedModule)));
17894
- resolvedTypeReferenceDirectiveNames == null ? void 0 : resolvedTypeReferenceDirectiveNames.forEach((cache) => cache.forEach((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective)));
17924
+ forEachResolvedModule((resolution) => processResolution(this, resolution.resolvedModule));
17925
+ forEachResolvedTypeReferenceDirective((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective));
17895
17926
  typeReferenceDirectives.forEach((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective));
17896
17927
  },
17897
17928
  hasProcessedResolutions: () => hasProcessedResolutions
@@ -28066,7 +28097,7 @@ ${lanes.join("\n")}
28066
28097
  function setExternalModuleIndicator(sourceFile) {
28067
28098
  sourceFile.externalModuleIndicator = isFileProbablyExternalModule(sourceFile);
28068
28099
  }
28069
- function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind, skipNonSemanticJSDoc) {
28100
+ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind) {
28070
28101
  var _a, _b, _c, _d;
28071
28102
  (_a = tracing) == null ? void 0 : _a.push(
28072
28103
  tracing.Phase.Parse,
@@ -28081,7 +28112,8 @@ ${lanes.join("\n")}
28081
28112
  const {
28082
28113
  languageVersion,
28083
28114
  setExternalModuleIndicator: overrideSetExternalModuleIndicator,
28084
- impliedNodeFormat: format
28115
+ impliedNodeFormat: format,
28116
+ jsDocParsingMode
28085
28117
  } = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions : { languageVersion: languageVersionOrOptions };
28086
28118
  if (languageVersion === 100 /* JSON */) {
28087
28119
  result = Parser.parseSourceFile(
@@ -28093,7 +28125,7 @@ ${lanes.join("\n")}
28093
28125
  setParentNodes,
28094
28126
  6 /* JSON */,
28095
28127
  noop,
28096
- skipNonSemanticJSDoc
28128
+ jsDocParsingMode
28097
28129
  );
28098
28130
  } else {
28099
28131
  const setIndicator = format === void 0 ? overrideSetExternalModuleIndicator : (file) => {
@@ -28109,7 +28141,7 @@ ${lanes.join("\n")}
28109
28141
  setParentNodes,
28110
28142
  scriptKind,
28111
28143
  setIndicator,
28112
- skipNonSemanticJSDoc
28144
+ jsDocParsingMode
28113
28145
  );
28114
28146
  }
28115
28147
  (_c = perfLogger) == null ? void 0 : _c.logStopParseSourceFile();
@@ -28893,7 +28925,7 @@ ${lanes.join("\n")}
28893
28925
  var contextFlags;
28894
28926
  var topLevel = true;
28895
28927
  var parseErrorBeforeNextFinishedNode = false;
28896
- function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride, skipNonSemanticJSDoc) {
28928
+ function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride, jsDocParsingMode = 0 /* ParseAll */) {
28897
28929
  var _a;
28898
28930
  scriptKind2 = ensureScriptKind(fileName2, scriptKind2);
28899
28931
  if (scriptKind2 === 6 /* JSON */) {
@@ -28915,9 +28947,8 @@ ${lanes.join("\n")}
28915
28947
  result2.pragmas = emptyMap;
28916
28948
  return result2;
28917
28949
  }
28918
- skipNonSemanticJSDoc = !!skipNonSemanticJSDoc && scriptKind2 !== 1 /* JS */ && scriptKind2 !== 2 /* JSX */;
28919
- initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, scriptKind2, skipNonSemanticJSDoc);
28920
- const result = parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride || setExternalModuleIndicator, skipNonSemanticJSDoc);
28950
+ initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, scriptKind2, jsDocParsingMode);
28951
+ const result = parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride || setExternalModuleIndicator, jsDocParsingMode);
28921
28952
  clearState();
28922
28953
  return result;
28923
28954
  }
@@ -28930,8 +28961,7 @@ ${lanes.join("\n")}
28930
28961
  /*syntaxCursor*/
28931
28962
  void 0,
28932
28963
  1 /* JS */,
28933
- /*skipNonSemanticJSDoc*/
28934
- false
28964
+ 0 /* ParseAll */
28935
28965
  );
28936
28966
  nextToken();
28937
28967
  const entityName = parseEntityName(
@@ -28944,15 +28974,7 @@ ${lanes.join("\n")}
28944
28974
  }
28945
28975
  Parser2.parseIsolatedEntityName = parseIsolatedEntityName2;
28946
28976
  function parseJsonText2(fileName2, sourceText2, languageVersion2 = 2 /* ES2015 */, syntaxCursor2, setParentNodes = false) {
28947
- initializeState(
28948
- fileName2,
28949
- sourceText2,
28950
- languageVersion2,
28951
- syntaxCursor2,
28952
- 6 /* JSON */,
28953
- /*skipNonSemanticJSDoc*/
28954
- false
28955
- );
28977
+ initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, 6 /* JSON */, 0 /* ParseAll */);
28956
28978
  sourceFlags = contextFlags;
28957
28979
  nextToken();
28958
28980
  const pos = getNodePos();
@@ -29033,7 +29055,7 @@ ${lanes.join("\n")}
29033
29055
  return result;
29034
29056
  }
29035
29057
  Parser2.parseJsonText = parseJsonText2;
29036
- function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind, _skipNonSemanticJSDoc) {
29058
+ function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind, _jsDocParsingMode) {
29037
29059
  NodeConstructor2 = objectAllocator.getNodeConstructor();
29038
29060
  TokenConstructor2 = objectAllocator.getTokenConstructor();
29039
29061
  IdentifierConstructor2 = objectAllocator.getIdentifierConstructor();
@@ -29069,13 +29091,15 @@ ${lanes.join("\n")}
29069
29091
  scanner2.setOnError(scanError);
29070
29092
  scanner2.setScriptTarget(languageVersion);
29071
29093
  scanner2.setLanguageVariant(languageVariant);
29072
- scanner2.setSkipNonSemanticJSDoc(_skipNonSemanticJSDoc);
29094
+ scanner2.setScriptKind(scriptKind);
29095
+ scanner2.setJSDocParsingMode(_jsDocParsingMode);
29073
29096
  }
29074
29097
  function clearState() {
29075
29098
  scanner2.clearCommentDirectives();
29076
29099
  scanner2.setText("");
29077
29100
  scanner2.setOnError(void 0);
29078
- scanner2.setSkipNonSemanticJSDoc(false);
29101
+ scanner2.setScriptKind(0 /* Unknown */);
29102
+ scanner2.setJSDocParsingMode(0 /* ParseAll */);
29079
29103
  sourceText = void 0;
29080
29104
  languageVersion = void 0;
29081
29105
  syntaxCursor = void 0;
@@ -29089,7 +29113,7 @@ ${lanes.join("\n")}
29089
29113
  notParenthesizedArrow = void 0;
29090
29114
  topLevel = true;
29091
29115
  }
29092
- function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2, skipNonSemanticJSDoc) {
29116
+ function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2, jsDocParsingMode) {
29093
29117
  const isDeclarationFile = isDeclarationFileName(fileName);
29094
29118
  if (isDeclarationFile) {
29095
29119
  contextFlags |= 33554432 /* Ambient */;
@@ -29108,7 +29132,7 @@ ${lanes.join("\n")}
29108
29132
  sourceFile.identifierCount = identifierCount;
29109
29133
  sourceFile.identifiers = identifiers;
29110
29134
  sourceFile.parseDiagnostics = attachFileToDiagnostics(parseDiagnostics, sourceFile);
29111
- sourceFile.skipNonSemanticJSDoc = skipNonSemanticJSDoc;
29135
+ sourceFile.jsDocParsingMode = jsDocParsingMode;
29112
29136
  if (jsDocDiagnostics) {
29113
29137
  sourceFile.jsDocDiagnostics = attachFileToDiagnostics(jsDocDiagnostics, sourceFile);
29114
29138
  }
@@ -34543,8 +34567,7 @@ ${lanes.join("\n")}
34543
34567
  /*syntaxCursor*/
34544
34568
  void 0,
34545
34569
  1 /* JS */,
34546
- /*skipNonSemanticJSDoc*/
34547
- false
34570
+ 0 /* ParseAll */
34548
34571
  );
34549
34572
  scanner2.setText(content, start, length2);
34550
34573
  currentToken = scanner2.scan();
@@ -34609,8 +34632,7 @@ ${lanes.join("\n")}
34609
34632
  /*syntaxCursor*/
34610
34633
  void 0,
34611
34634
  1 /* JS */,
34612
- /*skipNonSemanticJSDoc*/
34613
- false
34635
+ 0 /* ParseAll */
34614
34636
  );
34615
34637
  const jsDoc = doInsideOfContext(16777216 /* JSDoc */, () => parseJSDocCommentWorker(start, length2));
34616
34638
  const sourceFile = { languageVariant: 0 /* Standard */, text: content };
@@ -35566,7 +35588,7 @@ ${lanes.join("\n")}
35566
35588
  true,
35567
35589
  sourceFile.scriptKind,
35568
35590
  sourceFile.setExternalModuleIndicator,
35569
- sourceFile.skipNonSemanticJSDoc
35591
+ sourceFile.jsDocParsingMode
35570
35592
  );
35571
35593
  }
35572
35594
  const incrementalSourceFile = sourceFile;
@@ -35591,7 +35613,7 @@ ${lanes.join("\n")}
35591
35613
  true,
35592
35614
  sourceFile.scriptKind,
35593
35615
  sourceFile.setExternalModuleIndicator,
35594
- sourceFile.skipNonSemanticJSDoc
35616
+ sourceFile.jsDocParsingMode
35595
35617
  );
35596
35618
  result.commentDirectives = getNewCommentDirectives(
35597
35619
  sourceFile.commentDirectives,
@@ -40620,7 +40642,9 @@ ${lanes.join("\n")}
40620
40642
  extensionsToExtensionsArray(extensions),
40621
40643
  /*excludes*/
40622
40644
  void 0,
40623
- [changeAnyExtension(target.replace("*", "**/*"), getDeclarationEmitExtensionForPath(target))]
40645
+ [
40646
+ isDeclarationFileName(target) ? target.replace("*", "**/*") : changeAnyExtension(target.replace("*", "**/*"), getDeclarationEmitExtensionForPath(target))
40647
+ ]
40624
40648
  ).forEach((entry) => {
40625
40649
  entrypoints = appendIfUnique(entrypoints, {
40626
40650
  path: entry,
@@ -48749,7 +48773,7 @@ ${lanes.join("\n")}
48749
48773
  return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) : void 0;
48750
48774
  }
48751
48775
  function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) {
48752
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
48776
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
48753
48777
  if (startsWith(moduleReference, "@types/")) {
48754
48778
  const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
48755
48779
  const withoutAtTypePrefix = removePrefix(moduleReference, "@types/");
@@ -48767,7 +48791,7 @@ ${lanes.join("\n")}
48767
48791
  const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = findAncestor(location, isImportCall)) == null ? void 0 : _a.arguments[0]) || ((_b = findAncestor(location, isImportDeclaration)) == null ? void 0 : _b.moduleSpecifier) || ((_c = findAncestor(location, isExternalModuleImportEqualsDeclaration)) == null ? void 0 : _c.moduleReference.expression) || ((_d = findAncestor(location, isExportDeclaration)) == null ? void 0 : _d.moduleSpecifier) || ((_e = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _e.name) || ((_f = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _f.argument.literal);
48768
48792
  const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
48769
48793
  const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
48770
- const resolvedModule = (_i = (_h = (_g = host.resolvedModules) == null ? void 0 : _g.get(currentSourceFile.path)) == null ? void 0 : _h.get(moduleReference, mode)) == null ? void 0 : _i.resolvedModule;
48794
+ const resolvedModule = (_g = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _g.resolvedModule;
48771
48795
  const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule, currentSourceFile);
48772
48796
  const sourceFile = resolvedModule && (!resolutionDiagnostic || resolutionDiagnostic === Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set) && host.getSourceFile(resolvedModule.resolvedFileName);
48773
48797
  if (sourceFile) {
@@ -48775,7 +48799,7 @@ ${lanes.join("\n")}
48775
48799
  error2(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName);
48776
48800
  }
48777
48801
  if (resolvedModule.resolvedUsingTsExtension && isDeclarationFileName(moduleReference)) {
48778
- const importOrExport = ((_j = findAncestor(location, isImportDeclaration)) == null ? void 0 : _j.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
48802
+ const importOrExport = ((_h = findAncestor(location, isImportDeclaration)) == null ? void 0 : _h.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
48779
48803
  if (importOrExport && !importOrExport.isTypeOnly || findAncestor(location, isImportCall)) {
48780
48804
  error2(
48781
48805
  errorNode,
@@ -48784,7 +48808,7 @@ ${lanes.join("\n")}
48784
48808
  );
48785
48809
  }
48786
48810
  } else if (resolvedModule.resolvedUsingTsExtension && !shouldAllowImportingTsExtension(compilerOptions, currentSourceFile.fileName)) {
48787
- const importOrExport = ((_k = findAncestor(location, isImportDeclaration)) == null ? void 0 : _k.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
48811
+ const importOrExport = ((_i = findAncestor(location, isImportDeclaration)) == null ? void 0 : _i.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
48788
48812
  if (!((importOrExport == null ? void 0 : importOrExport.isTypeOnly) || findAncestor(location, isImportTypeNode))) {
48789
48813
  const tsExtension = Debug.checkDefined(tryExtractTSExtension(moduleReference));
48790
48814
  error2(errorNode, Diagnostics.An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled, tsExtension);
@@ -48805,7 +48829,7 @@ ${lanes.join("\n")}
48805
48829
  if (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */) {
48806
48830
  const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
48807
48831
  const overrideClauseHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l));
48808
- const overrideClause = overrideClauseHost && isImportTypeNode(overrideClauseHost) ? (_l = overrideClauseHost.assertions) == null ? void 0 : _l.assertClause : overrideClauseHost == null ? void 0 : overrideClauseHost.assertClause;
48832
+ const overrideClause = overrideClauseHost && isImportTypeNode(overrideClauseHost) ? (_j = overrideClauseHost.assertions) == null ? void 0 : _j.assertClause : overrideClauseHost == null ? void 0 : overrideClauseHost.assertClause;
48809
48833
  if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !getResolutionModeOverrideForClause(overrideClause)) {
48810
48834
  if (findAncestor(location, isImportEqualsDeclaration)) {
48811
48835
  error2(errorNode, Diagnostics.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead, moduleReference);
@@ -48912,7 +48936,7 @@ ${lanes.join("\n")}
48912
48936
  error2(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
48913
48937
  } else if (mode === 99 /* ESNext */ && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) {
48914
48938
  const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path));
48915
- const suggestedExt = (_m = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))) == null ? void 0 : _m[1];
48939
+ const suggestedExt = (_k = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))) == null ? void 0 : _k[1];
48916
48940
  if (suggestedExt) {
48917
48941
  error2(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0, moduleReference + suggestedExt);
48918
48942
  } else {
@@ -55670,7 +55694,28 @@ ${lanes.join("\n")}
55670
55694
  }
55671
55695
  }
55672
55696
  }
55673
- links[resolutionKind] = combineSymbolTables(earlySymbols, lateSymbols) || emptySymbols;
55697
+ let resolved = combineSymbolTables(earlySymbols, lateSymbols);
55698
+ if (symbol.flags & 33554432 /* Transient */ && links.cjsExportMerged && symbol.declarations) {
55699
+ for (const decl of symbol.declarations) {
55700
+ const original = getSymbolLinks(decl.symbol)[resolutionKind];
55701
+ if (!resolved) {
55702
+ resolved = original;
55703
+ continue;
55704
+ }
55705
+ if (!original)
55706
+ continue;
55707
+ original.forEach((s, name) => {
55708
+ const existing = resolved.get(name);
55709
+ if (!existing)
55710
+ resolved.set(name, s);
55711
+ else if (existing === s)
55712
+ return;
55713
+ else
55714
+ resolved.set(name, mergeSymbol(existing, s));
55715
+ });
55716
+ }
55717
+ }
55718
+ links[resolutionKind] = resolved || emptySymbols;
55674
55719
  }
55675
55720
  return links[resolutionKind];
55676
55721
  }
@@ -71565,6 +71610,7 @@ ${lanes.join("\n")}
71565
71610
  return checkPropertyAccessibilityAtLocation(node, isSuper, writing, type, prop, errorNode);
71566
71611
  }
71567
71612
  function checkPropertyAccessibilityAtLocation(location, isSuper, writing, containingType, prop, errorNode) {
71613
+ var _a;
71568
71614
  const flags = getDeclarationModifierFlagsFromSymbol(prop, writing);
71569
71615
  if (isSuper) {
71570
71616
  if (languageVersion < 2 /* ES2015 */) {
@@ -71581,6 +71627,12 @@ ${lanes.join("\n")}
71581
71627
  }
71582
71628
  return false;
71583
71629
  }
71630
+ if (!(flags & 32 /* Static */) && ((_a = prop.declarations) == null ? void 0 : _a.some(isClassFieldAndNotAutoAccessor))) {
71631
+ if (errorNode) {
71632
+ error2(errorNode, Diagnostics.Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super, symbolToString(prop));
71633
+ }
71634
+ return false;
71635
+ }
71584
71636
  }
71585
71637
  if (flags & 256 /* Abstract */ && symbolHasNonMethodDeclaration(prop) && (isThisProperty(location) || isThisInitializedObjectBindingExpression(location) || isObjectBindingPattern(location.parent) && isThisInitializedDeclaration(location.parent.parent))) {
71586
71638
  const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop));
@@ -71986,11 +72038,17 @@ ${lanes.join("\n")}
71986
72038
  return getFlowTypeOfAccessExpression(node, prop, propType, right, checkMode);
71987
72039
  }
71988
72040
  function isUncheckedJSSuggestion(node, suggestion, excludeClasses) {
72041
+ var _a;
71989
72042
  const file = getSourceFileOfNode(node);
71990
72043
  if (file) {
71991
72044
  if (compilerOptions.checkJs === void 0 && file.checkJsDirective === void 0 && (file.scriptKind === 1 /* JS */ || file.scriptKind === 2 /* JSX */)) {
71992
72045
  const declarationFile = forEach(suggestion == null ? void 0 : suggestion.declarations, getSourceFileOfNode);
71993
- return !(file !== declarationFile && !!declarationFile && isGlobalSourceFile(declarationFile)) && !(excludeClasses && suggestion && suggestion.flags & 32 /* Class */) && !(!!node && excludeClasses && isPropertyAccessExpression(node) && node.expression.kind === 110 /* ThisKeyword */);
72046
+ const suggestionHasNoExtendsOrDecorators = !(suggestion == null ? void 0 : suggestion.valueDeclaration) || !isClassLike(suggestion.valueDeclaration) || ((_a = suggestion.valueDeclaration.heritageClauses) == null ? void 0 : _a.length) || classOrConstructorParameterIsDecorated(
72047
+ /*useLegacyDecorators*/
72048
+ false,
72049
+ suggestion.valueDeclaration
72050
+ );
72051
+ return !(file !== declarationFile && !!declarationFile && isGlobalSourceFile(declarationFile)) && !(excludeClasses && suggestion && suggestion.flags & 32 /* Class */ && suggestionHasNoExtendsOrDecorators) && !(!!node && excludeClasses && isPropertyAccessExpression(node) && node.expression.kind === 110 /* ThisKeyword */ && suggestionHasNoExtendsOrDecorators);
71994
72052
  }
71995
72053
  }
71996
72054
  return false;
@@ -112204,6 +112262,7 @@ ${lanes.join("\n")}
112204
112262
  inlineSourceMap: compilerOptions.inlineSourceMap,
112205
112263
  extendedDiagnostics: compilerOptions.extendedDiagnostics,
112206
112264
  onlyPrintJsDocStyle: true,
112265
+ omitBraceSourceMapPositions: true,
112207
112266
  writeBundleFileInfo: !!bundleBuildInfo,
112208
112267
  recordInternalSection: !!bundleBuildInfo,
112209
112268
  relativeToBuildInfo
@@ -112566,6 +112625,7 @@ ${lanes.join("\n")}
112566
112625
  onAfterEmitToken
112567
112626
  } = handlers;
112568
112627
  var extendedDiagnostics = !!printerOptions.extendedDiagnostics;
112628
+ var omitBraceSourcePositions = !!printerOptions.omitBraceSourceMapPositions;
112569
112629
  var newLine = getNewLineCharacter(printerOptions);
112570
112630
  var moduleKind = getEmitModuleKind(printerOptions);
112571
112631
  var bundledHelpers = /* @__PURE__ */ new Map();
@@ -114561,7 +114621,11 @@ ${lanes.join("\n")}
114561
114621
  decreaseIndent();
114562
114622
  }
114563
114623
  }
114564
- pos = writeTokenText(token, writer2, pos);
114624
+ if (!omitBraceSourcePositions && (token === 19 /* OpenBraceToken */ || token === 20 /* CloseBraceToken */)) {
114625
+ pos = writeToken(token, pos, writer2, contextNode);
114626
+ } else {
114627
+ pos = writeTokenText(token, writer2, pos);
114628
+ }
114565
114629
  if (isSimilarNode && contextNode.end !== pos) {
114566
114630
  const isJsxExprContext = contextNode.kind === 294 /* JsxExpression */;
114567
114631
  emitTrailingCommentsOfPosition(
@@ -117858,7 +117922,7 @@ ${lanes.join("\n")}
117858
117922
  function createCompilerHost(options, setParentNodes) {
117859
117923
  return createCompilerHostWorker(options, setParentNodes);
117860
117924
  }
117861
- function createGetSourceFile(readFile, getCompilerOptions, setParentNodes, skipNonSemanticJSDocParsing) {
117925
+ function createGetSourceFile(readFile, getCompilerOptions, setParentNodes) {
117862
117926
  return (fileName, languageVersionOrOptions, onError) => {
117863
117927
  let text;
117864
117928
  try {
@@ -117872,15 +117936,7 @@ ${lanes.join("\n")}
117872
117936
  }
117873
117937
  text = "";
117874
117938
  }
117875
- return text !== void 0 ? createSourceFile(
117876
- fileName,
117877
- text,
117878
- languageVersionOrOptions,
117879
- setParentNodes,
117880
- /*scriptKind*/
117881
- void 0,
117882
- skipNonSemanticJSDocParsing
117883
- ) : void 0;
117939
+ return text !== void 0 ? createSourceFile(fileName, text, languageVersionOrOptions, setParentNodes) : void 0;
117884
117940
  };
117885
117941
  }
117886
117942
  function createWriteFileMeasuringIO(actualWriteFile, createDirectory, directoryExists) {
@@ -117904,7 +117960,7 @@ ${lanes.join("\n")}
117904
117960
  }
117905
117961
  };
117906
117962
  }
117907
- function createCompilerHostWorker(options, setParentNodes, skipNonSemanticJSDocParsing, system = sys) {
117963
+ function createCompilerHostWorker(options, setParentNodes, system = sys) {
117908
117964
  const existingDirectories = /* @__PURE__ */ new Map();
117909
117965
  const getCanonicalFileName = createGetCanonicalFileName(system.useCaseSensitiveFileNames);
117910
117966
  function directoryExists(directoryPath) {
@@ -117923,7 +117979,7 @@ ${lanes.join("\n")}
117923
117979
  const newLine = getNewLineCharacter(options);
117924
117980
  const realpath = system.realpath && ((path) => system.realpath(path));
117925
117981
  const compilerHost = {
117926
- getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes, skipNonSemanticJSDocParsing),
117982
+ getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes),
117927
117983
  getDefaultLibLocation,
117928
117984
  getDefaultLibFileName: (options2) => combinePaths(getDefaultLibLocation(), getDefaultLibFileName(options2)),
117929
117985
  writeFile: createWriteFileMeasuringIO(
@@ -118380,14 +118436,14 @@ ${lanes.join("\n")}
118380
118436
  return location.pos !== void 0;
118381
118437
  }
118382
118438
  function getReferencedFileLocation(program, ref) {
118383
- var _a, _b, _c, _d, _e, _f, _g, _h;
118439
+ var _a, _b, _c, _d;
118384
118440
  const file = Debug.checkDefined(program.getSourceFileByPath(ref.file));
118385
118441
  const { kind, index } = ref;
118386
118442
  let pos, end, packageId, resolutionMode;
118387
118443
  switch (kind) {
118388
118444
  case 3 /* Import */:
118389
118445
  const importLiteral = getModuleNameStringLiteralAt(file, index);
118390
- packageId = (_d = (_c = (_b = (_a = program.resolvedModules) == null ? void 0 : _a.get(file.path)) == null ? void 0 : _b.get(importLiteral.text, getModeForResolutionAtIndex(file, index))) == null ? void 0 : _c.resolvedModule) == null ? void 0 : _d.packageId;
118446
+ packageId = (_b = (_a = program.getResolvedModule(file, importLiteral.text, getModeForResolutionAtIndex(file, index))) == null ? void 0 : _a.resolvedModule) == null ? void 0 : _b.packageId;
118391
118447
  if (importLiteral.pos === -1)
118392
118448
  return { file, packageId, text: importLiteral.text };
118393
118449
  pos = skipTrivia(file.text, importLiteral.pos);
@@ -118398,7 +118454,7 @@ ${lanes.join("\n")}
118398
118454
  break;
118399
118455
  case 5 /* TypeReferenceDirective */:
118400
118456
  ({ pos, end, resolutionMode } = file.typeReferenceDirectives[index]);
118401
- packageId = (_h = (_g = (_f = (_e = program.resolvedTypeReferenceDirectiveNames) == null ? void 0 : _e.get(file.path)) == null ? void 0 : _f.get(toFileNameLowerCase(file.typeReferenceDirectives[index].fileName), resolutionMode || file.impliedNodeFormat)) == null ? void 0 : _g.resolvedTypeReferenceDirective) == null ? void 0 : _h.packageId;
118457
+ packageId = (_d = (_c = program.getResolvedTypeReferenceDirective(file, toFileNameLowerCase(file.typeReferenceDirectives[index].fileName), resolutionMode || file.impliedNodeFormat)) == null ? void 0 : _c.resolvedTypeReferenceDirective) == null ? void 0 : _d.packageId;
118402
118458
  break;
118403
118459
  case 7 /* LibReferenceDirective */:
118404
118460
  ({ pos, end } = file.libReferenceDirectives[index]);
@@ -118833,6 +118889,10 @@ ${lanes.join("\n")}
118833
118889
  resolvedModules,
118834
118890
  resolvedTypeReferenceDirectiveNames,
118835
118891
  resolvedLibReferences,
118892
+ getResolvedModule,
118893
+ getResolvedTypeReferenceDirective,
118894
+ forEachResolvedModule,
118895
+ forEachResolvedTypeReferenceDirective,
118836
118896
  getCurrentPackagesMap: () => packageMap,
118837
118897
  typesPackageExists,
118838
118898
  packageBundlesTypes,
@@ -118876,19 +118936,35 @@ ${lanes.join("\n")}
118876
118936
  measure("Program", "beforeProgram", "afterProgram");
118877
118937
  (_p = tracing) == null ? void 0 : _p.pop();
118878
118938
  return program;
118939
+ function getResolvedModule(file, moduleName, mode) {
118940
+ var _a2;
118941
+ return (_a2 = resolvedModules == null ? void 0 : resolvedModules.get(file.path)) == null ? void 0 : _a2.get(moduleName, mode);
118942
+ }
118943
+ function getResolvedTypeReferenceDirective(file, typeDirectiveName, mode) {
118944
+ var _a2;
118945
+ return (_a2 = resolvedTypeReferenceDirectiveNames == null ? void 0 : resolvedTypeReferenceDirectiveNames.get(file.path)) == null ? void 0 : _a2.get(typeDirectiveName, mode);
118946
+ }
118947
+ function forEachResolvedModule(callback, file) {
118948
+ forEachResolution(resolvedModules, callback, file);
118949
+ }
118950
+ function forEachResolvedTypeReferenceDirective(callback, file) {
118951
+ forEachResolution(resolvedTypeReferenceDirectiveNames, callback, file);
118952
+ }
118953
+ function forEachResolution(resolutionCache, callback, file) {
118954
+ var _a2;
118955
+ if (file)
118956
+ (_a2 = resolutionCache == null ? void 0 : resolutionCache.get(file.path)) == null ? void 0 : _a2.forEach((resolution, name, mode) => callback(resolution, name, mode, file.path));
118957
+ else
118958
+ resolutionCache == null ? void 0 : resolutionCache.forEach((resolutions, filePath) => resolutions.forEach((resolution, name, mode) => callback(resolution, name, mode, filePath)));
118959
+ }
118879
118960
  function getPackagesMap() {
118880
118961
  if (packageMap)
118881
118962
  return packageMap;
118882
118963
  packageMap = /* @__PURE__ */ new Map();
118883
- files.forEach(
118884
- (sf) => {
118885
- var _a2;
118886
- return (_a2 = resolvedModules == null ? void 0 : resolvedModules.get(sf.path)) == null ? void 0 : _a2.forEach(({ resolvedModule }) => {
118887
- if (resolvedModule == null ? void 0 : resolvedModule.packageId)
118888
- packageMap.set(resolvedModule.packageId.name, resolvedModule.extension === ".d.ts" /* Dts */ || !!packageMap.get(resolvedModule.packageId.name));
118889
- });
118890
- }
118891
- );
118964
+ forEachResolvedModule(({ resolvedModule }) => {
118965
+ if (resolvedModule == null ? void 0 : resolvedModule.packageId)
118966
+ packageMap.set(resolvedModule.packageId.name, resolvedModule.extension === ".d.ts" /* Dts */ || !!packageMap.get(resolvedModule.packageId.name));
118967
+ });
118892
118968
  return packageMap;
118893
118969
  }
118894
118970
  function typesPackageExists(packageName) {
@@ -119020,7 +119096,6 @@ ${lanes.join("\n")}
119020
119096
  return classifiableNames;
119021
119097
  }
119022
119098
  function resolveModuleNamesReusingOldState(moduleNames, file) {
119023
- var _a2, _b2;
119024
119099
  if (structureIsReused === 0 /* Not */ && !file.ambientModuleNames.length) {
119025
119100
  return resolveModuleNamesWorker(
119026
119101
  moduleNames,
@@ -119038,7 +119113,7 @@ ${lanes.join("\n")}
119038
119113
  const moduleName = moduleNames[i];
119039
119114
  if (file === oldSourceFile && !hasInvalidatedResolutions(file.path)) {
119040
119115
  const mode = getModeForUsageLocation(file, moduleName);
119041
- const oldResolution = (_b2 = (_a2 = oldProgram == null ? void 0 : oldProgram.resolvedModules) == null ? void 0 : _a2.get(file.path)) == null ? void 0 : _b2.get(moduleName.text, mode);
119116
+ const oldResolution = oldProgram == null ? void 0 : oldProgram.getResolvedModule(file, moduleName.text, mode);
119042
119117
  if (oldResolution == null ? void 0 : oldResolution.resolvedModule) {
119043
119118
  if (isTraceEnabled(options, host)) {
119044
119119
  trace(
@@ -119085,8 +119160,8 @@ ${lanes.join("\n")}
119085
119160
  Debug.assert(j === resolutions.length);
119086
119161
  return result;
119087
119162
  function moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName) {
119088
- var _a3, _b3, _c2;
119089
- const resolutionToFile = (_c2 = (_b3 = (_a3 = oldProgram == null ? void 0 : oldProgram.resolvedModules) == null ? void 0 : _a3.get(file.path)) == null ? void 0 : _b3.get(moduleName.text, getModeForUsageLocation(file, moduleName))) == null ? void 0 : _c2.resolvedModule;
119163
+ var _a2;
119164
+ const resolutionToFile = (_a2 = oldProgram == null ? void 0 : oldProgram.getResolvedModule(file, moduleName.text, getModeForUsageLocation(file, moduleName))) == null ? void 0 : _a2.resolvedModule;
119090
119165
  const resolvedFile = resolutionToFile && oldProgram.getSourceFile(resolutionToFile.resolvedFileName);
119091
119166
  if (resolutionToFile && resolvedFile) {
119092
119167
  return false;
@@ -119102,7 +119177,7 @@ ${lanes.join("\n")}
119102
119177
  }
119103
119178
  }
119104
119179
  function resolveTypeReferenceDirectiveNamesReusingOldState(typeDirectiveNames, containingFile) {
119105
- var _a2, _b2;
119180
+ var _a2;
119106
119181
  if (structureIsReused === 0 /* Not */) {
119107
119182
  return resolveTypeReferenceDirectiveNamesWorker(
119108
119183
  typeDirectiveNames,
@@ -119122,7 +119197,7 @@ ${lanes.join("\n")}
119122
119197
  if (canReuseResolutions) {
119123
119198
  const typeDirectiveName = getTypeReferenceResolutionName(entry);
119124
119199
  const mode = getModeForFileReference(entry, containingSourceFile == null ? void 0 : containingSourceFile.impliedNodeFormat);
119125
- const oldResolution = (_b2 = !isString(containingFile) ? (_a2 = oldProgram == null ? void 0 : oldProgram.resolvedTypeReferenceDirectiveNames) == null ? void 0 : _a2.get(containingFile.path) : oldProgram == null ? void 0 : oldProgram.getAutomaticTypeDirectiveResolutions()) == null ? void 0 : _b2.get(typeDirectiveName, mode);
119200
+ const oldResolution = !isString(containingFile) ? oldProgram == null ? void 0 : oldProgram.getResolvedTypeReferenceDirective(containingFile, typeDirectiveName, mode) : (_a2 = oldProgram == null ? void 0 : oldProgram.getAutomaticTypeDirectiveResolutions()) == null ? void 0 : _a2.get(typeDirectiveName, mode);
119126
119201
  if (oldResolution == null ? void 0 : oldResolution.resolvedTypeReferenceDirective) {
119127
119202
  if (isTraceEnabled(options, host)) {
119128
119203
  trace(
@@ -119182,7 +119257,7 @@ ${lanes.join("\n")}
119182
119257
  );
119183
119258
  }
119184
119259
  function tryReuseStructureFromOldProgram() {
119185
- var _a2, _b2, _c2;
119260
+ var _a2;
119186
119261
  if (!oldProgram) {
119187
119262
  return 0 /* Not */;
119188
119263
  }
@@ -119302,20 +119377,29 @@ ${lanes.join("\n")}
119302
119377
  const moduleNames = getModuleNames(newSourceFile);
119303
119378
  const resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFile);
119304
119379
  (resolvedModulesProcessing ?? (resolvedModulesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, resolutions);
119305
- const oldResolutions = (_b2 = oldProgram.resolvedModules) == null ? void 0 : _b2.get(newSourceFile.path);
119306
- const resolutionsChanged = hasChangesInResolutions(moduleNames, newSourceFile, resolutions, oldResolutions, moduleResolutionIsEqualTo, moduleResolutionNameAndModeGetter);
119380
+ const resolutionsChanged = hasChangesInResolutions(
119381
+ moduleNames,
119382
+ newSourceFile,
119383
+ resolutions,
119384
+ (name, mode) => oldProgram.getResolvedModule(newSourceFile, name, mode),
119385
+ moduleResolutionIsEqualTo,
119386
+ moduleResolutionNameAndModeGetter
119387
+ );
119307
119388
  if (resolutionsChanged)
119308
119389
  structureIsReused = 1 /* SafeModules */;
119309
119390
  const typesReferenceDirectives = newSourceFile.typeReferenceDirectives;
119310
119391
  const typeReferenceResolutions = resolveTypeReferenceDirectiveNamesReusingOldState(typesReferenceDirectives, newSourceFile);
119311
119392
  (resolvedTypeReferenceDirectiveNamesProcessing ?? (resolvedTypeReferenceDirectiveNamesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, typeReferenceResolutions);
119312
- const oldTypeResolutions = (_c2 = oldProgram.resolvedTypeReferenceDirectiveNames) == null ? void 0 : _c2.get(newSourceFile.path);
119313
- const typeReferenceResolutionsChanged = hasChangesInResolutions(typesReferenceDirectives, newSourceFile, typeReferenceResolutions, oldTypeResolutions, typeDirectiveIsEqualTo, typeReferenceResolutionNameAndModeGetter);
119314
- if (typeReferenceResolutionsChanged) {
119393
+ const typeReferenceResolutionsChanged = hasChangesInResolutions(
119394
+ typesReferenceDirectives,
119395
+ newSourceFile,
119396
+ typeReferenceResolutions,
119397
+ (name, mode) => oldProgram == null ? void 0 : oldProgram.getResolvedTypeReferenceDirective(newSourceFile, name, mode),
119398
+ typeDirectiveIsEqualTo,
119399
+ typeReferenceResolutionNameAndModeGetter
119400
+ );
119401
+ if (typeReferenceResolutionsChanged)
119315
119402
  structureIsReused = 1 /* SafeModules */;
119316
- } else if (oldTypeResolutions) {
119317
- (resolvedTypeReferenceDirectiveNamesProcessing ?? (resolvedTypeReferenceDirectiveNamesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, oldTypeResolutions);
119318
- }
119319
119403
  }
119320
119404
  if (structureIsReused !== 2 /* Completely */) {
119321
119405
  return structureIsReused;
@@ -120185,7 +120269,7 @@ ${lanes.join("\n")}
120185
120269
  const result = getImpliedNodeFormatForFileWorker(getNormalizedAbsolutePath(fileName, currentDirectory), moduleResolutionCache2 == null ? void 0 : moduleResolutionCache2.getPackageJsonInfoCache(), host2, options2);
120186
120270
  const languageVersion = getEmitScriptTarget(options2);
120187
120271
  const setExternalModuleIndicator2 = getSetExternalModuleIndicator(options2);
120188
- return typeof result === "object" ? { ...result, languageVersion, setExternalModuleIndicator: setExternalModuleIndicator2 } : { languageVersion, impliedNodeFormat: result, setExternalModuleIndicator: setExternalModuleIndicator2 };
120272
+ return typeof result === "object" ? { ...result, languageVersion, setExternalModuleIndicator: setExternalModuleIndicator2, jsDocParsingMode: host2.jsDocParsingMode } : { languageVersion, impliedNodeFormat: result, setExternalModuleIndicator: setExternalModuleIndicator2, jsDocParsingMode: host2.jsDocParsingMode };
120189
120273
  }
120190
120274
  function findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId) {
120191
120275
  var _a2;
@@ -121462,7 +121546,7 @@ ${lanes.join("\n")}
121462
121546
  symlinks = createSymlinkCache(currentDirectory, getCanonicalFileName);
121463
121547
  }
121464
121548
  if (files && !symlinks.hasProcessedResolutions()) {
121465
- symlinks.setSymlinksFromResolutions(resolvedModules, resolvedTypeReferenceDirectiveNames, automaticTypeDirectiveResolutions);
121549
+ symlinks.setSymlinksFromResolutions(forEachResolvedModule, forEachResolvedTypeReferenceDirective, automaticTypeDirectiveResolutions);
121466
121550
  }
121467
121551
  return symlinks;
121468
121552
  }
@@ -121967,7 +122051,6 @@ ${lanes.join("\n")}
121967
122051
  return toPath(program.getProjectReferenceRedirect(fileName) || fileName, sourceFileDirectory, getCanonicalFileName);
121968
122052
  }
121969
122053
  function getReferencedFiles(program, sourceFile, getCanonicalFileName) {
121970
- var _a;
121971
122054
  let referencedFiles;
121972
122055
  if (sourceFile.imports && sourceFile.imports.length > 0) {
121973
122056
  const checker = program.getTypeChecker();
@@ -121983,17 +122066,14 @@ ${lanes.join("\n")}
121983
122066
  addReferencedFile(referencedPath);
121984
122067
  }
121985
122068
  }
121986
- const resolvedTypeReferenceDirectiveNames = (_a = program.resolvedTypeReferenceDirectiveNames) == null ? void 0 : _a.get(sourceFile.path);
121987
- if (resolvedTypeReferenceDirectiveNames) {
121988
- resolvedTypeReferenceDirectiveNames.forEach(({ resolvedTypeReferenceDirective }) => {
121989
- if (!resolvedTypeReferenceDirective) {
121990
- return;
121991
- }
121992
- const fileName = resolvedTypeReferenceDirective.resolvedFileName;
121993
- const typeFilePath = getReferencedFileFromFileName(program, fileName, sourceFileDirectory, getCanonicalFileName);
121994
- addReferencedFile(typeFilePath);
121995
- });
121996
- }
122069
+ program.forEachResolvedTypeReferenceDirective(({ resolvedTypeReferenceDirective }) => {
122070
+ if (!resolvedTypeReferenceDirective) {
122071
+ return;
122072
+ }
122073
+ const fileName = resolvedTypeReferenceDirective.resolvedFileName;
122074
+ const typeFilePath = getReferencedFileFromFileName(program, fileName, sourceFileDirectory, getCanonicalFileName);
122075
+ addReferencedFile(typeFilePath);
122076
+ }, sourceFile);
121997
122077
  if (sourceFile.moduleAugmentations.length) {
121998
122078
  const checker = program.getTypeChecker();
121999
122079
  for (const moduleName of sourceFile.moduleAugmentations) {
@@ -123753,6 +123833,47 @@ ${lanes.join("\n")}
123753
123833
  function getRootPathSplitLength(rootPath) {
123754
123834
  return rootPath.split(directorySeparator).length - (hasTrailingDirectorySeparator(rootPath) ? 1 : 0);
123755
123835
  }
123836
+ function createModuleResolutionLoaderUsingGlobalCache(containingFile, redirectedReference, options, resolutionHost, moduleResolutionCache) {
123837
+ return {
123838
+ nameAndMode: moduleResolutionNameAndModeGetter,
123839
+ resolve: (moduleName, resoluionMode) => resolveModuleNameUsingGlobalCache(
123840
+ resolutionHost,
123841
+ moduleResolutionCache,
123842
+ moduleName,
123843
+ containingFile,
123844
+ options,
123845
+ redirectedReference,
123846
+ resoluionMode
123847
+ )
123848
+ };
123849
+ }
123850
+ function resolveModuleNameUsingGlobalCache(resolutionHost, moduleResolutionCache, moduleName, containingFile, compilerOptions, redirectedReference, mode) {
123851
+ var _a;
123852
+ const host = ((_a = resolutionHost.getCompilerHost) == null ? void 0 : _a.call(resolutionHost)) || resolutionHost;
123853
+ const primaryResult = resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference, mode);
123854
+ if (!resolutionHost.getGlobalCache) {
123855
+ return primaryResult;
123856
+ }
123857
+ const globalCache = resolutionHost.getGlobalCache();
123858
+ if (globalCache !== void 0 && !isExternalModuleNameRelative(moduleName) && !(primaryResult.resolvedModule && extensionIsTS(primaryResult.resolvedModule.extension))) {
123859
+ const { resolvedModule, failedLookupLocations, affectingLocations, resolutionDiagnostics } = loadModuleFromGlobalCache(
123860
+ Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName),
123861
+ resolutionHost.projectName,
123862
+ compilerOptions,
123863
+ host,
123864
+ globalCache,
123865
+ moduleResolutionCache
123866
+ );
123867
+ if (resolvedModule) {
123868
+ primaryResult.resolvedModule = resolvedModule;
123869
+ primaryResult.failedLookupLocations = updateResolutionField(primaryResult.failedLookupLocations, failedLookupLocations);
123870
+ primaryResult.affectingLocations = updateResolutionField(primaryResult.affectingLocations, affectingLocations);
123871
+ primaryResult.resolutionDiagnostics = updateResolutionField(primaryResult.resolutionDiagnostics, resolutionDiagnostics);
123872
+ return primaryResult;
123873
+ }
123874
+ }
123875
+ return primaryResult;
123876
+ }
123756
123877
  function createResolutionCache(resolutionHost, rootDirForResolution, logChangesWhenResolvingModule) {
123757
123878
  let filesWithChangedSetOfUnresolvedImports;
123758
123879
  let filesWithInvalidatedResolutions;
@@ -123799,6 +123920,16 @@ ${lanes.join("\n")}
123799
123920
  const rootPathComponents = getPathComponents(rootPath);
123800
123921
  const typeRootsWatches = /* @__PURE__ */ new Map();
123801
123922
  return {
123923
+ rootDirForResolution,
123924
+ resolvedModuleNames,
123925
+ resolvedTypeReferenceDirectives,
123926
+ resolvedLibraries,
123927
+ resolvedFileToResolution,
123928
+ resolutionsWithFailedLookups,
123929
+ resolutionsWithOnlyAffectingLocations,
123930
+ directoryWatchesOfFailedLookups,
123931
+ fileWatchesOfAffectingLocations,
123932
+ watchFailedLookupLocationsOfExternalModuleResolutions,
123802
123933
  getModuleResolutionCache: () => moduleResolutionCache,
123803
123934
  startRecordingFilesWithChangedResolutions,
123804
123935
  finishRecordingFilesWithChangedResolutions,
@@ -123901,7 +124032,7 @@ ${lanes.join("\n")}
123901
124032
  if (!((_a = newProgram == null ? void 0 : newProgram.resolvedLibReferences) == null ? void 0 : _a.has(libFileName))) {
123902
124033
  stopWatchFailedLookupLocationOfResolution(
123903
124034
  resolution,
123904
- resolutionHost.toPath(getInferredLibraryNameResolveFrom(newProgram.getCompilerOptions(), getCurrentDirectory(), libFileName)),
124035
+ resolutionHost.toPath(getInferredLibraryNameResolveFrom(resolutionHost.getCompilationSettings(), getCurrentDirectory(), libFileName)),
123905
124036
  getResolvedModule
123906
124037
  );
123907
124038
  resolvedLibraries.delete(libFileName);
@@ -123943,58 +124074,22 @@ ${lanes.join("\n")}
123943
124074
  }
123944
124075
  });
123945
124076
  }
123946
- directoryWatchesOfFailedLookups.forEach((watcher, path) => {
123947
- if (watcher.refCount === 0) {
123948
- directoryWatchesOfFailedLookups.delete(path);
123949
- watcher.watcher.close();
123950
- }
123951
- });
123952
- fileWatchesOfAffectingLocations.forEach((watcher, path) => {
123953
- if (watcher.files === 0 && watcher.resolutions === 0) {
123954
- fileWatchesOfAffectingLocations.delete(path);
123955
- watcher.watcher.close();
123956
- }
123957
- });
124077
+ directoryWatchesOfFailedLookups.forEach(closeDirectoryWatchesOfFailedLookup);
124078
+ fileWatchesOfAffectingLocations.forEach(closeFileWatcherOfAffectingLocation);
123958
124079
  hasChangedAutomaticTypeDirectiveNames = false;
123959
124080
  }
123960
- function resolveModuleName2(moduleName, containingFile, compilerOptions, redirectedReference, mode) {
123961
- var _a;
123962
- const host = ((_a = resolutionHost.getCompilerHost) == null ? void 0 : _a.call(resolutionHost)) || resolutionHost;
123963
- const primaryResult = resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference, mode);
123964
- if (!resolutionHost.getGlobalCache) {
123965
- return primaryResult;
123966
- }
123967
- const globalCache = resolutionHost.getGlobalCache();
123968
- if (globalCache !== void 0 && !isExternalModuleNameRelative(moduleName) && !(primaryResult.resolvedModule && extensionIsTS(primaryResult.resolvedModule.extension))) {
123969
- const { resolvedModule, failedLookupLocations, affectingLocations, resolutionDiagnostics } = loadModuleFromGlobalCache(
123970
- Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName),
123971
- resolutionHost.projectName,
123972
- compilerOptions,
123973
- host,
123974
- globalCache,
123975
- moduleResolutionCache
123976
- );
123977
- if (resolvedModule) {
123978
- primaryResult.resolvedModule = resolvedModule;
123979
- primaryResult.failedLookupLocations = updateResolutionField(primaryResult.failedLookupLocations, failedLookupLocations);
123980
- primaryResult.affectingLocations = updateResolutionField(primaryResult.affectingLocations, affectingLocations);
123981
- primaryResult.resolutionDiagnostics = updateResolutionField(primaryResult.resolutionDiagnostics, resolutionDiagnostics);
123982
- return primaryResult;
123983
- }
124081
+ function closeDirectoryWatchesOfFailedLookup(watcher, path) {
124082
+ if (watcher.refCount === 0) {
124083
+ directoryWatchesOfFailedLookups.delete(path);
124084
+ watcher.watcher.close();
123984
124085
  }
123985
- return primaryResult;
123986
124086
  }
123987
- function createModuleResolutionLoader2(containingFile, redirectedReference, options) {
123988
- return {
123989
- nameAndMode: moduleResolutionNameAndModeGetter,
123990
- resolve: (moduleName, resoluionMode) => resolveModuleName2(
123991
- moduleName,
123992
- containingFile,
123993
- options,
123994
- redirectedReference,
123995
- resoluionMode
123996
- )
123997
- };
124087
+ function closeFileWatcherOfAffectingLocation(watcher, path) {
124088
+ var _a;
124089
+ if (watcher.files === 0 && watcher.resolutions === 0 && !((_a = watcher.symlinks) == null ? void 0 : _a.size)) {
124090
+ fileWatchesOfAffectingLocations.delete(path);
124091
+ watcher.watcher.close();
124092
+ }
123998
124093
  }
123999
124094
  function resolveNamesWithLocalCache({
124000
124095
  entries,
@@ -124031,9 +124126,11 @@ ${lanes.join("\n")}
124031
124126
  resolutionHost.onDiscoveredSymlink();
124032
124127
  }
124033
124128
  resolutionsInFile.set(name, mode, resolution);
124034
- watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName, deferWatchingNonRelativeResolution);
124035
- if (existingResolution) {
124036
- stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolutionWithResolvedFileName);
124129
+ if (resolution !== existingResolution) {
124130
+ watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName, deferWatchingNonRelativeResolution);
124131
+ if (existingResolution) {
124132
+ stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolutionWithResolvedFileName);
124133
+ }
124037
124134
  }
124038
124135
  if (logChanges && filesWithChangedSetOfUnresolvedImports && !resolutionIsEqualTo(existingResolution, resolution)) {
124039
124136
  filesWithChangedSetOfUnresolvedImports.push(path);
@@ -124122,10 +124219,12 @@ ${lanes.join("\n")}
124122
124219
  options,
124123
124220
  reusedNames,
124124
124221
  perFileCache: resolvedModuleNames,
124125
- loader: createModuleResolutionLoader2(
124222
+ loader: createModuleResolutionLoaderUsingGlobalCache(
124126
124223
  containingFile,
124127
124224
  redirectedReference,
124128
- options
124225
+ options,
124226
+ resolutionHost,
124227
+ moduleResolutionCache
124129
124228
  ),
124130
124229
  getResolutionWithResolvedFileName: getResolvedModule,
124131
124230
  shouldRetryResolution: (resolution) => !resolution.resolvedModule || !resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension),
@@ -124179,7 +124278,7 @@ ${lanes.join("\n")}
124179
124278
  );
124180
124279
  if (resolution && !resolution.isInvalidated)
124181
124280
  return resolution;
124182
- return resolveModuleName2(moduleName, containingFile, resolutionHost.getCompilationSettings());
124281
+ return resolveModuleNameUsingGlobalCache(resolutionHost, moduleResolutionCache, moduleName, containingFile, resolutionHost.getCompilationSettings());
124183
124282
  }
124184
124283
  function isNodeModulesAtTypesDirectory(dirPath) {
124185
124284
  return endsWith(dirPath, "/node_modules/@types");
@@ -124279,52 +124378,63 @@ ${lanes.join("\n")}
124279
124378
  return;
124280
124379
  }
124281
124380
  let locationToWatch = affectingLocation;
124381
+ let isSymlink = false;
124382
+ let symlinkWatcher;
124282
124383
  if (resolutionHost.realpath) {
124283
124384
  locationToWatch = resolutionHost.realpath(affectingLocation);
124284
124385
  if (affectingLocation !== locationToWatch) {
124285
- const fileWatcher2 = fileWatchesOfAffectingLocations.get(locationToWatch);
124286
- if (fileWatcher2) {
124287
- if (forResolution)
124288
- fileWatcher2.resolutions++;
124289
- else
124290
- fileWatcher2.files++;
124291
- fileWatcher2.paths.add(affectingLocation);
124292
- fileWatchesOfAffectingLocations.set(affectingLocation, fileWatcher2);
124293
- return;
124294
- }
124295
- }
124296
- }
124297
- const paths = /* @__PURE__ */ new Set();
124298
- paths.add(locationToWatch);
124299
- let actualWatcher = canWatchAffectingLocation(resolutionHost.toPath(locationToWatch)) ? resolutionHost.watchAffectingFileLocation(locationToWatch, (fileName, eventKind) => {
124300
- cachedDirectoryStructureHost == null ? void 0 : cachedDirectoryStructureHost.addOrDeleteFile(fileName, resolutionHost.toPath(locationToWatch), eventKind);
124301
- const packageJsonMap = moduleResolutionCache.getPackageJsonInfoCache().getInternalMap();
124302
- paths.forEach((path) => {
124303
- if (watcher.resolutions)
124304
- (affectingPathChecks ?? (affectingPathChecks = /* @__PURE__ */ new Set())).add(path);
124305
- if (watcher.files)
124306
- (affectingPathChecksForFile ?? (affectingPathChecksForFile = /* @__PURE__ */ new Set())).add(path);
124307
- packageJsonMap == null ? void 0 : packageJsonMap.delete(resolutionHost.toPath(path));
124308
- });
124309
- resolutionHost.scheduleInvalidateResolutionsOfFailedLookupLocations();
124310
- }) : noopFileWatcher;
124311
- const watcher = {
124312
- watcher: actualWatcher !== noopFileWatcher ? {
124313
- close: () => {
124314
- actualWatcher.close();
124315
- actualWatcher = noopFileWatcher;
124316
- }
124317
- } : actualWatcher,
124318
- resolutions: forResolution ? 1 : 0,
124319
- files: forResolution ? 0 : 1,
124320
- paths
124321
- };
124322
- fileWatchesOfAffectingLocations.set(locationToWatch, watcher);
124323
- if (affectingLocation !== locationToWatch) {
124386
+ isSymlink = true;
124387
+ symlinkWatcher = fileWatchesOfAffectingLocations.get(locationToWatch);
124388
+ }
124389
+ }
124390
+ const resolutions = forResolution ? 1 : 0;
124391
+ const files = forResolution ? 0 : 1;
124392
+ if (!isSymlink || !symlinkWatcher) {
124393
+ const watcher = {
124394
+ watcher: canWatchAffectingLocation(resolutionHost.toPath(locationToWatch)) ? resolutionHost.watchAffectingFileLocation(locationToWatch, (fileName, eventKind) => {
124395
+ cachedDirectoryStructureHost == null ? void 0 : cachedDirectoryStructureHost.addOrDeleteFile(fileName, resolutionHost.toPath(locationToWatch), eventKind);
124396
+ invalidateAffectingFileWatcher(locationToWatch, moduleResolutionCache.getPackageJsonInfoCache().getInternalMap());
124397
+ resolutionHost.scheduleInvalidateResolutionsOfFailedLookupLocations();
124398
+ }) : noopFileWatcher,
124399
+ resolutions: isSymlink ? 0 : resolutions,
124400
+ files: isSymlink ? 0 : files,
124401
+ symlinks: void 0
124402
+ };
124403
+ fileWatchesOfAffectingLocations.set(locationToWatch, watcher);
124404
+ if (isSymlink)
124405
+ symlinkWatcher = watcher;
124406
+ }
124407
+ if (isSymlink) {
124408
+ Debug.assert(!!symlinkWatcher);
124409
+ const watcher = {
124410
+ watcher: {
124411
+ close: () => {
124412
+ var _a;
124413
+ const symlinkWatcher2 = fileWatchesOfAffectingLocations.get(locationToWatch);
124414
+ if (((_a = symlinkWatcher2 == null ? void 0 : symlinkWatcher2.symlinks) == null ? void 0 : _a.delete(affectingLocation)) && !symlinkWatcher2.symlinks.size && !symlinkWatcher2.resolutions && !symlinkWatcher2.files) {
124415
+ fileWatchesOfAffectingLocations.delete(locationToWatch);
124416
+ symlinkWatcher2.watcher.close();
124417
+ }
124418
+ }
124419
+ },
124420
+ resolutions,
124421
+ files,
124422
+ symlinks: void 0
124423
+ };
124324
124424
  fileWatchesOfAffectingLocations.set(affectingLocation, watcher);
124325
- paths.add(affectingLocation);
124425
+ (symlinkWatcher.symlinks ?? (symlinkWatcher.symlinks = /* @__PURE__ */ new Set())).add(affectingLocation);
124326
124426
  }
124327
124427
  }
124428
+ function invalidateAffectingFileWatcher(path, packageJsonMap) {
124429
+ var _a;
124430
+ const watcher = fileWatchesOfAffectingLocations.get(path);
124431
+ if (watcher == null ? void 0 : watcher.resolutions)
124432
+ (affectingPathChecks ?? (affectingPathChecks = /* @__PURE__ */ new Set())).add(path);
124433
+ if (watcher == null ? void 0 : watcher.files)
124434
+ (affectingPathChecksForFile ?? (affectingPathChecksForFile = /* @__PURE__ */ new Set())).add(path);
124435
+ (_a = watcher == null ? void 0 : watcher.symlinks) == null ? void 0 : _a.forEach((path2) => invalidateAffectingFileWatcher(path2, packageJsonMap));
124436
+ packageJsonMap == null ? void 0 : packageJsonMap.delete(resolutionHost.toPath(path));
124437
+ }
124328
124438
  function watchFailedLookupLocationOfNonRelativeModuleResolutions(resolutions, name) {
124329
124439
  const program = resolutionHost.getCurrentProgram();
124330
124440
  if (!program || !program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(name)) {
@@ -124346,7 +124456,7 @@ ${lanes.join("\n")}
124346
124456
  directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir, dirPath, nonRecursive), refCount: 1, nonRecursive });
124347
124457
  }
124348
124458
  }
124349
- function stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot) {
124459
+ function stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot, syncDirWatcherRemove) {
124350
124460
  const failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation);
124351
124461
  const toWatch = getDirectoryToWatchFailedLookupLocation(
124352
124462
  failedLookupLocation,
@@ -124361,12 +124471,12 @@ ${lanes.join("\n")}
124361
124471
  if (dirPath === rootPath) {
124362
124472
  removeAtRoot = true;
124363
124473
  } else {
124364
- removeDirectoryWatcher(dirPath);
124474
+ removeDirectoryWatcher(dirPath, syncDirWatcherRemove);
124365
124475
  }
124366
124476
  }
124367
124477
  return removeAtRoot;
124368
124478
  }
124369
- function stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName) {
124479
+ function stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName, syncDirWatcherRemove) {
124370
124480
  Debug.checkDefined(resolution.files).delete(filePath);
124371
124481
  resolution.refCount--;
124372
124482
  if (resolution.refCount) {
@@ -124384,13 +124494,13 @@ ${lanes.join("\n")}
124384
124494
  let removeAtRoot = false;
124385
124495
  if (failedLookupLocations) {
124386
124496
  for (const failedLookupLocation of failedLookupLocations) {
124387
- removeAtRoot = stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot);
124497
+ removeAtRoot = stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot, syncDirWatcherRemove);
124388
124498
  }
124389
124499
  }
124390
124500
  if (node10Result)
124391
- removeAtRoot = stopWatchFailedLookupLocation(node10Result, removeAtRoot);
124501
+ removeAtRoot = stopWatchFailedLookupLocation(node10Result, removeAtRoot, syncDirWatcherRemove);
124392
124502
  if (removeAtRoot)
124393
- removeDirectoryWatcher(rootPath);
124503
+ removeDirectoryWatcher(rootPath, syncDirWatcherRemove);
124394
124504
  } else if (affectingLocations == null ? void 0 : affectingLocations.length) {
124395
124505
  resolutionsWithOnlyAffectingLocations.delete(resolution);
124396
124506
  }
@@ -124398,12 +124508,16 @@ ${lanes.join("\n")}
124398
124508
  for (const affectingLocation of affectingLocations) {
124399
124509
  const watcher = fileWatchesOfAffectingLocations.get(affectingLocation);
124400
124510
  watcher.resolutions--;
124511
+ if (syncDirWatcherRemove)
124512
+ closeFileWatcherOfAffectingLocation(watcher, affectingLocation);
124401
124513
  }
124402
124514
  }
124403
124515
  }
124404
- function removeDirectoryWatcher(dirPath) {
124516
+ function removeDirectoryWatcher(dirPath, syncDirWatcherRemove) {
124405
124517
  const dirWatcher = directoryWatchesOfFailedLookups.get(dirPath);
124406
124518
  dirWatcher.refCount--;
124519
+ if (syncDirWatcherRemove)
124520
+ closeDirectoryWatchesOfFailedLookup(dirWatcher, dirPath);
124407
124521
  }
124408
124522
  function createDirectoryWatcher(directory, dirPath, nonRecursive) {
124409
124523
  return resolutionHost.watchDirectoryOfFailedLookupLocation(directory, (fileOrDirectory) => {
@@ -124414,10 +124528,17 @@ ${lanes.join("\n")}
124414
124528
  scheduleInvalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath);
124415
124529
  }, nonRecursive ? 0 /* None */ : 1 /* Recursive */);
124416
124530
  }
124417
- function removeResolutionsOfFileFromCache(cache, filePath, getResolutionWithResolvedFileName) {
124531
+ function removeResolutionsOfFileFromCache(cache, filePath, getResolutionWithResolvedFileName, syncDirWatcherRemove) {
124418
124532
  const resolutions = cache.get(filePath);
124419
124533
  if (resolutions) {
124420
- resolutions.forEach((resolution) => stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName));
124534
+ resolutions.forEach(
124535
+ (resolution) => stopWatchFailedLookupLocationOfResolution(
124536
+ resolution,
124537
+ filePath,
124538
+ getResolutionWithResolvedFileName,
124539
+ syncDirWatcherRemove
124540
+ )
124541
+ );
124421
124542
  cache.delete(filePath);
124422
124543
  }
124423
124544
  }
@@ -124432,9 +124553,9 @@ ${lanes.join("\n")}
124432
124553
  return;
124433
124554
  resolvedProjectReference.commandLine.fileNames.forEach((f) => removeResolutionsOfFile(resolutionHost.toPath(f)));
124434
124555
  }
124435
- function removeResolutionsOfFile(filePath) {
124436
- removeResolutionsOfFileFromCache(resolvedModuleNames, filePath, getResolvedModule);
124437
- removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath, getResolvedTypeReferenceDirective);
124556
+ function removeResolutionsOfFile(filePath, syncDirWatcherRemove) {
124557
+ removeResolutionsOfFileFromCache(resolvedModuleNames, filePath, getResolvedModule, syncDirWatcherRemove);
124558
+ removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath, getResolvedTypeReferenceDirective, syncDirWatcherRemove);
124438
124559
  }
124439
124560
  function invalidateResolutions(resolutions, canInvalidate) {
124440
124561
  if (!resolutions)
@@ -125060,8 +125181,7 @@ ${lanes.join("\n")}
125060
125181
  (fileName, encoding) => !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding),
125061
125182
  getCompilerOptions,
125062
125183
  /*setParentNodes*/
125063
- void 0,
125064
- host.skipNonSemanticJSDocParsing
125184
+ void 0
125065
125185
  ),
125066
125186
  getDefaultLibLocation: maybeBind(host, host.getDefaultLibLocation),
125067
125187
  getDefaultLibFileName: (options) => host.getDefaultLibFileName(options),
@@ -125083,7 +125203,8 @@ ${lanes.join("\n")}
125083
125203
  getEnvironmentVariable: maybeBind(host, host.getEnvironmentVariable) || (() => ""),
125084
125204
  createHash: maybeBind(host, host.createHash),
125085
125205
  readDirectory: maybeBind(host, host.readDirectory),
125086
- storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit
125206
+ storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
125207
+ jsDocParsingMode: host.jsDocParsingMode
125087
125208
  };
125088
125209
  return compilerHost;
125089
125210
  }
@@ -125288,12 +125409,11 @@ ${lanes.join("\n")}
125288
125409
  return void 0;
125289
125410
  return createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, host);
125290
125411
  }
125291
- function createIncrementalCompilerHost(options, system = sys, skipNonSemanticJSDocParsing) {
125412
+ function createIncrementalCompilerHost(options, system = sys) {
125292
125413
  const host = createCompilerHostWorker(
125293
125414
  options,
125294
125415
  /*setParentNodes*/
125295
125416
  void 0,
125296
- skipNonSemanticJSDocParsing,
125297
125417
  system
125298
125418
  );
125299
125419
  host.createHash = maybeBind(system, system.createHash);
@@ -125435,7 +125555,7 @@ ${lanes.join("\n")}
125435
125555
  watchConfigFileWildCardDirectories();
125436
125556
  if (configFileName)
125437
125557
  updateExtendedConfigFilesWatches(toPath3(configFileName), compilerOptions, watchOptions, WatchType.ExtendedConfigFile);
125438
- return configFileName ? { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, close } : { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, updateRootFileNames, close };
125558
+ return configFileName ? { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, close, getResolutionCache } : { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, updateRootFileNames, close, getResolutionCache };
125439
125559
  function close() {
125440
125560
  clearInvalidateResolutionsOfFailedLookupLocations();
125441
125561
  resolutionCache.clear();
@@ -125475,6 +125595,9 @@ ${lanes.join("\n")}
125475
125595
  parsedConfigs = void 0;
125476
125596
  }
125477
125597
  }
125598
+ function getResolutionCache() {
125599
+ return resolutionCache;
125600
+ }
125478
125601
  function getCurrentBuilderProgram() {
125479
125602
  return builderProgram;
125480
125603
  }
@@ -130953,7 +131076,7 @@ ${lanes.join("\n")}
130953
131076
  return idx === -1 ? -1 : idx + 1;
130954
131077
  }
130955
131078
  function needsParentheses(expression) {
130956
- return isBinaryExpression(expression) && expression.operatorToken.kind === 28 /* CommaToken */ || isObjectLiteralExpression(expression) || isAsExpression(expression) && isObjectLiteralExpression(expression.expression);
131079
+ return isBinaryExpression(expression) && expression.operatorToken.kind === 28 /* CommaToken */ || isObjectLiteralExpression(expression) || (isAsExpression(expression) || isSatisfiesExpression(expression)) && isObjectLiteralExpression(expression.expression);
130957
131080
  }
130958
131081
  function getContextualTypeFromParent(node, checker, contextFlags) {
130959
131082
  const parent2 = walkUpParenthesizedExpressions(node.parent);
@@ -133395,10 +133518,10 @@ ${lanes.join("\n")}
133395
133518
  function isDocumentRegistryEntry(entry) {
133396
133519
  return !!entry.sourceFile;
133397
133520
  }
133398
- function createDocumentRegistry(useCaseSensitiveFileNames2, currentDirectory) {
133399
- return createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory);
133521
+ function createDocumentRegistry(useCaseSensitiveFileNames2, currentDirectory, jsDocParsingMode) {
133522
+ return createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory, jsDocParsingMode);
133400
133523
  }
133401
- function createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory = "", externalCache) {
133524
+ function createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory = "", jsDocParsingMode, externalCache) {
133402
133525
  const buckets = /* @__PURE__ */ new Map();
133403
133526
  const getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames2);
133404
133527
  function reportStats() {
@@ -133482,9 +133605,11 @@ ${lanes.join("\n")}
133482
133605
  const sourceFileOptions = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions : {
133483
133606
  languageVersion: scriptTarget,
133484
133607
  impliedNodeFormat: host && getImpliedNodeFormatForFile(path, (_d = (_c = (_b = (_a = host.getCompilerHost) == null ? void 0 : _a.call(host)) == null ? void 0 : _b.getModuleResolutionCache) == null ? void 0 : _c.call(_b)) == null ? void 0 : _d.getPackageJsonInfoCache(), host, compilationSettings),
133485
- setExternalModuleIndicator: getSetExternalModuleIndicator(compilationSettings)
133608
+ setExternalModuleIndicator: getSetExternalModuleIndicator(compilationSettings),
133609
+ jsDocParsingMode
133486
133610
  };
133487
133611
  sourceFileOptions.languageVersion = scriptTarget;
133612
+ Debug.assertEqual(jsDocParsingMode, sourceFileOptions.jsDocParsingMode);
133488
133613
  const oldBucketCount = buckets.size;
133489
133614
  const keyWithMode = getDocumentRegistryBucketKeyWithMode(key, sourceFileOptions.impliedNodeFormat);
133490
133615
  const bucket = getOrUpdate(buckets, keyWithMode, () => /* @__PURE__ */ new Map());
@@ -133742,14 +133867,13 @@ ${lanes.join("\n")}
133742
133867
  return ensurePathIsNonModuleName(combineNormal(pathA, pathB));
133743
133868
  }
133744
133869
  function getSourceFileToImport(importedModuleSymbol, importLiteral, importingSourceFile, program, host, oldToNew) {
133745
- var _a, _b;
133746
133870
  if (importedModuleSymbol) {
133747
133871
  const oldFileName = find(importedModuleSymbol.declarations, isSourceFile).fileName;
133748
133872
  const newFileName = oldToNew(oldFileName);
133749
133873
  return newFileName === void 0 ? { newFileName: oldFileName, updated: false } : { newFileName, updated: true };
133750
133874
  } else {
133751
133875
  const mode = getModeForUsageLocation(importingSourceFile, importLiteral);
133752
- const resolved = host.resolveModuleNameLiterals || !host.resolveModuleNames ? (_b = (_a = program.resolvedModules) == null ? void 0 : _a.get(importingSourceFile.path)) == null ? void 0 : _b.get(importLiteral.text, mode) : host.getResolvedModuleWithFailedLookupLocationsFromCache && host.getResolvedModuleWithFailedLookupLocationsFromCache(importLiteral.text, importingSourceFile.fileName, mode);
133876
+ const resolved = host.resolveModuleNameLiterals || !host.resolveModuleNames ? program.getResolvedModule(importingSourceFile, importLiteral.text, mode) : host.getResolvedModuleWithFailedLookupLocationsFromCache && host.getResolvedModuleWithFailedLookupLocationsFromCache(importLiteral.text, importingSourceFile.fileName, mode);
133753
133877
  return getSourceFileToImportFromResolved(importLiteral, resolved, oldToNew, program.getSourceFiles());
133754
133878
  }
133755
133879
  }
@@ -134669,7 +134793,7 @@ ${lanes.join("\n")}
134669
134793
 
134670
134794
  // src/services/suggestionDiagnostics.ts
134671
134795
  function computeSuggestionDiagnostics(sourceFile, program, cancellationToken) {
134672
- var _a, _b, _c;
134796
+ var _a;
134673
134797
  program.getSemanticDiagnostics(sourceFile, cancellationToken);
134674
134798
  const diags = [];
134675
134799
  const checker = program.getTypeChecker();
@@ -134686,7 +134810,7 @@ ${lanes.join("\n")}
134686
134810
  const name = importNameForConvertToDefaultImport(importNode);
134687
134811
  if (!name)
134688
134812
  continue;
134689
- const module2 = (_c = (_b = (_a = program.resolvedModules) == null ? void 0 : _a.get(sourceFile.path)) == null ? void 0 : _b.get(moduleSpecifier.text, getModeForUsageLocation(sourceFile, moduleSpecifier))) == null ? void 0 : _c.resolvedModule;
134813
+ const module2 = (_a = program.getResolvedModule(sourceFile, moduleSpecifier.text, getModeForUsageLocation(sourceFile, moduleSpecifier))) == null ? void 0 : _a.resolvedModule;
134690
134814
  const resolvedFile = module2 && program.getSourceFile(module2.resolvedFileName);
134691
134815
  if (resolvedFile && resolvedFile.externalModuleIndicator && resolvedFile.externalModuleIndicator !== true && isExportAssignment(resolvedFile.externalModuleIndicator) && resolvedFile.externalModuleIndicator.isExportEquals) {
134692
134816
  diags.push(createDiagnosticForNode(name, Diagnostics.Import_may_be_converted_to_a_default_import));
@@ -134939,7 +135063,8 @@ ${lanes.join("\n")}
134939
135063
  compilerHost,
134940
135064
  options
134941
135065
  ),
134942
- setExternalModuleIndicator: getSetExternalModuleIndicator(options)
135066
+ setExternalModuleIndicator: getSetExternalModuleIndicator(options),
135067
+ jsDocParsingMode: 1 /* ParseNone */
134943
135068
  }
134944
135069
  );
134945
135070
  if (transpileOptions.moduleName) {
@@ -137102,10 +137227,10 @@ ${lanes.join("\n")}
137102
137227
  const targetSourceFile = program.getSourceFile(targetFile);
137103
137228
  for (const oldStatement of oldFile.statements) {
137104
137229
  forEachImportInStatement(oldStatement, (i) => {
137105
- var _a, _b, _c;
137230
+ var _a;
137106
137231
  const moduleSpecifier = moduleSpecifierFromImport(i);
137107
- const resolved = (_b = (_a = program.resolvedModules) == null ? void 0 : _a.get(oldFile.path)) == null ? void 0 : _b.get(moduleSpecifier.text, getModeForUsageLocation(oldFile, moduleSpecifier));
137108
- const fileName = (_c = resolved == null ? void 0 : resolved.resolvedModule) == null ? void 0 : _c.resolvedFileName;
137232
+ const resolved = program.getResolvedModule(oldFile, moduleSpecifier.text, getModeForUsageLocation(oldFile, moduleSpecifier));
137233
+ const fileName = (_a = resolved == null ? void 0 : resolved.resolvedModule) == null ? void 0 : _a.resolvedFileName;
137109
137234
  if (fileName && targetSourceFile) {
137110
137235
  const newModuleSpecifier = getModuleSpecifier(program.getCompilerOptions(), targetSourceFile, targetSourceFile.path, fileName, createModuleSpecifierResolutionHost(program, host));
137111
137236
  append(copiedOldImports, filterImport(i, makeStringLiteral(newModuleSpecifier, quotePreference), (name) => importsToCopy.has(checker.getSymbolAtLocation(name))));
@@ -138271,7 +138396,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
138271
138396
  } else if (refactorKindBeginsWith(removeBracesAction.kind, kind) && isBlock(func.body) && func.body.statements.length === 1) {
138272
138397
  const firstStatement = first(func.body.statements);
138273
138398
  if (isReturnStatement(firstStatement)) {
138274
- return { func, addBraces: false, expression: firstStatement.expression, returnStatement: firstStatement };
138399
+ const expression = firstStatement.expression && isObjectLiteralExpression(getLeftmostExpression(
138400
+ firstStatement.expression,
138401
+ /*stopAtCallExpressions*/
138402
+ false
138403
+ )) ? factory.createParenthesizedExpression(firstStatement.expression) : firstStatement.expression;
138404
+ return { func, addBraces: false, expression, returnStatement: firstStatement };
138275
138405
  }
138276
138406
  }
138277
138407
  return void 0;
@@ -139113,12 +139243,16 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
139113
139243
  const { file, startPosition } = context;
139114
139244
  const node = getNodeOrParentOfParentheses(file, startPosition);
139115
139245
  const maybeBinary = getParentBinaryExpression(node);
139246
+ const nodeIsStringLiteral = isStringLiteral(maybeBinary);
139116
139247
  const refactorInfo = { name: refactorName10, description: refactorDescription6, actions: [] };
139117
- if (isBinaryExpression(maybeBinary) && treeToArray(maybeBinary).isValidConcatenation) {
139248
+ if (nodeIsStringLiteral && context.triggerReason !== "invoked") {
139249
+ return emptyArray;
139250
+ }
139251
+ if (isExpressionNode(maybeBinary) && (nodeIsStringLiteral || isBinaryExpression(maybeBinary) && treeToArray(maybeBinary).isValidConcatenation)) {
139118
139252
  refactorInfo.actions.push(convertStringAction);
139119
139253
  return [refactorInfo];
139120
139254
  } else if (context.preferences.provideRefactorNotApplicableReason) {
139121
- refactorInfo.actions.push({ ...convertStringAction, notApplicableReason: getLocaleSpecificMessage(Diagnostics.Can_only_convert_string_concatenation) });
139255
+ refactorInfo.actions.push({ ...convertStringAction, notApplicableReason: getLocaleSpecificMessage(Diagnostics.Can_only_convert_string_concatenations_and_string_literals) });
139122
139256
  return [refactorInfo];
139123
139257
  }
139124
139258
  return emptyArray;
@@ -141850,7 +141984,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
141850
141984
  const options = {
141851
141985
  languageVersion: sourceFile.languageVersion,
141852
141986
  impliedNodeFormat: sourceFile.impliedNodeFormat,
141853
- setExternalModuleIndicator: sourceFile.setExternalModuleIndicator
141987
+ setExternalModuleIndicator: sourceFile.setExternalModuleIndicator,
141988
+ jsDocParsingMode: sourceFile.jsDocParsingMode
141854
141989
  };
141855
141990
  return createLanguageServiceSourceFile(
141856
141991
  sourceFile.fileName,
@@ -141968,7 +142103,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
141968
142103
  resolveTypeReferenceDirectiveReferences: maybeBind(host, host.resolveTypeReferenceDirectiveReferences),
141969
142104
  resolveLibrary: maybeBind(host, host.resolveLibrary),
141970
142105
  useSourceOfProjectReferenceRedirect: maybeBind(host, host.useSourceOfProjectReferenceRedirect),
141971
- getParsedCommandLine
142106
+ getParsedCommandLine,
142107
+ jsDocParsingMode: host.jsDocParsingMode
141972
142108
  };
141973
142109
  const originalGetSourceFile = compilerHost.getSourceFile;
141974
142110
  const { getSourceFileWithCache } = changeCompilerHostLikeToUseCache(
@@ -143697,7 +143833,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
143697
143833
  this.host,
143698
143834
  this.host.getCompilationSettings()
143699
143835
  ),
143700
- setExternalModuleIndicator: getSetExternalModuleIndicator(this.host.getCompilationSettings())
143836
+ setExternalModuleIndicator: getSetExternalModuleIndicator(this.host.getCompilationSettings()),
143837
+ // These files are used to produce syntax-based highlighting, which reads JSDoc, so we must use ParseAll.
143838
+ jsDocParsingMode: 0 /* ParseAll */
143701
143839
  };
143702
143840
  sourceFile = createLanguageServiceSourceFile(
143703
143841
  fileName,
@@ -143963,6 +144101,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
143963
144101
  return map(typeDirectiveNames, (name) => getProperty(typeDirectivesForFile, isString(name) ? name : toFileNameLowerCase(name.fileName)));
143964
144102
  };
143965
144103
  }
144104
+ if ("jsDocParsingMode" in this.shimHost) {
144105
+ this.jsDocParsingMode = this.shimHost.jsDocParsingMode;
144106
+ }
143966
144107
  }
143967
144108
  log(s) {
143968
144109
  if (this.loggingEnabled) {
@@ -147721,9 +147862,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
147721
147862
 
147722
147863
  // src/services/codefixes/convertToEsModule.ts
147723
147864
  function fixImportOfModuleExports(importingFile, exportingFile, program, changes, quotePreference) {
147724
- var _a, _b, _c;
147865
+ var _a;
147725
147866
  for (const moduleSpecifier of importingFile.imports) {
147726
- const imported = (_c = (_b = (_a = program.resolvedModules) == null ? void 0 : _a.get(importingFile.path)) == null ? void 0 : _b.get(moduleSpecifier.text, getModeForUsageLocation(importingFile, moduleSpecifier))) == null ? void 0 : _c.resolvedModule;
147867
+ const imported = (_a = program.getResolvedModule(importingFile, moduleSpecifier.text, getModeForUsageLocation(importingFile, moduleSpecifier))) == null ? void 0 : _a.resolvedModule;
147727
147868
  if (!imported || imported.resolvedFileName !== exportingFile.fileName) {
147728
147869
  continue;
147729
147870
  }
@@ -149859,11 +150000,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
149859
150000
  Debug.failBadSyntaxKind(aliasDeclaration);
149860
150001
  }
149861
150002
  function promoteImportClause(importClause) {
149862
- var _a, _b, _c;
150003
+ var _a;
149863
150004
  changes.delete(sourceFile, getTypeKeywordOfTypeOnlyImport(importClause, sourceFile));
149864
150005
  if (!compilerOptions.allowImportingTsExtensions) {
149865
150006
  const moduleSpecifier = tryGetModuleSpecifierFromDeclaration(importClause.parent);
149866
- const resolvedModule = moduleSpecifier && ((_c = (_b = (_a = program.resolvedModules) == null ? void 0 : _a.get(sourceFile.path)) == null ? void 0 : _b.get(moduleSpecifier.text, getModeForUsageLocation(sourceFile, moduleSpecifier))) == null ? void 0 : _c.resolvedModule);
150007
+ const resolvedModule = moduleSpecifier && ((_a = program.getResolvedModule(sourceFile, moduleSpecifier.text, getModeForUsageLocation(sourceFile, moduleSpecifier))) == null ? void 0 : _a.resolvedModule);
149867
150008
  if (resolvedModule == null ? void 0 : resolvedModule.resolvedUsingTsExtension) {
149868
150009
  const changedExtension = changeAnyExtension(moduleSpecifier.text, getOutputExtension(moduleSpecifier.text, compilerOptions));
149869
150010
  changes.replaceNode(sourceFile, moduleSpecifier, factory.createStringLiteral(changedExtension));
@@ -150570,7 +150711,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
150570
150711
 
150571
150712
  // src/services/codefixes/fixImportNonExportedMember.ts
150572
150713
  function getInfo7(sourceFile, pos, program) {
150573
- var _a, _b, _c, _d;
150714
+ var _a, _b;
150574
150715
  const token = getTokenAtPosition(sourceFile, pos);
150575
150716
  if (isIdentifier(token)) {
150576
150717
  const importDeclaration = findAncestor(token, isImportDeclaration);
@@ -150579,18 +150720,19 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
150579
150720
  const moduleSpecifier = isStringLiteral(importDeclaration.moduleSpecifier) ? importDeclaration.moduleSpecifier.text : void 0;
150580
150721
  if (moduleSpecifier === void 0)
150581
150722
  return void 0;
150582
- const resolvedModule = (_c = (_b = (_a = program.resolvedModules) == null ? void 0 : _a.get(sourceFile.path)) == null ? void 0 : _b.get(
150723
+ const resolvedModule = (_a = program.getResolvedModule(
150724
+ sourceFile,
150583
150725
  moduleSpecifier,
150584
150726
  /*mode*/
150585
150727
  void 0
150586
- )) == null ? void 0 : _c.resolvedModule;
150728
+ )) == null ? void 0 : _a.resolvedModule;
150587
150729
  if (resolvedModule === void 0)
150588
150730
  return void 0;
150589
150731
  const moduleSourceFile = program.getSourceFile(resolvedModule.resolvedFileName);
150590
150732
  if (moduleSourceFile === void 0 || isSourceFileFromLibrary(program, moduleSourceFile))
150591
150733
  return void 0;
150592
150734
  const moduleSymbol = moduleSourceFile.symbol;
150593
- const locals = (_d = tryCast(moduleSymbol.valueDeclaration, canHaveLocals)) == null ? void 0 : _d.locals;
150735
+ const locals = (_b = tryCast(moduleSymbol.valueDeclaration, canHaveLocals)) == null ? void 0 : _b.locals;
150594
150736
  if (locals === void 0)
150595
150737
  return void 0;
150596
150738
  const localSymbol = locals.get(token.escapedText);
@@ -150880,10 +151022,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
150880
151022
  return flags;
150881
151023
  }
150882
151024
  function getResolvedSourceFileFromImportDeclaration(sourceFile, context, importDeclaration) {
150883
- var _a, _b, _c;
151025
+ var _a;
150884
151026
  if (!importDeclaration || !isStringLiteralLike(importDeclaration.moduleSpecifier))
150885
151027
  return void 0;
150886
- const resolvedModule = (_c = (_b = (_a = context.program.resolvedModules) == null ? void 0 : _a.get(sourceFile.path)) == null ? void 0 : _b.get(importDeclaration.moduleSpecifier.text, getModeForUsageLocation(sourceFile, importDeclaration.moduleSpecifier))) == null ? void 0 : _c.resolvedModule;
151028
+ const resolvedModule = (_a = context.program.getResolvedModule(sourceFile, importDeclaration.moduleSpecifier.text, getModeForUsageLocation(sourceFile, importDeclaration.moduleSpecifier))) == null ? void 0 : _a.resolvedModule;
150887
151029
  if (!resolvedModule)
150888
151030
  return void 0;
150889
151031
  return context.program.getSourceFile(resolvedModule.resolvedFileName);
@@ -160355,8 +160497,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
160355
160497
  return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: completion.hasIndexSignature, optionalReplacementSpan, entries };
160356
160498
  }
160357
160499
  case 2 /* Types */: {
160500
+ const quoteChar = contextToken.kind === 15 /* NoSubstitutionTemplateLiteral */ ? 96 /* backtick */ : startsWith(getTextOfNode(contextToken), "'") ? 39 /* singleQuote */ : 34 /* doubleQuote */;
160358
160501
  const entries = completion.types.map((type) => ({
160359
- name: type.value,
160502
+ name: escapeString(type.value, quoteChar),
160360
160503
  kindModifiers: "" /* none */,
160361
160504
  kind: "string" /* string */,
160362
160505
  sortText: SortText.LocationPriority,
@@ -162195,7 +162338,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
162195
162338
  })(FindReferencesUse || {});
162196
162339
  ((Core2) => {
162197
162340
  function getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options = {}, sourceFilesSet = new Set(sourceFiles.map((f) => f.fileName))) {
162198
- var _a, _b, _c, _d;
162341
+ var _a, _b;
162199
162342
  node = getAdjustedNode2(node, options);
162200
162343
  if (isSourceFile(node)) {
162201
162344
  const resolvedRef = ts_GoToDefinition_exports.getReferenceAtPosition(node, position, program);
@@ -162234,7 +162377,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
162234
162377
  if (!options.implementations && isStringLiteralLike(node)) {
162235
162378
  if (isModuleSpecifierLike(node)) {
162236
162379
  const fileIncludeReasons = program.getFileIncludeReasons();
162237
- const referencedFileName = (_d = (_c = (_b = (_a = program.resolvedModules) == null ? void 0 : _a.get(node.getSourceFile().path)) == null ? void 0 : _b.get(node.text, getModeForUsageLocation(node.getSourceFile(), node))) == null ? void 0 : _c.resolvedModule) == null ? void 0 : _d.resolvedFileName;
162380
+ const referencedFileName = (_b = (_a = program.getResolvedModule(node.getSourceFile(), node.text, getModeForUsageLocation(node.getSourceFile(), node))) == null ? void 0 : _a.resolvedModule) == null ? void 0 : _b.resolvedFileName;
162238
162381
  const referencedFile = referencedFileName ? program.getSourceFile(referencedFileName) : void 0;
162239
162382
  if (referencedFile) {
162240
162383
  return [{ definition: { type: 4 /* String */, node }, references: getReferencesForNonModule(referencedFile, fileIncludeReasons, program) || emptyArray }];
@@ -163664,7 +163807,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
163664
163807
 
163665
163808
  // src/services/goToDefinition.ts
163666
163809
  function getDefinitionAtPosition(program, sourceFile, position, searchOtherFilesOnly, stopAtAlias) {
163667
- var _a, _b, _c;
163810
+ var _a;
163668
163811
  const resolvedRef = getReferenceAtPosition(sourceFile, position, program);
163669
163812
  const fileReferenceDefinition = resolvedRef && [getDefinitionInfoForFileReference(resolvedRef.reference.fileName, resolvedRef.fileName, resolvedRef.unverified)] || emptyArray;
163670
163813
  if (resolvedRef == null ? void 0 : resolvedRef.file) {
@@ -163737,7 +163880,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
163737
163880
  }
163738
163881
  }
163739
163882
  if (!symbol && isModuleSpecifierLike(fallbackNode)) {
163740
- const ref = (_c = (_b = (_a = program.resolvedModules) == null ? void 0 : _a.get(sourceFile.path)) == null ? void 0 : _b.get(fallbackNode.text, getModeForUsageLocation(sourceFile, fallbackNode))) == null ? void 0 : _c.resolvedModule;
163883
+ const ref = (_a = program.getResolvedModule(sourceFile, fallbackNode.text, getModeForUsageLocation(sourceFile, fallbackNode))) == null ? void 0 : _a.resolvedModule;
163741
163884
  if (ref) {
163742
163885
  return [{
163743
163886
  name: fallbackNode.text,
@@ -163832,7 +163975,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
163832
163975
  return getDefinitionFromSymbol(typeChecker, symbol, node);
163833
163976
  }
163834
163977
  function getReferenceAtPosition(sourceFile, position, program) {
163835
- var _a, _b, _c, _d;
163978
+ var _a, _b;
163836
163979
  const referencePath = findReferenceInPosition(sourceFile.referencedFiles, position);
163837
163980
  if (referencePath) {
163838
163981
  const file = program.getSourceFileFromReference(sourceFile, referencePath);
@@ -163849,11 +163992,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
163849
163992
  const file = program.getLibFileFromReference(libReferenceDirective);
163850
163993
  return file && { reference: libReferenceDirective, fileName: file.fileName, file, unverified: false };
163851
163994
  }
163852
- const resolvedModules = (_b = program.resolvedModules) == null ? void 0 : _b.get(sourceFile.path);
163853
- if (resolvedModules == null ? void 0 : resolvedModules.size()) {
163995
+ if (sourceFile.imports.length || sourceFile.moduleAugmentations.length) {
163854
163996
  const node = getTouchingToken(sourceFile, position);
163855
- if (isModuleSpecifierLike(node) && isExternalModuleNameRelative(node.text) && resolvedModules.has(node.text, getModeForUsageLocation(sourceFile, node))) {
163856
- const verifiedFileName = (_d = (_c = resolvedModules.get(node.text, getModeForUsageLocation(sourceFile, node))) == null ? void 0 : _c.resolvedModule) == null ? void 0 : _d.resolvedFileName;
163997
+ let resolution;
163998
+ if (isModuleSpecifierLike(node) && isExternalModuleNameRelative(node.text) && (resolution = program.getResolvedModule(sourceFile, node.text, getModeForUsageLocation(sourceFile, node)))) {
163999
+ const verifiedFileName = (_b = resolution.resolvedModule) == null ? void 0 : _b.resolvedFileName;
163857
164000
  const fileName = verifiedFileName || resolvePath(getDirectoryPath(sourceFile.fileName), node.text);
163858
164001
  return {
163859
164002
  file: program.getSourceFile(fileName),
@@ -169059,7 +169202,7 @@ ${options.prefix}` : "\n" : options.prefix
169059
169202
  const sourceFile = createSourceFile(
169060
169203
  "any file name",
169061
169204
  nonFormattedText,
169062
- 99 /* ESNext */,
169205
+ { languageVersion: 99 /* ESNext */, jsDocParsingMode: 1 /* ParseNone */ },
169063
169206
  /*setParentNodes*/
169064
169207
  true,
169065
169208
  scriptKind
@@ -172952,6 +173095,7 @@ ${options.prefix}` : "\n" : options.prefix
172952
173095
  CommandTypes2["ProvideCallHierarchyIncomingCalls"] = "provideCallHierarchyIncomingCalls";
172953
173096
  CommandTypes2["ProvideCallHierarchyOutgoingCalls"] = "provideCallHierarchyOutgoingCalls";
172954
173097
  CommandTypes2["ProvideInlayHints"] = "provideInlayHints";
173098
+ CommandTypes2["WatchChange"] = "watchChange";
172955
173099
  return CommandTypes2;
172956
173100
  })(CommandTypes || {});
172957
173101
  OrganizeImportsMode2 = /* @__PURE__ */ ((OrganizeImportsMode3) => {
@@ -173785,16 +173929,12 @@ ${options.prefix}` : "\n" : options.prefix
173785
173929
  }
173786
173930
  function extractUnresolvedImportsFromSourceFile(program, file, ambientModules, cachedUnresolvedImportsPerFile) {
173787
173931
  return getOrUpdate(cachedUnresolvedImportsPerFile, file.path, () => {
173788
- var _a;
173789
- const resolvedModules = (_a = program.resolvedModules) == null ? void 0 : _a.get(file.path);
173790
- if (!resolvedModules)
173791
- return emptyArray2;
173792
173932
  let unresolvedImports;
173793
- resolvedModules.forEach(({ resolvedModule }, name) => {
173933
+ program.forEachResolvedModule(({ resolvedModule }, name) => {
173794
173934
  if ((!resolvedModule || !resolutionExtensionIsTSOrJson(resolvedModule.extension)) && !isExternalModuleNameRelative(name) && !ambientModules.some((m) => m === name)) {
173795
173935
  unresolvedImports = append(unresolvedImports, parsePackageName(name).packageName);
173796
173936
  }
173797
- });
173937
+ }, file);
173798
173938
  return unresolvedImports || emptyArray2;
173799
173939
  });
173800
173940
  }
@@ -173878,6 +174018,7 @@ ${options.prefix}` : "\n" : options.prefix
173878
174018
  this.directoryStructureHost = directoryStructureHost;
173879
174019
  this.currentDirectory = this.projectService.getNormalizedAbsolutePath(currentDirectory);
173880
174020
  this.getCanonicalFileName = this.projectService.toCanonicalFileName;
174021
+ this.jsDocParsingMode = this.projectService.jsDocParsingMode;
173881
174022
  this.cancellationToken = new ThrottledCancellationToken(this.projectService.cancellationToken, this.projectService.throttleWaitMilliseconds);
173882
174023
  if (!this.compilerOptions) {
173883
174024
  this.compilerOptions = getDefaultCompilerOptions2();
@@ -174002,8 +174143,8 @@ ${options.prefix}` : "\n" : options.prefix
174002
174143
  }
174003
174144
  if (this.program && !this.symlinks.hasProcessedResolutions()) {
174004
174145
  this.symlinks.setSymlinksFromResolutions(
174005
- this.program.resolvedModules,
174006
- this.program.resolvedTypeReferenceDirectiveNames,
174146
+ this.program.forEachResolvedModule,
174147
+ this.program.forEachResolvedTypeReferenceDirective,
174007
174148
  this.program.getAutomaticTypeDirectiveResolutions()
174008
174149
  );
174009
174150
  }
@@ -174786,12 +174927,23 @@ ${options.prefix}` : "\n" : options.prefix
174786
174927
  for (const f of oldProgram.getSourceFiles()) {
174787
174928
  const newFile = this.program.getSourceFileByPath(f.resolvedPath);
174788
174929
  if (!newFile || f.resolvedPath === f.path && newFile.resolvedPath !== f.path) {
174789
- this.detachScriptInfoFromProject(f.fileName, !!this.program.getSourceFileByPath(f.path));
174930
+ this.detachScriptInfoFromProject(
174931
+ f.fileName,
174932
+ !!this.program.getSourceFileByPath(f.path),
174933
+ /*syncDirWatcherRemove*/
174934
+ true
174935
+ );
174790
174936
  }
174791
174937
  }
174792
174938
  oldProgram.forEachResolvedProjectReference((resolvedProjectReference) => {
174793
174939
  if (!this.program.getResolvedProjectReferenceByPath(resolvedProjectReference.sourceFile.path)) {
174794
- this.detachScriptInfoFromProject(resolvedProjectReference.sourceFile.fileName);
174940
+ this.detachScriptInfoFromProject(
174941
+ resolvedProjectReference.sourceFile.fileName,
174942
+ /*noRemoveResolution*/
174943
+ void 0,
174944
+ /*syncDirWatcherRemove*/
174945
+ true
174946
+ );
174795
174947
  }
174796
174948
  });
174797
174949
  }
@@ -174831,6 +174983,7 @@ ${options.prefix}` : "\n" : options.prefix
174831
174983
  this.resolutionCache.updateTypeRootsWatch();
174832
174984
  }
174833
174985
  }
174986
+ this.projectService.verifyProgram(this);
174834
174987
  if (this.exportMapCache && !this.exportMapCache.isEmpty()) {
174835
174988
  this.exportMapCache.releaseSymbols();
174836
174989
  if (this.hasAddedorRemovedFiles || oldProgram && !this.program.structureIsReused) {
@@ -174903,12 +175056,12 @@ ${options.prefix}` : "\n" : options.prefix
174903
175056
  sendPerformanceEvent(kind, durationMs) {
174904
175057
  this.projectService.sendPerformanceEvent(kind, durationMs);
174905
175058
  }
174906
- detachScriptInfoFromProject(uncheckedFileName, noRemoveResolution) {
175059
+ detachScriptInfoFromProject(uncheckedFileName, noRemoveResolution, syncDirWatcherRemove) {
174907
175060
  const scriptInfoToDetach = this.projectService.getScriptInfo(uncheckedFileName);
174908
175061
  if (scriptInfoToDetach) {
174909
175062
  scriptInfoToDetach.detachFromProject(this);
174910
175063
  if (!noRemoveResolution) {
174911
- this.resolutionCache.removeResolutionsOfFile(scriptInfoToDetach.path);
175064
+ this.resolutionCache.removeResolutionsOfFile(scriptInfoToDetach.path, syncDirWatcherRemove);
174912
175065
  }
174913
175066
  }
174914
175067
  }
@@ -175642,11 +175795,12 @@ ${options.prefix}` : "\n" : options.prefix
175642
175795
  );
175643
175796
  if (entrypoints) {
175644
175797
  const real = (_a2 = host.realpath) == null ? void 0 : _a2.call(host, packageJson.packageDirectory);
175645
- const isSymlink = real && real !== packageJson.packageDirectory;
175798
+ const realPath2 = real ? hostProject.toPath(real) : void 0;
175799
+ const isSymlink = realPath2 && realPath2 !== hostProject.toPath(packageJson.packageDirectory);
175646
175800
  if (isSymlink) {
175647
175801
  symlinkCache.setSymlinkedDirectory(packageJson.packageDirectory, {
175648
175802
  real,
175649
- realPath: hostProject.toPath(real)
175803
+ realPath: realPath2
175650
175804
  });
175651
175805
  }
175652
175806
  return mapDefined(entrypoints, (entrypoint) => {
@@ -176228,6 +176382,87 @@ ${options.prefix}` : "\n" : options.prefix
176228
176382
  let nextId = 1;
176229
176383
  return () => nameFactory(nextId++);
176230
176384
  }
176385
+ function getHostWatcherMap() {
176386
+ return { idToCallbacks: /* @__PURE__ */ new Map(), pathToId: /* @__PURE__ */ new Map() };
176387
+ }
176388
+ function createWatchFactoryHostUsingWatchEvents(service, canUseWatchEvents) {
176389
+ if (!canUseWatchEvents || !service.eventHandler || !service.session)
176390
+ return void 0;
176391
+ const watchedFiles = getHostWatcherMap();
176392
+ const watchedDirectories = getHostWatcherMap();
176393
+ const watchedDirectoriesRecursive = getHostWatcherMap();
176394
+ let ids = 1;
176395
+ service.session.addProtocolHandler("watchChange" /* WatchChange */, (req) => {
176396
+ onWatchChange(req.arguments);
176397
+ return { responseRequired: false };
176398
+ });
176399
+ return {
176400
+ watchFile: watchFile2,
176401
+ watchDirectory,
176402
+ getCurrentDirectory: () => service.host.getCurrentDirectory(),
176403
+ useCaseSensitiveFileNames: service.host.useCaseSensitiveFileNames
176404
+ };
176405
+ function watchFile2(path, callback) {
176406
+ return getOrCreateFileWatcher(
176407
+ watchedFiles,
176408
+ path,
176409
+ callback,
176410
+ (id) => ({ eventName: CreateFileWatcherEvent, data: { id, path } })
176411
+ );
176412
+ }
176413
+ function watchDirectory(path, callback, recursive) {
176414
+ return getOrCreateFileWatcher(
176415
+ recursive ? watchedDirectoriesRecursive : watchedDirectories,
176416
+ path,
176417
+ callback,
176418
+ (id) => ({ eventName: CreateDirectoryWatcherEvent, data: { id, path, recursive: !!recursive } })
176419
+ );
176420
+ }
176421
+ function getOrCreateFileWatcher({ pathToId, idToCallbacks }, path, callback, event) {
176422
+ const key = service.toPath(path);
176423
+ let id = pathToId.get(key);
176424
+ if (!id)
176425
+ pathToId.set(key, id = ids++);
176426
+ let callbacks = idToCallbacks.get(id);
176427
+ if (!callbacks) {
176428
+ idToCallbacks.set(id, callbacks = /* @__PURE__ */ new Set());
176429
+ service.eventHandler(event(id));
176430
+ }
176431
+ callbacks.add(callback);
176432
+ return {
176433
+ close() {
176434
+ const callbacks2 = idToCallbacks.get(id);
176435
+ if (!(callbacks2 == null ? void 0 : callbacks2.delete(callback)))
176436
+ return;
176437
+ if (callbacks2.size)
176438
+ return;
176439
+ idToCallbacks.delete(id);
176440
+ pathToId.delete(key);
176441
+ service.eventHandler({ eventName: CloseFileWatcherEvent, data: { id } });
176442
+ }
176443
+ };
176444
+ }
176445
+ function onWatchChange({ id, path, eventType }) {
176446
+ onFileWatcherCallback(id, path, eventType);
176447
+ onDirectoryWatcherCallback(watchedDirectories, id, path, eventType);
176448
+ onDirectoryWatcherCallback(watchedDirectoriesRecursive, id, path, eventType);
176449
+ }
176450
+ function onFileWatcherCallback(id, eventPath, eventType) {
176451
+ var _a;
176452
+ (_a = watchedFiles.idToCallbacks.get(id)) == null ? void 0 : _a.forEach((callback) => {
176453
+ const eventKind = eventType === "create" ? 0 /* Created */ : eventType === "delete" ? 2 /* Deleted */ : 1 /* Changed */;
176454
+ callback(eventPath, eventKind);
176455
+ });
176456
+ }
176457
+ function onDirectoryWatcherCallback({ idToCallbacks }, id, eventPath, eventType) {
176458
+ var _a;
176459
+ if (eventType === "update")
176460
+ return;
176461
+ (_a = idToCallbacks.get(id)) == null ? void 0 : _a.forEach((callback) => {
176462
+ callback(eventPath);
176463
+ });
176464
+ }
176465
+ }
176231
176466
  function createIncompleteCompletionsCache() {
176232
176467
  let info;
176233
176468
  return {
@@ -176255,12 +176490,13 @@ ${options.prefix}` : "\n" : options.prefix
176255
176490
  false
176256
176491
  );
176257
176492
  }
176258
- var maxProgramSizeForNonTsFiles, maxFileSize, ProjectsUpdatedInBackgroundEvent, ProjectLoadingStartEvent, ProjectLoadingFinishEvent, LargeFileReferencedEvent, ConfigFileDiagEvent, ProjectLanguageServiceStateEvent, ProjectInfoTelemetryEvent, OpenFileInfoTelemetryEvent, ensureProjectForOpenFileSchedule, compilerOptionConverters, watchOptionsConverters, indentStyle, defaultTypeSafeList, fileNamePropertyReader, externalFilePropertyReader, noopConfigFileWatcher, ProjectReferenceProjectLoadKind, _ProjectService, ProjectService3;
176493
+ var maxProgramSizeForNonTsFiles, maxFileSize, ProjectsUpdatedInBackgroundEvent, ProjectLoadingStartEvent, ProjectLoadingFinishEvent, LargeFileReferencedEvent, ConfigFileDiagEvent, ProjectLanguageServiceStateEvent, ProjectInfoTelemetryEvent, OpenFileInfoTelemetryEvent, CreateFileWatcherEvent, CreateDirectoryWatcherEvent, CloseFileWatcherEvent, ensureProjectForOpenFileSchedule, compilerOptionConverters, watchOptionsConverters, indentStyle, defaultTypeSafeList, fileNamePropertyReader, externalFilePropertyReader, noopConfigFileWatcher, ProjectReferenceProjectLoadKind, _ProjectService, ProjectService3;
176259
176494
  var init_editorServices = __esm({
176260
176495
  "src/server/editorServices.ts"() {
176261
176496
  "use strict";
176262
176497
  init_ts7();
176263
176498
  init_ts_server3();
176499
+ init_protocol();
176264
176500
  maxProgramSizeForNonTsFiles = 20 * 1024 * 1024;
176265
176501
  maxFileSize = 4 * 1024 * 1024;
176266
176502
  ProjectsUpdatedInBackgroundEvent = "projectsUpdatedInBackground";
@@ -176271,6 +176507,9 @@ ${options.prefix}` : "\n" : options.prefix
176271
176507
  ProjectLanguageServiceStateEvent = "projectLanguageServiceState";
176272
176508
  ProjectInfoTelemetryEvent = "projectInfo";
176273
176509
  OpenFileInfoTelemetryEvent = "openFileInfo";
176510
+ CreateFileWatcherEvent = "createFileWatcher";
176511
+ CreateDirectoryWatcherEvent = "createDirectoryWatcher";
176512
+ CloseFileWatcherEvent = "closeFileWatcher";
176274
176513
  ensureProjectForOpenFileSchedule = "*ensureProjectForOpenFiles*";
176275
176514
  compilerOptionConverters = prepareConvertersForEnumLikeCompilerOptions(optionDeclarations);
176276
176515
  watchOptionsConverters = prepareConvertersForEnumLikeCompilerOptions(optionsForWatch);
@@ -176426,6 +176665,8 @@ ${options.prefix}` : "\n" : options.prefix
176426
176665
  this.extendedConfigCache = /* @__PURE__ */ new Map();
176427
176666
  /** @internal */
176428
176667
  this.verifyDocumentRegistry = noop;
176668
+ /** @internal */
176669
+ this.verifyProgram = noop;
176429
176670
  var _a;
176430
176671
  this.host = opts.host;
176431
176672
  this.logger = opts.logger;
@@ -176441,6 +176682,7 @@ ${options.prefix}` : "\n" : options.prefix
176441
176682
  this.allowLocalPluginLoads = !!opts.allowLocalPluginLoads;
176442
176683
  this.typesMapLocation = opts.typesMapLocation === void 0 ? combinePaths(getDirectoryPath(this.getExecutingFilePath()), "typesMap.json") : opts.typesMapLocation;
176443
176684
  this.session = opts.session;
176685
+ this.jsDocParsingMode = opts.jsDocParsingMode;
176444
176686
  if (opts.serverMode !== void 0) {
176445
176687
  this.serverMode = opts.serverMode;
176446
176688
  } else {
@@ -176466,14 +176708,19 @@ ${options.prefix}` : "\n" : options.prefix
176466
176708
  hostInfo: "Unknown host",
176467
176709
  extraFileExtensions: []
176468
176710
  };
176469
- this.documentRegistry = createDocumentRegistryInternal(this.host.useCaseSensitiveFileNames, this.currentDirectory, this);
176711
+ this.documentRegistry = createDocumentRegistryInternal(this.host.useCaseSensitiveFileNames, this.currentDirectory, this.jsDocParsingMode, this);
176470
176712
  const watchLogLevel = this.logger.hasLevel(3 /* verbose */) ? 2 /* Verbose */ : this.logger.loggingEnabled() ? 1 /* TriggerOnly */ : 0 /* None */;
176471
176713
  const log = watchLogLevel !== 0 /* None */ ? (s) => this.logger.info(s) : noop;
176472
176714
  this.packageJsonCache = createPackageJsonCache(this);
176473
176715
  this.watchFactory = this.serverMode !== 0 /* Semantic */ ? {
176474
176716
  watchFile: returnNoopFileWatcher,
176475
176717
  watchDirectory: returnNoopFileWatcher
176476
- } : getWatchFactory(this.host, watchLogLevel, log, getDetailWatchInfo);
176718
+ } : getWatchFactory(
176719
+ createWatchFactoryHostUsingWatchEvents(this, opts.canUseWatchEvents) || this.host,
176720
+ watchLogLevel,
176721
+ log,
176722
+ getDetailWatchInfo
176723
+ );
176477
176724
  (_a = opts.incrementalVerifier) == null ? void 0 : _a.call(opts, this);
176478
176725
  }
176479
176726
  toPath(fileName) {
@@ -180766,6 +181013,7 @@ ${json}${newLine}`;
180766
181013
  typesMapLocation: opts.typesMapLocation,
180767
181014
  serverMode: opts.serverMode,
180768
181015
  session: this,
181016
+ canUseWatchEvents: opts.canUseWatchEvents,
180769
181017
  incrementalVerifier: opts.incrementalVerifier
180770
181018
  };
180771
181019
  this.projectService = new ProjectService3(settings);
@@ -180819,43 +181067,41 @@ ${json}${newLine}`;
180819
181067
  defaultEventHandler(event) {
180820
181068
  switch (event.eventName) {
180821
181069
  case ProjectsUpdatedInBackgroundEvent:
180822
- const { openFiles } = event.data;
180823
- this.projectsUpdatedInBackgroundEvent(openFiles);
181070
+ this.projectsUpdatedInBackgroundEvent(event.data.openFiles);
180824
181071
  break;
180825
181072
  case ProjectLoadingStartEvent:
180826
- const { project, reason } = event.data;
180827
- this.event(
180828
- { projectName: project.getProjectName(), reason },
180829
- ProjectLoadingStartEvent
180830
- );
181073
+ this.event({
181074
+ projectName: event.data.project.getProjectName(),
181075
+ reason: event.data.reason
181076
+ }, event.eventName);
180831
181077
  break;
180832
181078
  case ProjectLoadingFinishEvent:
180833
- const { project: finishProject } = event.data;
180834
- this.event({ projectName: finishProject.getProjectName() }, ProjectLoadingFinishEvent);
181079
+ this.event({
181080
+ projectName: event.data.project.getProjectName()
181081
+ }, event.eventName);
180835
181082
  break;
180836
181083
  case LargeFileReferencedEvent:
180837
- const { file, fileSize, maxFileSize: maxFileSize2 } = event.data;
180838
- this.event({ file, fileSize, maxFileSize: maxFileSize2 }, LargeFileReferencedEvent);
181084
+ case CreateFileWatcherEvent:
181085
+ case CreateDirectoryWatcherEvent:
181086
+ case CloseFileWatcherEvent:
181087
+ this.event(event.data, event.eventName);
180839
181088
  break;
180840
181089
  case ConfigFileDiagEvent:
180841
- const { triggerFile, configFileName: configFile, diagnostics } = event.data;
180842
- const bakedDiags = map(diagnostics, (diagnostic) => formatDiagnosticToProtocol(
180843
- diagnostic,
180844
- /*includeFileName*/
180845
- true
180846
- ));
180847
181090
  this.event({
180848
- triggerFile,
180849
- configFile,
180850
- diagnostics: bakedDiags
180851
- }, ConfigFileDiagEvent);
181091
+ triggerFile: event.data.triggerFile,
181092
+ configFile: event.data.configFileName,
181093
+ diagnostics: map(event.data.diagnostics, (diagnostic) => formatDiagnosticToProtocol(
181094
+ diagnostic,
181095
+ /*includeFileName*/
181096
+ true
181097
+ ))
181098
+ }, event.eventName);
180852
181099
  break;
180853
181100
  case ProjectLanguageServiceStateEvent: {
180854
- const eventName = ProjectLanguageServiceStateEvent;
180855
181101
  this.event({
180856
181102
  projectName: event.data.project.getProjectName(),
180857
181103
  languageServiceEnabled: event.data.languageServiceEnabled
180858
- }, eventName);
181104
+ }, event.eventName);
180859
181105
  break;
180860
181106
  }
180861
181107
  case ProjectInfoTelemetryEvent: {
@@ -183585,9 +183831,12 @@ ${e.message}`;
183585
183831
  AutoImportProviderProject: () => AutoImportProviderProject,
183586
183832
  AuxiliaryProject: () => AuxiliaryProject,
183587
183833
  CharRangeSection: () => CharRangeSection,
183834
+ CloseFileWatcherEvent: () => CloseFileWatcherEvent,
183588
183835
  CommandNames: () => CommandNames,
183589
183836
  ConfigFileDiagEvent: () => ConfigFileDiagEvent,
183590
183837
  ConfiguredProject: () => ConfiguredProject2,
183838
+ CreateDirectoryWatcherEvent: () => CreateDirectoryWatcherEvent,
183839
+ CreateFileWatcherEvent: () => CreateFileWatcherEvent,
183591
183840
  Errors: () => Errors,
183592
183841
  EventBeginInstallTypes: () => EventBeginInstallTypes,
183593
183842
  EventEndInstallTypes: () => EventEndInstallTypes,
@@ -183758,6 +184007,7 @@ ${e.message}`;
183758
184007
  InternalEmitFlags: () => InternalEmitFlags,
183759
184008
  InternalSymbolName: () => InternalSymbolName,
183760
184009
  InvalidatedProjectKind: () => InvalidatedProjectKind,
184010
+ JSDocParsingMode: () => JSDocParsingMode,
183761
184011
  JsDoc: () => ts_JsDoc_exports,
183762
184012
  JsTyping: () => ts_JsTyping_exports,
183763
184013
  JsxEmit: () => JsxEmit,
@@ -184085,6 +184335,7 @@ ${e.message}`;
184085
184335
  createModuleNotFoundChain: () => createModuleNotFoundChain,
184086
184336
  createModuleResolutionCache: () => createModuleResolutionCache,
184087
184337
  createModuleResolutionLoader: () => createModuleResolutionLoader,
184338
+ createModuleResolutionLoaderUsingGlobalCache: () => createModuleResolutionLoaderUsingGlobalCache,
184088
184339
  createModuleSpecifierResolutionHost: () => createModuleSpecifierResolutionHost,
184089
184340
  createMultiMap: () => createMultiMap,
184090
184341
  createNodeConverters: () => createNodeConverters,
@@ -184513,6 +184764,7 @@ ${e.message}`;
184513
184764
  getLeadingCommentRangesOfNode: () => getLeadingCommentRangesOfNode,
184514
184765
  getLeftmostAccessExpression: () => getLeftmostAccessExpression,
184515
184766
  getLeftmostExpression: () => getLeftmostExpression,
184767
+ getLibraryNameFromLibFileName: () => getLibraryNameFromLibFileName,
184516
184768
  getLineAndCharacterOfPosition: () => getLineAndCharacterOfPosition,
184517
184769
  getLineInfo: () => getLineInfo,
184518
184770
  getLineOfLocalPosition: () => getLineOfLocalPosition,
@@ -184907,6 +185159,7 @@ ${e.message}`;
184907
185159
  isClassDeclaration: () => isClassDeclaration,
184908
185160
  isClassElement: () => isClassElement,
184909
185161
  isClassExpression: () => isClassExpression,
185162
+ isClassFieldAndNotAutoAccessor: () => isClassFieldAndNotAutoAccessor,
184910
185163
  isClassLike: () => isClassLike,
184911
185164
  isClassMemberModifier: () => isClassMemberModifier,
184912
185165
  isClassNamedEvaluationHelperBlock: () => isClassNamedEvaluationHelperBlock,
@@ -185996,9 +186249,12 @@ ${e.message}`;
185996
186249
  AutoImportProviderProject: () => AutoImportProviderProject,
185997
186250
  AuxiliaryProject: () => AuxiliaryProject,
185998
186251
  CharRangeSection: () => CharRangeSection,
186252
+ CloseFileWatcherEvent: () => CloseFileWatcherEvent,
185999
186253
  CommandNames: () => CommandNames,
186000
186254
  ConfigFileDiagEvent: () => ConfigFileDiagEvent,
186001
186255
  ConfiguredProject: () => ConfiguredProject2,
186256
+ CreateDirectoryWatcherEvent: () => CreateDirectoryWatcherEvent,
186257
+ CreateFileWatcherEvent: () => CreateFileWatcherEvent,
186002
186258
  Errors: () => Errors,
186003
186259
  EventBeginInstallTypes: () => EventBeginInstallTypes,
186004
186260
  EventEndInstallTypes: () => EventEndInstallTypes,
@@ -186157,6 +186413,7 @@ ${e.message}`;
186157
186413
  InternalEmitFlags: () => InternalEmitFlags,
186158
186414
  InternalSymbolName: () => InternalSymbolName,
186159
186415
  InvalidatedProjectKind: () => InvalidatedProjectKind,
186416
+ JSDocParsingMode: () => JSDocParsingMode,
186160
186417
  JsDoc: () => ts_JsDoc_exports,
186161
186418
  JsTyping: () => ts_JsTyping_exports,
186162
186419
  JsxEmit: () => JsxEmit,
@@ -186484,6 +186741,7 @@ ${e.message}`;
186484
186741
  createModuleNotFoundChain: () => createModuleNotFoundChain,
186485
186742
  createModuleResolutionCache: () => createModuleResolutionCache,
186486
186743
  createModuleResolutionLoader: () => createModuleResolutionLoader,
186744
+ createModuleResolutionLoaderUsingGlobalCache: () => createModuleResolutionLoaderUsingGlobalCache,
186487
186745
  createModuleSpecifierResolutionHost: () => createModuleSpecifierResolutionHost,
186488
186746
  createMultiMap: () => createMultiMap,
186489
186747
  createNodeConverters: () => createNodeConverters,
@@ -186912,6 +187170,7 @@ ${e.message}`;
186912
187170
  getLeadingCommentRangesOfNode: () => getLeadingCommentRangesOfNode,
186913
187171
  getLeftmostAccessExpression: () => getLeftmostAccessExpression,
186914
187172
  getLeftmostExpression: () => getLeftmostExpression,
187173
+ getLibraryNameFromLibFileName: () => getLibraryNameFromLibFileName,
186915
187174
  getLineAndCharacterOfPosition: () => getLineAndCharacterOfPosition,
186916
187175
  getLineInfo: () => getLineInfo,
186917
187176
  getLineOfLocalPosition: () => getLineOfLocalPosition,
@@ -187306,6 +187565,7 @@ ${e.message}`;
187306
187565
  isClassDeclaration: () => isClassDeclaration,
187307
187566
  isClassElement: () => isClassElement,
187308
187567
  isClassExpression: () => isClassExpression,
187568
+ isClassFieldAndNotAutoAccessor: () => isClassFieldAndNotAutoAccessor,
187309
187569
  isClassLike: () => isClassLike,
187310
187570
  isClassMemberModifier: () => isClassMemberModifier,
187311
187571
  isClassNamedEvaluationHelperBlock: () => isClassNamedEvaluationHelperBlock,