typescript 5.3.0-dev.20230920 → 5.3.0-dev.20230922

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/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.20230920`;
38
+ version = `${versionMajorMinor}.0-dev.20230922`;
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
 
@@ -8991,7 +8998,7 @@ ${lanes.join("\n")}
8991
8998
  Could_not_convert_to_arrow_function: diag(95151, 3 /* Message */, "Could_not_convert_to_arrow_function_95151", "Could not convert to arrow function"),
8992
8999
  Could_not_convert_to_named_function: diag(95152, 3 /* Message */, "Could_not_convert_to_named_function_95152", "Could not convert to named function"),
8993
9000
  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"),
9001
+ 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
9002
  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
9003
  Add_missing_function_declaration_0: diag(95156, 3 /* Message */, "Add_missing_function_declaration_0_95156", "Add missing function declaration '{0}'"),
8997
9004
  Add_all_missing_function_declarations: diag(95157, 3 /* Message */, "Add_all_missing_function_declarations_95157", "Add all missing function declarations"),
@@ -9582,7 +9589,8 @@ ${lanes.join("\n")}
9582
9589
  var tokenFlags;
9583
9590
  var commentDirectives;
9584
9591
  var inJSDocType = 0;
9585
- var skipNonSemanticJSDoc = false;
9592
+ var scriptKind = 0 /* Unknown */;
9593
+ var jsDocParsingMode = 0 /* ParseAll */;
9586
9594
  setText(text, start, length2);
9587
9595
  var scanner2 = {
9588
9596
  getTokenFullStart: () => fullStartPos,
@@ -9626,14 +9634,15 @@ ${lanes.join("\n")}
9626
9634
  setText,
9627
9635
  setScriptTarget,
9628
9636
  setLanguageVariant,
9637
+ setScriptKind,
9638
+ setJSDocParsingMode,
9629
9639
  setOnError,
9630
9640
  resetTokenState,
9631
9641
  setTextPos: resetTokenState,
9632
9642
  setInJSDocType,
9633
9643
  tryScan,
9634
9644
  lookAhead,
9635
- scanRange,
9636
- setSkipNonSemanticJSDoc
9645
+ scanRange
9637
9646
  };
9638
9647
  if (Debug.isDebugging) {
9639
9648
  Object.defineProperty(scanner2, "__debugShowCurrentPositionInText", {
@@ -10421,7 +10430,7 @@ ${lanes.join("\n")}
10421
10430
  tokenFlags |= 1 /* PrecedingLineBreak */;
10422
10431
  }
10423
10432
  }
10424
- if (isJSDoc2 && (!skipNonSemanticJSDoc || semanticJSDocTagRegEx.test(text.slice(fullStartPos, pos)))) {
10433
+ if (isJSDoc2 && shouldParseJSDoc()) {
10425
10434
  tokenFlags |= 2 /* PrecedingJSDocComment */;
10426
10435
  }
10427
10436
  commentDirectives = appendIfCommentDirective(commentDirectives, text.slice(lastLineStart, pos), commentDirectiveRegExMultiLine, lastLineStart);
@@ -10680,6 +10689,21 @@ ${lanes.join("\n")}
10680
10689
  }
10681
10690
  }
10682
10691
  }
10692
+ function shouldParseJSDoc() {
10693
+ switch (jsDocParsingMode) {
10694
+ case 0 /* ParseAll */:
10695
+ return true;
10696
+ case 1 /* ParseNone */:
10697
+ return false;
10698
+ }
10699
+ if (scriptKind !== 3 /* TS */ && scriptKind !== 4 /* TSX */) {
10700
+ return true;
10701
+ }
10702
+ if (jsDocParsingMode === 3 /* ParseForTypeInfo */) {
10703
+ return false;
10704
+ }
10705
+ return jsDocSeeOrLink.test(text.slice(fullStartPos, pos));
10706
+ }
10683
10707
  function reScanInvalidIdentifier() {
10684
10708
  Debug.assert(token === 0 /* Unknown */, "'reScanInvalidIdentifier' should only be called when the current token is 'SyntaxKind.Unknown'.");
10685
10709
  pos = tokenStart = fullStartPos;
@@ -11094,8 +11118,11 @@ ${lanes.join("\n")}
11094
11118
  function setLanguageVariant(variant) {
11095
11119
  languageVariant = variant;
11096
11120
  }
11097
- function setSkipNonSemanticJSDoc(skip) {
11098
- skipNonSemanticJSDoc = skip;
11121
+ function setScriptKind(kind) {
11122
+ scriptKind = kind;
11123
+ }
11124
+ function setJSDocParsingMode(kind) {
11125
+ jsDocParsingMode = kind;
11099
11126
  }
11100
11127
  function resetTokenState(position) {
11101
11128
  Debug.assert(position >= 0);
@@ -11131,7 +11158,7 @@ ${lanes.join("\n")}
11131
11158
  function utf16EncodeAsString(codePoint) {
11132
11159
  return utf16EncodeAsStringWorker(codePoint);
11133
11160
  }
11134
- var textToKeywordObj, textToKeyword, textToToken, unicodeES3IdentifierStart, unicodeES3IdentifierPart, unicodeES5IdentifierStart, unicodeES5IdentifierPart, unicodeESNextIdentifierStart, unicodeESNextIdentifierPart, commentDirectiveRegExSingleLine, commentDirectiveRegExMultiLine, semanticJSDocTagRegEx, tokenStrings, mergeConflictMarkerLength, shebangTriviaRegex, utf16EncodeAsStringWorker;
11161
+ var textToKeywordObj, textToKeyword, textToToken, unicodeES3IdentifierStart, unicodeES3IdentifierPart, unicodeES5IdentifierStart, unicodeES5IdentifierPart, unicodeESNextIdentifierStart, unicodeESNextIdentifierPart, commentDirectiveRegExSingleLine, commentDirectiveRegExMultiLine, jsDocSeeOrLink, tokenStrings, mergeConflictMarkerLength, shebangTriviaRegex, utf16EncodeAsStringWorker;
11135
11162
  var init_scanner = __esm({
11136
11163
  "src/compiler/scanner.ts"() {
11137
11164
  "use strict";
@@ -11294,7 +11321,7 @@ ${lanes.join("\n")}
11294
11321
  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
11322
  commentDirectiveRegExSingleLine = /^\/\/\/?\s*@(ts-expect-error|ts-ignore)/;
11296
11323
  commentDirectiveRegExMultiLine = /^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/;
11297
- semanticJSDocTagRegEx = /@(?:see|link)/i;
11324
+ jsDocSeeOrLink = /@(?:see|link)/i;
11298
11325
  tokenStrings = makeReverseMap(textToToken);
11299
11326
  mergeConflictMarkerLength = "<<<<<<<".length;
11300
11327
  shebangTriviaRegex = /^#!.*/;
@@ -12936,26 +12963,6 @@ ${lanes.join("\n")}
12936
12963
  function getFullWidth(node) {
12937
12964
  return node.end - node.pos;
12938
12965
  }
12939
- function getResolvedModule(sourceFile, moduleNameText, mode) {
12940
- var _a, _b;
12941
- return (_b = (_a = sourceFile == null ? void 0 : sourceFile.resolvedModules) == null ? void 0 : _a.get(moduleNameText, mode)) == null ? void 0 : _b.resolvedModule;
12942
- }
12943
- function setResolvedModule(sourceFile, moduleNameText, resolvedModule, mode) {
12944
- if (!sourceFile.resolvedModules) {
12945
- sourceFile.resolvedModules = createModeAwareCache();
12946
- }
12947
- sourceFile.resolvedModules.set(moduleNameText, mode, resolvedModule);
12948
- }
12949
- function setResolvedTypeReferenceDirective(sourceFile, typeReferenceDirectiveName, resolvedTypeReferenceDirective, mode) {
12950
- if (!sourceFile.resolvedTypeReferenceDirectiveNames) {
12951
- sourceFile.resolvedTypeReferenceDirectiveNames = createModeAwareCache();
12952
- }
12953
- sourceFile.resolvedTypeReferenceDirectiveNames.set(typeReferenceDirectiveName, mode, resolvedTypeReferenceDirective);
12954
- }
12955
- function getResolvedTypeReferenceDirective(sourceFile, typeReferenceDirectiveName, mode) {
12956
- var _a, _b;
12957
- return (_b = (_a = sourceFile == null ? void 0 : sourceFile.resolvedTypeReferenceDirectiveNames) == null ? void 0 : _a.get(typeReferenceDirectiveName, mode)) == null ? void 0 : _b.resolvedTypeReferenceDirective;
12958
- }
12959
12966
  function projectReferenceIsEqualTo(oldRef, newRef) {
12960
12967
  return oldRef.path === newRef.path && !oldRef.prepend === !newRef.prepend && !oldRef.circular === !newRef.circular;
12961
12968
  }
@@ -12963,8 +12970,8 @@ ${lanes.join("\n")}
12963
12970
  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;
12964
12971
  }
12965
12972
  function createModuleNotFoundChain(sourceFile, host, moduleReference, mode, packageName) {
12966
- var _a, _b;
12967
- const node10Result = (_b = (_a = sourceFile.resolvedModules) == null ? void 0 : _a.get(moduleReference, mode)) == null ? void 0 : _b.node10Result;
12973
+ var _a, _b, _c;
12974
+ 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;
12968
12975
  const result = node10Result ? chainDiagnosticMessages(
12969
12976
  /*details*/
12970
12977
  void 0,
@@ -17907,14 +17914,11 @@ ${lanes.join("\n")}
17907
17914
  (symlinkedDirectories || (symlinkedDirectories = /* @__PURE__ */ new Map())).set(symlinkPath, real);
17908
17915
  }
17909
17916
  },
17910
- setSymlinksFromResolutions(files, typeReferenceDirectives) {
17911
- var _a, _b;
17917
+ setSymlinksFromResolutions(resolvedModules, resolvedTypeReferenceDirectiveNames, typeReferenceDirectives) {
17912
17918
  Debug.assert(!hasProcessedResolutions);
17913
17919
  hasProcessedResolutions = true;
17914
- for (const file of files) {
17915
- (_a = file.resolvedModules) == null ? void 0 : _a.forEach((resolution) => processResolution(this, resolution.resolvedModule));
17916
- (_b = file.resolvedTypeReferenceDirectiveNames) == null ? void 0 : _b.forEach((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective));
17917
- }
17920
+ resolvedModules == null ? void 0 : resolvedModules.forEach((cache) => cache.forEach((resolution) => processResolution(this, resolution.resolvedModule)));
17921
+ resolvedTypeReferenceDirectiveNames == null ? void 0 : resolvedTypeReferenceDirectiveNames.forEach((cache) => cache.forEach((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective)));
17918
17922
  typeReferenceDirectives.forEach((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective));
17919
17923
  },
17920
17924
  hasProcessedResolutions: () => hasProcessedResolutions
@@ -23480,7 +23484,6 @@ ${lanes.join("\n")}
23480
23484
  node.imports = void 0;
23481
23485
  node.moduleAugmentations = void 0;
23482
23486
  node.ambientModuleNames = void 0;
23483
- node.resolvedModules = void 0;
23484
23487
  node.classifiableNames = void 0;
23485
23488
  node.impliedNodeFormat = void 0;
23486
23489
  return node;
@@ -28090,7 +28093,7 @@ ${lanes.join("\n")}
28090
28093
  function setExternalModuleIndicator(sourceFile) {
28091
28094
  sourceFile.externalModuleIndicator = isFileProbablyExternalModule(sourceFile);
28092
28095
  }
28093
- function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind, skipNonSemanticJSDoc) {
28096
+ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind) {
28094
28097
  var _a, _b, _c, _d;
28095
28098
  (_a = tracing) == null ? void 0 : _a.push(
28096
28099
  tracing.Phase.Parse,
@@ -28105,7 +28108,8 @@ ${lanes.join("\n")}
28105
28108
  const {
28106
28109
  languageVersion,
28107
28110
  setExternalModuleIndicator: overrideSetExternalModuleIndicator,
28108
- impliedNodeFormat: format
28111
+ impliedNodeFormat: format,
28112
+ jsDocParsingMode
28109
28113
  } = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions : { languageVersion: languageVersionOrOptions };
28110
28114
  if (languageVersion === 100 /* JSON */) {
28111
28115
  result = Parser.parseSourceFile(
@@ -28117,7 +28121,7 @@ ${lanes.join("\n")}
28117
28121
  setParentNodes,
28118
28122
  6 /* JSON */,
28119
28123
  noop,
28120
- skipNonSemanticJSDoc
28124
+ jsDocParsingMode
28121
28125
  );
28122
28126
  } else {
28123
28127
  const setIndicator = format === void 0 ? overrideSetExternalModuleIndicator : (file) => {
@@ -28133,7 +28137,7 @@ ${lanes.join("\n")}
28133
28137
  setParentNodes,
28134
28138
  scriptKind,
28135
28139
  setIndicator,
28136
- skipNonSemanticJSDoc
28140
+ jsDocParsingMode
28137
28141
  );
28138
28142
  }
28139
28143
  (_c = perfLogger) == null ? void 0 : _c.logStopParseSourceFile();
@@ -28917,7 +28921,7 @@ ${lanes.join("\n")}
28917
28921
  var contextFlags;
28918
28922
  var topLevel = true;
28919
28923
  var parseErrorBeforeNextFinishedNode = false;
28920
- function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride, skipNonSemanticJSDoc) {
28924
+ function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride, jsDocParsingMode = 0 /* ParseAll */) {
28921
28925
  var _a;
28922
28926
  scriptKind2 = ensureScriptKind(fileName2, scriptKind2);
28923
28927
  if (scriptKind2 === 6 /* JSON */) {
@@ -28939,9 +28943,8 @@ ${lanes.join("\n")}
28939
28943
  result2.pragmas = emptyMap;
28940
28944
  return result2;
28941
28945
  }
28942
- skipNonSemanticJSDoc = !!skipNonSemanticJSDoc && scriptKind2 !== 1 /* JS */ && scriptKind2 !== 2 /* JSX */;
28943
- initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, scriptKind2, skipNonSemanticJSDoc);
28944
- const result = parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride || setExternalModuleIndicator, skipNonSemanticJSDoc);
28946
+ initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, scriptKind2, jsDocParsingMode);
28947
+ const result = parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride || setExternalModuleIndicator, jsDocParsingMode);
28945
28948
  clearState();
28946
28949
  return result;
28947
28950
  }
@@ -28954,8 +28957,7 @@ ${lanes.join("\n")}
28954
28957
  /*syntaxCursor*/
28955
28958
  void 0,
28956
28959
  1 /* JS */,
28957
- /*skipNonSemanticJSDoc*/
28958
- false
28960
+ 0 /* ParseAll */
28959
28961
  );
28960
28962
  nextToken();
28961
28963
  const entityName = parseEntityName(
@@ -28968,15 +28970,7 @@ ${lanes.join("\n")}
28968
28970
  }
28969
28971
  Parser2.parseIsolatedEntityName = parseIsolatedEntityName2;
28970
28972
  function parseJsonText2(fileName2, sourceText2, languageVersion2 = 2 /* ES2015 */, syntaxCursor2, setParentNodes = false) {
28971
- initializeState(
28972
- fileName2,
28973
- sourceText2,
28974
- languageVersion2,
28975
- syntaxCursor2,
28976
- 6 /* JSON */,
28977
- /*skipNonSemanticJSDoc*/
28978
- false
28979
- );
28973
+ initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, 6 /* JSON */, 0 /* ParseAll */);
28980
28974
  sourceFlags = contextFlags;
28981
28975
  nextToken();
28982
28976
  const pos = getNodePos();
@@ -29057,7 +29051,7 @@ ${lanes.join("\n")}
29057
29051
  return result;
29058
29052
  }
29059
29053
  Parser2.parseJsonText = parseJsonText2;
29060
- function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind, _skipNonSemanticJSDoc) {
29054
+ function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind, _jsDocParsingMode) {
29061
29055
  NodeConstructor2 = objectAllocator.getNodeConstructor();
29062
29056
  TokenConstructor2 = objectAllocator.getTokenConstructor();
29063
29057
  IdentifierConstructor2 = objectAllocator.getIdentifierConstructor();
@@ -29093,13 +29087,15 @@ ${lanes.join("\n")}
29093
29087
  scanner2.setOnError(scanError);
29094
29088
  scanner2.setScriptTarget(languageVersion);
29095
29089
  scanner2.setLanguageVariant(languageVariant);
29096
- scanner2.setSkipNonSemanticJSDoc(_skipNonSemanticJSDoc);
29090
+ scanner2.setScriptKind(scriptKind);
29091
+ scanner2.setJSDocParsingMode(_jsDocParsingMode);
29097
29092
  }
29098
29093
  function clearState() {
29099
29094
  scanner2.clearCommentDirectives();
29100
29095
  scanner2.setText("");
29101
29096
  scanner2.setOnError(void 0);
29102
- scanner2.setSkipNonSemanticJSDoc(false);
29097
+ scanner2.setScriptKind(0 /* Unknown */);
29098
+ scanner2.setJSDocParsingMode(0 /* ParseAll */);
29103
29099
  sourceText = void 0;
29104
29100
  languageVersion = void 0;
29105
29101
  syntaxCursor = void 0;
@@ -29113,7 +29109,7 @@ ${lanes.join("\n")}
29113
29109
  notParenthesizedArrow = void 0;
29114
29110
  topLevel = true;
29115
29111
  }
29116
- function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2, skipNonSemanticJSDoc) {
29112
+ function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2, jsDocParsingMode) {
29117
29113
  const isDeclarationFile = isDeclarationFileName(fileName);
29118
29114
  if (isDeclarationFile) {
29119
29115
  contextFlags |= 33554432 /* Ambient */;
@@ -29132,7 +29128,7 @@ ${lanes.join("\n")}
29132
29128
  sourceFile.identifierCount = identifierCount;
29133
29129
  sourceFile.identifiers = identifiers;
29134
29130
  sourceFile.parseDiagnostics = attachFileToDiagnostics(parseDiagnostics, sourceFile);
29135
- sourceFile.skipNonSemanticJSDoc = skipNonSemanticJSDoc;
29131
+ sourceFile.jsDocParsingMode = jsDocParsingMode;
29136
29132
  if (jsDocDiagnostics) {
29137
29133
  sourceFile.jsDocDiagnostics = attachFileToDiagnostics(jsDocDiagnostics, sourceFile);
29138
29134
  }
@@ -34567,8 +34563,7 @@ ${lanes.join("\n")}
34567
34563
  /*syntaxCursor*/
34568
34564
  void 0,
34569
34565
  1 /* JS */,
34570
- /*skipNonSemanticJSDoc*/
34571
- false
34566
+ 0 /* ParseAll */
34572
34567
  );
34573
34568
  scanner2.setText(content, start, length2);
34574
34569
  currentToken = scanner2.scan();
@@ -34633,8 +34628,7 @@ ${lanes.join("\n")}
34633
34628
  /*syntaxCursor*/
34634
34629
  void 0,
34635
34630
  1 /* JS */,
34636
- /*skipNonSemanticJSDoc*/
34637
- false
34631
+ 0 /* ParseAll */
34638
34632
  );
34639
34633
  const jsDoc = doInsideOfContext(16777216 /* JSDoc */, () => parseJSDocCommentWorker(start, length2));
34640
34634
  const sourceFile = { languageVariant: 0 /* Standard */, text: content };
@@ -35590,7 +35584,7 @@ ${lanes.join("\n")}
35590
35584
  true,
35591
35585
  sourceFile.scriptKind,
35592
35586
  sourceFile.setExternalModuleIndicator,
35593
- sourceFile.skipNonSemanticJSDoc
35587
+ sourceFile.jsDocParsingMode
35594
35588
  );
35595
35589
  }
35596
35590
  const incrementalSourceFile = sourceFile;
@@ -35615,7 +35609,7 @@ ${lanes.join("\n")}
35615
35609
  true,
35616
35610
  sourceFile.scriptKind,
35617
35611
  sourceFile.setExternalModuleIndicator,
35618
- sourceFile.skipNonSemanticJSDoc
35612
+ sourceFile.jsDocParsingMode
35619
35613
  );
35620
35614
  result.commentDirectives = getNewCommentDirectives(
35621
35615
  sourceFile.commentDirectives,
@@ -37968,6 +37962,7 @@ ${lanes.join("\n")}
37968
37962
  node16: 100 /* Node16 */,
37969
37963
  nodenext: 199 /* NodeNext */
37970
37964
  })),
37965
+ affectsSourceFile: true,
37971
37966
  affectsModuleResolution: true,
37972
37967
  affectsEmit: true,
37973
37968
  affectsBuildInfo: true,
@@ -38404,6 +38399,7 @@ ${lanes.join("\n")}
38404
38399
  bundler: 100 /* Bundler */
38405
38400
  })),
38406
38401
  deprecatedKeys: /* @__PURE__ */ new Set(["node"]),
38402
+ affectsSourceFile: true,
38407
38403
  affectsModuleResolution: true,
38408
38404
  paramType: Diagnostics.STRATEGY,
38409
38405
  category: Diagnostics.Modules,
@@ -38946,6 +38942,7 @@ ${lanes.join("\n")}
38946
38942
  legacy: 1 /* Legacy */,
38947
38943
  force: 3 /* Force */
38948
38944
  })),
38945
+ affectsSourceFile: true,
38949
38946
  affectsModuleResolution: true,
38950
38947
  description: Diagnostics.Control_what_method_is_used_to_detect_module_format_JS_files,
38951
38948
  category: Diagnostics.Language_and_Environment,
@@ -38965,7 +38962,7 @@ ${lanes.join("\n")}
38965
38962
  affectsEmitOptionDeclarations = optionDeclarations.filter((option) => !!option.affectsEmit);
38966
38963
  affectsDeclarationPathOptionDeclarations = optionDeclarations.filter((option) => !!option.affectsDeclarationPath);
38967
38964
  moduleResolutionOptionDeclarations = optionDeclarations.filter((option) => !!option.affectsModuleResolution);
38968
- sourceFileAffectingCompilerOptions = optionDeclarations.filter((option) => !!option.affectsSourceFile || !!option.affectsModuleResolution || !!option.affectsBindDiagnostics);
38965
+ sourceFileAffectingCompilerOptions = optionDeclarations.filter((option) => !!option.affectsSourceFile || !!option.affectsBindDiagnostics);
38969
38966
  optionsAffectingProgramStructure = optionDeclarations.filter((option) => !!option.affectsProgramStructure);
38970
38967
  transpileOptionValueCompilerOptions = optionDeclarations.filter((option) => hasProperty(option, "transpileOptionValue"));
38971
38968
  optionsForBuild = [
@@ -39815,15 +39812,6 @@ ${lanes.join("\n")}
39815
39812
  return result;
39816
39813
  }
39817
39814
  }
39818
- function zipToModeAwareCache(file, keys, values, nameAndModeGetter) {
39819
- Debug.assert(keys.length === values.length);
39820
- const map2 = createModeAwareCache();
39821
- for (let i = 0; i < keys.length; ++i) {
39822
- const entry = keys[i];
39823
- map2.set(nameAndModeGetter.getName(entry), nameAndModeGetter.getMode(entry, file), values[i]);
39824
- }
39825
- return map2;
39826
- }
39827
39815
  function getOriginalOrResolvedModuleFileName(result) {
39828
39816
  return result.resolvedModule && (result.resolvedModule.originalPath || result.resolvedModule.resolvedFileName);
39829
39817
  }
@@ -40650,7 +40638,9 @@ ${lanes.join("\n")}
40650
40638
  extensionsToExtensionsArray(extensions),
40651
40639
  /*excludes*/
40652
40640
  void 0,
40653
- [changeAnyExtension(target.replace("*", "**/*"), getDeclarationEmitExtensionForPath(target))]
40641
+ [
40642
+ isDeclarationFileName(target) ? target.replace("*", "**/*") : changeAnyExtension(target.replace("*", "**/*"), getDeclarationEmitExtensionForPath(target))
40643
+ ]
40654
40644
  ).forEach((entry) => {
40655
40645
  entrypoints = appendIfUnique(entrypoints, {
40656
40646
  path: entry,
@@ -48779,7 +48769,7 @@ ${lanes.join("\n")}
48779
48769
  return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) : void 0;
48780
48770
  }
48781
48771
  function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) {
48782
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
48772
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
48783
48773
  if (startsWith(moduleReference, "@types/")) {
48784
48774
  const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
48785
48775
  const withoutAtTypePrefix = removePrefix(moduleReference, "@types/");
@@ -48797,7 +48787,7 @@ ${lanes.join("\n")}
48797
48787
  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);
48798
48788
  const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
48799
48789
  const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
48800
- const resolvedModule = getResolvedModule(currentSourceFile, moduleReference, mode);
48790
+ 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;
48801
48791
  const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule, currentSourceFile);
48802
48792
  const sourceFile = resolvedModule && (!resolutionDiagnostic || resolutionDiagnostic === Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set) && host.getSourceFile(resolvedModule.resolvedFileName);
48803
48793
  if (sourceFile) {
@@ -48805,7 +48795,7 @@ ${lanes.join("\n")}
48805
48795
  error2(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName);
48806
48796
  }
48807
48797
  if (resolvedModule.resolvedUsingTsExtension && isDeclarationFileName(moduleReference)) {
48808
- const importOrExport = ((_g = findAncestor(location, isImportDeclaration)) == null ? void 0 : _g.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
48798
+ const importOrExport = ((_j = findAncestor(location, isImportDeclaration)) == null ? void 0 : _j.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
48809
48799
  if (importOrExport && !importOrExport.isTypeOnly || findAncestor(location, isImportCall)) {
48810
48800
  error2(
48811
48801
  errorNode,
@@ -48814,7 +48804,7 @@ ${lanes.join("\n")}
48814
48804
  );
48815
48805
  }
48816
48806
  } else if (resolvedModule.resolvedUsingTsExtension && !shouldAllowImportingTsExtension(compilerOptions, currentSourceFile.fileName)) {
48817
- const importOrExport = ((_h = findAncestor(location, isImportDeclaration)) == null ? void 0 : _h.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
48807
+ const importOrExport = ((_k = findAncestor(location, isImportDeclaration)) == null ? void 0 : _k.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
48818
48808
  if (!((importOrExport == null ? void 0 : importOrExport.isTypeOnly) || findAncestor(location, isImportTypeNode))) {
48819
48809
  const tsExtension = Debug.checkDefined(tryExtractTSExtension(moduleReference));
48820
48810
  error2(errorNode, Diagnostics.An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled, tsExtension);
@@ -48835,7 +48825,7 @@ ${lanes.join("\n")}
48835
48825
  if (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */) {
48836
48826
  const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
48837
48827
  const overrideClauseHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l));
48838
- const overrideClause = overrideClauseHost && isImportTypeNode(overrideClauseHost) ? (_i = overrideClauseHost.assertions) == null ? void 0 : _i.assertClause : overrideClauseHost == null ? void 0 : overrideClauseHost.assertClause;
48828
+ const overrideClause = overrideClauseHost && isImportTypeNode(overrideClauseHost) ? (_l = overrideClauseHost.assertions) == null ? void 0 : _l.assertClause : overrideClauseHost == null ? void 0 : overrideClauseHost.assertClause;
48839
48829
  if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !getResolutionModeOverrideForClause(overrideClause)) {
48840
48830
  if (findAncestor(location, isImportEqualsDeclaration)) {
48841
48831
  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);
@@ -48942,7 +48932,7 @@ ${lanes.join("\n")}
48942
48932
  error2(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
48943
48933
  } else if (mode === 99 /* ESNext */ && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) {
48944
48934
  const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path));
48945
- const suggestedExt = (_j = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))) == null ? void 0 : _j[1];
48935
+ const suggestedExt = (_m = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))) == null ? void 0 : _m[1];
48946
48936
  if (suggestedExt) {
48947
48937
  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);
48948
48938
  } else {
@@ -55700,7 +55690,28 @@ ${lanes.join("\n")}
55700
55690
  }
55701
55691
  }
55702
55692
  }
55703
- links[resolutionKind] = combineSymbolTables(earlySymbols, lateSymbols) || emptySymbols;
55693
+ let resolved = combineSymbolTables(earlySymbols, lateSymbols);
55694
+ if (symbol.flags & 33554432 /* Transient */ && links.cjsExportMerged && symbol.declarations) {
55695
+ for (const decl of symbol.declarations) {
55696
+ const original = getSymbolLinks(decl.symbol)[resolutionKind];
55697
+ if (!resolved) {
55698
+ resolved = original;
55699
+ continue;
55700
+ }
55701
+ if (!original)
55702
+ continue;
55703
+ original.forEach((s, name) => {
55704
+ const existing = resolved.get(name);
55705
+ if (!existing)
55706
+ resolved.set(name, s);
55707
+ else if (existing === s)
55708
+ return;
55709
+ else
55710
+ resolved.set(name, mergeSymbol(existing, s));
55711
+ });
55712
+ }
55713
+ }
55714
+ links[resolutionKind] = resolved || emptySymbols;
55704
55715
  }
55705
55716
  return links[resolutionKind];
55706
55717
  }
@@ -117888,7 +117899,7 @@ ${lanes.join("\n")}
117888
117899
  function createCompilerHost(options, setParentNodes) {
117889
117900
  return createCompilerHostWorker(options, setParentNodes);
117890
117901
  }
117891
- function createGetSourceFile(readFile, getCompilerOptions, setParentNodes, skipNonSemanticJSDocParsing) {
117902
+ function createGetSourceFile(readFile, getCompilerOptions, setParentNodes) {
117892
117903
  return (fileName, languageVersionOrOptions, onError) => {
117893
117904
  let text;
117894
117905
  try {
@@ -117902,15 +117913,7 @@ ${lanes.join("\n")}
117902
117913
  }
117903
117914
  text = "";
117904
117915
  }
117905
- return text !== void 0 ? createSourceFile(
117906
- fileName,
117907
- text,
117908
- languageVersionOrOptions,
117909
- setParentNodes,
117910
- /*scriptKind*/
117911
- void 0,
117912
- skipNonSemanticJSDocParsing
117913
- ) : void 0;
117916
+ return text !== void 0 ? createSourceFile(fileName, text, languageVersionOrOptions, setParentNodes) : void 0;
117914
117917
  };
117915
117918
  }
117916
117919
  function createWriteFileMeasuringIO(actualWriteFile, createDirectory, directoryExists) {
@@ -117934,7 +117937,7 @@ ${lanes.join("\n")}
117934
117937
  }
117935
117938
  };
117936
117939
  }
117937
- function createCompilerHostWorker(options, setParentNodes, skipNonSemanticJSDocParsing, system = sys) {
117940
+ function createCompilerHostWorker(options, setParentNodes, system = sys) {
117938
117941
  const existingDirectories = /* @__PURE__ */ new Map();
117939
117942
  const getCanonicalFileName = createGetCanonicalFileName(system.useCaseSensitiveFileNames);
117940
117943
  function directoryExists(directoryPath) {
@@ -117953,7 +117956,7 @@ ${lanes.join("\n")}
117953
117956
  const newLine = getNewLineCharacter(options);
117954
117957
  const realpath = system.realpath && ((path) => system.realpath(path));
117955
117958
  const compilerHost = {
117956
- getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes, skipNonSemanticJSDocParsing),
117959
+ getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes),
117957
117960
  getDefaultLibLocation,
117958
117961
  getDefaultLibFileName: (options2) => combinePaths(getDefaultLibLocation(), getDefaultLibFileName(options2)),
117959
117962
  writeFile: createWriteFileMeasuringIO(
@@ -118409,15 +118412,15 @@ ${lanes.join("\n")}
118409
118412
  function isReferenceFileLocation(location) {
118410
118413
  return location.pos !== void 0;
118411
118414
  }
118412
- function getReferencedFileLocation(getSourceFileByPath, ref) {
118413
- var _a, _b, _c, _d, _e, _f;
118414
- const file = Debug.checkDefined(getSourceFileByPath(ref.file));
118415
+ function getReferencedFileLocation(program, ref) {
118416
+ var _a, _b, _c, _d, _e, _f, _g, _h;
118417
+ const file = Debug.checkDefined(program.getSourceFileByPath(ref.file));
118415
118418
  const { kind, index } = ref;
118416
118419
  let pos, end, packageId, resolutionMode;
118417
118420
  switch (kind) {
118418
118421
  case 3 /* Import */:
118419
118422
  const importLiteral = getModuleNameStringLiteralAt(file, index);
118420
- packageId = (_c = (_b = (_a = file.resolvedModules) == null ? void 0 : _a.get(importLiteral.text, getModeForResolutionAtIndex(file, index))) == null ? void 0 : _b.resolvedModule) == null ? void 0 : _c.packageId;
118423
+ 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;
118421
118424
  if (importLiteral.pos === -1)
118422
118425
  return { file, packageId, text: importLiteral.text };
118423
118426
  pos = skipTrivia(file.text, importLiteral.pos);
@@ -118428,7 +118431,7 @@ ${lanes.join("\n")}
118428
118431
  break;
118429
118432
  case 5 /* TypeReferenceDirective */:
118430
118433
  ({ pos, end, resolutionMode } = file.typeReferenceDirectives[index]);
118431
- packageId = (_f = (_e = (_d = file.resolvedTypeReferenceDirectiveNames) == null ? void 0 : _d.get(toFileNameLowerCase(file.typeReferenceDirectives[index].fileName), resolutionMode || file.impliedNodeFormat)) == null ? void 0 : _e.resolvedTypeReferenceDirective) == null ? void 0 : _f.packageId;
118434
+ 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;
118432
118435
  break;
118433
118436
  case 7 /* LibReferenceDirective */:
118434
118437
  ({ pos, end } = file.libReferenceDirectives[index]);
@@ -118549,6 +118552,10 @@ ${lanes.join("\n")}
118549
118552
  let automaticTypeDirectiveResolutions;
118550
118553
  let resolvedLibReferences;
118551
118554
  let resolvedLibProcessing;
118555
+ let resolvedModules;
118556
+ let resolvedModulesProcessing;
118557
+ let resolvedTypeReferenceDirectiveNames;
118558
+ let resolvedTypeReferenceDirectiveNamesProcessing;
118552
118559
  let packageMap;
118553
118560
  const maxNodeModuleJsDepth = typeof options.maxNodeModuleJsDepth === "number" ? options.maxNodeModuleJsDepth : 0;
118554
118561
  let currentNodeModulesDepth = 0;
@@ -118813,6 +118820,8 @@ ${lanes.join("\n")}
118813
118820
  }
118814
118821
  oldProgram = void 0;
118815
118822
  resolvedLibProcessing = void 0;
118823
+ resolvedModulesProcessing = void 0;
118824
+ resolvedTypeReferenceDirectiveNamesProcessing = void 0;
118816
118825
  const program = {
118817
118826
  getRootFileNames: () => rootNames,
118818
118827
  getSourceFile,
@@ -118854,6 +118863,8 @@ ${lanes.join("\n")}
118854
118863
  sourceFileToPackageName,
118855
118864
  redirectTargetsMap,
118856
118865
  usesUriStyleNodeCoreModules,
118866
+ resolvedModules,
118867
+ resolvedTypeReferenceDirectiveNames,
118857
118868
  resolvedLibReferences,
118858
118869
  getCurrentPackagesMap: () => packageMap,
118859
118870
  typesPackageExists,
@@ -118885,7 +118896,7 @@ ${lanes.join("\n")}
118885
118896
  case 1 /* FilePreprocessingFileExplainingDiagnostic */:
118886
118897
  return programDiagnostics.add(createDiagnosticExplainingFile(diagnostic.file && getSourceFileByPath(diagnostic.file), diagnostic.fileProcessingReason, diagnostic.diagnostic, diagnostic.args || emptyArray));
118887
118898
  case 0 /* FilePreprocessingReferencedDiagnostic */:
118888
- const { file, pos, end } = getReferencedFileLocation(getSourceFileByPath, diagnostic.reason);
118899
+ const { file, pos, end } = getReferencedFileLocation(program, diagnostic.reason);
118889
118900
  return programDiagnostics.add(createFileDiagnostic(file, Debug.checkDefined(pos), Debug.checkDefined(end) - pos, diagnostic.diagnostic, ...diagnostic.args || emptyArray));
118890
118901
  case 2 /* ResolutionDiagnostics */:
118891
118902
  return diagnostic.diagnostics.forEach((d) => programDiagnostics.add(d));
@@ -118902,14 +118913,15 @@ ${lanes.join("\n")}
118902
118913
  if (packageMap)
118903
118914
  return packageMap;
118904
118915
  packageMap = /* @__PURE__ */ new Map();
118905
- files.forEach((sf) => {
118906
- if (!sf.resolvedModules)
118907
- return;
118908
- sf.resolvedModules.forEach(({ resolvedModule }) => {
118909
- if (resolvedModule == null ? void 0 : resolvedModule.packageId)
118910
- packageMap.set(resolvedModule.packageId.name, resolvedModule.extension === ".d.ts" /* Dts */ || !!packageMap.get(resolvedModule.packageId.name));
118911
- });
118912
- });
118916
+ files.forEach(
118917
+ (sf) => {
118918
+ var _a2;
118919
+ return (_a2 = resolvedModules == null ? void 0 : resolvedModules.get(sf.path)) == null ? void 0 : _a2.forEach(({ resolvedModule }) => {
118920
+ if (resolvedModule == null ? void 0 : resolvedModule.packageId)
118921
+ packageMap.set(resolvedModule.packageId.name, resolvedModule.extension === ".d.ts" /* Dts */ || !!packageMap.get(resolvedModule.packageId.name));
118922
+ });
118923
+ }
118924
+ );
118913
118925
  return packageMap;
118914
118926
  }
118915
118927
  function typesPackageExists(packageName) {
@@ -119041,7 +119053,7 @@ ${lanes.join("\n")}
119041
119053
  return classifiableNames;
119042
119054
  }
119043
119055
  function resolveModuleNamesReusingOldState(moduleNames, file) {
119044
- var _a2;
119056
+ var _a2, _b2;
119045
119057
  if (structureIsReused === 0 /* Not */ && !file.ambientModuleNames.length) {
119046
119058
  return resolveModuleNamesWorker(
119047
119059
  moduleNames,
@@ -119050,24 +119062,16 @@ ${lanes.join("\n")}
119050
119062
  void 0
119051
119063
  );
119052
119064
  }
119053
- const oldSourceFile = oldProgram && oldProgram.getSourceFile(file.fileName);
119054
- if (oldSourceFile !== file && file.resolvedModules) {
119055
- const result2 = [];
119056
- for (const moduleName of moduleNames) {
119057
- const resolvedModule = file.resolvedModules.get(moduleName.text, getModeForUsageLocation(file, moduleName));
119058
- result2.push(resolvedModule);
119059
- }
119060
- return result2;
119061
- }
119062
119065
  let unknownModuleNames;
119063
119066
  let result;
119064
119067
  let reusedNames;
119065
119068
  const predictedToResolveToAmbientModuleMarker = emptyResolution;
119069
+ const oldSourceFile = oldProgram && oldProgram.getSourceFile(file.fileName);
119066
119070
  for (let i = 0; i < moduleNames.length; i++) {
119067
119071
  const moduleName = moduleNames[i];
119068
- if (file === oldSourceFile && !hasInvalidatedResolutions(oldSourceFile.path)) {
119072
+ if (file === oldSourceFile && !hasInvalidatedResolutions(file.path)) {
119069
119073
  const mode = getModeForUsageLocation(file, moduleName);
119070
- const oldResolution = (_a2 = oldSourceFile.resolvedModules) == null ? void 0 : _a2.get(moduleName.text, mode);
119074
+ 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);
119071
119075
  if (oldResolution == null ? void 0 : oldResolution.resolvedModule) {
119072
119076
  if (isTraceEnabled(options, host)) {
119073
119077
  trace(
@@ -119114,7 +119118,8 @@ ${lanes.join("\n")}
119114
119118
  Debug.assert(j === resolutions.length);
119115
119119
  return result;
119116
119120
  function moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName) {
119117
- const resolutionToFile = getResolvedModule(oldSourceFile, moduleName.text, getModeForUsageLocation(file, moduleName));
119121
+ var _a3, _b3, _c2;
119122
+ 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;
119118
119123
  const resolvedFile = resolutionToFile && oldProgram.getSourceFile(resolutionToFile.resolvedFileName);
119119
119124
  if (resolutionToFile && resolvedFile) {
119120
119125
  return false;
@@ -119130,7 +119135,7 @@ ${lanes.join("\n")}
119130
119135
  }
119131
119136
  }
119132
119137
  function resolveTypeReferenceDirectiveNamesReusingOldState(typeDirectiveNames, containingFile) {
119133
- var _a2;
119138
+ var _a2, _b2;
119134
119139
  if (structureIsReused === 0 /* Not */) {
119135
119140
  return resolveTypeReferenceDirectiveNamesWorker(
119136
119141
  typeDirectiveNames,
@@ -119139,28 +119144,18 @@ ${lanes.join("\n")}
119139
119144
  void 0
119140
119145
  );
119141
119146
  }
119142
- const oldSourceFile = !isString(containingFile) ? oldProgram && oldProgram.getSourceFile(containingFile.fileName) : void 0;
119143
- if (!isString(containingFile)) {
119144
- if (oldSourceFile !== containingFile && containingFile.resolvedTypeReferenceDirectiveNames) {
119145
- const result2 = [];
119146
- for (const typeDirectiveName of typeDirectiveNames) {
119147
- const resolvedTypeReferenceDirective = containingFile.resolvedTypeReferenceDirectiveNames.get(getTypeReferenceResolutionName(typeDirectiveName), getModeForFileReference(typeDirectiveName, containingFile.impliedNodeFormat));
119148
- result2.push(resolvedTypeReferenceDirective);
119149
- }
119150
- return result2;
119151
- }
119152
- }
119153
119147
  let unknownTypeReferenceDirectiveNames;
119154
119148
  let result;
119155
119149
  let reusedNames;
119156
119150
  const containingSourceFile = !isString(containingFile) ? containingFile : void 0;
119157
- const canReuseResolutions = !isString(containingFile) ? containingFile === oldSourceFile && !hasInvalidatedResolutions(oldSourceFile.path) : !hasInvalidatedResolutions(toPath3(containingFile));
119151
+ const oldSourceFile = !isString(containingFile) ? oldProgram && oldProgram.getSourceFile(containingFile.fileName) : void 0;
119152
+ const canReuseResolutions = !isString(containingFile) ? containingFile === oldSourceFile && !hasInvalidatedResolutions(containingFile.path) : !hasInvalidatedResolutions(toPath3(containingFile));
119158
119153
  for (let i = 0; i < typeDirectiveNames.length; i++) {
119159
119154
  const entry = typeDirectiveNames[i];
119160
119155
  if (canReuseResolutions) {
119161
119156
  const typeDirectiveName = getTypeReferenceResolutionName(entry);
119162
119157
  const mode = getModeForFileReference(entry, containingSourceFile == null ? void 0 : containingSourceFile.impliedNodeFormat);
119163
- const oldResolution = (_a2 = !isString(containingFile) ? oldSourceFile == null ? void 0 : oldSourceFile.resolvedTypeReferenceDirectiveNames : oldProgram == null ? void 0 : oldProgram.getAutomaticTypeDirectiveResolutions()) == null ? void 0 : _a2.get(typeDirectiveName, mode);
119158
+ 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);
119164
119159
  if (oldResolution == null ? void 0 : oldResolution.resolvedTypeReferenceDirective) {
119165
119160
  if (isTraceEnabled(options, host)) {
119166
119161
  trace(
@@ -119220,7 +119215,7 @@ ${lanes.join("\n")}
119220
119215
  );
119221
119216
  }
119222
119217
  function tryReuseStructureFromOldProgram() {
119223
- var _a2;
119218
+ var _a2, _b2, _c2;
119224
119219
  if (!oldProgram) {
119225
119220
  return 0 /* Not */;
119226
119221
  }
@@ -119322,42 +119317,37 @@ ${lanes.join("\n")}
119322
119317
  structureIsReused = 1 /* SafeModules */;
119323
119318
  }
119324
119319
  }
119325
- modifiedSourceFiles.push({ oldFile: oldSourceFile, newFile: newSourceFile });
119320
+ modifiedSourceFiles.push(newSourceFile);
119326
119321
  } else if (hasInvalidatedResolutions(oldSourceFile.path)) {
119327
119322
  structureIsReused = 1 /* SafeModules */;
119328
- modifiedSourceFiles.push({ oldFile: oldSourceFile, newFile: newSourceFile });
119323
+ modifiedSourceFiles.push(newSourceFile);
119324
+ } else {
119325
+ for (const moduleName of oldSourceFile.ambientModuleNames) {
119326
+ ambientModuleNameToUnmodifiedFileName.set(moduleName, oldSourceFile.fileName);
119327
+ }
119329
119328
  }
119330
119329
  newSourceFiles.push(newSourceFile);
119331
119330
  }
119332
119331
  if (structureIsReused !== 2 /* Completely */) {
119333
119332
  return structureIsReused;
119334
119333
  }
119335
- const modifiedFiles = modifiedSourceFiles.map((f) => f.oldFile);
119336
- for (const oldFile of oldSourceFiles) {
119337
- if (!contains(modifiedFiles, oldFile)) {
119338
- for (const moduleName of oldFile.ambientModuleNames) {
119339
- ambientModuleNameToUnmodifiedFileName.set(moduleName, oldFile.fileName);
119340
- }
119341
- }
119342
- }
119343
- for (const { oldFile: oldSourceFile, newFile: newSourceFile } of modifiedSourceFiles) {
119334
+ for (const newSourceFile of modifiedSourceFiles) {
119344
119335
  const moduleNames = getModuleNames(newSourceFile);
119345
119336
  const resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFile);
119346
- const resolutionsChanged = hasChangesInResolutions(moduleNames, newSourceFile, resolutions, oldSourceFile.resolvedModules, moduleResolutionIsEqualTo, moduleResolutionNameAndModeGetter);
119347
- if (resolutionsChanged) {
119337
+ (resolvedModulesProcessing ?? (resolvedModulesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, resolutions);
119338
+ const oldResolutions = (_b2 = oldProgram.resolvedModules) == null ? void 0 : _b2.get(newSourceFile.path);
119339
+ const resolutionsChanged = hasChangesInResolutions(moduleNames, newSourceFile, resolutions, oldResolutions, moduleResolutionIsEqualTo, moduleResolutionNameAndModeGetter);
119340
+ if (resolutionsChanged)
119348
119341
  structureIsReused = 1 /* SafeModules */;
119349
- newSourceFile.resolvedModules = zipToModeAwareCache(newSourceFile, moduleNames, resolutions, moduleResolutionNameAndModeGetter);
119350
- } else {
119351
- newSourceFile.resolvedModules = oldSourceFile.resolvedModules;
119352
- }
119353
119342
  const typesReferenceDirectives = newSourceFile.typeReferenceDirectives;
119354
119343
  const typeReferenceResolutions = resolveTypeReferenceDirectiveNamesReusingOldState(typesReferenceDirectives, newSourceFile);
119355
- const typeReferenceResolutionsChanged = hasChangesInResolutions(typesReferenceDirectives, newSourceFile, typeReferenceResolutions, oldSourceFile.resolvedTypeReferenceDirectiveNames, typeDirectiveIsEqualTo, typeReferenceResolutionNameAndModeGetter);
119344
+ (resolvedTypeReferenceDirectiveNamesProcessing ?? (resolvedTypeReferenceDirectiveNamesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, typeReferenceResolutions);
119345
+ const oldTypeResolutions = (_c2 = oldProgram.resolvedTypeReferenceDirectiveNames) == null ? void 0 : _c2.get(newSourceFile.path);
119346
+ const typeReferenceResolutionsChanged = hasChangesInResolutions(typesReferenceDirectives, newSourceFile, typeReferenceResolutions, oldTypeResolutions, typeDirectiveIsEqualTo, typeReferenceResolutionNameAndModeGetter);
119356
119347
  if (typeReferenceResolutionsChanged) {
119357
119348
  structureIsReused = 1 /* SafeModules */;
119358
- newSourceFile.resolvedTypeReferenceDirectiveNames = zipToModeAwareCache(newSourceFile, typesReferenceDirectives, typeReferenceResolutions, typeReferenceResolutionNameAndModeGetter);
119359
- } else {
119360
- newSourceFile.resolvedTypeReferenceDirectiveNames = oldSourceFile.resolvedTypeReferenceDirectiveNames;
119349
+ } else if (oldTypeResolutions) {
119350
+ (resolvedTypeReferenceDirectiveNamesProcessing ?? (resolvedTypeReferenceDirectiveNamesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, oldTypeResolutions);
119361
119351
  }
119362
119352
  }
119363
119353
  if (structureIsReused !== 2 /* Completely */) {
@@ -119405,6 +119395,8 @@ ${lanes.join("\n")}
119405
119395
  sourceFileToPackageName = oldProgram.sourceFileToPackageName;
119406
119396
  redirectTargetsMap = oldProgram.redirectTargetsMap;
119407
119397
  usesUriStyleNodeCoreModules = oldProgram.usesUriStyleNodeCoreModules;
119398
+ resolvedModules = oldProgram.resolvedModules;
119399
+ resolvedTypeReferenceDirectiveNames = oldProgram.resolvedTypeReferenceDirectiveNames;
119408
119400
  resolvedLibReferences = oldProgram.resolvedLibReferences;
119409
119401
  packageMap = oldProgram.getCurrentPackagesMap();
119410
119402
  return 2 /* Completely */;
@@ -120226,7 +120218,7 @@ ${lanes.join("\n")}
120226
120218
  const result = getImpliedNodeFormatForFileWorker(getNormalizedAbsolutePath(fileName, currentDirectory), moduleResolutionCache2 == null ? void 0 : moduleResolutionCache2.getPackageJsonInfoCache(), host2, options2);
120227
120219
  const languageVersion = getEmitScriptTarget(options2);
120228
120220
  const setExternalModuleIndicator2 = getSetExternalModuleIndicator(options2);
120229
- return typeof result === "object" ? { ...result, languageVersion, setExternalModuleIndicator: setExternalModuleIndicator2 } : { languageVersion, impliedNodeFormat: result, setExternalModuleIndicator: setExternalModuleIndicator2 };
120221
+ return typeof result === "object" ? { ...result, languageVersion, setExternalModuleIndicator: setExternalModuleIndicator2, jsDocParsingMode: host2.jsDocParsingMode } : { languageVersion, impliedNodeFormat: result, setExternalModuleIndicator: setExternalModuleIndicator2, jsDocParsingMode: host2.jsDocParsingMode };
120230
120222
  }
120231
120223
  function findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId) {
120232
120224
  var _a2;
@@ -120450,16 +120442,16 @@ ${lanes.join("\n")}
120450
120442
  }
120451
120443
  function processTypeReferenceDirectives(file) {
120452
120444
  const typeDirectives = file.typeReferenceDirectives;
120453
- if (!typeDirectives.length) {
120454
- file.resolvedTypeReferenceDirectiveNames = void 0;
120445
+ if (!typeDirectives.length)
120455
120446
  return;
120456
- }
120457
- const resolutions = resolveTypeReferenceDirectiveNamesReusingOldState(typeDirectives, file);
120447
+ const resolutions = (resolvedTypeReferenceDirectiveNamesProcessing == null ? void 0 : resolvedTypeReferenceDirectiveNamesProcessing.get(file.path)) || resolveTypeReferenceDirectiveNamesReusingOldState(typeDirectives, file);
120448
+ const resolutionsInFile = createModeAwareCache();
120449
+ (resolvedTypeReferenceDirectiveNames ?? (resolvedTypeReferenceDirectiveNames = /* @__PURE__ */ new Map())).set(file.path, resolutionsInFile);
120458
120450
  for (let index = 0; index < typeDirectives.length; index++) {
120459
120451
  const ref = file.typeReferenceDirectives[index];
120460
120452
  const resolvedTypeReferenceDirective = resolutions[index];
120461
120453
  const fileName = toFileNameLowerCase(ref.fileName);
120462
- setResolvedTypeReferenceDirective(file, fileName, resolvedTypeReferenceDirective, getModeForFileReference(ref, file.impliedNodeFormat));
120454
+ resolutionsInFile.set(fileName, getModeForFileReference(ref, file.impliedNodeFormat), resolvedTypeReferenceDirective);
120463
120455
  const mode = ref.resolutionMode || file.impliedNodeFormat;
120464
120456
  if (mode && getEmitModuleResolutionKind(options) !== 3 /* Node16 */ && getEmitModuleResolutionKind(options) !== 99 /* NodeNext */) {
120465
120457
  (fileProcessingDiagnostics ?? (fileProcessingDiagnostics = [])).push({
@@ -120623,14 +120615,16 @@ ${lanes.join("\n")}
120623
120615
  collectExternalModuleReferences(file);
120624
120616
  if (file.imports.length || file.moduleAugmentations.length) {
120625
120617
  const moduleNames = getModuleNames(file);
120626
- const resolutions = resolveModuleNamesReusingOldState(moduleNames, file);
120618
+ const resolutions = (resolvedModulesProcessing == null ? void 0 : resolvedModulesProcessing.get(file.path)) || resolveModuleNamesReusingOldState(moduleNames, file);
120627
120619
  Debug.assert(resolutions.length === moduleNames.length);
120628
120620
  const optionsForFile = (useSourceOfProjectReferenceRedirect ? (_a2 = getRedirectReferenceForResolution(file)) == null ? void 0 : _a2.commandLine.options : void 0) || options;
120621
+ const resolutionsInFile = createModeAwareCache();
120622
+ (resolvedModules ?? (resolvedModules = /* @__PURE__ */ new Map())).set(file.path, resolutionsInFile);
120629
120623
  for (let index = 0; index < moduleNames.length; index++) {
120630
120624
  const resolution = resolutions[index].resolvedModule;
120631
120625
  const moduleName = moduleNames[index].text;
120632
120626
  const mode = getModeForUsageLocation(file, moduleNames[index]);
120633
- setResolvedModule(file, moduleName, resolutions[index], mode);
120627
+ resolutionsInFile.set(moduleName, mode, resolutions[index]);
120634
120628
  addResolutionDiagnosticsFromResolutionOrCache(file, moduleName, resolutions[index], mode);
120635
120629
  if (!resolution) {
120636
120630
  continue;
@@ -120661,8 +120655,6 @@ ${lanes.join("\n")}
120661
120655
  currentNodeModulesDepth--;
120662
120656
  }
120663
120657
  }
120664
- } else {
120665
- file.resolvedModules = void 0;
120666
120658
  }
120667
120659
  }
120668
120660
  function checkSourceFilesBelongToPath(sourceFiles, rootDirectory) {
@@ -121177,7 +121169,7 @@ ${lanes.join("\n")}
121177
121169
  processReason(fileProcessingReason);
121178
121170
  if (locationReason && (fileIncludeReasons == null ? void 0 : fileIncludeReasons.length) === 1)
121179
121171
  fileIncludeReasons = void 0;
121180
- const location = locationReason && getReferencedFileLocation(getSourceFileByPath, locationReason);
121172
+ const location = locationReason && getReferencedFileLocation(program, locationReason);
121181
121173
  const fileIncludeReasonDetails = fileIncludeReasons && chainDiagnosticMessages(fileIncludeReasons, Diagnostics.The_file_is_in_the_program_because_Colon);
121182
121174
  const redirectInfo = file && explainIfFileIsRedirectAndImpliedFormat(file);
121183
121175
  const chain = chainDiagnosticMessages(redirectInfo ? fileIncludeReasonDetails ? [fileIncludeReasonDetails, ...redirectInfo] : redirectInfo : fileIncludeReasonDetails, diagnostic, ...args || emptyArray);
@@ -121213,7 +121205,7 @@ ${lanes.join("\n")}
121213
121205
  }
121214
121206
  function fileIncludeReasonToRelatedInformation(reason) {
121215
121207
  if (isReferencedFile(reason)) {
121216
- const referenceLocation = getReferencedFileLocation(getSourceFileByPath, reason);
121208
+ const referenceLocation = getReferencedFileLocation(program, reason);
121217
121209
  let message2;
121218
121210
  switch (reason.kind) {
121219
121211
  case 3 /* Import */:
@@ -121502,8 +121494,8 @@ ${lanes.join("\n")}
121502
121494
  if (!symlinks) {
121503
121495
  symlinks = createSymlinkCache(currentDirectory, getCanonicalFileName);
121504
121496
  }
121505
- if (files && automaticTypeDirectiveResolutions && !symlinks.hasProcessedResolutions()) {
121506
- symlinks.setSymlinksFromResolutions(files, automaticTypeDirectiveResolutions);
121497
+ if (files && !symlinks.hasProcessedResolutions()) {
121498
+ symlinks.setSymlinksFromResolutions(resolvedModules, resolvedTypeReferenceDirectiveNames, automaticTypeDirectiveResolutions);
121507
121499
  }
121508
121500
  return symlinks;
121509
121501
  }
@@ -122008,6 +122000,7 @@ ${lanes.join("\n")}
122008
122000
  return toPath(program.getProjectReferenceRedirect(fileName) || fileName, sourceFileDirectory, getCanonicalFileName);
122009
122001
  }
122010
122002
  function getReferencedFiles(program, sourceFile, getCanonicalFileName) {
122003
+ var _a;
122011
122004
  let referencedFiles;
122012
122005
  if (sourceFile.imports && sourceFile.imports.length > 0) {
122013
122006
  const checker = program.getTypeChecker();
@@ -122023,8 +122016,9 @@ ${lanes.join("\n")}
122023
122016
  addReferencedFile(referencedPath);
122024
122017
  }
122025
122018
  }
122026
- if (sourceFile.resolvedTypeReferenceDirectiveNames) {
122027
- sourceFile.resolvedTypeReferenceDirectiveNames.forEach(({ resolvedTypeReferenceDirective }) => {
122019
+ const resolvedTypeReferenceDirectiveNames = (_a = program.resolvedTypeReferenceDirectiveNames) == null ? void 0 : _a.get(sourceFile.path);
122020
+ if (resolvedTypeReferenceDirectiveNames) {
122021
+ resolvedTypeReferenceDirectiveNames.forEach(({ resolvedTypeReferenceDirective }) => {
122028
122022
  if (!resolvedTypeReferenceDirective) {
122029
122023
  return;
122030
122024
  }
@@ -123862,10 +123856,10 @@ ${lanes.join("\n")}
123862
123856
  clear: clear2,
123863
123857
  onChangesAffectModuleResolution
123864
123858
  };
123865
- function getResolvedModule2(resolution) {
123859
+ function getResolvedModule(resolution) {
123866
123860
  return resolution.resolvedModule;
123867
123861
  }
123868
- function getResolvedTypeReferenceDirective2(resolution) {
123862
+ function getResolvedTypeReferenceDirective(resolution) {
123869
123863
  return resolution.resolvedTypeReferenceDirective;
123870
123864
  }
123871
123865
  function clear2() {
@@ -123941,7 +123935,7 @@ ${lanes.join("\n")}
123941
123935
  stopWatchFailedLookupLocationOfResolution(
123942
123936
  resolution,
123943
123937
  resolutionHost.toPath(getInferredLibraryNameResolveFrom(newProgram.getCompilerOptions(), getCurrentDirectory(), libFileName)),
123944
- getResolvedModule2
123938
+ getResolvedModule
123945
123939
  );
123946
123940
  resolvedLibraries.delete(libFileName);
123947
123941
  }
@@ -124147,7 +124141,7 @@ ${lanes.join("\n")}
124147
124141
  ((_a = resolutionHost.getCompilerHost) == null ? void 0 : _a.call(resolutionHost)) || resolutionHost,
124148
124142
  typeReferenceDirectiveResolutionCache
124149
124143
  ),
124150
- getResolutionWithResolvedFileName: getResolvedTypeReferenceDirective2,
124144
+ getResolutionWithResolvedFileName: getResolvedTypeReferenceDirective,
124151
124145
  shouldRetryResolution: (resolution) => resolution.resolvedTypeReferenceDirective === void 0,
124152
124146
  deferWatchingNonRelativeResolution: false
124153
124147
  });
@@ -124166,7 +124160,7 @@ ${lanes.join("\n")}
124166
124160
  redirectedReference,
124167
124161
  options
124168
124162
  ),
124169
- getResolutionWithResolvedFileName: getResolvedModule2,
124163
+ getResolutionWithResolvedFileName: getResolvedModule,
124170
124164
  shouldRetryResolution: (resolution) => !resolution.resolvedModule || !resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension),
124171
124165
  logChanges: logChangesWhenResolvingModule,
124172
124166
  deferWatchingNonRelativeResolution: true
@@ -124185,17 +124179,17 @@ ${lanes.join("\n")}
124185
124179
  libraryName,
124186
124180
  resolution,
124187
124181
  path,
124188
- getResolvedModule2,
124182
+ getResolvedModule,
124189
124183
  /*deferWatchingNonRelativeResolution*/
124190
124184
  false
124191
124185
  );
124192
124186
  resolvedLibraries.set(libFileName, resolution);
124193
124187
  if (existingResolution) {
124194
- stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolvedModule2);
124188
+ stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolvedModule);
124195
124189
  }
124196
124190
  } else {
124197
124191
  if (isTraceEnabled(options, host)) {
124198
- const resolved = getResolvedModule2(resolution);
124192
+ const resolved = getResolvedModule(resolution);
124199
124193
  trace(
124200
124194
  host,
124201
124195
  (resolved == null ? void 0 : resolved.resolvedFileName) ? resolved.packageId ? Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3 : Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2 : Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved,
@@ -124472,8 +124466,8 @@ ${lanes.join("\n")}
124472
124466
  resolvedProjectReference.commandLine.fileNames.forEach((f) => removeResolutionsOfFile(resolutionHost.toPath(f)));
124473
124467
  }
124474
124468
  function removeResolutionsOfFile(filePath) {
124475
- removeResolutionsOfFileFromCache(resolvedModuleNames, filePath, getResolvedModule2);
124476
- removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath, getResolvedTypeReferenceDirective2);
124469
+ removeResolutionsOfFileFromCache(resolvedModuleNames, filePath, getResolvedModule);
124470
+ removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath, getResolvedTypeReferenceDirective);
124477
124471
  }
124478
124472
  function invalidateResolutions(resolutions, canInvalidate) {
124479
124473
  if (!resolutions)
@@ -124896,7 +124890,7 @@ ${lanes.join("\n")}
124896
124890
  var _a, _b;
124897
124891
  const options = program.getCompilerOptions();
124898
124892
  if (isReferencedFile(reason)) {
124899
- const referenceLocation = getReferencedFileLocation((path) => program.getSourceFileByPath(path), reason);
124893
+ const referenceLocation = getReferencedFileLocation(program, reason);
124900
124894
  const referenceText = isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : `"${referenceLocation.text}"`;
124901
124895
  let message;
124902
124896
  Debug.assert(isReferenceFileLocation(referenceLocation) || reason.kind === 3 /* Import */, "Only synthetic references are imports");
@@ -125099,8 +125093,7 @@ ${lanes.join("\n")}
125099
125093
  (fileName, encoding) => !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding),
125100
125094
  getCompilerOptions,
125101
125095
  /*setParentNodes*/
125102
- void 0,
125103
- host.skipNonSemanticJSDocParsing
125096
+ void 0
125104
125097
  ),
125105
125098
  getDefaultLibLocation: maybeBind(host, host.getDefaultLibLocation),
125106
125099
  getDefaultLibFileName: (options) => host.getDefaultLibFileName(options),
@@ -125122,7 +125115,8 @@ ${lanes.join("\n")}
125122
125115
  getEnvironmentVariable: maybeBind(host, host.getEnvironmentVariable) || (() => ""),
125123
125116
  createHash: maybeBind(host, host.createHash),
125124
125117
  readDirectory: maybeBind(host, host.readDirectory),
125125
- storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit
125118
+ storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
125119
+ jsDocParsingMode: host.jsDocParsingMode
125126
125120
  };
125127
125121
  return compilerHost;
125128
125122
  }
@@ -125327,12 +125321,11 @@ ${lanes.join("\n")}
125327
125321
  return void 0;
125328
125322
  return createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, host);
125329
125323
  }
125330
- function createIncrementalCompilerHost(options, system = sys, skipNonSemanticJSDocParsing) {
125324
+ function createIncrementalCompilerHost(options, system = sys) {
125331
125325
  const host = createCompilerHostWorker(
125332
125326
  options,
125333
125327
  /*setParentNodes*/
125334
125328
  void 0,
125335
- skipNonSemanticJSDocParsing,
125336
125329
  system
125337
125330
  );
125338
125331
  host.createHash = maybeBind(system, system.createHash);
@@ -133434,10 +133427,10 @@ ${lanes.join("\n")}
133434
133427
  function isDocumentRegistryEntry(entry) {
133435
133428
  return !!entry.sourceFile;
133436
133429
  }
133437
- function createDocumentRegistry(useCaseSensitiveFileNames2, currentDirectory) {
133438
- return createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory);
133430
+ function createDocumentRegistry(useCaseSensitiveFileNames2, currentDirectory, jsDocParsingMode) {
133431
+ return createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory, jsDocParsingMode);
133439
133432
  }
133440
- function createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory = "", externalCache) {
133433
+ function createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory = "", jsDocParsingMode, externalCache) {
133441
133434
  const buckets = /* @__PURE__ */ new Map();
133442
133435
  const getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames2);
133443
133436
  function reportStats() {
@@ -133521,9 +133514,11 @@ ${lanes.join("\n")}
133521
133514
  const sourceFileOptions = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions : {
133522
133515
  languageVersion: scriptTarget,
133523
133516
  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),
133524
- setExternalModuleIndicator: getSetExternalModuleIndicator(compilationSettings)
133517
+ setExternalModuleIndicator: getSetExternalModuleIndicator(compilationSettings),
133518
+ jsDocParsingMode
133525
133519
  };
133526
133520
  sourceFileOptions.languageVersion = scriptTarget;
133521
+ Debug.assertEqual(jsDocParsingMode, sourceFileOptions.jsDocParsingMode);
133527
133522
  const oldBucketCount = buckets.size;
133528
133523
  const keyWithMode = getDocumentRegistryBucketKeyWithMode(key, sourceFileOptions.impliedNodeFormat);
133529
133524
  const bucket = getOrUpdate(buckets, keyWithMode, () => /* @__PURE__ */ new Map());
@@ -133781,14 +133776,14 @@ ${lanes.join("\n")}
133781
133776
  return ensurePathIsNonModuleName(combineNormal(pathA, pathB));
133782
133777
  }
133783
133778
  function getSourceFileToImport(importedModuleSymbol, importLiteral, importingSourceFile, program, host, oldToNew) {
133784
- var _a;
133779
+ var _a, _b;
133785
133780
  if (importedModuleSymbol) {
133786
133781
  const oldFileName = find(importedModuleSymbol.declarations, isSourceFile).fileName;
133787
133782
  const newFileName = oldToNew(oldFileName);
133788
133783
  return newFileName === void 0 ? { newFileName: oldFileName, updated: false } : { newFileName, updated: true };
133789
133784
  } else {
133790
133785
  const mode = getModeForUsageLocation(importingSourceFile, importLiteral);
133791
- const resolved = host.resolveModuleNameLiterals || !host.resolveModuleNames ? (_a = importingSourceFile.resolvedModules) == null ? void 0 : _a.get(importLiteral.text, mode) : host.getResolvedModuleWithFailedLookupLocationsFromCache && host.getResolvedModuleWithFailedLookupLocationsFromCache(importLiteral.text, importingSourceFile.fileName, mode);
133786
+ 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);
133792
133787
  return getSourceFileToImportFromResolved(importLiteral, resolved, oldToNew, program.getSourceFiles());
133793
133788
  }
133794
133789
  }
@@ -134708,6 +134703,7 @@ ${lanes.join("\n")}
134708
134703
 
134709
134704
  // src/services/suggestionDiagnostics.ts
134710
134705
  function computeSuggestionDiagnostics(sourceFile, program, cancellationToken) {
134706
+ var _a, _b, _c;
134711
134707
  program.getSemanticDiagnostics(sourceFile, cancellationToken);
134712
134708
  const diags = [];
134713
134709
  const checker = program.getTypeChecker();
@@ -134724,7 +134720,7 @@ ${lanes.join("\n")}
134724
134720
  const name = importNameForConvertToDefaultImport(importNode);
134725
134721
  if (!name)
134726
134722
  continue;
134727
- const module2 = getResolvedModule(sourceFile, moduleSpecifier.text, getModeForUsageLocation(sourceFile, moduleSpecifier));
134723
+ 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;
134728
134724
  const resolvedFile = module2 && program.getSourceFile(module2.resolvedFileName);
134729
134725
  if (resolvedFile && resolvedFile.externalModuleIndicator && resolvedFile.externalModuleIndicator !== true && isExportAssignment(resolvedFile.externalModuleIndicator) && resolvedFile.externalModuleIndicator.isExportEquals) {
134730
134726
  diags.push(createDiagnosticForNode(name, Diagnostics.Import_may_be_converted_to_a_default_import));
@@ -134977,7 +134973,8 @@ ${lanes.join("\n")}
134977
134973
  compilerHost,
134978
134974
  options
134979
134975
  ),
134980
- setExternalModuleIndicator: getSetExternalModuleIndicator(options)
134976
+ setExternalModuleIndicator: getSetExternalModuleIndicator(options),
134977
+ jsDocParsingMode: 1 /* ParseNone */
134981
134978
  }
134982
134979
  );
134983
134980
  if (transpileOptions.moduleName) {
@@ -137140,10 +137137,10 @@ ${lanes.join("\n")}
137140
137137
  const targetSourceFile = program.getSourceFile(targetFile);
137141
137138
  for (const oldStatement of oldFile.statements) {
137142
137139
  forEachImportInStatement(oldStatement, (i) => {
137143
- var _a, _b;
137140
+ var _a, _b, _c;
137144
137141
  const moduleSpecifier = moduleSpecifierFromImport(i);
137145
- const resolved = (_a = oldFile.resolvedModules) == null ? void 0 : _a.get(moduleSpecifier.text, getModeForUsageLocation(oldFile, moduleSpecifier));
137146
- const fileName = (_b = resolved == null ? void 0 : resolved.resolvedModule) == null ? void 0 : _b.resolvedFileName;
137142
+ const resolved = (_b = (_a = program.resolvedModules) == null ? void 0 : _a.get(oldFile.path)) == null ? void 0 : _b.get(moduleSpecifier.text, getModeForUsageLocation(oldFile, moduleSpecifier));
137143
+ const fileName = (_c = resolved == null ? void 0 : resolved.resolvedModule) == null ? void 0 : _c.resolvedFileName;
137147
137144
  if (fileName && targetSourceFile) {
137148
137145
  const newModuleSpecifier = getModuleSpecifier(program.getCompilerOptions(), targetSourceFile, targetSourceFile.path, fileName, createModuleSpecifierResolutionHost(program, host));
137149
137146
  append(copiedOldImports, filterImport(i, makeStringLiteral(newModuleSpecifier, quotePreference), (name) => importsToCopy.has(checker.getSymbolAtLocation(name))));
@@ -139151,12 +139148,16 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
139151
139148
  const { file, startPosition } = context;
139152
139149
  const node = getNodeOrParentOfParentheses(file, startPosition);
139153
139150
  const maybeBinary = getParentBinaryExpression(node);
139151
+ const nodeIsStringLiteral = isStringLiteral(maybeBinary);
139154
139152
  const refactorInfo = { name: refactorName10, description: refactorDescription6, actions: [] };
139155
- if (isBinaryExpression(maybeBinary) && treeToArray(maybeBinary).isValidConcatenation) {
139153
+ if (nodeIsStringLiteral && context.triggerReason !== "invoked") {
139154
+ return emptyArray;
139155
+ }
139156
+ if (isExpressionNode(maybeBinary) && (nodeIsStringLiteral || isBinaryExpression(maybeBinary) && treeToArray(maybeBinary).isValidConcatenation)) {
139156
139157
  refactorInfo.actions.push(convertStringAction);
139157
139158
  return [refactorInfo];
139158
139159
  } else if (context.preferences.provideRefactorNotApplicableReason) {
139159
- refactorInfo.actions.push({ ...convertStringAction, notApplicableReason: getLocaleSpecificMessage(Diagnostics.Can_only_convert_string_concatenation) });
139160
+ refactorInfo.actions.push({ ...convertStringAction, notApplicableReason: getLocaleSpecificMessage(Diagnostics.Can_only_convert_string_concatenations_and_string_literals) });
139160
139161
  return [refactorInfo];
139161
139162
  }
139162
139163
  return emptyArray;
@@ -141888,7 +141889,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
141888
141889
  const options = {
141889
141890
  languageVersion: sourceFile.languageVersion,
141890
141891
  impliedNodeFormat: sourceFile.impliedNodeFormat,
141891
- setExternalModuleIndicator: sourceFile.setExternalModuleIndicator
141892
+ setExternalModuleIndicator: sourceFile.setExternalModuleIndicator,
141893
+ jsDocParsingMode: sourceFile.jsDocParsingMode
141892
141894
  };
141893
141895
  return createLanguageServiceSourceFile(
141894
141896
  sourceFile.fileName,
@@ -142006,7 +142008,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
142006
142008
  resolveTypeReferenceDirectiveReferences: maybeBind(host, host.resolveTypeReferenceDirectiveReferences),
142007
142009
  resolveLibrary: maybeBind(host, host.resolveLibrary),
142008
142010
  useSourceOfProjectReferenceRedirect: maybeBind(host, host.useSourceOfProjectReferenceRedirect),
142009
- getParsedCommandLine
142011
+ getParsedCommandLine,
142012
+ jsDocParsingMode: host.jsDocParsingMode
142010
142013
  };
142011
142014
  const originalGetSourceFile = compilerHost.getSourceFile;
142012
142015
  const { getSourceFileWithCache } = changeCompilerHostLikeToUseCache(
@@ -143735,7 +143738,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
143735
143738
  this.host,
143736
143739
  this.host.getCompilationSettings()
143737
143740
  ),
143738
- setExternalModuleIndicator: getSetExternalModuleIndicator(this.host.getCompilationSettings())
143741
+ setExternalModuleIndicator: getSetExternalModuleIndicator(this.host.getCompilationSettings()),
143742
+ // These files are used to produce syntax-based highlighting, which reads JSDoc, so we must use ParseAll.
143743
+ jsDocParsingMode: 0 /* ParseAll */
143739
143744
  };
143740
143745
  sourceFile = createLanguageServiceSourceFile(
143741
143746
  fileName,
@@ -144001,6 +144006,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
144001
144006
  return map(typeDirectiveNames, (name) => getProperty(typeDirectivesForFile, isString(name) ? name : toFileNameLowerCase(name.fileName)));
144002
144007
  };
144003
144008
  }
144009
+ if ("jsDocParsingMode" in this.shimHost) {
144010
+ this.jsDocParsingMode = this.shimHost.jsDocParsingMode;
144011
+ }
144004
144012
  }
144005
144013
  log(s) {
144006
144014
  if (this.loggingEnabled) {
@@ -147758,9 +147766,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
147758
147766
  });
147759
147767
 
147760
147768
  // src/services/codefixes/convertToEsModule.ts
147761
- function fixImportOfModuleExports(importingFile, exportingFile, changes, quotePreference) {
147769
+ function fixImportOfModuleExports(importingFile, exportingFile, program, changes, quotePreference) {
147770
+ var _a, _b, _c;
147762
147771
  for (const moduleSpecifier of importingFile.imports) {
147763
- const imported = getResolvedModule(importingFile, moduleSpecifier.text, getModeForUsageLocation(importingFile, moduleSpecifier));
147772
+ 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;
147764
147773
  if (!imported || imported.resolvedFileName !== exportingFile.fileName) {
147765
147774
  continue;
147766
147775
  }
@@ -148288,7 +148297,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
148288
148297
  const moduleExportsChangedToDefault = convertFileToEsModule(sourceFile, program.getTypeChecker(), changes2, getEmitScriptTarget(program.getCompilerOptions()), getQuotePreference(sourceFile, preferences));
148289
148298
  if (moduleExportsChangedToDefault) {
148290
148299
  for (const importingFile of program.getSourceFiles()) {
148291
- fixImportOfModuleExports(importingFile, sourceFile, changes2, getQuotePreference(importingFile, preferences));
148300
+ fixImportOfModuleExports(importingFile, sourceFile, program, changes2, getQuotePreference(importingFile, preferences));
148292
148301
  }
148293
148302
  }
148294
148303
  });
@@ -149177,7 +149186,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
149177
149186
  }
149178
149187
  }
149179
149188
  function getImportCompletionAction(targetSymbol, moduleSymbol, exportMapKey, sourceFile, symbolName2, isJsxTagName, host, program, formatContext, position, preferences, cancellationToken) {
149180
- const compilerOptions = program.getCompilerOptions();
149181
149189
  let exportInfos;
149182
149190
  if (exportMapKey) {
149183
149191
  exportInfos = getExportInfoMap(sourceFile, host, program, preferences, cancellationToken).get(sourceFile.path, exportMapKey);
@@ -149198,7 +149206,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
149198
149206
  fix,
149199
149207
  /*includeSymbolNameInDescription*/
149200
149208
  false,
149201
- compilerOptions,
149209
+ program,
149202
149210
  preferences
149203
149211
  ))
149204
149212
  };
@@ -149208,7 +149216,15 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
149208
149216
  const symbolName2 = single(getSymbolNamesToImport(sourceFile, program.getTypeChecker(), symbolToken, compilerOptions));
149209
149217
  const fix = getTypeOnlyPromotionFix(sourceFile, symbolToken, symbolName2, program);
149210
149218
  const includeSymbolNameInDescription = symbolName2 !== symbolToken.text;
149211
- return fix && codeFixActionToCodeAction(codeActionForFix({ host, formatContext, preferences }, sourceFile, symbolName2, fix, includeSymbolNameInDescription, compilerOptions, preferences));
149219
+ return fix && codeFixActionToCodeAction(codeActionForFix(
149220
+ { host, formatContext, preferences },
149221
+ sourceFile,
149222
+ symbolName2,
149223
+ fix,
149224
+ includeSymbolNameInDescription,
149225
+ program,
149226
+ preferences
149227
+ ));
149212
149228
  }
149213
149229
  function getImportFixForSymbol(sourceFile, exportInfos, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences) {
149214
149230
  const packageJsonImportFilter = createPackageJsonImportFilter(sourceFile, preferences, host);
@@ -149778,14 +149794,14 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
149778
149794
  }
149779
149795
  return allowSyntheticDefaults ? 1 /* Default */ : 3 /* CommonJS */;
149780
149796
  }
149781
- function codeActionForFix(context, sourceFile, symbolName2, fix, includeSymbolNameInDescription, compilerOptions, preferences) {
149797
+ function codeActionForFix(context, sourceFile, symbolName2, fix, includeSymbolNameInDescription, program, preferences) {
149782
149798
  let diag2;
149783
149799
  const changes = ts_textChanges_exports.ChangeTracker.with(context, (tracker) => {
149784
- diag2 = codeActionForFixWorker(tracker, sourceFile, symbolName2, fix, includeSymbolNameInDescription, compilerOptions, preferences);
149800
+ diag2 = codeActionForFixWorker(tracker, sourceFile, symbolName2, fix, includeSymbolNameInDescription, program, preferences);
149785
149801
  });
149786
149802
  return createCodeFixAction(importFixName, changes, diag2, importFixId, Diagnostics.Add_all_missing_imports);
149787
149803
  }
149788
- function codeActionForFixWorker(changes, sourceFile, symbolName2, fix, includeSymbolNameInDescription, compilerOptions, preferences) {
149804
+ function codeActionForFixWorker(changes, sourceFile, symbolName2, fix, includeSymbolNameInDescription, program, preferences) {
149789
149805
  const quotePreference = getQuotePreference(sourceFile, preferences);
149790
149806
  switch (fix.kind) {
149791
149807
  case 0 /* UseNamespace */:
@@ -149822,7 +149838,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
149822
149838
  defaultImport,
149823
149839
  namedImports,
149824
149840
  namespaceLikeImport,
149825
- compilerOptions
149841
+ program.getCompilerOptions()
149826
149842
  ),
149827
149843
  /*blankLineBetween*/
149828
149844
  true,
@@ -149835,7 +149851,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
149835
149851
  }
149836
149852
  case 4 /* PromoteTypeOnly */: {
149837
149853
  const { typeOnlyAliasDeclaration } = fix;
149838
- const promotedDeclaration = promoteFromTypeOnly(changes, typeOnlyAliasDeclaration, compilerOptions, sourceFile, preferences);
149854
+ const promotedDeclaration = promoteFromTypeOnly(changes, typeOnlyAliasDeclaration, program, sourceFile, preferences);
149839
149855
  return promotedDeclaration.kind === 276 /* ImportSpecifier */ ? [Diagnostics.Remove_type_from_import_of_0_from_1, symbolName2, getModuleSpecifierText(promotedDeclaration.parent.parent)] : [Diagnostics.Remove_type_from_import_declaration_from_0, getModuleSpecifierText(promotedDeclaration)];
149840
149856
  }
149841
149857
  default:
@@ -149846,7 +149862,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
149846
149862
  var _a, _b;
149847
149863
  return promotedDeclaration.kind === 271 /* ImportEqualsDeclaration */ ? ((_b = tryCast((_a = tryCast(promotedDeclaration.moduleReference, isExternalModuleReference)) == null ? void 0 : _a.expression, isStringLiteralLike)) == null ? void 0 : _b.text) || promotedDeclaration.moduleReference.getText() : cast(promotedDeclaration.parent.moduleSpecifier, isStringLiteral).text;
149848
149864
  }
149849
- function promoteFromTypeOnly(changes, aliasDeclaration, compilerOptions, sourceFile, preferences) {
149865
+ function promoteFromTypeOnly(changes, aliasDeclaration, program, sourceFile, preferences) {
149866
+ const compilerOptions = program.getCompilerOptions();
149850
149867
  const convertExistingToTypeOnly = importNameElisionDisabled(compilerOptions);
149851
149868
  switch (aliasDeclaration.kind) {
149852
149869
  case 276 /* ImportSpecifier */:
@@ -149888,10 +149905,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
149888
149905
  Debug.failBadSyntaxKind(aliasDeclaration);
149889
149906
  }
149890
149907
  function promoteImportClause(importClause) {
149908
+ var _a, _b, _c;
149891
149909
  changes.delete(sourceFile, getTypeKeywordOfTypeOnlyImport(importClause, sourceFile));
149892
149910
  if (!compilerOptions.allowImportingTsExtensions) {
149893
149911
  const moduleSpecifier = tryGetModuleSpecifierFromDeclaration(importClause.parent);
149894
- const resolvedModule = moduleSpecifier && getResolvedModule(sourceFile, moduleSpecifier.text, getModeForUsageLocation(sourceFile, moduleSpecifier));
149912
+ 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);
149895
149913
  if (resolvedModule == null ? void 0 : resolvedModule.resolvedUsingTsExtension) {
149896
149914
  const changedExtension = changeAnyExtension(moduleSpecifier.text, getOutputExtension(moduleSpecifier.text, compilerOptions));
149897
149915
  changes.replaceNode(sourceFile, moduleSpecifier, factory.createStringLiteral(changedExtension));
@@ -150185,7 +150203,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
150185
150203
  fix,
150186
150204
  /*includeSymbolNameInDescription*/
150187
150205
  symbolName2 !== errorIdentifierText,
150188
- program.getCompilerOptions(),
150206
+ program,
150189
150207
  preferences
150190
150208
  )
150191
150209
  );
@@ -150598,7 +150616,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
150598
150616
 
150599
150617
  // src/services/codefixes/fixImportNonExportedMember.ts
150600
150618
  function getInfo7(sourceFile, pos, program) {
150601
- var _a;
150619
+ var _a, _b, _c, _d;
150602
150620
  const token = getTokenAtPosition(sourceFile, pos);
150603
150621
  if (isIdentifier(token)) {
150604
150622
  const importDeclaration = findAncestor(token, isImportDeclaration);
@@ -150607,19 +150625,18 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
150607
150625
  const moduleSpecifier = isStringLiteral(importDeclaration.moduleSpecifier) ? importDeclaration.moduleSpecifier.text : void 0;
150608
150626
  if (moduleSpecifier === void 0)
150609
150627
  return void 0;
150610
- const resolvedModule = getResolvedModule(
150611
- sourceFile,
150628
+ const resolvedModule = (_c = (_b = (_a = program.resolvedModules) == null ? void 0 : _a.get(sourceFile.path)) == null ? void 0 : _b.get(
150612
150629
  moduleSpecifier,
150613
150630
  /*mode*/
150614
150631
  void 0
150615
- );
150632
+ )) == null ? void 0 : _c.resolvedModule;
150616
150633
  if (resolvedModule === void 0)
150617
150634
  return void 0;
150618
150635
  const moduleSourceFile = program.getSourceFile(resolvedModule.resolvedFileName);
150619
150636
  if (moduleSourceFile === void 0 || isSourceFileFromLibrary(program, moduleSourceFile))
150620
150637
  return void 0;
150621
150638
  const moduleSymbol = moduleSourceFile.symbol;
150622
- const locals = (_a = tryCast(moduleSymbol.valueDeclaration, canHaveLocals)) == null ? void 0 : _a.locals;
150639
+ const locals = (_d = tryCast(moduleSymbol.valueDeclaration, canHaveLocals)) == null ? void 0 : _d.locals;
150623
150640
  if (locals === void 0)
150624
150641
  return void 0;
150625
150642
  const localSymbol = locals.get(token.escapedText);
@@ -150909,9 +150926,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
150909
150926
  return flags;
150910
150927
  }
150911
150928
  function getResolvedSourceFileFromImportDeclaration(sourceFile, context, importDeclaration) {
150929
+ var _a, _b, _c;
150912
150930
  if (!importDeclaration || !isStringLiteralLike(importDeclaration.moduleSpecifier))
150913
150931
  return void 0;
150914
- const resolvedModule = getResolvedModule(sourceFile, importDeclaration.moduleSpecifier.text, getModeForUsageLocation(sourceFile, importDeclaration.moduleSpecifier));
150932
+ 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;
150915
150933
  if (!resolvedModule)
150916
150934
  return void 0;
150917
150935
  return context.program.getSourceFile(resolvedModule.resolvedFileName);
@@ -160383,8 +160401,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
160383
160401
  return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: completion.hasIndexSignature, optionalReplacementSpan, entries };
160384
160402
  }
160385
160403
  case 2 /* Types */: {
160404
+ const quoteChar = contextToken.kind === 15 /* NoSubstitutionTemplateLiteral */ ? 96 /* backtick */ : startsWith(getTextOfNode(contextToken), "'") ? 39 /* singleQuote */ : 34 /* doubleQuote */;
160386
160405
  const entries = completion.types.map((type) => ({
160387
- name: type.value,
160406
+ name: escapeString(type.value, quoteChar),
160388
160407
  kindModifiers: "" /* none */,
160389
160408
  kind: "string" /* string */,
160390
160409
  sortText: SortText.LocationPriority,
@@ -162223,7 +162242,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
162223
162242
  })(FindReferencesUse || {});
162224
162243
  ((Core2) => {
162225
162244
  function getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options = {}, sourceFilesSet = new Set(sourceFiles.map((f) => f.fileName))) {
162226
- var _a, _b, _c;
162245
+ var _a, _b, _c, _d;
162227
162246
  node = getAdjustedNode2(node, options);
162228
162247
  if (isSourceFile(node)) {
162229
162248
  const resolvedRef = ts_GoToDefinition_exports.getReferenceAtPosition(node, position, program);
@@ -162262,7 +162281,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
162262
162281
  if (!options.implementations && isStringLiteralLike(node)) {
162263
162282
  if (isModuleSpecifierLike(node)) {
162264
162283
  const fileIncludeReasons = program.getFileIncludeReasons();
162265
- const referencedFileName = (_c = (_b = (_a = node.getSourceFile().resolvedModules) == null ? void 0 : _a.get(node.text, getModeForUsageLocation(node.getSourceFile(), node))) == null ? void 0 : _b.resolvedModule) == null ? void 0 : _c.resolvedFileName;
162284
+ 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;
162266
162285
  const referencedFile = referencedFileName ? program.getSourceFile(referencedFileName) : void 0;
162267
162286
  if (referencedFile) {
162268
162287
  return [{ definition: { type: 4 /* String */, node }, references: getReferencesForNonModule(referencedFile, fileIncludeReasons, program) || emptyArray }];
@@ -162325,7 +162344,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
162325
162344
  for (const ref of references) {
162326
162345
  if (isReferencedFile(ref)) {
162327
162346
  const referencingFile = program.getSourceFileByPath(ref.file);
162328
- const location = getReferencedFileLocation(program.getSourceFileByPath, ref);
162347
+ const location = getReferencedFileLocation(program, ref);
162329
162348
  if (isReferenceFileLocation(location)) {
162330
162349
  entries = append(entries, {
162331
162350
  kind: 0 /* Span */,
@@ -163692,7 +163711,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
163692
163711
 
163693
163712
  // src/services/goToDefinition.ts
163694
163713
  function getDefinitionAtPosition(program, sourceFile, position, searchOtherFilesOnly, stopAtAlias) {
163695
- var _a, _b;
163714
+ var _a, _b, _c;
163696
163715
  const resolvedRef = getReferenceAtPosition(sourceFile, position, program);
163697
163716
  const fileReferenceDefinition = resolvedRef && [getDefinitionInfoForFileReference(resolvedRef.reference.fileName, resolvedRef.fileName, resolvedRef.unverified)] || emptyArray;
163698
163717
  if (resolvedRef == null ? void 0 : resolvedRef.file) {
@@ -163765,7 +163784,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
163765
163784
  }
163766
163785
  }
163767
163786
  if (!symbol && isModuleSpecifierLike(fallbackNode)) {
163768
- const ref = (_b = (_a = sourceFile.resolvedModules) == null ? void 0 : _a.get(fallbackNode.text, getModeForUsageLocation(sourceFile, fallbackNode))) == null ? void 0 : _b.resolvedModule;
163787
+ 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;
163769
163788
  if (ref) {
163770
163789
  return [{
163771
163790
  name: fallbackNode.text,
@@ -163877,10 +163896,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
163877
163896
  const file = program.getLibFileFromReference(libReferenceDirective);
163878
163897
  return file && { reference: libReferenceDirective, fileName: file.fileName, file, unverified: false };
163879
163898
  }
163880
- if ((_b = sourceFile.resolvedModules) == null ? void 0 : _b.size()) {
163899
+ const resolvedModules = (_b = program.resolvedModules) == null ? void 0 : _b.get(sourceFile.path);
163900
+ if (resolvedModules == null ? void 0 : resolvedModules.size()) {
163881
163901
  const node = getTouchingToken(sourceFile, position);
163882
- if (isModuleSpecifierLike(node) && isExternalModuleNameRelative(node.text) && sourceFile.resolvedModules.has(node.text, getModeForUsageLocation(sourceFile, node))) {
163883
- const verifiedFileName = (_d = (_c = sourceFile.resolvedModules.get(node.text, getModeForUsageLocation(sourceFile, node))) == null ? void 0 : _c.resolvedModule) == null ? void 0 : _d.resolvedFileName;
163902
+ if (isModuleSpecifierLike(node) && isExternalModuleNameRelative(node.text) && resolvedModules.has(node.text, getModeForUsageLocation(sourceFile, node))) {
163903
+ const verifiedFileName = (_d = (_c = resolvedModules.get(node.text, getModeForUsageLocation(sourceFile, node))) == null ? void 0 : _c.resolvedModule) == null ? void 0 : _d.resolvedFileName;
163884
163904
  const fileName = verifiedFileName || resolvePath(getDirectoryPath(sourceFile.fileName), node.text);
163885
163905
  return {
163886
163906
  file: program.getSourceFile(fileName),
@@ -169086,7 +169106,7 @@ ${options.prefix}` : "\n" : options.prefix
169086
169106
  const sourceFile = createSourceFile(
169087
169107
  "any file name",
169088
169108
  nonFormattedText,
169089
- 99 /* ESNext */,
169109
+ { languageVersion: 99 /* ESNext */, jsDocParsingMode: 1 /* ParseNone */ },
169090
169110
  /*setParentNodes*/
169091
169111
  true,
169092
169112
  scriptKind
@@ -173801,16 +173821,23 @@ ${options.prefix}` : "\n" : options.prefix
173801
173821
  const sourceFiles = program.getSourceFiles();
173802
173822
  (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "getUnresolvedImports", { count: sourceFiles.length });
173803
173823
  const ambientModules = program.getTypeChecker().getAmbientModules().map((mod) => stripQuotes(mod.getName()));
173804
- const result = sortAndDeduplicate(flatMap(sourceFiles, (sourceFile) => extractUnresolvedImportsFromSourceFile(sourceFile, ambientModules, cachedUnresolvedImportsPerFile)));
173824
+ const result = sortAndDeduplicate(flatMap(sourceFiles, (sourceFile) => extractUnresolvedImportsFromSourceFile(
173825
+ program,
173826
+ sourceFile,
173827
+ ambientModules,
173828
+ cachedUnresolvedImportsPerFile
173829
+ )));
173805
173830
  (_b = tracing) == null ? void 0 : _b.pop();
173806
173831
  return result;
173807
173832
  }
173808
- function extractUnresolvedImportsFromSourceFile(file, ambientModules, cachedUnresolvedImportsPerFile) {
173833
+ function extractUnresolvedImportsFromSourceFile(program, file, ambientModules, cachedUnresolvedImportsPerFile) {
173809
173834
  return getOrUpdate(cachedUnresolvedImportsPerFile, file.path, () => {
173810
- if (!file.resolvedModules)
173835
+ var _a;
173836
+ const resolvedModules = (_a = program.resolvedModules) == null ? void 0 : _a.get(file.path);
173837
+ if (!resolvedModules)
173811
173838
  return emptyArray2;
173812
173839
  let unresolvedImports;
173813
- file.resolvedModules.forEach(({ resolvedModule }, name) => {
173840
+ resolvedModules.forEach(({ resolvedModule }, name) => {
173814
173841
  if ((!resolvedModule || !resolutionExtensionIsTSOrJson(resolvedModule.extension)) && !isExternalModuleNameRelative(name) && !ambientModules.some((m) => m === name)) {
173815
173842
  unresolvedImports = append(unresolvedImports, parsePackageName(name).packageName);
173816
173843
  }
@@ -173898,6 +173925,7 @@ ${options.prefix}` : "\n" : options.prefix
173898
173925
  this.directoryStructureHost = directoryStructureHost;
173899
173926
  this.currentDirectory = this.projectService.getNormalizedAbsolutePath(currentDirectory);
173900
173927
  this.getCanonicalFileName = this.projectService.toCanonicalFileName;
173928
+ this.jsDocParsingMode = this.projectService.jsDocParsingMode;
173901
173929
  this.cancellationToken = new ThrottledCancellationToken(this.projectService.cancellationToken, this.projectService.throttleWaitMilliseconds);
173902
173930
  if (!this.compilerOptions) {
173903
173931
  this.compilerOptions = getDefaultCompilerOptions2();
@@ -174022,7 +174050,8 @@ ${options.prefix}` : "\n" : options.prefix
174022
174050
  }
174023
174051
  if (this.program && !this.symlinks.hasProcessedResolutions()) {
174024
174052
  this.symlinks.setSymlinksFromResolutions(
174025
- this.program.getSourceFiles(),
174053
+ this.program.resolvedModules,
174054
+ this.program.resolvedTypeReferenceDirectiveNames,
174026
174055
  this.program.getAutomaticTypeDirectiveResolutions()
174027
174056
  );
174028
174057
  }
@@ -176460,6 +176489,7 @@ ${options.prefix}` : "\n" : options.prefix
176460
176489
  this.allowLocalPluginLoads = !!opts.allowLocalPluginLoads;
176461
176490
  this.typesMapLocation = opts.typesMapLocation === void 0 ? combinePaths(getDirectoryPath(this.getExecutingFilePath()), "typesMap.json") : opts.typesMapLocation;
176462
176491
  this.session = opts.session;
176492
+ this.jsDocParsingMode = opts.jsDocParsingMode;
176463
176493
  if (opts.serverMode !== void 0) {
176464
176494
  this.serverMode = opts.serverMode;
176465
176495
  } else {
@@ -176485,7 +176515,7 @@ ${options.prefix}` : "\n" : options.prefix
176485
176515
  hostInfo: "Unknown host",
176486
176516
  extraFileExtensions: []
176487
176517
  };
176488
- this.documentRegistry = createDocumentRegistryInternal(this.host.useCaseSensitiveFileNames, this.currentDirectory, this);
176518
+ this.documentRegistry = createDocumentRegistryInternal(this.host.useCaseSensitiveFileNames, this.currentDirectory, this.jsDocParsingMode, this);
176489
176519
  const watchLogLevel = this.logger.hasLevel(3 /* verbose */) ? 2 /* Verbose */ : this.logger.loggingEnabled() ? 1 /* TriggerOnly */ : 0 /* None */;
176490
176520
  const log = watchLogLevel !== 0 /* None */ ? (s) => this.logger.info(s) : noop;
176491
176521
  this.packageJsonCache = createPackageJsonCache(this);
@@ -183777,6 +183807,7 @@ ${e.message}`;
183777
183807
  InternalEmitFlags: () => InternalEmitFlags,
183778
183808
  InternalSymbolName: () => InternalSymbolName,
183779
183809
  InvalidatedProjectKind: () => InvalidatedProjectKind,
183810
+ JSDocParsingMode: () => JSDocParsingMode,
183780
183811
  JsDoc: () => ts_JsDoc_exports,
183781
183812
  JsTyping: () => ts_JsTyping_exports,
183782
183813
  JsxEmit: () => JsxEmit,
@@ -184668,8 +184699,6 @@ ${e.message}`;
184668
184699
  getResolvePackageJsonExports: () => getResolvePackageJsonExports,
184669
184700
  getResolvePackageJsonImports: () => getResolvePackageJsonImports,
184670
184701
  getResolvedExternalModuleName: () => getResolvedExternalModuleName,
184671
- getResolvedModule: () => getResolvedModule,
184672
- getResolvedTypeReferenceDirective: () => getResolvedTypeReferenceDirective,
184673
184702
  getRestIndicatorOfBindingOrAssignmentElement: () => getRestIndicatorOfBindingOrAssignmentElement,
184674
184703
  getRestParameterElementType: () => getRestParameterElementType,
184675
184704
  getRightMostAssignedExpression: () => getRightMostAssignedExpression,
@@ -185767,8 +185796,6 @@ ${e.message}`;
185767
185796
  setParent: () => setParent,
185768
185797
  setParentRecursive: () => setParentRecursive,
185769
185798
  setPrivateIdentifier: () => setPrivateIdentifier,
185770
- setResolvedModule: () => setResolvedModule,
185771
- setResolvedTypeReferenceDirective: () => setResolvedTypeReferenceDirective,
185772
185799
  setSnippetElement: () => setSnippetElement,
185773
185800
  setSourceMapRange: () => setSourceMapRange,
185774
185801
  setStackTraceLimit: () => setStackTraceLimit,
@@ -185995,7 +186022,6 @@ ${e.message}`;
185995
186022
  writeCommentRange: () => writeCommentRange,
185996
186023
  writeFile: () => writeFile,
185997
186024
  writeFileEnsuringDirectories: () => writeFileEnsuringDirectories,
185998
- zipToModeAwareCache: () => zipToModeAwareCache,
185999
186025
  zipWith: () => zipWith
186000
186026
  });
186001
186027
  var init_ts7 = __esm({
@@ -186181,6 +186207,7 @@ ${e.message}`;
186181
186207
  InternalEmitFlags: () => InternalEmitFlags,
186182
186208
  InternalSymbolName: () => InternalSymbolName,
186183
186209
  InvalidatedProjectKind: () => InvalidatedProjectKind,
186210
+ JSDocParsingMode: () => JSDocParsingMode,
186184
186211
  JsDoc: () => ts_JsDoc_exports,
186185
186212
  JsTyping: () => ts_JsTyping_exports,
186186
186213
  JsxEmit: () => JsxEmit,
@@ -187072,8 +187099,6 @@ ${e.message}`;
187072
187099
  getResolvePackageJsonExports: () => getResolvePackageJsonExports,
187073
187100
  getResolvePackageJsonImports: () => getResolvePackageJsonImports,
187074
187101
  getResolvedExternalModuleName: () => getResolvedExternalModuleName,
187075
- getResolvedModule: () => getResolvedModule,
187076
- getResolvedTypeReferenceDirective: () => getResolvedTypeReferenceDirective,
187077
187102
  getRestIndicatorOfBindingOrAssignmentElement: () => getRestIndicatorOfBindingOrAssignmentElement,
187078
187103
  getRestParameterElementType: () => getRestParameterElementType,
187079
187104
  getRightMostAssignedExpression: () => getRightMostAssignedExpression,
@@ -188171,8 +188196,6 @@ ${e.message}`;
188171
188196
  setParent: () => setParent,
188172
188197
  setParentRecursive: () => setParentRecursive,
188173
188198
  setPrivateIdentifier: () => setPrivateIdentifier,
188174
- setResolvedModule: () => setResolvedModule,
188175
- setResolvedTypeReferenceDirective: () => setResolvedTypeReferenceDirective,
188176
188199
  setSnippetElement: () => setSnippetElement,
188177
188200
  setSourceMapRange: () => setSourceMapRange,
188178
188201
  setStackTraceLimit: () => setStackTraceLimit,
@@ -188399,7 +188422,6 @@ ${e.message}`;
188399
188422
  writeCommentRange: () => writeCommentRange,
188400
188423
  writeFile: () => writeFile,
188401
188424
  writeFileEnsuringDirectories: () => writeFileEnsuringDirectories,
188402
- zipToModeAwareCache: () => zipToModeAwareCache,
188403
188425
  zipWith: () => zipWith
188404
188426
  });
188405
188427
  var init_ts8 = __esm({