@typescript-deploys/pr-build 5.3.0-pr-55820-7 → 5.3.0-pr-54242-4
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/lib.es5.d.ts +9 -1
- package/lib/tsc.js +582 -487
- package/lib/tsserver.js +715 -561
- package/lib/typescript.d.ts +96 -32
- package/lib/typescript.js +709 -561
- package/lib/typingsInstaller.js +187 -125
- package/package.json +2 -2
package/lib/tsserver.js
CHANGED
|
@@ -103,6 +103,7 @@ __export(server_exports, {
|
|
|
103
103
|
InternalEmitFlags: () => InternalEmitFlags,
|
|
104
104
|
InternalSymbolName: () => InternalSymbolName,
|
|
105
105
|
InvalidatedProjectKind: () => InvalidatedProjectKind,
|
|
106
|
+
JSDocParsingMode: () => JSDocParsingMode,
|
|
106
107
|
JsDoc: () => ts_JsDoc_exports,
|
|
107
108
|
JsTyping: () => ts_JsTyping_exports,
|
|
108
109
|
JsxEmit: () => JsxEmit,
|
|
@@ -430,6 +431,7 @@ __export(server_exports, {
|
|
|
430
431
|
createModuleNotFoundChain: () => createModuleNotFoundChain,
|
|
431
432
|
createModuleResolutionCache: () => createModuleResolutionCache,
|
|
432
433
|
createModuleResolutionLoader: () => createModuleResolutionLoader,
|
|
434
|
+
createModuleResolutionLoaderUsingGlobalCache: () => createModuleResolutionLoaderUsingGlobalCache,
|
|
433
435
|
createModuleSpecifierResolutionHost: () => createModuleSpecifierResolutionHost,
|
|
434
436
|
createMultiMap: () => createMultiMap,
|
|
435
437
|
createNodeConverters: () => createNodeConverters,
|
|
@@ -858,6 +860,7 @@ __export(server_exports, {
|
|
|
858
860
|
getLeadingCommentRangesOfNode: () => getLeadingCommentRangesOfNode,
|
|
859
861
|
getLeftmostAccessExpression: () => getLeftmostAccessExpression,
|
|
860
862
|
getLeftmostExpression: () => getLeftmostExpression,
|
|
863
|
+
getLibraryNameFromLibFileName: () => getLibraryNameFromLibFileName,
|
|
861
864
|
getLineAndCharacterOfPosition: () => getLineAndCharacterOfPosition,
|
|
862
865
|
getLineInfo: () => getLineInfo,
|
|
863
866
|
getLineOfLocalPosition: () => getLineOfLocalPosition,
|
|
@@ -989,7 +992,7 @@ __export(server_exports, {
|
|
|
989
992
|
getRenameLocation: () => getRenameLocation,
|
|
990
993
|
getReplacementSpanForContextToken: () => getReplacementSpanForContextToken,
|
|
991
994
|
getResolutionDiagnostic: () => getResolutionDiagnostic,
|
|
992
|
-
|
|
995
|
+
getResolutionModeOverride: () => getResolutionModeOverride,
|
|
993
996
|
getResolveJsonModule: () => getResolveJsonModule,
|
|
994
997
|
getResolvePackageJsonExports: () => getResolvePackageJsonExports,
|
|
995
998
|
getResolvePackageJsonImports: () => getResolvePackageJsonImports,
|
|
@@ -1121,6 +1124,7 @@ __export(server_exports, {
|
|
|
1121
1124
|
hasPropertyAccessExpressionWithName: () => hasPropertyAccessExpressionWithName,
|
|
1122
1125
|
hasQuestionToken: () => hasQuestionToken,
|
|
1123
1126
|
hasRecordedExternalHelpers: () => hasRecordedExternalHelpers,
|
|
1127
|
+
hasResolutionModeOverride: () => hasResolutionModeOverride,
|
|
1124
1128
|
hasRestParameter: () => hasRestParameter,
|
|
1125
1129
|
hasScopeMarker: () => hasScopeMarker,
|
|
1126
1130
|
hasStaticModifier: () => hasStaticModifier,
|
|
@@ -1194,7 +1198,6 @@ __export(server_exports, {
|
|
|
1194
1198
|
isAssertClause: () => isAssertClause,
|
|
1195
1199
|
isAssertEntry: () => isAssertEntry,
|
|
1196
1200
|
isAssertionExpression: () => isAssertionExpression,
|
|
1197
|
-
isAssertionKey: () => isAssertionKey,
|
|
1198
1201
|
isAssertsKeyword: () => isAssertsKeyword,
|
|
1199
1202
|
isAssignmentDeclaration: () => isAssignmentDeclaration,
|
|
1200
1203
|
isAssignmentExpression: () => isAssignmentExpression,
|
|
@@ -1402,6 +1405,9 @@ __export(server_exports, {
|
|
|
1402
1405
|
isIfStatement: () => isIfStatement,
|
|
1403
1406
|
isIgnoredFileFromWildCardWatching: () => isIgnoredFileFromWildCardWatching,
|
|
1404
1407
|
isImplicitGlob: () => isImplicitGlob,
|
|
1408
|
+
isImportAttribute: () => isImportAttribute,
|
|
1409
|
+
isImportAttributeName: () => isImportAttributeName,
|
|
1410
|
+
isImportAttributes: () => isImportAttributes,
|
|
1405
1411
|
isImportCall: () => isImportCall,
|
|
1406
1412
|
isImportClause: () => isImportClause,
|
|
1407
1413
|
isImportDeclaration: () => isImportDeclaration,
|
|
@@ -1412,6 +1418,7 @@ __export(server_exports, {
|
|
|
1412
1418
|
isImportOrExportSpecifierName: () => isImportOrExportSpecifierName,
|
|
1413
1419
|
isImportSpecifier: () => isImportSpecifier,
|
|
1414
1420
|
isImportTypeAssertionContainer: () => isImportTypeAssertionContainer,
|
|
1421
|
+
isImportTypeAttributes: () => isImportTypeAttributes,
|
|
1415
1422
|
isImportTypeNode: () => isImportTypeNode,
|
|
1416
1423
|
isImportableFile: () => isImportableFile,
|
|
1417
1424
|
isInComment: () => isInComment,
|
|
@@ -1593,7 +1600,6 @@ __export(server_exports, {
|
|
|
1593
1600
|
isNamespaceReexportDeclaration: () => isNamespaceReexportDeclaration,
|
|
1594
1601
|
isNewExpression: () => isNewExpression,
|
|
1595
1602
|
isNewExpressionTarget: () => isNewExpressionTarget,
|
|
1596
|
-
isNightly: () => isNightly,
|
|
1597
1603
|
isNoSubstitutionTemplateLiteral: () => isNoSubstitutionTemplateLiteral,
|
|
1598
1604
|
isNode: () => isNode,
|
|
1599
1605
|
isNodeArray: () => isNodeArray,
|
|
@@ -2323,7 +2329,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2323
2329
|
|
|
2324
2330
|
// src/compiler/corePublic.ts
|
|
2325
2331
|
var versionMajorMinor = "5.3";
|
|
2326
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2332
|
+
var version = `${versionMajorMinor}.0-insiders.20230922`;
|
|
2327
2333
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2328
2334
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2329
2335
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6032,9 +6038,12 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind5) => {
|
|
|
6032
6038
|
SyntaxKind5[SyntaxKind5["DefaultClause"] = 297] = "DefaultClause";
|
|
6033
6039
|
SyntaxKind5[SyntaxKind5["HeritageClause"] = 298] = "HeritageClause";
|
|
6034
6040
|
SyntaxKind5[SyntaxKind5["CatchClause"] = 299] = "CatchClause";
|
|
6035
|
-
SyntaxKind5[SyntaxKind5["
|
|
6036
|
-
SyntaxKind5[SyntaxKind5["
|
|
6037
|
-
SyntaxKind5[SyntaxKind5["
|
|
6041
|
+
SyntaxKind5[SyntaxKind5["ImportAttributes"] = 300] = "ImportAttributes";
|
|
6042
|
+
SyntaxKind5[SyntaxKind5["ImportAttribute"] = 301] = "ImportAttribute";
|
|
6043
|
+
SyntaxKind5[SyntaxKind5["ImportTypeAttributes"] = 302] = "ImportTypeAttributes";
|
|
6044
|
+
SyntaxKind5[SyntaxKind5["AssertClause"] = 300 /* ImportAttributes */] = "AssertClause";
|
|
6045
|
+
SyntaxKind5[SyntaxKind5["AssertEntry"] = 301 /* ImportAttribute */] = "AssertEntry";
|
|
6046
|
+
SyntaxKind5[SyntaxKind5["ImportTypeAssertionContainer"] = 302 /* ImportTypeAttributes */] = "ImportTypeAssertionContainer";
|
|
6038
6047
|
SyntaxKind5[SyntaxKind5["PropertyAssignment"] = 303] = "PropertyAssignment";
|
|
6039
6048
|
SyntaxKind5[SyntaxKind5["ShorthandPropertyAssignment"] = 304] = "ShorthandPropertyAssignment";
|
|
6040
6049
|
SyntaxKind5[SyntaxKind5["SpreadAssignment"] = 305] = "SpreadAssignment";
|
|
@@ -7336,7 +7345,8 @@ var ListFormat = /* @__PURE__ */ ((ListFormat2) => {
|
|
|
7336
7345
|
ListFormat2[ListFormat2["ObjectBindingPatternElements"] = 525136] = "ObjectBindingPatternElements";
|
|
7337
7346
|
ListFormat2[ListFormat2["ArrayBindingPatternElements"] = 524880] = "ArrayBindingPatternElements";
|
|
7338
7347
|
ListFormat2[ListFormat2["ObjectLiteralExpressionProperties"] = 526226] = "ObjectLiteralExpressionProperties";
|
|
7339
|
-
ListFormat2[ListFormat2["
|
|
7348
|
+
ListFormat2[ListFormat2["ImportAttributes"] = 526226] = "ImportAttributes";
|
|
7349
|
+
ListFormat2[ListFormat2["ImportClauseEntries"] = 526226 /* ImportAttributes */] = "ImportClauseEntries";
|
|
7340
7350
|
ListFormat2[ListFormat2["ArrayLiteralExpressionElements"] = 8914] = "ArrayLiteralExpressionElements";
|
|
7341
7351
|
ListFormat2[ListFormat2["CommaListElements"] = 528] = "CommaListElements";
|
|
7342
7352
|
ListFormat2[ListFormat2["CallExpressionArguments"] = 2576] = "CallExpressionArguments";
|
|
@@ -7417,6 +7427,13 @@ var commentPragmas = {
|
|
|
7417
7427
|
kind: 4 /* MultiLine */
|
|
7418
7428
|
}
|
|
7419
7429
|
};
|
|
7430
|
+
var JSDocParsingMode = /* @__PURE__ */ ((JSDocParsingMode7) => {
|
|
7431
|
+
JSDocParsingMode7[JSDocParsingMode7["ParseAll"] = 0] = "ParseAll";
|
|
7432
|
+
JSDocParsingMode7[JSDocParsingMode7["ParseNone"] = 1] = "ParseNone";
|
|
7433
|
+
JSDocParsingMode7[JSDocParsingMode7["ParseForTypeErrors"] = 2] = "ParseForTypeErrors";
|
|
7434
|
+
JSDocParsingMode7[JSDocParsingMode7["ParseForTypeInfo"] = 3] = "ParseForTypeInfo";
|
|
7435
|
+
return JSDocParsingMode7;
|
|
7436
|
+
})(JSDocParsingMode || {});
|
|
7420
7437
|
|
|
7421
7438
|
// src/compiler/sys.ts
|
|
7422
7439
|
function generateDjb2Hash(data) {
|
|
@@ -9206,6 +9223,7 @@ var Diagnostics = {
|
|
|
9206
9223
|
_0_expected: diag(1005, 1 /* Error */, "_0_expected_1005", "'{0}' expected."),
|
|
9207
9224
|
A_file_cannot_have_a_reference_to_itself: diag(1006, 1 /* Error */, "A_file_cannot_have_a_reference_to_itself_1006", "A file cannot have a reference to itself."),
|
|
9208
9225
|
The_parser_expected_to_find_a_1_to_match_the_0_token_here: diag(1007, 1 /* Error */, "The_parser_expected_to_find_a_1_to_match_the_0_token_here_1007", "The parser expected to find a '{1}' to match the '{0}' token here."),
|
|
9226
|
+
The_assert_keyword_in_import_attributes_is_deprecated_and_has_been_replaced_by_the_with_keyword: diag(1008, 1 /* Error */, "The_assert_keyword_in_import_attributes_is_deprecated_and_has_been_replaced_by_the_with_keyword_1008", "The 'assert' keyword in import attributes is deprecated and has been replaced by the 'with' keyword."),
|
|
9209
9227
|
Trailing_comma_not_allowed: diag(1009, 1 /* Error */, "Trailing_comma_not_allowed_1009", "Trailing comma not allowed."),
|
|
9210
9228
|
Asterisk_Slash_expected: diag(1010, 1 /* Error */, "Asterisk_Slash_expected_1010", "'*/' expected."),
|
|
9211
9229
|
An_element_access_expression_should_take_an_argument: diag(1011, 1 /* Error */, "An_element_access_expression_should_take_an_argument_1011", "An element access expression should take an argument."),
|
|
@@ -9569,7 +9587,7 @@ var Diagnostics = {
|
|
|
9569
9587
|
_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled: diag(1446, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveVa_1446", "'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."),
|
|
9570
9588
|
_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled: diag(1448, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_1448", "'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when '{1}' is enabled."),
|
|
9571
9589
|
Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed: diag(1449, 3 /* Message */, "Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed_1449", "Preserve unused imported values in the JavaScript output that would otherwise be removed."),
|
|
9572
|
-
|
|
9590
|
+
Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments: diag(1450, 3 /* Message */, "Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments_1450", "Dynamic imports can only accept a module specifier and an optional set of attributes as arguments"),
|
|
9573
9591
|
Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression: diag(1451, 1 /* Error */, "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451", "Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"),
|
|
9574
9592
|
resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext: diag(1452, 1 /* Error */, "resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext_1452", "'resolution-mode' assertions are only supported when `moduleResolution` is `node16` or `nodenext`."),
|
|
9575
9593
|
resolution_mode_should_be_either_require_or_import: diag(1453, 1 /* Error */, "resolution_mode_should_be_either_require_or_import_1453", "`resolution-mode` should be either `require` or `import`."),
|
|
@@ -9581,6 +9599,9 @@ var Diagnostics = {
|
|
|
9581
9599
|
File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module: diag(1459, 3 /* Message */, "File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module_1459", `File is CommonJS module because '{0}' has field "type" whose value is not "module"`),
|
|
9582
9600
|
File_is_CommonJS_module_because_0_does_not_have_field_type: diag(1460, 3 /* Message */, "File_is_CommonJS_module_because_0_does_not_have_field_type_1460", `File is CommonJS module because '{0}' does not have field "type"`),
|
|
9583
9601
|
File_is_CommonJS_module_because_package_json_was_not_found: diag(1461, 3 /* Message */, "File_is_CommonJS_module_because_package_json_was_not_found_1461", "File is CommonJS module because 'package.json' was not found"),
|
|
9602
|
+
resolution_mode_attribute_are_only_supported_when_moduleResolution_is_node16_or_nodenext: diag(1462, 1 /* Error */, "resolution_mode_attribute_are_only_supported_when_moduleResolution_is_node16_or_nodenext_1462", "'resolution-mode' attribute are only supported when `moduleResolution` is `node16` or `nodenext`."),
|
|
9603
|
+
resolution_mode_is_the_only_valid_key_for_type_import_attributes: diag(1463, 1 /* Error */, "resolution_mode_is_the_only_valid_key_for_type_import_attributes_1463", "`resolution-mode` is the only valid key for type import attributes."),
|
|
9604
|
+
Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require: diag(1464, 1 /* Error */, "Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1464", "Type import attributes should have exactly one key - `resolution-mode` - with value `import` or `require`."),
|
|
9584
9605
|
The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output: diag(1470, 1 /* Error */, "The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470", "The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."),
|
|
9585
9606
|
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: diag(1471, 1 /* Error */, "Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471", "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."),
|
|
9586
9607
|
catch_or_finally_expected: diag(1472, 1 /* Error */, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
|
|
@@ -9607,6 +9628,7 @@ var Diagnostics = {
|
|
|
9607
9628
|
The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration: diag(1493, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration_1493", "The left-hand side of a 'for...in' statement cannot be a 'using' declaration."),
|
|
9608
9629
|
The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration: diag(1494, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration_1494", "The left-hand side of a 'for...in' statement cannot be an 'await using' declaration."),
|
|
9609
9630
|
_0_modifier_cannot_appear_on_an_await_using_declaration: diag(1495, 1 /* Error */, "_0_modifier_cannot_appear_on_an_await_using_declaration_1495", "'{0}' modifier cannot appear on an 'await using' declaration."),
|
|
9631
|
+
Identifier_string_literal_or_number_literal_expected: diag(1496, 1 /* Error */, "Identifier_string_literal_or_number_literal_expected_1496", "Identifier, string literal or number literal expected."),
|
|
9610
9632
|
The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
|
|
9611
9633
|
The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
|
|
9612
9634
|
Call_signature_return_types_0_and_1_are_incompatible: diag(
|
|
@@ -10136,6 +10158,7 @@ var Diagnostics = {
|
|
|
10136
10158
|
Type_0_is_not_assignable_to_type_1_Did_you_mean_2: diag(2820, 1 /* Error */, "Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820", "Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"),
|
|
10137
10159
|
Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext: diag(2821, 1 /* Error */, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext_2821", "Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'."),
|
|
10138
10160
|
Import_assertions_cannot_be_used_with_type_only_imports_or_exports: diag(2822, 1 /* Error */, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."),
|
|
10161
|
+
Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext: diag(2823, 1 /* Error */, "Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext_2823", "Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'."),
|
|
10139
10162
|
Cannot_find_namespace_0_Did_you_mean_1: diag(2833, 1 /* Error */, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"),
|
|
10140
10163
|
Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path: diag(2834, 1 /* Error */, "Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2834", "Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path."),
|
|
10141
10164
|
Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0: diag(2835, 1 /* Error */, "Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2835", "Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean '{0}'?"),
|
|
@@ -10144,7 +10167,6 @@ var Diagnostics = {
|
|
|
10144
10167
|
All_declarations_of_0_must_have_identical_constraints: diag(2838, 1 /* Error */, "All_declarations_of_0_must_have_identical_constraints_2838", "All declarations of '{0}' must have identical constraints."),
|
|
10145
10168
|
This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value: diag(2839, 1 /* Error */, "This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value_2839", "This condition will always return '{0}' since JavaScript compares objects by reference, not value."),
|
|
10146
10169
|
An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_classes: diag(2840, 1 /* Error */, "An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_clas_2840", "An interface cannot extend a primitive type like '{0}'; an interface can only extend named types and classes"),
|
|
10147
|
-
The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_feature_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(2841, 1 /* Error */, "The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_2841", "The type of this expression cannot be named without a 'resolution-mode' assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
|
|
10148
10170
|
_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation: diag(2842, 1 /* Error */, "_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation_2842", "'{0}' is an unused renaming of '{1}'. Did you intend to use it as a type annotation?"),
|
|
10149
10171
|
We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here: diag(2843, 1 /* Error */, "We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here_2843", "We can only write a type for '{0}' by adding a type for the entire parameter here."),
|
|
10150
10172
|
Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2844, 1 /* Error */, "Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844", "Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),
|
|
@@ -10157,6 +10179,9 @@ var Diagnostics = {
|
|
|
10157
10179
|
await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(2852, 1 /* Error */, "await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_2852", "'await using' statements are only allowed within async functions and at the top levels of modules."),
|
|
10158
10180
|
await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(2853, 1 /* Error */, "await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_th_2853", "'await using' statements are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
|
|
10159
10181
|
Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(2854, 1 /* Error */, "Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_sys_2854", "Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
|
|
10182
|
+
Import_attributes_are_not_allowed_on_statements_that_transpile_to_CommonJS_require_calls: diag(2855, 1 /* Error */, "Import_attributes_are_not_allowed_on_statements_that_transpile_to_CommonJS_require_calls_2855", "Import attributes are not allowed on statements that transpile to CommonJS 'require' calls."),
|
|
10183
|
+
Import_attributes_cannot_be_used_with_type_only_imports_or_exports: diag(2856, 1 /* Error */, "Import_attributes_cannot_be_used_with_type_only_imports_or_exports_2856", "Import attributes cannot be used with type-only imports or exports."),
|
|
10184
|
+
Import_attribute_values_must_be_string_literal_expressions: diag(2857, 1 /* Error */, "Import_attribute_values_must_be_string_literal_expressions_2857", "Import attribute values must be string literal expressions."),
|
|
10160
10185
|
Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
10161
10186
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
|
10162
10187
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
|
@@ -10265,7 +10290,6 @@ var Diagnostics = {
|
|
|
10265
10290
|
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0: diag(4122, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122", "This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),
|
|
10266
10291
|
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4123, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123", "This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),
|
|
10267
10292
|
Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4124, 1 /* Error */, "Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124", "Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
|
|
10268
|
-
resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4125, 1 /* Error */, "resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_wi_4125", "'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
|
|
10269
10293
|
The_current_host_does_not_support_the_0_option: diag(5001, 1 /* Error */, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
|
|
10270
10294
|
Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, 1 /* Error */, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
|
|
10271
10295
|
File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, 1 /* Error */, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
|
|
@@ -11448,7 +11472,7 @@ var unicodeESNextIdentifierStart = [65, 90, 97, 122, 170, 170, 181, 181, 186, 18
|
|
|
11448
11472
|
var unicodeESNextIdentifierPart = [48, 57, 65, 90, 95, 95, 97, 122, 170, 170, 181, 181, 183, 183, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 895, 895, 902, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1519, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2045, 2045, 2048, 2093, 2112, 2139, 2144, 2154, 2208, 2228, 2230, 2237, 2259, 2273, 2275, 2403, 2406, 2415, 2417, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2556, 2556, 2558, 2558, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2809, 2815, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3072, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3162, 3168, 3171, 3174, 3183, 3200, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3328, 3331, 3333, 3340, 3342, 3344, 3346, 3396, 3398, 3400, 3402, 3406, 3412, 3415, 3423, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3558, 3567, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4969, 4977, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6e3, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6264, 6272, 6314, 6320, 6389, 6400, 6430, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6618, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6832, 6845, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7376, 7378, 7380, 7418, 7424, 7673, 7675, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42737, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43047, 43072, 43123, 43136, 43205, 43216, 43225, 43232, 43255, 43259, 43259, 43261, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43488, 43518, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65071, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66045, 66045, 66176, 66204, 66208, 66256, 66272, 66272, 66304, 66335, 66349, 66378, 66384, 66426, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66720, 66729, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68099, 68101, 68102, 68108, 68115, 68117, 68119, 68121, 68149, 68152, 68154, 68159, 68159, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68326, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68903, 68912, 68921, 69376, 69404, 69415, 69415, 69424, 69456, 69600, 69622, 69632, 69702, 69734, 69743, 69759, 69818, 69840, 69864, 69872, 69881, 69888, 69940, 69942, 69951, 69956, 69958, 69968, 70003, 70006, 70006, 70016, 70084, 70089, 70092, 70096, 70106, 70108, 70108, 70144, 70161, 70163, 70199, 70206, 70206, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70378, 70384, 70393, 70400, 70403, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70459, 70468, 70471, 70472, 70475, 70477, 70480, 70480, 70487, 70487, 70493, 70499, 70502, 70508, 70512, 70516, 70656, 70730, 70736, 70745, 70750, 70751, 70784, 70853, 70855, 70855, 70864, 70873, 71040, 71093, 71096, 71104, 71128, 71133, 71168, 71232, 71236, 71236, 71248, 71257, 71296, 71352, 71360, 71369, 71424, 71450, 71453, 71467, 71472, 71481, 71680, 71738, 71840, 71913, 71935, 71935, 72096, 72103, 72106, 72151, 72154, 72161, 72163, 72164, 72192, 72254, 72263, 72263, 72272, 72345, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72758, 72760, 72768, 72784, 72793, 72818, 72847, 72850, 72871, 72873, 72886, 72960, 72966, 72968, 72969, 72971, 73014, 73018, 73018, 73020, 73021, 73023, 73031, 73040, 73049, 73056, 73061, 73063, 73064, 73066, 73102, 73104, 73105, 73107, 73112, 73120, 73129, 73440, 73462, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92768, 92777, 92880, 92909, 92912, 92916, 92928, 92982, 92992, 92995, 93008, 93017, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94031, 94087, 94095, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 113821, 113822, 119141, 119145, 119149, 119154, 119163, 119170, 119173, 119179, 119210, 119213, 119362, 119364, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 120782, 120831, 121344, 121398, 121403, 121452, 121461, 121461, 121476, 121476, 121499, 121503, 121505, 121519, 122880, 122886, 122888, 122904, 122907, 122913, 122915, 122916, 122918, 122922, 123136, 123180, 123184, 123197, 123200, 123209, 123214, 123214, 123584, 123641, 124928, 125124, 125136, 125142, 125184, 125259, 125264, 125273, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101, 917760, 917999];
|
|
11449
11473
|
var commentDirectiveRegExSingleLine = /^\/\/\/?\s*@(ts-expect-error|ts-ignore)/;
|
|
11450
11474
|
var commentDirectiveRegExMultiLine = /^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/;
|
|
11451
|
-
var
|
|
11475
|
+
var jsDocSeeOrLink = /@(?:see|link)/i;
|
|
11452
11476
|
function lookupInUnicodeMap(code, map2) {
|
|
11453
11477
|
if (code < map2[0]) {
|
|
11454
11478
|
return false;
|
|
@@ -11955,7 +11979,8 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
11955
11979
|
var tokenFlags;
|
|
11956
11980
|
var commentDirectives;
|
|
11957
11981
|
var inJSDocType = 0;
|
|
11958
|
-
var
|
|
11982
|
+
var scriptKind = 0 /* Unknown */;
|
|
11983
|
+
var jsDocParsingMode = 0 /* ParseAll */;
|
|
11959
11984
|
setText(text, start2, length2);
|
|
11960
11985
|
var scanner2 = {
|
|
11961
11986
|
getTokenFullStart: () => fullStartPos,
|
|
@@ -11999,14 +12024,15 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
11999
12024
|
setText,
|
|
12000
12025
|
setScriptTarget,
|
|
12001
12026
|
setLanguageVariant,
|
|
12027
|
+
setScriptKind,
|
|
12028
|
+
setJSDocParsingMode,
|
|
12002
12029
|
setOnError,
|
|
12003
12030
|
resetTokenState,
|
|
12004
12031
|
setTextPos: resetTokenState,
|
|
12005
12032
|
setInJSDocType,
|
|
12006
12033
|
tryScan,
|
|
12007
12034
|
lookAhead,
|
|
12008
|
-
scanRange
|
|
12009
|
-
setSkipNonSemanticJSDoc
|
|
12035
|
+
scanRange
|
|
12010
12036
|
};
|
|
12011
12037
|
if (Debug.isDebugging) {
|
|
12012
12038
|
Object.defineProperty(scanner2, "__debugShowCurrentPositionInText", {
|
|
@@ -12794,7 +12820,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
12794
12820
|
tokenFlags |= 1 /* PrecedingLineBreak */;
|
|
12795
12821
|
}
|
|
12796
12822
|
}
|
|
12797
|
-
if (isJSDoc2 && (
|
|
12823
|
+
if (isJSDoc2 && shouldParseJSDoc()) {
|
|
12798
12824
|
tokenFlags |= 2 /* PrecedingJSDocComment */;
|
|
12799
12825
|
}
|
|
12800
12826
|
commentDirectives = appendIfCommentDirective(commentDirectives, text.slice(lastLineStart, pos), commentDirectiveRegExMultiLine, lastLineStart);
|
|
@@ -13053,6 +13079,21 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
13053
13079
|
}
|
|
13054
13080
|
}
|
|
13055
13081
|
}
|
|
13082
|
+
function shouldParseJSDoc() {
|
|
13083
|
+
switch (jsDocParsingMode) {
|
|
13084
|
+
case 0 /* ParseAll */:
|
|
13085
|
+
return true;
|
|
13086
|
+
case 1 /* ParseNone */:
|
|
13087
|
+
return false;
|
|
13088
|
+
}
|
|
13089
|
+
if (scriptKind !== 3 /* TS */ && scriptKind !== 4 /* TSX */) {
|
|
13090
|
+
return true;
|
|
13091
|
+
}
|
|
13092
|
+
if (jsDocParsingMode === 3 /* ParseForTypeInfo */) {
|
|
13093
|
+
return false;
|
|
13094
|
+
}
|
|
13095
|
+
return jsDocSeeOrLink.test(text.slice(fullStartPos, pos));
|
|
13096
|
+
}
|
|
13056
13097
|
function reScanInvalidIdentifier() {
|
|
13057
13098
|
Debug.assert(token === 0 /* Unknown */, "'reScanInvalidIdentifier' should only be called when the current token is 'SyntaxKind.Unknown'.");
|
|
13058
13099
|
pos = tokenStart = fullStartPos;
|
|
@@ -13467,8 +13508,11 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
13467
13508
|
function setLanguageVariant(variant) {
|
|
13468
13509
|
languageVariant = variant;
|
|
13469
13510
|
}
|
|
13470
|
-
function
|
|
13471
|
-
|
|
13511
|
+
function setScriptKind(kind) {
|
|
13512
|
+
scriptKind = kind;
|
|
13513
|
+
}
|
|
13514
|
+
function setJSDocParsingMode(kind) {
|
|
13515
|
+
jsDocParsingMode = kind;
|
|
13472
13516
|
}
|
|
13473
13517
|
function resetTokenState(position) {
|
|
13474
13518
|
Debug.assert(position >= 0);
|
|
@@ -14320,12 +14364,12 @@ function isTypeOnlyExportDeclaration(node) {
|
|
|
14320
14364
|
function isTypeOnlyImportOrExportDeclaration(node) {
|
|
14321
14365
|
return isTypeOnlyImportDeclaration(node) || isTypeOnlyExportDeclaration(node);
|
|
14322
14366
|
}
|
|
14323
|
-
function isAssertionKey(node) {
|
|
14324
|
-
return isStringLiteral(node) || isIdentifier(node);
|
|
14325
|
-
}
|
|
14326
14367
|
function isStringTextContainingNode(node) {
|
|
14327
14368
|
return node.kind === 11 /* StringLiteral */ || isTemplateLiteralKind(node.kind);
|
|
14328
14369
|
}
|
|
14370
|
+
function isImportAttributeName(node) {
|
|
14371
|
+
return isStringLiteral(node) || isIdentifier(node);
|
|
14372
|
+
}
|
|
14329
14373
|
function isGeneratedIdentifier(node) {
|
|
14330
14374
|
var _a;
|
|
14331
14375
|
return isIdentifier(node) && ((_a = node.emitNode) == null ? void 0 : _a.autoGenerate) !== void 0;
|
|
@@ -15145,8 +15189,8 @@ function moduleResolutionIsEqualTo(oldResolution, newResolution) {
|
|
|
15145
15189
|
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;
|
|
15146
15190
|
}
|
|
15147
15191
|
function createModuleNotFoundChain(sourceFile, host, moduleReference, mode, packageName) {
|
|
15148
|
-
var _a
|
|
15149
|
-
const node10Result = (
|
|
15192
|
+
var _a;
|
|
15193
|
+
const node10Result = (_a = host.getResolvedModule(sourceFile, moduleReference, mode)) == null ? void 0 : _a.node10Result;
|
|
15150
15194
|
const result = node10Result ? chainDiagnosticMessages(
|
|
15151
15195
|
/*details*/
|
|
15152
15196
|
void 0,
|
|
@@ -15188,14 +15232,14 @@ function packageIdToString(packageId) {
|
|
|
15188
15232
|
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
|
|
15189
15233
|
return oldResolution === newResolution || oldResolution.resolvedTypeReferenceDirective === newResolution.resolvedTypeReferenceDirective || !!oldResolution.resolvedTypeReferenceDirective && !!newResolution.resolvedTypeReferenceDirective && oldResolution.resolvedTypeReferenceDirective.resolvedFileName === newResolution.resolvedTypeReferenceDirective.resolvedFileName && !!oldResolution.resolvedTypeReferenceDirective.primary === !!newResolution.resolvedTypeReferenceDirective.primary && oldResolution.resolvedTypeReferenceDirective.originalPath === newResolution.resolvedTypeReferenceDirective.originalPath;
|
|
15190
15234
|
}
|
|
15191
|
-
function hasChangesInResolutions(names, newSourceFile, newResolutions,
|
|
15235
|
+
function hasChangesInResolutions(names, newSourceFile, newResolutions, getOldResolution, comparer, nameAndModeGetter) {
|
|
15192
15236
|
Debug.assert(names.length === newResolutions.length);
|
|
15193
15237
|
for (let i = 0; i < names.length; i++) {
|
|
15194
15238
|
const newResolution = newResolutions[i];
|
|
15195
15239
|
const entry = names[i];
|
|
15196
15240
|
const name = nameAndModeGetter.getName(entry);
|
|
15197
15241
|
const mode = nameAndModeGetter.getMode(entry, newSourceFile);
|
|
15198
|
-
const oldResolution =
|
|
15242
|
+
const oldResolution = getOldResolution(name, mode);
|
|
15199
15243
|
const changed = oldResolution ? !newResolution || !comparer(oldResolution, newResolution) : newResolution;
|
|
15200
15244
|
if (changed) {
|
|
15201
15245
|
return true;
|
|
@@ -18674,9 +18718,6 @@ function getIndentString(level) {
|
|
|
18674
18718
|
function getIndentSize() {
|
|
18675
18719
|
return indentStrings[1].length;
|
|
18676
18720
|
}
|
|
18677
|
-
function isNightly() {
|
|
18678
|
-
return version.includes("-dev") || version.includes("-insiders");
|
|
18679
|
-
}
|
|
18680
18721
|
function createTextWriter(newLine) {
|
|
18681
18722
|
var output;
|
|
18682
18723
|
var indent3;
|
|
@@ -20594,11 +20635,11 @@ function createSymlinkCache(cwd, getCanonicalFileName) {
|
|
|
20594
20635
|
(symlinkedDirectories || (symlinkedDirectories = /* @__PURE__ */ new Map())).set(symlinkPath, real);
|
|
20595
20636
|
}
|
|
20596
20637
|
},
|
|
20597
|
-
setSymlinksFromResolutions(
|
|
20638
|
+
setSymlinksFromResolutions(forEachResolvedModule, forEachResolvedTypeReferenceDirective, typeReferenceDirectives) {
|
|
20598
20639
|
Debug.assert(!hasProcessedResolutions);
|
|
20599
20640
|
hasProcessedResolutions = true;
|
|
20600
|
-
|
|
20601
|
-
|
|
20641
|
+
forEachResolvedModule((resolution) => processResolution(this, resolution.resolvedModule));
|
|
20642
|
+
forEachResolvedTypeReferenceDirective((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective));
|
|
20602
20643
|
typeReferenceDirectives.forEach((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective));
|
|
20603
20644
|
},
|
|
20604
20645
|
hasProcessedResolutions: () => hasProcessedResolutions
|
|
@@ -21618,6 +21659,13 @@ function getPropertyNameFromType(type) {
|
|
|
21618
21659
|
function isExpandoPropertyDeclaration(declaration) {
|
|
21619
21660
|
return !!declaration && (isPropertyAccessExpression(declaration) || isElementAccessExpression(declaration) || isBinaryExpression(declaration));
|
|
21620
21661
|
}
|
|
21662
|
+
function hasResolutionModeOverride(node) {
|
|
21663
|
+
var _a;
|
|
21664
|
+
if (node === void 0) {
|
|
21665
|
+
return false;
|
|
21666
|
+
}
|
|
21667
|
+
return !!getResolutionModeOverride(isImportTypeNode(node) ? (_a = node.attributes) == null ? void 0 : _a.attributes : node.attributes);
|
|
21668
|
+
}
|
|
21621
21669
|
|
|
21622
21670
|
// src/compiler/factory/baseNodeFactory.ts
|
|
21623
21671
|
function createBaseNodeFactory() {
|
|
@@ -22500,6 +22548,12 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22500
22548
|
updateAssertEntry,
|
|
22501
22549
|
createImportTypeAssertionContainer,
|
|
22502
22550
|
updateImportTypeAssertionContainer,
|
|
22551
|
+
createImportTypeAttributes,
|
|
22552
|
+
updateImportTypeAttributes,
|
|
22553
|
+
createImportAttributes,
|
|
22554
|
+
updateImportAttributes,
|
|
22555
|
+
createImportAttribute,
|
|
22556
|
+
updateImportAttribute,
|
|
22503
22557
|
createNamespaceImport,
|
|
22504
22558
|
updateNamespaceImport,
|
|
22505
22559
|
createNamespaceExport,
|
|
@@ -23768,18 +23822,18 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
23768
23822
|
function updateTemplateLiteralType(node, head, templateSpans) {
|
|
23769
23823
|
return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateLiteralType(head, templateSpans), node) : node;
|
|
23770
23824
|
}
|
|
23771
|
-
function createImportTypeNode(argument,
|
|
23825
|
+
function createImportTypeNode(argument, attributes, qualifier, typeArguments, isTypeOf = false) {
|
|
23772
23826
|
const node = createBaseNode(205 /* ImportType */);
|
|
23773
23827
|
node.argument = argument;
|
|
23774
|
-
node.assertions =
|
|
23828
|
+
node.attributes = node.assertions = attributes;
|
|
23775
23829
|
node.qualifier = qualifier;
|
|
23776
23830
|
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
|
|
23777
23831
|
node.isTypeOf = isTypeOf;
|
|
23778
23832
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
23779
23833
|
return node;
|
|
23780
23834
|
}
|
|
23781
|
-
function updateImportTypeNode(node, argument,
|
|
23782
|
-
return node.argument !== argument || node.
|
|
23835
|
+
function updateImportTypeNode(node, argument, attributes, qualifier, typeArguments, isTypeOf = node.isTypeOf) {
|
|
23836
|
+
return node.argument !== argument || node.attributes !== attributes || node.qualifier !== qualifier || node.typeArguments !== typeArguments || node.isTypeOf !== isTypeOf ? update(createImportTypeNode(argument, attributes, qualifier, typeArguments, isTypeOf), node) : node;
|
|
23783
23837
|
}
|
|
23784
23838
|
function createParenthesizedType(type) {
|
|
23785
23839
|
const node = createBaseNode(196 /* ParenthesizedType */);
|
|
@@ -24909,19 +24963,19 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24909
24963
|
function updateImportEqualsDeclaration(node, modifiers, isTypeOnly, name, moduleReference) {
|
|
24910
24964
|
return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.name !== name || node.moduleReference !== moduleReference ? update(createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference), node) : node;
|
|
24911
24965
|
}
|
|
24912
|
-
function createImportDeclaration(modifiers, importClause, moduleSpecifier,
|
|
24966
|
+
function createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes) {
|
|
24913
24967
|
const node = createBaseNode(272 /* ImportDeclaration */);
|
|
24914
24968
|
node.modifiers = asNodeArray(modifiers);
|
|
24915
24969
|
node.importClause = importClause;
|
|
24916
24970
|
node.moduleSpecifier = moduleSpecifier;
|
|
24917
|
-
node.assertClause =
|
|
24971
|
+
node.attributes = node.assertClause = attributes;
|
|
24918
24972
|
node.transformFlags |= propagateChildFlags(node.importClause) | propagateChildFlags(node.moduleSpecifier);
|
|
24919
24973
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
24920
24974
|
node.jsDoc = void 0;
|
|
24921
24975
|
return node;
|
|
24922
24976
|
}
|
|
24923
|
-
function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier,
|
|
24924
|
-
return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.
|
|
24977
|
+
function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, attributes) {
|
|
24978
|
+
return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.attributes !== attributes ? update(createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes), node) : node;
|
|
24925
24979
|
}
|
|
24926
24980
|
function createImportClause(isTypeOnly, name, namedBindings) {
|
|
24927
24981
|
const node = createBaseDeclaration(273 /* ImportClause */);
|
|
@@ -24942,6 +24996,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24942
24996
|
const node = createBaseNode(300 /* AssertClause */);
|
|
24943
24997
|
node.elements = createNodeArray(elements);
|
|
24944
24998
|
node.multiLine = multiLine;
|
|
24999
|
+
node.token = 132 /* AssertKeyword */;
|
|
24945
25000
|
node.transformFlags |= 4 /* ContainsESNext */;
|
|
24946
25001
|
return node;
|
|
24947
25002
|
}
|
|
@@ -24967,6 +25022,36 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
24967
25022
|
function updateImportTypeAssertionContainer(node, clause, multiLine) {
|
|
24968
25023
|
return node.assertClause !== clause || node.multiLine !== multiLine ? update(createImportTypeAssertionContainer(clause, multiLine), node) : node;
|
|
24969
25024
|
}
|
|
25025
|
+
function createImportTypeAttributes(attributes, multiLine) {
|
|
25026
|
+
const node = createBaseNode(302 /* ImportTypeAttributes */);
|
|
25027
|
+
node.attributes = node.assertClause = attributes;
|
|
25028
|
+
node.multiLine = multiLine;
|
|
25029
|
+
return node;
|
|
25030
|
+
}
|
|
25031
|
+
function updateImportTypeAttributes(node, attributes, multiLine) {
|
|
25032
|
+
return node.attributes !== attributes || node.multiLine !== multiLine ? update(createImportTypeAttributes(attributes, multiLine), node) : node;
|
|
25033
|
+
}
|
|
25034
|
+
function createImportAttributes(elements, multiLine, token) {
|
|
25035
|
+
const node = createBaseNode(300 /* ImportAttributes */);
|
|
25036
|
+
node.token = token ?? 118 /* WithKeyword */;
|
|
25037
|
+
node.elements = createNodeArray(elements);
|
|
25038
|
+
node.multiLine = multiLine;
|
|
25039
|
+
node.transformFlags |= 4 /* ContainsESNext */;
|
|
25040
|
+
return node;
|
|
25041
|
+
}
|
|
25042
|
+
function updateImportAttributes(node, elements, multiLine) {
|
|
25043
|
+
return node.elements !== elements || node.multiLine !== multiLine ? update(createImportAttributes(elements, multiLine, node.token), node) : node;
|
|
25044
|
+
}
|
|
25045
|
+
function createImportAttribute(name, value) {
|
|
25046
|
+
const node = createBaseNode(301 /* ImportAttribute */);
|
|
25047
|
+
node.name = name;
|
|
25048
|
+
node.value = value;
|
|
25049
|
+
node.transformFlags |= 4 /* ContainsESNext */;
|
|
25050
|
+
return node;
|
|
25051
|
+
}
|
|
25052
|
+
function updateImportAttribute(node, name, value) {
|
|
25053
|
+
return node.name !== name || node.value !== value ? update(createImportAttribute(name, value), node) : node;
|
|
25054
|
+
}
|
|
24970
25055
|
function createNamespaceImport(name) {
|
|
24971
25056
|
const node = createBaseDeclaration(274 /* NamespaceImport */);
|
|
24972
25057
|
node.name = name;
|
|
@@ -25027,20 +25112,20 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
25027
25112
|
function updateExportAssignment(node, modifiers, expression) {
|
|
25028
25113
|
return node.modifiers !== modifiers || node.expression !== expression ? update(createExportAssignment2(modifiers, node.isExportEquals, expression), node) : node;
|
|
25029
25114
|
}
|
|
25030
|
-
function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier,
|
|
25115
|
+
function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes) {
|
|
25031
25116
|
const node = createBaseDeclaration(278 /* ExportDeclaration */);
|
|
25032
25117
|
node.modifiers = asNodeArray(modifiers);
|
|
25033
25118
|
node.isTypeOnly = isTypeOnly;
|
|
25034
25119
|
node.exportClause = exportClause;
|
|
25035
25120
|
node.moduleSpecifier = moduleSpecifier;
|
|
25036
|
-
node.assertClause =
|
|
25121
|
+
node.attributes = node.assertClause = attributes;
|
|
25037
25122
|
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.exportClause) | propagateChildFlags(node.moduleSpecifier);
|
|
25038
25123
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
25039
25124
|
node.jsDoc = void 0;
|
|
25040
25125
|
return node;
|
|
25041
25126
|
}
|
|
25042
|
-
function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier,
|
|
25043
|
-
return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier || node.
|
|
25127
|
+
function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes) {
|
|
25128
|
+
return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier || node.attributes !== attributes ? finishUpdateExportDeclaration(createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes), node) : node;
|
|
25044
25129
|
}
|
|
25045
25130
|
function finishUpdateExportDeclaration(updated, original) {
|
|
25046
25131
|
if (updated !== original) {
|
|
@@ -26367,7 +26452,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
26367
26452
|
} else {
|
|
26368
26453
|
modifierArray = modifiers;
|
|
26369
26454
|
}
|
|
26370
|
-
return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.
|
|
26455
|
+
return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.attributes) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.attributes) : Debug.assertNever(node);
|
|
26371
26456
|
}
|
|
26372
26457
|
function updateModifierLike(node, modifierArray) {
|
|
26373
26458
|
return isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : Debug.assertNever(node);
|
|
@@ -28710,12 +28795,21 @@ function isImportClause(node) {
|
|
|
28710
28795
|
function isImportTypeAssertionContainer(node) {
|
|
28711
28796
|
return node.kind === 302 /* ImportTypeAssertionContainer */;
|
|
28712
28797
|
}
|
|
28798
|
+
function isImportTypeAttributes(node) {
|
|
28799
|
+
return node.kind === 302 /* ImportTypeAttributes */;
|
|
28800
|
+
}
|
|
28713
28801
|
function isAssertClause(node) {
|
|
28714
28802
|
return node.kind === 300 /* AssertClause */;
|
|
28715
28803
|
}
|
|
28716
28804
|
function isAssertEntry(node) {
|
|
28717
28805
|
return node.kind === 301 /* AssertEntry */;
|
|
28718
28806
|
}
|
|
28807
|
+
function isImportAttributes(node) {
|
|
28808
|
+
return node.kind === 300 /* ImportAttributes */;
|
|
28809
|
+
}
|
|
28810
|
+
function isImportAttribute(node) {
|
|
28811
|
+
return node.kind === 301 /* ImportAttribute */;
|
|
28812
|
+
}
|
|
28719
28813
|
function isNamespaceImport(node) {
|
|
28720
28814
|
return node.kind === 274 /* NamespaceImport */;
|
|
28721
28815
|
}
|
|
@@ -29437,7 +29531,7 @@ function createExternalHelpersImportDeclarationIfNeeded(nodeFactory, helperFacto
|
|
|
29437
29531
|
namedBindings
|
|
29438
29532
|
),
|
|
29439
29533
|
nodeFactory.createStringLiteral(externalHelpersModuleNameText),
|
|
29440
|
-
/*
|
|
29534
|
+
/*attributes*/
|
|
29441
29535
|
void 0
|
|
29442
29536
|
);
|
|
29443
29537
|
addInternalEmitFlags(externalHelpersImportDeclaration, 2 /* NeverApplyImportHelper */);
|
|
@@ -30203,10 +30297,10 @@ var forEachChildTable = {
|
|
|
30203
30297
|
return visitNode2(cbNode, node.typeParameter);
|
|
30204
30298
|
},
|
|
30205
30299
|
[205 /* ImportType */]: function forEachChildInImportType(node, cbNode, cbNodes) {
|
|
30206
|
-
return visitNode2(cbNode, node.argument) || visitNode2(cbNode, node.
|
|
30300
|
+
return visitNode2(cbNode, node.argument) || visitNode2(cbNode, node.attributes) || visitNode2(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments);
|
|
30207
30301
|
},
|
|
30208
|
-
[302 /*
|
|
30209
|
-
return visitNode2(cbNode, node.
|
|
30302
|
+
[302 /* ImportTypeAttributes */]: function forEachChildInImportTypeAttributes(node, cbNode, _cbNodes) {
|
|
30303
|
+
return visitNode2(cbNode, node.attributes);
|
|
30210
30304
|
},
|
|
30211
30305
|
[196 /* ParenthesizedType */]: forEachChildInParenthesizedTypeOrTypeOperator,
|
|
30212
30306
|
[198 /* TypeOperator */]: forEachChildInParenthesizedTypeOrTypeOperator,
|
|
@@ -30377,15 +30471,15 @@ var forEachChildTable = {
|
|
|
30377
30471
|
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference);
|
|
30378
30472
|
},
|
|
30379
30473
|
[272 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) {
|
|
30380
|
-
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.
|
|
30474
|
+
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.attributes);
|
|
30381
30475
|
},
|
|
30382
30476
|
[273 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) {
|
|
30383
30477
|
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.namedBindings);
|
|
30384
30478
|
},
|
|
30385
|
-
[300 /*
|
|
30479
|
+
[300 /* ImportAttributes */]: function forEachChildInImportAttributes(node, cbNode, cbNodes) {
|
|
30386
30480
|
return visitNodes(cbNode, cbNodes, node.elements);
|
|
30387
30481
|
},
|
|
30388
|
-
[301 /*
|
|
30482
|
+
[301 /* ImportAttribute */]: function forEachChildInImportAttribute(node, cbNode, _cbNodes) {
|
|
30389
30483
|
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.value);
|
|
30390
30484
|
},
|
|
30391
30485
|
[270 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) {
|
|
@@ -30400,7 +30494,7 @@ var forEachChildTable = {
|
|
|
30400
30494
|
[275 /* NamedImports */]: forEachChildInNamedImportsOrExports,
|
|
30401
30495
|
[279 /* NamedExports */]: forEachChildInNamedImportsOrExports,
|
|
30402
30496
|
[278 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) {
|
|
30403
|
-
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.
|
|
30497
|
+
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.attributes);
|
|
30404
30498
|
},
|
|
30405
30499
|
[276 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier,
|
|
30406
30500
|
[281 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier,
|
|
@@ -30639,7 +30733,7 @@ function gatherPossibleChildren(node) {
|
|
|
30639
30733
|
function setExternalModuleIndicator(sourceFile) {
|
|
30640
30734
|
sourceFile.externalModuleIndicator = isFileProbablyExternalModule(sourceFile);
|
|
30641
30735
|
}
|
|
30642
|
-
function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind
|
|
30736
|
+
function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind) {
|
|
30643
30737
|
var _a, _b, _c, _d;
|
|
30644
30738
|
(_a = tracing) == null ? void 0 : _a.push(
|
|
30645
30739
|
tracing.Phase.Parse,
|
|
@@ -30654,7 +30748,8 @@ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setPar
|
|
|
30654
30748
|
const {
|
|
30655
30749
|
languageVersion,
|
|
30656
30750
|
setExternalModuleIndicator: overrideSetExternalModuleIndicator,
|
|
30657
|
-
impliedNodeFormat: format
|
|
30751
|
+
impliedNodeFormat: format,
|
|
30752
|
+
jsDocParsingMode
|
|
30658
30753
|
} = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions : { languageVersion: languageVersionOrOptions };
|
|
30659
30754
|
if (languageVersion === 100 /* JSON */) {
|
|
30660
30755
|
result = Parser.parseSourceFile(
|
|
@@ -30666,7 +30761,7 @@ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setPar
|
|
|
30666
30761
|
setParentNodes,
|
|
30667
30762
|
6 /* JSON */,
|
|
30668
30763
|
noop,
|
|
30669
|
-
|
|
30764
|
+
jsDocParsingMode
|
|
30670
30765
|
);
|
|
30671
30766
|
} else {
|
|
30672
30767
|
const setIndicator = format === void 0 ? overrideSetExternalModuleIndicator : (file) => {
|
|
@@ -30682,7 +30777,7 @@ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setPar
|
|
|
30682
30777
|
setParentNodes,
|
|
30683
30778
|
scriptKind,
|
|
30684
30779
|
setIndicator,
|
|
30685
|
-
|
|
30780
|
+
jsDocParsingMode
|
|
30686
30781
|
);
|
|
30687
30782
|
}
|
|
30688
30783
|
(_c = perfLogger) == null ? void 0 : _c.logStopParseSourceFile();
|
|
@@ -30816,7 +30911,7 @@ var Parser;
|
|
|
30816
30911
|
var contextFlags;
|
|
30817
30912
|
var topLevel = true;
|
|
30818
30913
|
var parseErrorBeforeNextFinishedNode = false;
|
|
30819
|
-
function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride,
|
|
30914
|
+
function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride, jsDocParsingMode = 0 /* ParseAll */) {
|
|
30820
30915
|
var _a;
|
|
30821
30916
|
scriptKind2 = ensureScriptKind(fileName2, scriptKind2);
|
|
30822
30917
|
if (scriptKind2 === 6 /* JSON */) {
|
|
@@ -30838,9 +30933,8 @@ var Parser;
|
|
|
30838
30933
|
result2.pragmas = emptyMap;
|
|
30839
30934
|
return result2;
|
|
30840
30935
|
}
|
|
30841
|
-
|
|
30842
|
-
|
|
30843
|
-
const result = parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride || setExternalModuleIndicator, skipNonSemanticJSDoc);
|
|
30936
|
+
initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, scriptKind2, jsDocParsingMode);
|
|
30937
|
+
const result = parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride || setExternalModuleIndicator, jsDocParsingMode);
|
|
30844
30938
|
clearState();
|
|
30845
30939
|
return result;
|
|
30846
30940
|
}
|
|
@@ -30853,8 +30947,7 @@ var Parser;
|
|
|
30853
30947
|
/*syntaxCursor*/
|
|
30854
30948
|
void 0,
|
|
30855
30949
|
1 /* JS */,
|
|
30856
|
-
/*
|
|
30857
|
-
false
|
|
30950
|
+
0 /* ParseAll */
|
|
30858
30951
|
);
|
|
30859
30952
|
nextToken();
|
|
30860
30953
|
const entityName = parseEntityName(
|
|
@@ -30867,15 +30960,7 @@ var Parser;
|
|
|
30867
30960
|
}
|
|
30868
30961
|
Parser2.parseIsolatedEntityName = parseIsolatedEntityName2;
|
|
30869
30962
|
function parseJsonText2(fileName2, sourceText2, languageVersion2 = 2 /* ES2015 */, syntaxCursor2, setParentNodes = false) {
|
|
30870
|
-
initializeState(
|
|
30871
|
-
fileName2,
|
|
30872
|
-
sourceText2,
|
|
30873
|
-
languageVersion2,
|
|
30874
|
-
syntaxCursor2,
|
|
30875
|
-
6 /* JSON */,
|
|
30876
|
-
/*skipNonSemanticJSDoc*/
|
|
30877
|
-
false
|
|
30878
|
-
);
|
|
30963
|
+
initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, 6 /* JSON */, 0 /* ParseAll */);
|
|
30879
30964
|
sourceFlags = contextFlags;
|
|
30880
30965
|
nextToken();
|
|
30881
30966
|
const pos = getNodePos();
|
|
@@ -30956,7 +31041,7 @@ var Parser;
|
|
|
30956
31041
|
return result;
|
|
30957
31042
|
}
|
|
30958
31043
|
Parser2.parseJsonText = parseJsonText2;
|
|
30959
|
-
function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind,
|
|
31044
|
+
function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind, _jsDocParsingMode) {
|
|
30960
31045
|
NodeConstructor2 = objectAllocator.getNodeConstructor();
|
|
30961
31046
|
TokenConstructor2 = objectAllocator.getTokenConstructor();
|
|
30962
31047
|
IdentifierConstructor2 = objectAllocator.getIdentifierConstructor();
|
|
@@ -30992,13 +31077,15 @@ var Parser;
|
|
|
30992
31077
|
scanner2.setOnError(scanError);
|
|
30993
31078
|
scanner2.setScriptTarget(languageVersion);
|
|
30994
31079
|
scanner2.setLanguageVariant(languageVariant);
|
|
30995
|
-
scanner2.
|
|
31080
|
+
scanner2.setScriptKind(scriptKind);
|
|
31081
|
+
scanner2.setJSDocParsingMode(_jsDocParsingMode);
|
|
30996
31082
|
}
|
|
30997
31083
|
function clearState() {
|
|
30998
31084
|
scanner2.clearCommentDirectives();
|
|
30999
31085
|
scanner2.setText("");
|
|
31000
31086
|
scanner2.setOnError(void 0);
|
|
31001
|
-
scanner2.
|
|
31087
|
+
scanner2.setScriptKind(0 /* Unknown */);
|
|
31088
|
+
scanner2.setJSDocParsingMode(0 /* ParseAll */);
|
|
31002
31089
|
sourceText = void 0;
|
|
31003
31090
|
languageVersion = void 0;
|
|
31004
31091
|
syntaxCursor = void 0;
|
|
@@ -31012,7 +31099,7 @@ var Parser;
|
|
|
31012
31099
|
notParenthesizedArrow = void 0;
|
|
31013
31100
|
topLevel = true;
|
|
31014
31101
|
}
|
|
31015
|
-
function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2,
|
|
31102
|
+
function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2, jsDocParsingMode) {
|
|
31016
31103
|
const isDeclarationFile = isDeclarationFileName(fileName);
|
|
31017
31104
|
if (isDeclarationFile) {
|
|
31018
31105
|
contextFlags |= 33554432 /* Ambient */;
|
|
@@ -31031,7 +31118,7 @@ var Parser;
|
|
|
31031
31118
|
sourceFile.identifierCount = identifierCount;
|
|
31032
31119
|
sourceFile.identifiers = identifiers;
|
|
31033
31120
|
sourceFile.parseDiagnostics = attachFileToDiagnostics(parseDiagnostics, sourceFile);
|
|
31034
|
-
sourceFile.
|
|
31121
|
+
sourceFile.jsDocParsingMode = jsDocParsingMode;
|
|
31035
31122
|
if (jsDocDiagnostics) {
|
|
31036
31123
|
sourceFile.jsDocDiagnostics = attachFileToDiagnostics(jsDocDiagnostics, sourceFile);
|
|
31037
31124
|
}
|
|
@@ -31687,7 +31774,7 @@ var Parser;
|
|
|
31687
31774
|
function isLiteralPropertyName() {
|
|
31688
31775
|
return tokenIsIdentifierOrKeyword(token()) || token() === 11 /* StringLiteral */ || token() === 9 /* NumericLiteral */;
|
|
31689
31776
|
}
|
|
31690
|
-
function
|
|
31777
|
+
function isImportAttributeName2() {
|
|
31691
31778
|
return tokenIsIdentifierOrKeyword(token()) || token() === 11 /* StringLiteral */;
|
|
31692
31779
|
}
|
|
31693
31780
|
function parsePropertyNameWorker(allowComputedPropertyNames) {
|
|
@@ -31806,8 +31893,8 @@ var Parser;
|
|
|
31806
31893
|
return isLiteralPropertyName();
|
|
31807
31894
|
case 9 /* ObjectBindingElements */:
|
|
31808
31895
|
return token() === 23 /* OpenBracketToken */ || token() === 26 /* DotDotDotToken */ || isLiteralPropertyName();
|
|
31809
|
-
case 24 /*
|
|
31810
|
-
return
|
|
31896
|
+
case 24 /* ImportAttributes */:
|
|
31897
|
+
return isImportAttributeName2();
|
|
31811
31898
|
case 7 /* HeritageClauseElement */:
|
|
31812
31899
|
if (token() === 19 /* OpenBraceToken */) {
|
|
31813
31900
|
return lookAhead(isValidHeritageClauseObjectLiteral);
|
|
@@ -31910,7 +31997,7 @@ var Parser;
|
|
|
31910
31997
|
case 12 /* ObjectLiteralMembers */:
|
|
31911
31998
|
case 9 /* ObjectBindingElements */:
|
|
31912
31999
|
case 23 /* ImportOrExportSpecifiers */:
|
|
31913
|
-
case 24 /*
|
|
32000
|
+
case 24 /* ImportAttributes */:
|
|
31914
32001
|
return token() === 20 /* CloseBraceToken */;
|
|
31915
32002
|
case 3 /* SwitchClauseStatements */:
|
|
31916
32003
|
return token() === 20 /* CloseBraceToken */ || token() === 84 /* CaseKeyword */ || token() === 90 /* DefaultKeyword */;
|
|
@@ -32216,7 +32303,7 @@ var Parser;
|
|
|
32216
32303
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
32217
32304
|
case 14 /* JsxChildren */:
|
|
32218
32305
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
32219
|
-
case 24 /*
|
|
32306
|
+
case 24 /* ImportAttributes */:
|
|
32220
32307
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_or_string_literal_expected);
|
|
32221
32308
|
case 25 /* JSDocComment */:
|
|
32222
32309
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
@@ -33091,16 +33178,22 @@ var Parser;
|
|
|
33091
33178
|
nextToken();
|
|
33092
33179
|
return token() === 102 /* ImportKeyword */;
|
|
33093
33180
|
}
|
|
33094
|
-
function
|
|
33181
|
+
function parseImportTypeAttributes() {
|
|
33095
33182
|
const pos = getNodePos();
|
|
33096
33183
|
const openBracePosition = scanner2.getTokenStart();
|
|
33097
33184
|
parseExpected(19 /* OpenBraceToken */);
|
|
33098
33185
|
const multiLine = scanner2.hasPrecedingLineBreak();
|
|
33099
|
-
|
|
33186
|
+
const currentToken2 = token();
|
|
33187
|
+
if (currentToken2 !== 118 /* WithKeyword */ && currentToken2 !== 132 /* AssertKeyword */) {
|
|
33188
|
+
parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(118 /* WithKeyword */));
|
|
33189
|
+
} else {
|
|
33190
|
+
nextToken();
|
|
33191
|
+
}
|
|
33100
33192
|
parseExpected(59 /* ColonToken */);
|
|
33101
|
-
const
|
|
33102
|
-
|
|
33103
|
-
|
|
33193
|
+
const attributes = parseImportAttributes(
|
|
33194
|
+
currentToken2,
|
|
33195
|
+
/*shouldAdvance*/
|
|
33196
|
+
false
|
|
33104
33197
|
);
|
|
33105
33198
|
if (!parseExpected(20 /* CloseBraceToken */)) {
|
|
33106
33199
|
const lastError = lastOrUndefined(parseDiagnostics);
|
|
@@ -33111,7 +33204,7 @@ var Parser;
|
|
|
33111
33204
|
);
|
|
33112
33205
|
}
|
|
33113
33206
|
}
|
|
33114
|
-
return finishNode(factory2.
|
|
33207
|
+
return finishNode(factory2.createImportTypeAttributes(attributes, multiLine), pos);
|
|
33115
33208
|
}
|
|
33116
33209
|
function parseImportType() {
|
|
33117
33210
|
sourceFlags |= 4194304 /* PossiblyContainsDynamicImport */;
|
|
@@ -33120,14 +33213,14 @@ var Parser;
|
|
|
33120
33213
|
parseExpected(102 /* ImportKeyword */);
|
|
33121
33214
|
parseExpected(21 /* OpenParenToken */);
|
|
33122
33215
|
const type = parseType();
|
|
33123
|
-
let
|
|
33216
|
+
let attributes;
|
|
33124
33217
|
if (parseOptional(28 /* CommaToken */)) {
|
|
33125
|
-
|
|
33218
|
+
attributes = parseImportTypeAttributes();
|
|
33126
33219
|
}
|
|
33127
33220
|
parseExpected(22 /* CloseParenToken */);
|
|
33128
33221
|
const qualifier = parseOptional(25 /* DotToken */) ? parseEntityNameOfTypeReference() : void 0;
|
|
33129
33222
|
const typeArguments = parseTypeArgumentsOfTypeReference();
|
|
33130
|
-
return finishNode(factory2.createImportTypeNode(type,
|
|
33223
|
+
return finishNode(factory2.createImportTypeNode(type, attributes, qualifier, typeArguments, isTypeOf), pos);
|
|
33131
33224
|
}
|
|
33132
33225
|
function nextTokenIsNumericOrBigIntLiteral() {
|
|
33133
33226
|
nextToken();
|
|
@@ -36189,15 +36282,16 @@ var Parser;
|
|
|
36189
36282
|
parseExpected(161 /* FromKeyword */);
|
|
36190
36283
|
}
|
|
36191
36284
|
const moduleSpecifier = parseModuleSpecifier();
|
|
36192
|
-
|
|
36193
|
-
|
|
36194
|
-
|
|
36285
|
+
const currentToken2 = token();
|
|
36286
|
+
let attributes;
|
|
36287
|
+
if ((currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) && !scanner2.hasPrecedingLineBreak()) {
|
|
36288
|
+
attributes = parseImportAttributes(currentToken2);
|
|
36195
36289
|
}
|
|
36196
36290
|
parseSemicolon();
|
|
36197
|
-
const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier,
|
|
36291
|
+
const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes);
|
|
36198
36292
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
36199
36293
|
}
|
|
36200
|
-
function
|
|
36294
|
+
function parseImportAttribute() {
|
|
36201
36295
|
const pos = getNodePos();
|
|
36202
36296
|
const name = tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode(11 /* StringLiteral */);
|
|
36203
36297
|
parseExpected(59 /* ColonToken */);
|
|
@@ -36205,19 +36299,19 @@ var Parser;
|
|
|
36205
36299
|
/*allowReturnTypeInArrowFunction*/
|
|
36206
36300
|
true
|
|
36207
36301
|
);
|
|
36208
|
-
return finishNode(factory2.
|
|
36302
|
+
return finishNode(factory2.createImportAttribute(name, value), pos);
|
|
36209
36303
|
}
|
|
36210
|
-
function
|
|
36304
|
+
function parseImportAttributes(token2, shouldAdvance = true) {
|
|
36211
36305
|
const pos = getNodePos();
|
|
36212
|
-
if (
|
|
36213
|
-
|
|
36306
|
+
if (shouldAdvance) {
|
|
36307
|
+
nextToken();
|
|
36214
36308
|
}
|
|
36215
36309
|
const openBracePosition = scanner2.getTokenStart();
|
|
36216
36310
|
if (parseExpected(19 /* OpenBraceToken */)) {
|
|
36217
36311
|
const multiLine = scanner2.hasPrecedingLineBreak();
|
|
36218
36312
|
const elements = parseDelimitedList(
|
|
36219
|
-
24 /*
|
|
36220
|
-
|
|
36313
|
+
24 /* ImportAttributes */,
|
|
36314
|
+
parseImportAttribute,
|
|
36221
36315
|
/*considerSemicolonAsDelimiter*/
|
|
36222
36316
|
true
|
|
36223
36317
|
);
|
|
@@ -36230,7 +36324,7 @@ var Parser;
|
|
|
36230
36324
|
);
|
|
36231
36325
|
}
|
|
36232
36326
|
}
|
|
36233
|
-
return finishNode(factory2.
|
|
36327
|
+
return finishNode(factory2.createImportAttributes(elements, multiLine, token2), pos);
|
|
36234
36328
|
} else {
|
|
36235
36329
|
const elements = createNodeArray(
|
|
36236
36330
|
[],
|
|
@@ -36240,10 +36334,11 @@ var Parser;
|
|
|
36240
36334
|
/*hasTrailingComma*/
|
|
36241
36335
|
false
|
|
36242
36336
|
);
|
|
36243
|
-
return finishNode(factory2.
|
|
36337
|
+
return finishNode(factory2.createImportAttributes(
|
|
36244
36338
|
elements,
|
|
36245
36339
|
/*multiLine*/
|
|
36246
|
-
false
|
|
36340
|
+
false,
|
|
36341
|
+
token2
|
|
36247
36342
|
), pos);
|
|
36248
36343
|
}
|
|
36249
36344
|
}
|
|
@@ -36375,7 +36470,7 @@ var Parser;
|
|
|
36375
36470
|
);
|
|
36376
36471
|
let exportClause;
|
|
36377
36472
|
let moduleSpecifier;
|
|
36378
|
-
let
|
|
36473
|
+
let attributes;
|
|
36379
36474
|
const isTypeOnly = parseOptional(156 /* TypeKeyword */);
|
|
36380
36475
|
const namespaceExportPos = getNodePos();
|
|
36381
36476
|
if (parseOptional(42 /* AsteriskToken */)) {
|
|
@@ -36391,12 +36486,13 @@ var Parser;
|
|
|
36391
36486
|
moduleSpecifier = parseModuleSpecifier();
|
|
36392
36487
|
}
|
|
36393
36488
|
}
|
|
36394
|
-
|
|
36395
|
-
|
|
36489
|
+
const currentToken2 = token();
|
|
36490
|
+
if (moduleSpecifier && (currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) && !scanner2.hasPrecedingLineBreak()) {
|
|
36491
|
+
attributes = parseImportAttributes(currentToken2);
|
|
36396
36492
|
}
|
|
36397
36493
|
parseSemicolon();
|
|
36398
36494
|
setAwaitContext(savedAwaitContext);
|
|
36399
|
-
const node = factory2.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier,
|
|
36495
|
+
const node = factory2.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes);
|
|
36400
36496
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
36401
36497
|
}
|
|
36402
36498
|
function parseExportAssignment(pos, hasJSDoc, modifiers) {
|
|
@@ -36446,7 +36542,7 @@ var Parser;
|
|
|
36446
36542
|
ParsingContext2[ParsingContext2["TupleElementTypes"] = 21] = "TupleElementTypes";
|
|
36447
36543
|
ParsingContext2[ParsingContext2["HeritageClauses"] = 22] = "HeritageClauses";
|
|
36448
36544
|
ParsingContext2[ParsingContext2["ImportOrExportSpecifiers"] = 23] = "ImportOrExportSpecifiers";
|
|
36449
|
-
ParsingContext2[ParsingContext2["
|
|
36545
|
+
ParsingContext2[ParsingContext2["ImportAttributes"] = 24] = "ImportAttributes";
|
|
36450
36546
|
ParsingContext2[ParsingContext2["JSDocComment"] = 25] = "JSDocComment";
|
|
36451
36547
|
ParsingContext2[ParsingContext2["Count"] = 26] = "Count";
|
|
36452
36548
|
})(ParsingContext || (ParsingContext = {}));
|
|
@@ -36466,8 +36562,7 @@ var Parser;
|
|
|
36466
36562
|
/*syntaxCursor*/
|
|
36467
36563
|
void 0,
|
|
36468
36564
|
1 /* JS */,
|
|
36469
|
-
/*
|
|
36470
|
-
false
|
|
36565
|
+
0 /* ParseAll */
|
|
36471
36566
|
);
|
|
36472
36567
|
scanner2.setText(content, start2, length2);
|
|
36473
36568
|
currentToken = scanner2.scan();
|
|
@@ -36532,8 +36627,7 @@ var Parser;
|
|
|
36532
36627
|
/*syntaxCursor*/
|
|
36533
36628
|
void 0,
|
|
36534
36629
|
1 /* JS */,
|
|
36535
|
-
/*
|
|
36536
|
-
false
|
|
36630
|
+
0 /* ParseAll */
|
|
36537
36631
|
);
|
|
36538
36632
|
const jsDoc = doInsideOfContext(16777216 /* JSDoc */, () => parseJSDocCommentWorker(start2, length2));
|
|
36539
36633
|
const sourceFile = { languageVariant: 0 /* Standard */, text: content };
|
|
@@ -37490,7 +37584,7 @@ var IncrementalParser;
|
|
|
37490
37584
|
true,
|
|
37491
37585
|
sourceFile.scriptKind,
|
|
37492
37586
|
sourceFile.setExternalModuleIndicator,
|
|
37493
|
-
sourceFile.
|
|
37587
|
+
sourceFile.jsDocParsingMode
|
|
37494
37588
|
);
|
|
37495
37589
|
}
|
|
37496
37590
|
const incrementalSourceFile = sourceFile;
|
|
@@ -37515,7 +37609,7 @@ var IncrementalParser;
|
|
|
37515
37609
|
true,
|
|
37516
37610
|
sourceFile.scriptKind,
|
|
37517
37611
|
sourceFile.setExternalModuleIndicator,
|
|
37518
|
-
sourceFile.
|
|
37612
|
+
sourceFile.jsDocParsingMode
|
|
37519
37613
|
);
|
|
37520
37614
|
result.commentDirectives = getNewCommentDirectives(
|
|
37521
37615
|
sourceFile.commentDirectives,
|
|
@@ -50980,7 +51074,7 @@ function createTypeChecker(host) {
|
|
|
50980
51074
|
return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) : void 0;
|
|
50981
51075
|
}
|
|
50982
51076
|
function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) {
|
|
50983
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j
|
|
51077
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
50984
51078
|
if (startsWith(moduleReference, "@types/")) {
|
|
50985
51079
|
const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
|
|
50986
51080
|
const withoutAtTypePrefix = removePrefix(moduleReference, "@types/");
|
|
@@ -50998,7 +51092,7 @@ function createTypeChecker(host) {
|
|
|
50998
51092
|
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);
|
|
50999
51093
|
const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
|
|
51000
51094
|
const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
|
|
51001
|
-
const resolvedModule = (
|
|
51095
|
+
const resolvedModule = (_g = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _g.resolvedModule;
|
|
51002
51096
|
const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule, currentSourceFile);
|
|
51003
51097
|
const sourceFile = resolvedModule && (!resolutionDiagnostic || resolutionDiagnostic === Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set) && host.getSourceFile(resolvedModule.resolvedFileName);
|
|
51004
51098
|
if (sourceFile) {
|
|
@@ -51006,7 +51100,7 @@ function createTypeChecker(host) {
|
|
|
51006
51100
|
error2(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName);
|
|
51007
51101
|
}
|
|
51008
51102
|
if (resolvedModule.resolvedUsingTsExtension && isDeclarationFileName(moduleReference)) {
|
|
51009
|
-
const importOrExport = ((
|
|
51103
|
+
const importOrExport = ((_h = findAncestor(location, isImportDeclaration)) == null ? void 0 : _h.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
|
|
51010
51104
|
if (importOrExport && !importOrExport.isTypeOnly || findAncestor(location, isImportCall)) {
|
|
51011
51105
|
error2(
|
|
51012
51106
|
errorNode,
|
|
@@ -51015,7 +51109,7 @@ function createTypeChecker(host) {
|
|
|
51015
51109
|
);
|
|
51016
51110
|
}
|
|
51017
51111
|
} else if (resolvedModule.resolvedUsingTsExtension && !shouldAllowImportingTsExtension(compilerOptions, currentSourceFile.fileName)) {
|
|
51018
|
-
const importOrExport = ((
|
|
51112
|
+
const importOrExport = ((_i = findAncestor(location, isImportDeclaration)) == null ? void 0 : _i.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
|
|
51019
51113
|
if (!((importOrExport == null ? void 0 : importOrExport.isTypeOnly) || findAncestor(location, isImportTypeNode))) {
|
|
51020
51114
|
const tsExtension = Debug.checkDefined(tryExtractTSExtension(moduleReference));
|
|
51021
51115
|
error2(errorNode, Diagnostics.An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled, tsExtension);
|
|
@@ -51035,9 +51129,8 @@ function createTypeChecker(host) {
|
|
|
51035
51129
|
}
|
|
51036
51130
|
if (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */) {
|
|
51037
51131
|
const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
|
|
51038
|
-
const
|
|
51039
|
-
|
|
51040
|
-
if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !getResolutionModeOverrideForClause(overrideClause)) {
|
|
51132
|
+
const overrideHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l));
|
|
51133
|
+
if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !hasResolutionModeOverride(overrideHost)) {
|
|
51041
51134
|
if (findAncestor(location, isImportEqualsDeclaration)) {
|
|
51042
51135
|
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);
|
|
51043
51136
|
} else {
|
|
@@ -51143,7 +51236,7 @@ function createTypeChecker(host) {
|
|
|
51143
51236
|
error2(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
|
|
51144
51237
|
} else if (mode === 99 /* ESNext */ && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) {
|
|
51145
51238
|
const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path));
|
|
51146
|
-
const suggestedExt = (
|
|
51239
|
+
const suggestedExt = (_j = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))) == null ? void 0 : _j[1];
|
|
51147
51240
|
if (suggestedExt) {
|
|
51148
51241
|
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);
|
|
51149
51242
|
} else {
|
|
@@ -52442,7 +52535,7 @@ function createTypeChecker(host) {
|
|
|
52442
52535
|
}
|
|
52443
52536
|
return factory.createInferTypeNode(typeParameterToDeclarationWithConstraint(type, context, constraintNode));
|
|
52444
52537
|
}
|
|
52445
|
-
if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && type.flags & 262144 /* TypeParameter */) {
|
|
52538
|
+
if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && type.flags & 262144 /* TypeParameter */ && !isTypeSymbolAccessible(type.symbol, context.enclosingDeclaration)) {
|
|
52446
52539
|
const name2 = typeParameterToName(type, context);
|
|
52447
52540
|
context.approximateLength += idText(name2).length;
|
|
52448
52541
|
return factory.createTypeReferenceNode(
|
|
@@ -52908,7 +53001,7 @@ function createTypeChecker(host) {
|
|
|
52908
53001
|
return factory.updateImportTypeNode(
|
|
52909
53002
|
root,
|
|
52910
53003
|
root.argument,
|
|
52911
|
-
root.
|
|
53004
|
+
root.attributes,
|
|
52912
53005
|
qualifier,
|
|
52913
53006
|
typeArguments,
|
|
52914
53007
|
root.isTypeOf
|
|
@@ -53208,65 +53301,36 @@ function createTypeChecker(host) {
|
|
|
53208
53301
|
true
|
|
53209
53302
|
)[0];
|
|
53210
53303
|
let cleanup;
|
|
53211
|
-
if (context.enclosingDeclaration && signature.declaration && signature.declaration !== context.enclosingDeclaration && !isInJSFile(signature.declaration) &&
|
|
53212
|
-
|
|
53213
|
-
|
|
53214
|
-
|
|
53215
|
-
|
|
53216
|
-
|
|
53217
|
-
|
|
53218
|
-
|
|
53219
|
-
|
|
53220
|
-
|
|
53221
|
-
|
|
53222
|
-
|
|
53223
|
-
|
|
53224
|
-
if (!locals.has(name)) {
|
|
53225
|
-
newLocals = append(newLocals, name);
|
|
53226
|
-
locals.set(name, symbol);
|
|
53227
|
-
}
|
|
53228
|
-
});
|
|
53229
|
-
if (!newLocals)
|
|
53230
|
-
return;
|
|
53231
|
-
const oldCleanup = cleanup;
|
|
53232
|
-
function undo() {
|
|
53304
|
+
if (context.enclosingDeclaration && signature.declaration && signature.declaration !== context.enclosingDeclaration && !isInJSFile(signature.declaration) && some(expandedParams)) {
|
|
53305
|
+
const existingFakeScope = getNodeLinks(context.enclosingDeclaration).fakeScopeForSignatureDeclaration ? context.enclosingDeclaration : void 0;
|
|
53306
|
+
Debug.assertOptionalNode(existingFakeScope, isBlock);
|
|
53307
|
+
const locals = (existingFakeScope == null ? void 0 : existingFakeScope.locals) ?? createSymbolTable();
|
|
53308
|
+
let newLocals;
|
|
53309
|
+
for (const param of expandedParams) {
|
|
53310
|
+
if (!locals.has(param.escapedName)) {
|
|
53311
|
+
newLocals = append(newLocals, param.escapedName);
|
|
53312
|
+
locals.set(param.escapedName, param);
|
|
53313
|
+
}
|
|
53314
|
+
}
|
|
53315
|
+
if (newLocals) {
|
|
53316
|
+
let removeNewLocals2 = function() {
|
|
53233
53317
|
forEach(newLocals, (s) => locals.delete(s));
|
|
53234
|
-
|
|
53235
|
-
|
|
53318
|
+
};
|
|
53319
|
+
var removeNewLocals = removeNewLocals2;
|
|
53236
53320
|
if (existingFakeScope) {
|
|
53237
|
-
cleanup =
|
|
53321
|
+
cleanup = removeNewLocals2;
|
|
53238
53322
|
} else {
|
|
53239
53323
|
const fakeScope = parseNodeFactory.createBlock(emptyArray);
|
|
53240
|
-
getNodeLinks(fakeScope).fakeScopeForSignatureDeclaration =
|
|
53324
|
+
getNodeLinks(fakeScope).fakeScopeForSignatureDeclaration = true;
|
|
53241
53325
|
fakeScope.locals = locals;
|
|
53242
53326
|
const saveEnclosingDeclaration = context.enclosingDeclaration;
|
|
53243
53327
|
setParent(fakeScope, saveEnclosingDeclaration);
|
|
53244
53328
|
context.enclosingDeclaration = fakeScope;
|
|
53245
53329
|
cleanup = () => {
|
|
53246
53330
|
context.enclosingDeclaration = saveEnclosingDeclaration;
|
|
53247
|
-
|
|
53331
|
+
removeNewLocals2();
|
|
53248
53332
|
};
|
|
53249
53333
|
}
|
|
53250
|
-
};
|
|
53251
|
-
var pushFakeScope = pushFakeScope2;
|
|
53252
|
-
pushFakeScope2(
|
|
53253
|
-
"params",
|
|
53254
|
-
(add) => {
|
|
53255
|
-
for (const param of expandedParams) {
|
|
53256
|
-
add(param.escapedName, param);
|
|
53257
|
-
}
|
|
53258
|
-
}
|
|
53259
|
-
);
|
|
53260
|
-
if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */) {
|
|
53261
|
-
pushFakeScope2(
|
|
53262
|
-
"typeParams",
|
|
53263
|
-
(add) => {
|
|
53264
|
-
for (const typeParam of signature.typeParameters ?? emptyArray) {
|
|
53265
|
-
const typeParamName = typeParameterToName(typeParam, context).escapedText;
|
|
53266
|
-
add(typeParamName, typeParam.symbol);
|
|
53267
|
-
}
|
|
53268
|
-
}
|
|
53269
|
-
);
|
|
53270
53334
|
}
|
|
53271
53335
|
}
|
|
53272
53336
|
const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 176 /* Constructor */, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports));
|
|
@@ -53670,7 +53734,6 @@ function createTypeChecker(host) {
|
|
|
53670
53734
|
return symbol.parent ? factory.createQualifiedName(symbolToEntityNameNode(symbol.parent), identifier) : identifier;
|
|
53671
53735
|
}
|
|
53672
53736
|
function symbolToTypeNode(symbol, context, meaning, overrideTypeArguments) {
|
|
53673
|
-
var _a, _b, _c, _d;
|
|
53674
53737
|
const chain = lookupSymbolChain(symbol, context, meaning, !(context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */));
|
|
53675
53738
|
const isTypeOf = meaning === 111551 /* Value */;
|
|
53676
53739
|
if (some(chain[0].declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {
|
|
@@ -53679,17 +53742,18 @@ function createTypeChecker(host) {
|
|
|
53679
53742
|
const contextFile = getSourceFileOfNode(getOriginalNode(context.enclosingDeclaration));
|
|
53680
53743
|
const targetFile = getSourceFileOfModule(chain[0]);
|
|
53681
53744
|
let specifier;
|
|
53682
|
-
let
|
|
53745
|
+
let attributes;
|
|
53683
53746
|
if (getEmitModuleResolutionKind(compilerOptions) === 3 /* Node16 */ || getEmitModuleResolutionKind(compilerOptions) === 99 /* NodeNext */) {
|
|
53684
53747
|
if ((targetFile == null ? void 0 : targetFile.impliedNodeFormat) === 99 /* ESNext */ && targetFile.impliedNodeFormat !== (contextFile == null ? void 0 : contextFile.impliedNodeFormat)) {
|
|
53685
53748
|
specifier = getSpecifierForModuleSymbol(chain[0], context, 99 /* ESNext */);
|
|
53686
|
-
|
|
53687
|
-
factory.
|
|
53688
|
-
factory.
|
|
53689
|
-
|
|
53690
|
-
|
|
53691
|
-
|
|
53692
|
-
|
|
53749
|
+
attributes = factory.createImportTypeAttributes(factory.createImportAttributes(
|
|
53750
|
+
factory.createNodeArray([
|
|
53751
|
+
factory.createImportAttribute(
|
|
53752
|
+
factory.createStringLiteral("resolution-mode"),
|
|
53753
|
+
factory.createStringLiteral("import")
|
|
53754
|
+
)
|
|
53755
|
+
])
|
|
53756
|
+
));
|
|
53693
53757
|
}
|
|
53694
53758
|
}
|
|
53695
53759
|
if (!specifier) {
|
|
@@ -53703,16 +53767,17 @@ function createTypeChecker(host) {
|
|
|
53703
53767
|
if (specifier.includes("/node_modules/")) {
|
|
53704
53768
|
specifier = oldSpecifier;
|
|
53705
53769
|
} else {
|
|
53706
|
-
|
|
53707
|
-
factory.
|
|
53708
|
-
factory.
|
|
53709
|
-
|
|
53710
|
-
|
|
53711
|
-
|
|
53712
|
-
|
|
53770
|
+
attributes = factory.createImportTypeAttributes(factory.createImportAttributes(
|
|
53771
|
+
factory.createNodeArray([
|
|
53772
|
+
factory.createImportAttribute(
|
|
53773
|
+
factory.createStringLiteral("resolution-mode"),
|
|
53774
|
+
factory.createStringLiteral(swappedMode === 99 /* ESNext */ ? "import" : "require")
|
|
53775
|
+
)
|
|
53776
|
+
])
|
|
53777
|
+
));
|
|
53713
53778
|
}
|
|
53714
53779
|
}
|
|
53715
|
-
if (!
|
|
53780
|
+
if (!attributes) {
|
|
53716
53781
|
context.encounteredError = true;
|
|
53717
53782
|
if (context.tracker.reportLikelyUnsafeImportRequiredError) {
|
|
53718
53783
|
context.tracker.reportLikelyUnsafeImportRequiredError(oldSpecifier);
|
|
@@ -53732,11 +53797,11 @@ function createTypeChecker(host) {
|
|
|
53732
53797
|
void 0
|
|
53733
53798
|
);
|
|
53734
53799
|
}
|
|
53735
|
-
return factory.createImportTypeNode(lit,
|
|
53800
|
+
return factory.createImportTypeNode(lit, attributes, nonRootParts, typeParameterNodes, isTypeOf);
|
|
53736
53801
|
} else {
|
|
53737
53802
|
const splitNode = getTopmostIndexedAccessType(nonRootParts);
|
|
53738
53803
|
const qualifier = splitNode.objectType.typeName;
|
|
53739
|
-
return factory.createIndexedAccessTypeNode(factory.createImportTypeNode(lit,
|
|
53804
|
+
return factory.createIndexedAccessTypeNode(factory.createImportTypeNode(lit, attributes, qualifier, typeParameterNodes, isTypeOf), splitNode.indexType);
|
|
53740
53805
|
}
|
|
53741
53806
|
}
|
|
53742
53807
|
const entityName = createAccessFromSymbolChain(chain, chain.length - 1, 0);
|
|
@@ -53810,7 +53875,7 @@ function createTypeChecker(host) {
|
|
|
53810
53875
|
return identifier;
|
|
53811
53876
|
}
|
|
53812
53877
|
}
|
|
53813
|
-
function
|
|
53878
|
+
function typeParameterShadowsNameInScope(escapedName, context, type) {
|
|
53814
53879
|
const result = resolveName(
|
|
53815
53880
|
context.enclosingDeclaration,
|
|
53816
53881
|
escapedName,
|
|
@@ -53821,8 +53886,11 @@ function createTypeChecker(host) {
|
|
|
53821
53886
|
/*isUse*/
|
|
53822
53887
|
false
|
|
53823
53888
|
);
|
|
53824
|
-
if (result
|
|
53825
|
-
|
|
53889
|
+
if (result) {
|
|
53890
|
+
if (result.flags & 262144 /* TypeParameter */ && result === type.symbol) {
|
|
53891
|
+
return false;
|
|
53892
|
+
}
|
|
53893
|
+
return true;
|
|
53826
53894
|
}
|
|
53827
53895
|
return false;
|
|
53828
53896
|
}
|
|
@@ -53848,7 +53916,7 @@ function createTypeChecker(host) {
|
|
|
53848
53916
|
const rawtext = result.escapedText;
|
|
53849
53917
|
let i = ((_a = context.typeParameterNamesByTextNextNameCount) == null ? void 0 : _a.get(rawtext)) || 0;
|
|
53850
53918
|
let text = rawtext;
|
|
53851
|
-
while (((_b = context.typeParameterNamesByText) == null ? void 0 : _b.has(text)) ||
|
|
53919
|
+
while (((_b = context.typeParameterNamesByText) == null ? void 0 : _b.has(text)) || typeParameterShadowsNameInScope(text, context, type)) {
|
|
53852
53920
|
i++;
|
|
53853
53921
|
text = `${rawtext}_${i}`;
|
|
53854
53922
|
}
|
|
@@ -53859,7 +53927,7 @@ function createTypeChecker(host) {
|
|
|
53859
53927
|
}
|
|
53860
53928
|
(context.typeParameterNamesByTextNextNameCount || (context.typeParameterNamesByTextNextNameCount = /* @__PURE__ */ new Map())).set(rawtext, i);
|
|
53861
53929
|
(context.typeParameterNames || (context.typeParameterNames = /* @__PURE__ */ new Map())).set(getTypeId(type), result);
|
|
53862
|
-
(context.typeParameterNamesByText || (context.typeParameterNamesByText = /* @__PURE__ */ new Set())).add(
|
|
53930
|
+
(context.typeParameterNamesByText || (context.typeParameterNamesByText = /* @__PURE__ */ new Set())).add(rawtext);
|
|
53863
53931
|
}
|
|
53864
53932
|
return result;
|
|
53865
53933
|
}
|
|
@@ -54004,10 +54072,7 @@ function createTypeChecker(host) {
|
|
|
54004
54072
|
return !(getObjectFlags(type) & 4 /* Reference */) || !isTypeReferenceNode(existing) || length(existing.typeArguments) >= getMinTypeArgumentCount(type.target.typeParameters);
|
|
54005
54073
|
}
|
|
54006
54074
|
function getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration) {
|
|
54007
|
-
|
|
54008
|
-
enclosingDeclaration = enclosingDeclaration.parent;
|
|
54009
|
-
}
|
|
54010
|
-
return enclosingDeclaration;
|
|
54075
|
+
return getNodeLinks(enclosingDeclaration).fakeScopeForSignatureDeclaration ? enclosingDeclaration.parent : enclosingDeclaration;
|
|
54011
54076
|
}
|
|
54012
54077
|
function serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled) {
|
|
54013
54078
|
if (!isErrorType(type) && enclosingDeclaration) {
|
|
@@ -54087,7 +54152,7 @@ function createTypeChecker(host) {
|
|
|
54087
54152
|
}
|
|
54088
54153
|
if (isIdentifier(node)) {
|
|
54089
54154
|
const type = getDeclaredTypeOfSymbol(sym);
|
|
54090
|
-
const name = sym.flags & 262144 /* TypeParameter */ ? typeParameterToName(type, context) : factory.cloneNode(node);
|
|
54155
|
+
const name = sym.flags & 262144 /* TypeParameter */ && !isTypeSymbolAccessible(type.symbol, context.enclosingDeclaration) ? typeParameterToName(type, context) : factory.cloneNode(node);
|
|
54091
54156
|
name.symbol = sym;
|
|
54092
54157
|
return { introducesError, node: setEmitFlags(setOriginalNode(name, node), 16777216 /* NoAsciiEscaping */) };
|
|
54093
54158
|
}
|
|
@@ -54212,7 +54277,7 @@ function createTypeChecker(host) {
|
|
|
54212
54277
|
return factory.updateImportTypeNode(
|
|
54213
54278
|
node,
|
|
54214
54279
|
factory.updateLiteralTypeNode(node.argument, rewriteModuleSpecifier(node, node.argument.literal)),
|
|
54215
|
-
node.
|
|
54280
|
+
node.attributes,
|
|
54216
54281
|
node.qualifier,
|
|
54217
54282
|
visitNodes2(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode),
|
|
54218
54283
|
node.isTypeOf
|
|
@@ -54432,7 +54497,7 @@ function createTypeChecker(host) {
|
|
|
54432
54497
|
return statements;
|
|
54433
54498
|
}
|
|
54434
54499
|
function inlineExportModifiers(statements) {
|
|
54435
|
-
const index = findIndex(statements, (d) => isExportDeclaration(d) && !d.moduleSpecifier && !d.
|
|
54500
|
+
const index = findIndex(statements, (d) => isExportDeclaration(d) && !d.moduleSpecifier && !d.attributes && !!d.exportClause && isNamedExports(d.exportClause));
|
|
54436
54501
|
if (index >= 0) {
|
|
54437
54502
|
const exportDecl = statements[index];
|
|
54438
54503
|
const replacements = mapDefined(exportDecl.exportClause.elements, (e) => {
|
|
@@ -54460,7 +54525,7 @@ function createTypeChecker(host) {
|
|
|
54460
54525
|
replacements
|
|
54461
54526
|
),
|
|
54462
54527
|
exportDecl.moduleSpecifier,
|
|
54463
|
-
exportDecl.
|
|
54528
|
+
exportDecl.attributes
|
|
54464
54529
|
);
|
|
54465
54530
|
}
|
|
54466
54531
|
}
|
|
@@ -55111,7 +55176,7 @@ function createTypeChecker(host) {
|
|
|
55111
55176
|
)])
|
|
55112
55177
|
),
|
|
55113
55178
|
factory.createStringLiteral(specifier2),
|
|
55114
|
-
/*
|
|
55179
|
+
/*attributes*/
|
|
55115
55180
|
void 0
|
|
55116
55181
|
),
|
|
55117
55182
|
0 /* None */
|
|
@@ -55199,7 +55264,7 @@ function createTypeChecker(host) {
|
|
|
55199
55264
|
void 0
|
|
55200
55265
|
),
|
|
55201
55266
|
specifier2,
|
|
55202
|
-
node.parent.
|
|
55267
|
+
node.parent.attributes
|
|
55203
55268
|
),
|
|
55204
55269
|
0 /* None */
|
|
55205
55270
|
);
|
|
@@ -55220,7 +55285,7 @@ function createTypeChecker(host) {
|
|
|
55220
55285
|
factory.createNamespaceImport(factory.createIdentifier(localName))
|
|
55221
55286
|
),
|
|
55222
55287
|
specifier2,
|
|
55223
|
-
node.parent.
|
|
55288
|
+
node.parent.attributes
|
|
55224
55289
|
),
|
|
55225
55290
|
0 /* None */
|
|
55226
55291
|
);
|
|
@@ -55261,7 +55326,7 @@ function createTypeChecker(host) {
|
|
|
55261
55326
|
])
|
|
55262
55327
|
),
|
|
55263
55328
|
specifier2,
|
|
55264
|
-
node.parent.parent.parent.
|
|
55329
|
+
node.parent.parent.parent.attributes
|
|
55265
55330
|
),
|
|
55266
55331
|
0 /* None */
|
|
55267
55332
|
);
|
|
@@ -80499,16 +80564,16 @@ function createTypeChecker(host) {
|
|
|
80499
80564
|
getTypeFromTypeNode(node);
|
|
80500
80565
|
}
|
|
80501
80566
|
function checkImportType(node) {
|
|
80567
|
+
var _a, _b;
|
|
80502
80568
|
checkSourceElement(node.argument);
|
|
80503
|
-
if (node.
|
|
80504
|
-
const override =
|
|
80505
|
-
|
|
80506
|
-
|
|
80507
|
-
|
|
80508
|
-
|
|
80509
|
-
|
|
80510
|
-
|
|
80511
|
-
}
|
|
80569
|
+
if (node.attributes) {
|
|
80570
|
+
const override = getResolutionModeOverride((_a = node.attributes) == null ? void 0 : _a.attributes, grammarErrorOnNode);
|
|
80571
|
+
const errorNode = (_b = node.attributes) == null ? void 0 : _b.attributes;
|
|
80572
|
+
if (override && errorNode && getEmitModuleResolutionKind(compilerOptions) !== 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) !== 99 /* NodeNext */) {
|
|
80573
|
+
grammarErrorOnNode(
|
|
80574
|
+
errorNode,
|
|
80575
|
+
node.attributes.attributes.token === 118 /* WithKeyword */ ? Diagnostics.resolution_mode_attribute_are_only_supported_when_moduleResolution_is_node16_or_nodenext : Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext
|
|
80576
|
+
);
|
|
80512
80577
|
}
|
|
80513
80578
|
}
|
|
80514
80579
|
checkTypeReferenceOrImport(node);
|
|
@@ -84473,12 +84538,13 @@ function createTypeChecker(host) {
|
|
|
84473
84538
|
return false;
|
|
84474
84539
|
}
|
|
84475
84540
|
}
|
|
84476
|
-
if (!isImportEqualsDeclaration(node) && node.
|
|
84541
|
+
if (!isImportEqualsDeclaration(node) && node.attributes) {
|
|
84542
|
+
const diagnostic = node.attributes.token === 118 /* WithKeyword */ ? Diagnostics.Import_attribute_values_must_be_string_literal_expressions : Diagnostics.Import_assertion_values_must_be_string_literal_expressions;
|
|
84477
84543
|
let hasError = false;
|
|
84478
|
-
for (const
|
|
84479
|
-
if (!isStringLiteral(
|
|
84544
|
+
for (const attr of node.attributes.elements) {
|
|
84545
|
+
if (!isStringLiteral(attr.value)) {
|
|
84480
84546
|
hasError = true;
|
|
84481
|
-
error2(
|
|
84547
|
+
error2(attr.value, diagnostic);
|
|
84482
84548
|
}
|
|
84483
84549
|
}
|
|
84484
84550
|
return !hasError;
|
|
@@ -84610,32 +84676,35 @@ function createTypeChecker(host) {
|
|
|
84610
84676
|
checkExternalEmitHelpers(node, 131072 /* ImportDefault */);
|
|
84611
84677
|
}
|
|
84612
84678
|
}
|
|
84613
|
-
function
|
|
84679
|
+
function checkImportAttributes(declaration) {
|
|
84614
84680
|
var _a;
|
|
84615
|
-
if (declaration.
|
|
84616
|
-
|
|
84617
|
-
|
|
84618
|
-
|
|
84619
|
-
|
|
84620
|
-
|
|
84621
|
-
|
|
84681
|
+
if (declaration.attributes && declaration.attributes.token === 132 /* AssertKeyword */) {
|
|
84682
|
+
grammarErrorOnFirstToken(declaration.attributes, Diagnostics.The_assert_keyword_in_import_attributes_is_deprecated_and_has_been_replaced_by_the_with_keyword);
|
|
84683
|
+
}
|
|
84684
|
+
const node = declaration.attributes;
|
|
84685
|
+
if (node) {
|
|
84686
|
+
const validForTypeAttributes = isExclusivelyTypeOnlyImportOrExport(declaration);
|
|
84687
|
+
const override = getResolutionModeOverride(node, validForTypeAttributes ? grammarErrorOnNode : void 0);
|
|
84688
|
+
const isImportAttributes2 = declaration.attributes.token === 118 /* WithKeyword */;
|
|
84689
|
+
if (validForTypeAttributes && override) {
|
|
84622
84690
|
if (getEmitModuleResolutionKind(compilerOptions) !== 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) !== 99 /* NodeNext */) {
|
|
84623
|
-
return grammarErrorOnNode(
|
|
84691
|
+
return grammarErrorOnNode(
|
|
84692
|
+
node,
|
|
84693
|
+
isImportAttributes2 ? Diagnostics.resolution_mode_attribute_are_only_supported_when_moduleResolution_is_node16_or_nodenext : Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext
|
|
84694
|
+
);
|
|
84624
84695
|
}
|
|
84625
84696
|
return;
|
|
84626
84697
|
}
|
|
84627
84698
|
const mode = moduleKind === 199 /* NodeNext */ && declaration.moduleSpecifier && getUsageModeForExpression(declaration.moduleSpecifier);
|
|
84628
84699
|
if (mode !== 99 /* ESNext */ && moduleKind !== 99 /* ESNext */) {
|
|
84629
|
-
|
|
84630
|
-
|
|
84631
|
-
moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_assertions_are_not_allowed_on_statements_that_transpile_to_CommonJS_require_calls : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext
|
|
84632
|
-
);
|
|
84700
|
+
const message = isImportAttributes2 ? moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_attributes_are_not_allowed_on_statements_that_transpile_to_CommonJS_require_calls : Diagnostics.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext : moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_assertions_are_not_allowed_on_statements_that_transpile_to_CommonJS_require_calls : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext;
|
|
84701
|
+
return grammarErrorOnNode(node, message);
|
|
84633
84702
|
}
|
|
84634
84703
|
if (isImportDeclaration(declaration) ? (_a = declaration.importClause) == null ? void 0 : _a.isTypeOnly : declaration.isTypeOnly) {
|
|
84635
|
-
return grammarErrorOnNode(
|
|
84704
|
+
return grammarErrorOnNode(node, isImportAttributes2 ? Diagnostics.Import_attributes_cannot_be_used_with_type_only_imports_or_exports : Diagnostics.Import_assertions_cannot_be_used_with_type_only_imports_or_exports);
|
|
84636
84705
|
}
|
|
84637
84706
|
if (override) {
|
|
84638
|
-
return grammarErrorOnNode(
|
|
84707
|
+
return grammarErrorOnNode(node, Diagnostics.resolution_mode_can_only_be_set_for_type_only_imports);
|
|
84639
84708
|
}
|
|
84640
84709
|
}
|
|
84641
84710
|
}
|
|
@@ -84667,7 +84736,7 @@ function createTypeChecker(host) {
|
|
|
84667
84736
|
}
|
|
84668
84737
|
}
|
|
84669
84738
|
}
|
|
84670
|
-
|
|
84739
|
+
checkImportAttributes(node);
|
|
84671
84740
|
}
|
|
84672
84741
|
function checkImportEqualsDeclaration(node) {
|
|
84673
84742
|
if (checkGrammarModuleElementContext(node, isInJSFile(node) ? Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module : Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) {
|
|
@@ -84740,7 +84809,7 @@ function createTypeChecker(host) {
|
|
|
84740
84809
|
}
|
|
84741
84810
|
}
|
|
84742
84811
|
}
|
|
84743
|
-
|
|
84812
|
+
checkImportAttributes(node);
|
|
84744
84813
|
}
|
|
84745
84814
|
function checkGrammarExportDeclaration(node) {
|
|
84746
84815
|
var _a;
|
|
@@ -88530,12 +88599,12 @@ function createTypeChecker(host) {
|
|
|
88530
88599
|
if (moduleKind !== 99 /* ESNext */ && moduleKind !== 199 /* NodeNext */ && moduleKind !== 100 /* Node16 */) {
|
|
88531
88600
|
checkGrammarForDisallowedTrailingComma(nodeArguments);
|
|
88532
88601
|
if (nodeArguments.length > 1) {
|
|
88533
|
-
const
|
|
88534
|
-
return grammarErrorOnNode(
|
|
88602
|
+
const importAttributesArgument = nodeArguments[1];
|
|
88603
|
+
return grammarErrorOnNode(importAttributesArgument, Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext);
|
|
88535
88604
|
}
|
|
88536
88605
|
}
|
|
88537
88606
|
if (nodeArguments.length === 0 || nodeArguments.length > 2) {
|
|
88538
|
-
return grammarErrorOnNode(node, Diagnostics.
|
|
88607
|
+
return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments);
|
|
88539
88608
|
}
|
|
88540
88609
|
const spreadElement = find(nodeArguments, isSpreadElement);
|
|
88541
88610
|
if (spreadElement) {
|
|
@@ -88802,13 +88871,6 @@ var SymbolTrackerImpl = class _SymbolTrackerImpl {
|
|
|
88802
88871
|
this.inner.reportNonSerializableProperty(propertyName);
|
|
88803
88872
|
}
|
|
88804
88873
|
}
|
|
88805
|
-
reportImportTypeNodeResolutionModeOverride() {
|
|
88806
|
-
var _a;
|
|
88807
|
-
if ((_a = this.inner) == null ? void 0 : _a.reportImportTypeNodeResolutionModeOverride) {
|
|
88808
|
-
this.onDiagnosticReported();
|
|
88809
|
-
this.inner.reportImportTypeNodeResolutionModeOverride();
|
|
88810
|
-
}
|
|
88811
|
-
}
|
|
88812
88874
|
onDiagnosticReported() {
|
|
88813
88875
|
this.context.reportedDiagnostic = true;
|
|
88814
88876
|
}
|
|
@@ -89317,16 +89379,16 @@ var visitEachChildTable = {
|
|
|
89317
89379
|
return context.factory.updateImportTypeNode(
|
|
89318
89380
|
node,
|
|
89319
89381
|
Debug.checkDefined(nodeVisitor(node.argument, visitor, isTypeNode)),
|
|
89320
|
-
nodeVisitor(node.
|
|
89382
|
+
nodeVisitor(node.attributes, visitor, isImportTypeAttributes),
|
|
89321
89383
|
nodeVisitor(node.qualifier, visitor, isEntityName),
|
|
89322
89384
|
nodesVisitor(node.typeArguments, visitor, isTypeNode),
|
|
89323
89385
|
node.isTypeOf
|
|
89324
89386
|
);
|
|
89325
89387
|
},
|
|
89326
|
-
[302 /*
|
|
89327
|
-
return context.factory.
|
|
89388
|
+
[302 /* ImportTypeAttributes */]: function visitEachChildOfImportTypeAttributes(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
89389
|
+
return context.factory.updateImportTypeAttributes(
|
|
89328
89390
|
node,
|
|
89329
|
-
Debug.checkDefined(nodeVisitor(node.
|
|
89391
|
+
Debug.checkDefined(nodeVisitor(node.attributes, visitor, isImportAttributes)),
|
|
89330
89392
|
node.multiLine
|
|
89331
89393
|
);
|
|
89332
89394
|
},
|
|
@@ -89868,20 +89930,20 @@ var visitEachChildTable = {
|
|
|
89868
89930
|
nodesVisitor(node.modifiers, visitor, isModifierLike),
|
|
89869
89931
|
nodeVisitor(node.importClause, visitor, isImportClause),
|
|
89870
89932
|
Debug.checkDefined(nodeVisitor(node.moduleSpecifier, visitor, isExpression)),
|
|
89871
|
-
nodeVisitor(node.
|
|
89933
|
+
nodeVisitor(node.attributes, visitor, isImportAttributes)
|
|
89872
89934
|
);
|
|
89873
89935
|
},
|
|
89874
|
-
[300 /*
|
|
89875
|
-
return context.factory.
|
|
89936
|
+
[300 /* ImportAttributes */]: function visitEachChildOfImportAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
89937
|
+
return context.factory.updateImportAttributes(
|
|
89876
89938
|
node,
|
|
89877
|
-
nodesVisitor(node.elements, visitor,
|
|
89939
|
+
nodesVisitor(node.elements, visitor, isImportAttribute),
|
|
89878
89940
|
node.multiLine
|
|
89879
89941
|
);
|
|
89880
89942
|
},
|
|
89881
|
-
[301 /*
|
|
89882
|
-
return context.factory.
|
|
89943
|
+
[301 /* ImportAttribute */]: function visitEachChildOfImportAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
89944
|
+
return context.factory.updateImportAttribute(
|
|
89883
89945
|
node,
|
|
89884
|
-
Debug.checkDefined(nodeVisitor(node.name, visitor,
|
|
89946
|
+
Debug.checkDefined(nodeVisitor(node.name, visitor, isImportAttributeName)),
|
|
89885
89947
|
Debug.checkDefined(nodeVisitor(node.value, visitor, isExpression))
|
|
89886
89948
|
);
|
|
89887
89949
|
},
|
|
@@ -89933,7 +89995,7 @@ var visitEachChildTable = {
|
|
|
89933
89995
|
node.isTypeOnly,
|
|
89934
89996
|
nodeVisitor(node.exportClause, visitor, isNamedExportBindings),
|
|
89935
89997
|
nodeVisitor(node.moduleSpecifier, visitor, isExpression),
|
|
89936
|
-
nodeVisitor(node.
|
|
89998
|
+
nodeVisitor(node.attributes, visitor, isImportAttributes)
|
|
89937
89999
|
);
|
|
89938
90000
|
},
|
|
89939
90001
|
[279 /* NamedExports */]: function visitEachChildOfNamedExports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
@@ -93423,7 +93485,7 @@ function transformTypeScript(context) {
|
|
|
93423
93485
|
void 0,
|
|
93424
93486
|
importClause,
|
|
93425
93487
|
node.moduleSpecifier,
|
|
93426
|
-
node.
|
|
93488
|
+
node.attributes
|
|
93427
93489
|
) : void 0;
|
|
93428
93490
|
}
|
|
93429
93491
|
function visitImportClause(node) {
|
|
@@ -93473,7 +93535,7 @@ function transformTypeScript(context) {
|
|
|
93473
93535
|
node.isTypeOnly,
|
|
93474
93536
|
exportClause,
|
|
93475
93537
|
node.moduleSpecifier,
|
|
93476
|
-
node.
|
|
93538
|
+
node.attributes
|
|
93477
93539
|
) : void 0;
|
|
93478
93540
|
}
|
|
93479
93541
|
function visitNamedExports(node, allowEmpty) {
|
|
@@ -93507,7 +93569,7 @@ function transformTypeScript(context) {
|
|
|
93507
93569
|
/*importClause*/
|
|
93508
93570
|
void 0,
|
|
93509
93571
|
node.moduleReference.expression,
|
|
93510
|
-
/*
|
|
93572
|
+
/*attributes*/
|
|
93511
93573
|
void 0
|
|
93512
93574
|
),
|
|
93513
93575
|
node
|
|
@@ -101677,7 +101739,7 @@ function transformJsx(context) {
|
|
|
101677
101739
|
factory2.createNamedImports(arrayFrom(importSpecifiersMap.values()))
|
|
101678
101740
|
),
|
|
101679
101741
|
factory2.createStringLiteral(importSource),
|
|
101680
|
-
/*
|
|
101742
|
+
/*attributes*/
|
|
101681
101743
|
void 0
|
|
101682
101744
|
);
|
|
101683
101745
|
setParentRecursive(
|
|
@@ -111084,7 +111146,9 @@ function transformECMAScriptModule(context) {
|
|
|
111084
111146
|
)
|
|
111085
111147
|
])
|
|
111086
111148
|
),
|
|
111087
|
-
factory2.createStringLiteral("module")
|
|
111149
|
+
factory2.createStringLiteral("module"),
|
|
111150
|
+
/*attributes*/
|
|
111151
|
+
void 0
|
|
111088
111152
|
);
|
|
111089
111153
|
const requireHelperName = factory2.createUniqueName("__require", 16 /* Optimistic */ | 32 /* FileLevel */);
|
|
111090
111154
|
const requireStatement = factory2.createVariableStatement(
|
|
@@ -111201,7 +111265,7 @@ function transformECMAScriptModule(context) {
|
|
|
111201
111265
|
)
|
|
111202
111266
|
),
|
|
111203
111267
|
node.moduleSpecifier,
|
|
111204
|
-
node.
|
|
111268
|
+
node.attributes
|
|
111205
111269
|
);
|
|
111206
111270
|
setOriginalNode(importDecl, node.exportClause);
|
|
111207
111271
|
const exportDecl = isExportNamespaceAsDefaultDeclaration(node) ? factory2.createExportDefault(synthName) : factory2.createExportDeclaration(
|
|
@@ -111654,8 +111718,7 @@ function transformDeclarations(context) {
|
|
|
111654
111718
|
trackReferencedAmbientModule,
|
|
111655
111719
|
trackExternalModuleSymbolOfImportTypeNode,
|
|
111656
111720
|
reportNonlocalAugmentation,
|
|
111657
|
-
reportNonSerializableProperty
|
|
111658
|
-
reportImportTypeNodeResolutionModeOverride
|
|
111721
|
+
reportNonSerializableProperty
|
|
111659
111722
|
};
|
|
111660
111723
|
let errorNameNode;
|
|
111661
111724
|
let errorFallbackNode;
|
|
@@ -111779,11 +111842,6 @@ function transformDeclarations(context) {
|
|
|
111779
111842
|
context.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized, propertyName));
|
|
111780
111843
|
}
|
|
111781
111844
|
}
|
|
111782
|
-
function reportImportTypeNodeResolutionModeOverride() {
|
|
111783
|
-
if (!isNightly() && (errorNameNode || errorFallbackNode)) {
|
|
111784
|
-
context.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_feature_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next));
|
|
111785
|
-
}
|
|
111786
|
-
}
|
|
111787
111845
|
function transformDeclarationsForJS(sourceFile, bundled) {
|
|
111788
111846
|
const oldDiag = getSymbolAccessibilityDiagnostic;
|
|
111789
111847
|
getSymbolAccessibilityDiagnostic = (s) => s.errorNode && canProduceDiagnostics(s.errorNode) ? createGetSymbolAccessibilityDiagnosticForNode(s.errorNode)(s) : {
|
|
@@ -112288,7 +112346,7 @@ function transformDeclarations(context) {
|
|
|
112288
112346
|
decl.modifiers,
|
|
112289
112347
|
decl.importClause,
|
|
112290
112348
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
112291
|
-
|
|
112349
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
112292
112350
|
);
|
|
112293
112351
|
}
|
|
112294
112352
|
const visibleDefaultBinding = decl.importClause && decl.importClause.name && resolver.isDeclarationVisible(decl.importClause) ? decl.importClause.name : void 0;
|
|
@@ -112304,7 +112362,7 @@ function transformDeclarations(context) {
|
|
|
112304
112362
|
void 0
|
|
112305
112363
|
),
|
|
112306
112364
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
112307
|
-
|
|
112365
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
112308
112366
|
);
|
|
112309
112367
|
}
|
|
112310
112368
|
if (decl.importClause.namedBindings.kind === 274 /* NamespaceImport */) {
|
|
@@ -112322,7 +112380,7 @@ function transformDeclarations(context) {
|
|
|
112322
112380
|
namedBindings
|
|
112323
112381
|
),
|
|
112324
112382
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
112325
|
-
|
|
112383
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
112326
112384
|
) : void 0;
|
|
112327
112385
|
}
|
|
112328
112386
|
const bindingList = mapDefined(decl.importClause.namedBindings.elements, (b) => resolver.isDeclarationVisible(b) ? b : void 0);
|
|
@@ -112337,7 +112395,7 @@ function transformDeclarations(context) {
|
|
|
112337
112395
|
bindingList && bindingList.length ? factory2.updateNamedImports(decl.importClause.namedBindings, bindingList) : void 0
|
|
112338
112396
|
),
|
|
112339
112397
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
112340
|
-
|
|
112398
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
112341
112399
|
);
|
|
112342
112400
|
}
|
|
112343
112401
|
if (resolver.isImportRequiredByAugmentation(decl)) {
|
|
@@ -112347,19 +112405,13 @@ function transformDeclarations(context) {
|
|
|
112347
112405
|
/*importClause*/
|
|
112348
112406
|
void 0,
|
|
112349
112407
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
112350
|
-
|
|
112408
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
112351
112409
|
);
|
|
112352
112410
|
}
|
|
112353
112411
|
}
|
|
112354
|
-
function
|
|
112355
|
-
const mode =
|
|
112356
|
-
|
|
112357
|
-
if (!isNightly()) {
|
|
112358
|
-
context.addDiagnostic(createDiagnosticForNode(assertClause, Diagnostics.resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next));
|
|
112359
|
-
}
|
|
112360
|
-
return assertClause;
|
|
112361
|
-
}
|
|
112362
|
-
return void 0;
|
|
112412
|
+
function tryGetResolutionModeOverride(node) {
|
|
112413
|
+
const mode = getResolutionModeOverride(node);
|
|
112414
|
+
return node && mode !== void 0 ? node : void 0;
|
|
112363
112415
|
}
|
|
112364
112416
|
function transformAndReplaceLatePaintedStatements(statements) {
|
|
112365
112417
|
while (length(lateMarkedStatements)) {
|
|
@@ -112645,7 +112697,7 @@ function transformDeclarations(context) {
|
|
|
112645
112697
|
return cleanup(factory2.updateImportTypeNode(
|
|
112646
112698
|
input,
|
|
112647
112699
|
factory2.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)),
|
|
112648
|
-
input.
|
|
112700
|
+
input.attributes,
|
|
112649
112701
|
input.qualifier,
|
|
112650
112702
|
visitNodes2(input.typeArguments, visitDeclarationSubtree, isTypeNode),
|
|
112651
112703
|
input.isTypeOf
|
|
@@ -112699,7 +112751,7 @@ function transformDeclarations(context) {
|
|
|
112699
112751
|
input.isTypeOnly,
|
|
112700
112752
|
input.exportClause,
|
|
112701
112753
|
rewriteModuleSpecifier(input, input.moduleSpecifier),
|
|
112702
|
-
|
|
112754
|
+
tryGetResolutionModeOverride(input.attributes)
|
|
112703
112755
|
);
|
|
112704
112756
|
}
|
|
112705
112757
|
case 277 /* ExportAssignment */: {
|
|
@@ -115203,10 +115255,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
115203
115255
|
return emitNamedExports(node);
|
|
115204
115256
|
case 281 /* ExportSpecifier */:
|
|
115205
115257
|
return emitExportSpecifier(node);
|
|
115206
|
-
case 300 /*
|
|
115207
|
-
return
|
|
115208
|
-
case 301 /*
|
|
115209
|
-
return
|
|
115258
|
+
case 300 /* ImportAttributes */:
|
|
115259
|
+
return emitImportAttributes(node);
|
|
115260
|
+
case 301 /* ImportAttribute */:
|
|
115261
|
+
return emitImportAttribute(node);
|
|
115210
115262
|
case 282 /* MissingDeclaration */:
|
|
115211
115263
|
return;
|
|
115212
115264
|
case 283 /* ExternalModuleReference */:
|
|
@@ -115981,16 +116033,16 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
115981
116033
|
writeKeyword("import");
|
|
115982
116034
|
writePunctuation("(");
|
|
115983
116035
|
emit(node.argument);
|
|
115984
|
-
if (node.
|
|
116036
|
+
if (node.attributes) {
|
|
115985
116037
|
writePunctuation(",");
|
|
115986
116038
|
writeSpace();
|
|
115987
116039
|
writePunctuation("{");
|
|
115988
116040
|
writeSpace();
|
|
115989
|
-
writeKeyword("assert");
|
|
116041
|
+
writeKeyword(node.attributes.attributes.token === 132 /* AssertKeyword */ ? "assert" : "with");
|
|
115990
116042
|
writePunctuation(":");
|
|
115991
116043
|
writeSpace();
|
|
115992
|
-
const elements = node.
|
|
115993
|
-
emitList(node.
|
|
116044
|
+
const elements = node.attributes.attributes.elements;
|
|
116045
|
+
emitList(node.attributes.attributes, elements, 526226 /* ImportAttributes */);
|
|
115994
116046
|
writeSpace();
|
|
115995
116047
|
writePunctuation("}");
|
|
115996
116048
|
}
|
|
@@ -116975,8 +117027,8 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
116975
117027
|
writeSpace();
|
|
116976
117028
|
}
|
|
116977
117029
|
emitExpression(node.moduleSpecifier);
|
|
116978
|
-
if (node.
|
|
116979
|
-
emitWithLeadingSpace(node.
|
|
117030
|
+
if (node.attributes) {
|
|
117031
|
+
emitWithLeadingSpace(node.attributes);
|
|
116980
117032
|
}
|
|
116981
117033
|
writeTrailingSemicolon();
|
|
116982
117034
|
}
|
|
@@ -117045,18 +117097,18 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
117045
117097
|
writeSpace();
|
|
117046
117098
|
emitExpression(node.moduleSpecifier);
|
|
117047
117099
|
}
|
|
117048
|
-
if (node.
|
|
117049
|
-
emitWithLeadingSpace(node.
|
|
117100
|
+
if (node.attributes) {
|
|
117101
|
+
emitWithLeadingSpace(node.attributes);
|
|
117050
117102
|
}
|
|
117051
117103
|
writeTrailingSemicolon();
|
|
117052
117104
|
}
|
|
117053
|
-
function
|
|
117054
|
-
emitTokenWithComment(
|
|
117105
|
+
function emitImportAttributes(node) {
|
|
117106
|
+
emitTokenWithComment(node.token, node.pos, writeKeyword, node);
|
|
117055
117107
|
writeSpace();
|
|
117056
117108
|
const elements = node.elements;
|
|
117057
|
-
emitList(node, elements, 526226 /*
|
|
117109
|
+
emitList(node, elements, 526226 /* ImportAttributes */);
|
|
117058
117110
|
}
|
|
117059
|
-
function
|
|
117111
|
+
function emitImportAttribute(node) {
|
|
117060
117112
|
emit(node.name);
|
|
117061
117113
|
writePunctuation(":");
|
|
117062
117114
|
writeSpace();
|
|
@@ -119796,7 +119848,7 @@ function computeCommonSourceDirectoryOfFilenames(fileNames, currentDirectory, ge
|
|
|
119796
119848
|
function createCompilerHost(options, setParentNodes) {
|
|
119797
119849
|
return createCompilerHostWorker(options, setParentNodes);
|
|
119798
119850
|
}
|
|
119799
|
-
function createGetSourceFile(readFile, getCompilerOptions, setParentNodes
|
|
119851
|
+
function createGetSourceFile(readFile, getCompilerOptions, setParentNodes) {
|
|
119800
119852
|
return (fileName, languageVersionOrOptions, onError) => {
|
|
119801
119853
|
let text;
|
|
119802
119854
|
try {
|
|
@@ -119810,15 +119862,7 @@ function createGetSourceFile(readFile, getCompilerOptions, setParentNodes, skipN
|
|
|
119810
119862
|
}
|
|
119811
119863
|
text = "";
|
|
119812
119864
|
}
|
|
119813
|
-
return text !== void 0 ? createSourceFile(
|
|
119814
|
-
fileName,
|
|
119815
|
-
text,
|
|
119816
|
-
languageVersionOrOptions,
|
|
119817
|
-
setParentNodes,
|
|
119818
|
-
/*scriptKind*/
|
|
119819
|
-
void 0,
|
|
119820
|
-
skipNonSemanticJSDocParsing
|
|
119821
|
-
) : void 0;
|
|
119865
|
+
return text !== void 0 ? createSourceFile(fileName, text, languageVersionOrOptions, setParentNodes) : void 0;
|
|
119822
119866
|
};
|
|
119823
119867
|
}
|
|
119824
119868
|
function createWriteFileMeasuringIO(actualWriteFile, createDirectory, directoryExists) {
|
|
@@ -119842,7 +119886,7 @@ function createWriteFileMeasuringIO(actualWriteFile, createDirectory, directoryE
|
|
|
119842
119886
|
}
|
|
119843
119887
|
};
|
|
119844
119888
|
}
|
|
119845
|
-
function createCompilerHostWorker(options, setParentNodes,
|
|
119889
|
+
function createCompilerHostWorker(options, setParentNodes, system = sys) {
|
|
119846
119890
|
const existingDirectories = /* @__PURE__ */ new Map();
|
|
119847
119891
|
const getCanonicalFileName = createGetCanonicalFileName(system.useCaseSensitiveFileNames);
|
|
119848
119892
|
function directoryExists(directoryPath) {
|
|
@@ -119861,7 +119905,7 @@ function createCompilerHostWorker(options, setParentNodes, skipNonSemanticJSDocP
|
|
|
119861
119905
|
const newLine = getNewLineCharacter(options);
|
|
119862
119906
|
const realpath = system.realpath && ((path) => system.realpath(path));
|
|
119863
119907
|
const compilerHost = {
|
|
119864
|
-
getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes
|
|
119908
|
+
getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes),
|
|
119865
119909
|
getDefaultLibLocation,
|
|
119866
119910
|
getDefaultLibFileName: (options2) => combinePaths(getDefaultLibLocation(), getDefaultLibFileName(options2)),
|
|
119867
119911
|
writeFile: createWriteFileMeasuringIO(
|
|
@@ -120172,14 +120216,14 @@ function getModeForUsageLocation(file, usage) {
|
|
|
120172
120216
|
if (isImportDeclaration(usage.parent) || isExportDeclaration(usage.parent)) {
|
|
120173
120217
|
const isTypeOnly = isExclusivelyTypeOnlyImportOrExport(usage.parent);
|
|
120174
120218
|
if (isTypeOnly) {
|
|
120175
|
-
const override =
|
|
120219
|
+
const override = getResolutionModeOverride(usage.parent.attributes);
|
|
120176
120220
|
if (override) {
|
|
120177
120221
|
return override;
|
|
120178
120222
|
}
|
|
120179
120223
|
}
|
|
120180
120224
|
}
|
|
120181
120225
|
if (usage.parent.parent && isImportTypeNode(usage.parent.parent)) {
|
|
120182
|
-
const override =
|
|
120226
|
+
const override = getResolutionModeOverride((_a = usage.parent.parent.attributes) == null ? void 0 : _a.attributes);
|
|
120183
120227
|
if (override) {
|
|
120184
120228
|
return override;
|
|
120185
120229
|
}
|
|
@@ -120190,18 +120234,24 @@ function getModeForUsageLocation(file, usage) {
|
|
|
120190
120234
|
const exprParentParent = (_b = walkUpParenthesizedExpressions(usage.parent)) == null ? void 0 : _b.parent;
|
|
120191
120235
|
return exprParentParent && isImportEqualsDeclaration(exprParentParent) ? 1 /* CommonJS */ : 99 /* ESNext */;
|
|
120192
120236
|
}
|
|
120193
|
-
function
|
|
120194
|
-
if (!
|
|
120237
|
+
function getResolutionModeOverride(node, grammarErrorOnNode) {
|
|
120238
|
+
if (!node)
|
|
120195
120239
|
return void 0;
|
|
120196
|
-
if (length(
|
|
120197
|
-
grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(
|
|
120240
|
+
if (length(node.elements) !== 1) {
|
|
120241
|
+
grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(
|
|
120242
|
+
node,
|
|
120243
|
+
node.token === 118 /* WithKeyword */ ? Diagnostics.Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require : Diagnostics.Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require
|
|
120244
|
+
);
|
|
120198
120245
|
return void 0;
|
|
120199
120246
|
}
|
|
120200
|
-
const elem =
|
|
120247
|
+
const elem = node.elements[0];
|
|
120201
120248
|
if (!isStringLiteralLike(elem.name))
|
|
120202
120249
|
return void 0;
|
|
120203
120250
|
if (elem.name.text !== "resolution-mode") {
|
|
120204
|
-
grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(
|
|
120251
|
+
grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(
|
|
120252
|
+
elem.name,
|
|
120253
|
+
node.token === 118 /* WithKeyword */ ? Diagnostics.resolution_mode_is_the_only_valid_key_for_type_import_attributes : Diagnostics.resolution_mode_is_the_only_valid_key_for_type_import_assertions
|
|
120254
|
+
);
|
|
120205
120255
|
return void 0;
|
|
120206
120256
|
}
|
|
120207
120257
|
if (!isStringLiteralLike(elem.value))
|
|
@@ -120345,14 +120395,14 @@ function isReferenceFileLocation(location) {
|
|
|
120345
120395
|
return location.pos !== void 0;
|
|
120346
120396
|
}
|
|
120347
120397
|
function getReferencedFileLocation(program, ref) {
|
|
120348
|
-
var _a, _b, _c, _d
|
|
120398
|
+
var _a, _b, _c, _d;
|
|
120349
120399
|
const file = Debug.checkDefined(program.getSourceFileByPath(ref.file));
|
|
120350
120400
|
const { kind, index } = ref;
|
|
120351
120401
|
let pos, end, packageId, resolutionMode;
|
|
120352
120402
|
switch (kind) {
|
|
120353
120403
|
case 3 /* Import */:
|
|
120354
120404
|
const importLiteral = getModuleNameStringLiteralAt(file, index);
|
|
120355
|
-
packageId = (
|
|
120405
|
+
packageId = (_b = (_a = program.getResolvedModule(file, importLiteral.text, getModeForResolutionAtIndex(file, index))) == null ? void 0 : _a.resolvedModule) == null ? void 0 : _b.packageId;
|
|
120356
120406
|
if (importLiteral.pos === -1)
|
|
120357
120407
|
return { file, packageId, text: importLiteral.text };
|
|
120358
120408
|
pos = skipTrivia(file.text, importLiteral.pos);
|
|
@@ -120363,7 +120413,7 @@ function getReferencedFileLocation(program, ref) {
|
|
|
120363
120413
|
break;
|
|
120364
120414
|
case 5 /* TypeReferenceDirective */:
|
|
120365
120415
|
({ pos, end, resolutionMode } = file.typeReferenceDirectives[index]);
|
|
120366
|
-
packageId = (
|
|
120416
|
+
packageId = (_d = (_c = program.getResolvedTypeReferenceDirective(file, toFileNameLowerCase(file.typeReferenceDirectives[index].fileName), resolutionMode || file.impliedNodeFormat)) == null ? void 0 : _c.resolvedTypeReferenceDirective) == null ? void 0 : _d.packageId;
|
|
120367
120417
|
break;
|
|
120368
120418
|
case 7 /* LibReferenceDirective */:
|
|
120369
120419
|
({ pos, end } = file.libReferenceDirectives[index]);
|
|
@@ -120500,7 +120550,7 @@ var plainJSErrors = /* @__PURE__ */ new Set([
|
|
|
120500
120550
|
Diagnostics.Classes_may_not_have_a_field_named_constructor.code,
|
|
120501
120551
|
Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code,
|
|
120502
120552
|
Diagnostics.Duplicate_label_0.code,
|
|
120503
|
-
Diagnostics.
|
|
120553
|
+
Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments.code,
|
|
120504
120554
|
Diagnostics.for_await_loops_cannot_be_used_inside_a_class_static_block.code,
|
|
120505
120555
|
Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code,
|
|
120506
120556
|
Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code,
|
|
@@ -120895,6 +120945,10 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
120895
120945
|
resolvedModules,
|
|
120896
120946
|
resolvedTypeReferenceDirectiveNames,
|
|
120897
120947
|
resolvedLibReferences,
|
|
120948
|
+
getResolvedModule,
|
|
120949
|
+
getResolvedTypeReferenceDirective,
|
|
120950
|
+
forEachResolvedModule,
|
|
120951
|
+
forEachResolvedTypeReferenceDirective,
|
|
120898
120952
|
getCurrentPackagesMap: () => packageMap,
|
|
120899
120953
|
typesPackageExists,
|
|
120900
120954
|
packageBundlesTypes,
|
|
@@ -120938,19 +120992,35 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
120938
120992
|
measure("Program", "beforeProgram", "afterProgram");
|
|
120939
120993
|
(_p = tracing) == null ? void 0 : _p.pop();
|
|
120940
120994
|
return program;
|
|
120995
|
+
function getResolvedModule(file, moduleName, mode) {
|
|
120996
|
+
var _a2;
|
|
120997
|
+
return (_a2 = resolvedModules == null ? void 0 : resolvedModules.get(file.path)) == null ? void 0 : _a2.get(moduleName, mode);
|
|
120998
|
+
}
|
|
120999
|
+
function getResolvedTypeReferenceDirective(file, typeDirectiveName, mode) {
|
|
121000
|
+
var _a2;
|
|
121001
|
+
return (_a2 = resolvedTypeReferenceDirectiveNames == null ? void 0 : resolvedTypeReferenceDirectiveNames.get(file.path)) == null ? void 0 : _a2.get(typeDirectiveName, mode);
|
|
121002
|
+
}
|
|
121003
|
+
function forEachResolvedModule(callback, file) {
|
|
121004
|
+
forEachResolution(resolvedModules, callback, file);
|
|
121005
|
+
}
|
|
121006
|
+
function forEachResolvedTypeReferenceDirective(callback, file) {
|
|
121007
|
+
forEachResolution(resolvedTypeReferenceDirectiveNames, callback, file);
|
|
121008
|
+
}
|
|
121009
|
+
function forEachResolution(resolutionCache, callback, file) {
|
|
121010
|
+
var _a2;
|
|
121011
|
+
if (file)
|
|
121012
|
+
(_a2 = resolutionCache == null ? void 0 : resolutionCache.get(file.path)) == null ? void 0 : _a2.forEach((resolution, name, mode) => callback(resolution, name, mode, file.path));
|
|
121013
|
+
else
|
|
121014
|
+
resolutionCache == null ? void 0 : resolutionCache.forEach((resolutions, filePath) => resolutions.forEach((resolution, name, mode) => callback(resolution, name, mode, filePath)));
|
|
121015
|
+
}
|
|
120941
121016
|
function getPackagesMap() {
|
|
120942
121017
|
if (packageMap)
|
|
120943
121018
|
return packageMap;
|
|
120944
121019
|
packageMap = /* @__PURE__ */ new Map();
|
|
120945
|
-
|
|
120946
|
-
(
|
|
120947
|
-
|
|
120948
|
-
|
|
120949
|
-
if (resolvedModule == null ? void 0 : resolvedModule.packageId)
|
|
120950
|
-
packageMap.set(resolvedModule.packageId.name, resolvedModule.extension === ".d.ts" /* Dts */ || !!packageMap.get(resolvedModule.packageId.name));
|
|
120951
|
-
});
|
|
120952
|
-
}
|
|
120953
|
-
);
|
|
121020
|
+
forEachResolvedModule(({ resolvedModule }) => {
|
|
121021
|
+
if (resolvedModule == null ? void 0 : resolvedModule.packageId)
|
|
121022
|
+
packageMap.set(resolvedModule.packageId.name, resolvedModule.extension === ".d.ts" /* Dts */ || !!packageMap.get(resolvedModule.packageId.name));
|
|
121023
|
+
});
|
|
120954
121024
|
return packageMap;
|
|
120955
121025
|
}
|
|
120956
121026
|
function typesPackageExists(packageName) {
|
|
@@ -121082,7 +121152,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
121082
121152
|
return classifiableNames;
|
|
121083
121153
|
}
|
|
121084
121154
|
function resolveModuleNamesReusingOldState(moduleNames, file) {
|
|
121085
|
-
var _a2, _b2;
|
|
121086
121155
|
if (structureIsReused === 0 /* Not */ && !file.ambientModuleNames.length) {
|
|
121087
121156
|
return resolveModuleNamesWorker(
|
|
121088
121157
|
moduleNames,
|
|
@@ -121100,7 +121169,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
121100
121169
|
const moduleName = moduleNames[i];
|
|
121101
121170
|
if (file === oldSourceFile && !hasInvalidatedResolutions(file.path)) {
|
|
121102
121171
|
const mode = getModeForUsageLocation(file, moduleName);
|
|
121103
|
-
const oldResolution =
|
|
121172
|
+
const oldResolution = oldProgram == null ? void 0 : oldProgram.getResolvedModule(file, moduleName.text, mode);
|
|
121104
121173
|
if (oldResolution == null ? void 0 : oldResolution.resolvedModule) {
|
|
121105
121174
|
if (isTraceEnabled(options, host)) {
|
|
121106
121175
|
trace(
|
|
@@ -121147,8 +121216,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
121147
121216
|
Debug.assert(j === resolutions.length);
|
|
121148
121217
|
return result;
|
|
121149
121218
|
function moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName) {
|
|
121150
|
-
var
|
|
121151
|
-
const resolutionToFile = (
|
|
121219
|
+
var _a2;
|
|
121220
|
+
const resolutionToFile = (_a2 = oldProgram == null ? void 0 : oldProgram.getResolvedModule(file, moduleName.text, getModeForUsageLocation(file, moduleName))) == null ? void 0 : _a2.resolvedModule;
|
|
121152
121221
|
const resolvedFile = resolutionToFile && oldProgram.getSourceFile(resolutionToFile.resolvedFileName);
|
|
121153
121222
|
if (resolutionToFile && resolvedFile) {
|
|
121154
121223
|
return false;
|
|
@@ -121164,7 +121233,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
121164
121233
|
}
|
|
121165
121234
|
}
|
|
121166
121235
|
function resolveTypeReferenceDirectiveNamesReusingOldState(typeDirectiveNames, containingFile) {
|
|
121167
|
-
var _a2
|
|
121236
|
+
var _a2;
|
|
121168
121237
|
if (structureIsReused === 0 /* Not */) {
|
|
121169
121238
|
return resolveTypeReferenceDirectiveNamesWorker(
|
|
121170
121239
|
typeDirectiveNames,
|
|
@@ -121184,7 +121253,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
121184
121253
|
if (canReuseResolutions) {
|
|
121185
121254
|
const typeDirectiveName = getTypeReferenceResolutionName(entry);
|
|
121186
121255
|
const mode = getModeForFileReference(entry, containingSourceFile == null ? void 0 : containingSourceFile.impliedNodeFormat);
|
|
121187
|
-
const oldResolution =
|
|
121256
|
+
const oldResolution = !isString(containingFile) ? oldProgram == null ? void 0 : oldProgram.getResolvedTypeReferenceDirective(containingFile, typeDirectiveName, mode) : (_a2 = oldProgram == null ? void 0 : oldProgram.getAutomaticTypeDirectiveResolutions()) == null ? void 0 : _a2.get(typeDirectiveName, mode);
|
|
121188
121257
|
if (oldResolution == null ? void 0 : oldResolution.resolvedTypeReferenceDirective) {
|
|
121189
121258
|
if (isTraceEnabled(options, host)) {
|
|
121190
121259
|
trace(
|
|
@@ -121244,7 +121313,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
121244
121313
|
);
|
|
121245
121314
|
}
|
|
121246
121315
|
function tryReuseStructureFromOldProgram() {
|
|
121247
|
-
var _a2
|
|
121316
|
+
var _a2;
|
|
121248
121317
|
if (!oldProgram) {
|
|
121249
121318
|
return 0 /* Not */;
|
|
121250
121319
|
}
|
|
@@ -121364,20 +121433,29 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
121364
121433
|
const moduleNames = getModuleNames(newSourceFile);
|
|
121365
121434
|
const resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFile);
|
|
121366
121435
|
(resolvedModulesProcessing ?? (resolvedModulesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, resolutions);
|
|
121367
|
-
const
|
|
121368
|
-
|
|
121436
|
+
const resolutionsChanged = hasChangesInResolutions(
|
|
121437
|
+
moduleNames,
|
|
121438
|
+
newSourceFile,
|
|
121439
|
+
resolutions,
|
|
121440
|
+
(name, mode) => oldProgram.getResolvedModule(newSourceFile, name, mode),
|
|
121441
|
+
moduleResolutionIsEqualTo,
|
|
121442
|
+
moduleResolutionNameAndModeGetter
|
|
121443
|
+
);
|
|
121369
121444
|
if (resolutionsChanged)
|
|
121370
121445
|
structureIsReused = 1 /* SafeModules */;
|
|
121371
121446
|
const typesReferenceDirectives = newSourceFile.typeReferenceDirectives;
|
|
121372
121447
|
const typeReferenceResolutions = resolveTypeReferenceDirectiveNamesReusingOldState(typesReferenceDirectives, newSourceFile);
|
|
121373
121448
|
(resolvedTypeReferenceDirectiveNamesProcessing ?? (resolvedTypeReferenceDirectiveNamesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, typeReferenceResolutions);
|
|
121374
|
-
const
|
|
121375
|
-
|
|
121376
|
-
|
|
121449
|
+
const typeReferenceResolutionsChanged = hasChangesInResolutions(
|
|
121450
|
+
typesReferenceDirectives,
|
|
121451
|
+
newSourceFile,
|
|
121452
|
+
typeReferenceResolutions,
|
|
121453
|
+
(name, mode) => oldProgram == null ? void 0 : oldProgram.getResolvedTypeReferenceDirective(newSourceFile, name, mode),
|
|
121454
|
+
typeDirectiveIsEqualTo,
|
|
121455
|
+
typeReferenceResolutionNameAndModeGetter
|
|
121456
|
+
);
|
|
121457
|
+
if (typeReferenceResolutionsChanged)
|
|
121377
121458
|
structureIsReused = 1 /* SafeModules */;
|
|
121378
|
-
} else if (oldTypeResolutions) {
|
|
121379
|
-
(resolvedTypeReferenceDirectiveNamesProcessing ?? (resolvedTypeReferenceDirectiveNamesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, oldTypeResolutions);
|
|
121380
|
-
}
|
|
121381
121459
|
}
|
|
121382
121460
|
if (structureIsReused !== 2 /* Completely */) {
|
|
121383
121461
|
return structureIsReused;
|
|
@@ -122006,7 +122084,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
122006
122084
|
/*importClause*/
|
|
122007
122085
|
void 0,
|
|
122008
122086
|
externalHelpersModuleReference,
|
|
122009
|
-
/*
|
|
122087
|
+
/*attributes*/
|
|
122010
122088
|
void 0
|
|
122011
122089
|
);
|
|
122012
122090
|
addInternalEmitFlags(importDecl, 2 /* NeverApplyImportHelper */);
|
|
@@ -122247,7 +122325,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
122247
122325
|
const result = getImpliedNodeFormatForFileWorker(getNormalizedAbsolutePath(fileName, currentDirectory), moduleResolutionCache2 == null ? void 0 : moduleResolutionCache2.getPackageJsonInfoCache(), host2, options2);
|
|
122248
122326
|
const languageVersion = getEmitScriptTarget(options2);
|
|
122249
122327
|
const setExternalModuleIndicator2 = getSetExternalModuleIndicator(options2);
|
|
122250
|
-
return typeof result === "object" ? { ...result, languageVersion, setExternalModuleIndicator: setExternalModuleIndicator2 } : { languageVersion, impliedNodeFormat: result, setExternalModuleIndicator: setExternalModuleIndicator2 };
|
|
122328
|
+
return typeof result === "object" ? { ...result, languageVersion, setExternalModuleIndicator: setExternalModuleIndicator2, jsDocParsingMode: host2.jsDocParsingMode } : { languageVersion, impliedNodeFormat: result, setExternalModuleIndicator: setExternalModuleIndicator2, jsDocParsingMode: host2.jsDocParsingMode };
|
|
122251
122329
|
}
|
|
122252
122330
|
function findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId) {
|
|
122253
122331
|
var _a2;
|
|
@@ -123524,7 +123602,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
123524
123602
|
symlinks = createSymlinkCache(currentDirectory, getCanonicalFileName);
|
|
123525
123603
|
}
|
|
123526
123604
|
if (files && !symlinks.hasProcessedResolutions()) {
|
|
123527
|
-
symlinks.setSymlinksFromResolutions(
|
|
123605
|
+
symlinks.setSymlinksFromResolutions(forEachResolvedModule, forEachResolvedTypeReferenceDirective, automaticTypeDirectiveResolutions);
|
|
123528
123606
|
}
|
|
123529
123607
|
return symlinks;
|
|
123530
123608
|
}
|
|
@@ -123886,7 +123964,6 @@ var BuilderState;
|
|
|
123886
123964
|
return toPath(program.getProjectReferenceRedirect(fileName) || fileName, sourceFileDirectory, getCanonicalFileName);
|
|
123887
123965
|
}
|
|
123888
123966
|
function getReferencedFiles(program, sourceFile, getCanonicalFileName) {
|
|
123889
|
-
var _a;
|
|
123890
123967
|
let referencedFiles;
|
|
123891
123968
|
if (sourceFile.imports && sourceFile.imports.length > 0) {
|
|
123892
123969
|
const checker = program.getTypeChecker();
|
|
@@ -123902,17 +123979,14 @@ var BuilderState;
|
|
|
123902
123979
|
addReferencedFile(referencedPath);
|
|
123903
123980
|
}
|
|
123904
123981
|
}
|
|
123905
|
-
|
|
123906
|
-
|
|
123907
|
-
|
|
123908
|
-
|
|
123909
|
-
|
|
123910
|
-
|
|
123911
|
-
|
|
123912
|
-
|
|
123913
|
-
addReferencedFile(typeFilePath);
|
|
123914
|
-
});
|
|
123915
|
-
}
|
|
123982
|
+
program.forEachResolvedTypeReferenceDirective(({ resolvedTypeReferenceDirective }) => {
|
|
123983
|
+
if (!resolvedTypeReferenceDirective) {
|
|
123984
|
+
return;
|
|
123985
|
+
}
|
|
123986
|
+
const fileName = resolvedTypeReferenceDirective.resolvedFileName;
|
|
123987
|
+
const typeFilePath = getReferencedFileFromFileName(program, fileName, sourceFileDirectory, getCanonicalFileName);
|
|
123988
|
+
addReferencedFile(typeFilePath);
|
|
123989
|
+
}, sourceFile);
|
|
123916
123990
|
if (sourceFile.moduleAugmentations.length) {
|
|
123917
123991
|
const checker = program.getTypeChecker();
|
|
123918
123992
|
for (const moduleName of sourceFile.moduleAugmentations) {
|
|
@@ -125657,6 +125731,47 @@ function getRootDirectoryOfResolutionCache(rootDirForResolution, getCurrentDirec
|
|
|
125657
125731
|
function getRootPathSplitLength(rootPath) {
|
|
125658
125732
|
return rootPath.split(directorySeparator).length - (hasTrailingDirectorySeparator(rootPath) ? 1 : 0);
|
|
125659
125733
|
}
|
|
125734
|
+
function createModuleResolutionLoaderUsingGlobalCache(containingFile, redirectedReference, options, resolutionHost, moduleResolutionCache) {
|
|
125735
|
+
return {
|
|
125736
|
+
nameAndMode: moduleResolutionNameAndModeGetter,
|
|
125737
|
+
resolve: (moduleName, resoluionMode) => resolveModuleNameUsingGlobalCache(
|
|
125738
|
+
resolutionHost,
|
|
125739
|
+
moduleResolutionCache,
|
|
125740
|
+
moduleName,
|
|
125741
|
+
containingFile,
|
|
125742
|
+
options,
|
|
125743
|
+
redirectedReference,
|
|
125744
|
+
resoluionMode
|
|
125745
|
+
)
|
|
125746
|
+
};
|
|
125747
|
+
}
|
|
125748
|
+
function resolveModuleNameUsingGlobalCache(resolutionHost, moduleResolutionCache, moduleName, containingFile, compilerOptions, redirectedReference, mode) {
|
|
125749
|
+
var _a;
|
|
125750
|
+
const host = ((_a = resolutionHost.getCompilerHost) == null ? void 0 : _a.call(resolutionHost)) || resolutionHost;
|
|
125751
|
+
const primaryResult = resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference, mode);
|
|
125752
|
+
if (!resolutionHost.getGlobalCache) {
|
|
125753
|
+
return primaryResult;
|
|
125754
|
+
}
|
|
125755
|
+
const globalCache = resolutionHost.getGlobalCache();
|
|
125756
|
+
if (globalCache !== void 0 && !isExternalModuleNameRelative(moduleName) && !(primaryResult.resolvedModule && extensionIsTS(primaryResult.resolvedModule.extension))) {
|
|
125757
|
+
const { resolvedModule, failedLookupLocations, affectingLocations, resolutionDiagnostics } = loadModuleFromGlobalCache(
|
|
125758
|
+
Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName),
|
|
125759
|
+
resolutionHost.projectName,
|
|
125760
|
+
compilerOptions,
|
|
125761
|
+
host,
|
|
125762
|
+
globalCache,
|
|
125763
|
+
moduleResolutionCache
|
|
125764
|
+
);
|
|
125765
|
+
if (resolvedModule) {
|
|
125766
|
+
primaryResult.resolvedModule = resolvedModule;
|
|
125767
|
+
primaryResult.failedLookupLocations = updateResolutionField(primaryResult.failedLookupLocations, failedLookupLocations);
|
|
125768
|
+
primaryResult.affectingLocations = updateResolutionField(primaryResult.affectingLocations, affectingLocations);
|
|
125769
|
+
primaryResult.resolutionDiagnostics = updateResolutionField(primaryResult.resolutionDiagnostics, resolutionDiagnostics);
|
|
125770
|
+
return primaryResult;
|
|
125771
|
+
}
|
|
125772
|
+
}
|
|
125773
|
+
return primaryResult;
|
|
125774
|
+
}
|
|
125660
125775
|
function createResolutionCache(resolutionHost, rootDirForResolution, logChangesWhenResolvingModule) {
|
|
125661
125776
|
let filesWithChangedSetOfUnresolvedImports;
|
|
125662
125777
|
let filesWithInvalidatedResolutions;
|
|
@@ -125703,6 +125818,16 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
125703
125818
|
const rootPathComponents = getPathComponents(rootPath);
|
|
125704
125819
|
const typeRootsWatches = /* @__PURE__ */ new Map();
|
|
125705
125820
|
return {
|
|
125821
|
+
rootDirForResolution,
|
|
125822
|
+
resolvedModuleNames,
|
|
125823
|
+
resolvedTypeReferenceDirectives,
|
|
125824
|
+
resolvedLibraries,
|
|
125825
|
+
resolvedFileToResolution,
|
|
125826
|
+
resolutionsWithFailedLookups,
|
|
125827
|
+
resolutionsWithOnlyAffectingLocations,
|
|
125828
|
+
directoryWatchesOfFailedLookups,
|
|
125829
|
+
fileWatchesOfAffectingLocations,
|
|
125830
|
+
watchFailedLookupLocationsOfExternalModuleResolutions,
|
|
125706
125831
|
getModuleResolutionCache: () => moduleResolutionCache,
|
|
125707
125832
|
startRecordingFilesWithChangedResolutions,
|
|
125708
125833
|
finishRecordingFilesWithChangedResolutions,
|
|
@@ -125805,7 +125930,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
125805
125930
|
if (!((_a = newProgram == null ? void 0 : newProgram.resolvedLibReferences) == null ? void 0 : _a.has(libFileName))) {
|
|
125806
125931
|
stopWatchFailedLookupLocationOfResolution(
|
|
125807
125932
|
resolution,
|
|
125808
|
-
resolutionHost.toPath(getInferredLibraryNameResolveFrom(
|
|
125933
|
+
resolutionHost.toPath(getInferredLibraryNameResolveFrom(resolutionHost.getCompilationSettings(), getCurrentDirectory(), libFileName)),
|
|
125809
125934
|
getResolvedModule
|
|
125810
125935
|
);
|
|
125811
125936
|
resolvedLibraries.delete(libFileName);
|
|
@@ -125847,58 +125972,22 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
125847
125972
|
}
|
|
125848
125973
|
});
|
|
125849
125974
|
}
|
|
125850
|
-
directoryWatchesOfFailedLookups.forEach(
|
|
125851
|
-
|
|
125852
|
-
directoryWatchesOfFailedLookups.delete(path);
|
|
125853
|
-
watcher.watcher.close();
|
|
125854
|
-
}
|
|
125855
|
-
});
|
|
125856
|
-
fileWatchesOfAffectingLocations.forEach((watcher, path) => {
|
|
125857
|
-
if (watcher.files === 0 && watcher.resolutions === 0) {
|
|
125858
|
-
fileWatchesOfAffectingLocations.delete(path);
|
|
125859
|
-
watcher.watcher.close();
|
|
125860
|
-
}
|
|
125861
|
-
});
|
|
125975
|
+
directoryWatchesOfFailedLookups.forEach(closeDirectoryWatchesOfFailedLookup);
|
|
125976
|
+
fileWatchesOfAffectingLocations.forEach(closeFileWatcherOfAffectingLocation);
|
|
125862
125977
|
hasChangedAutomaticTypeDirectiveNames = false;
|
|
125863
125978
|
}
|
|
125864
|
-
function
|
|
125865
|
-
|
|
125866
|
-
|
|
125867
|
-
|
|
125868
|
-
if (!resolutionHost.getGlobalCache) {
|
|
125869
|
-
return primaryResult;
|
|
125870
|
-
}
|
|
125871
|
-
const globalCache = resolutionHost.getGlobalCache();
|
|
125872
|
-
if (globalCache !== void 0 && !isExternalModuleNameRelative(moduleName) && !(primaryResult.resolvedModule && extensionIsTS(primaryResult.resolvedModule.extension))) {
|
|
125873
|
-
const { resolvedModule, failedLookupLocations, affectingLocations, resolutionDiagnostics } = loadModuleFromGlobalCache(
|
|
125874
|
-
Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName),
|
|
125875
|
-
resolutionHost.projectName,
|
|
125876
|
-
compilerOptions,
|
|
125877
|
-
host,
|
|
125878
|
-
globalCache,
|
|
125879
|
-
moduleResolutionCache
|
|
125880
|
-
);
|
|
125881
|
-
if (resolvedModule) {
|
|
125882
|
-
primaryResult.resolvedModule = resolvedModule;
|
|
125883
|
-
primaryResult.failedLookupLocations = updateResolutionField(primaryResult.failedLookupLocations, failedLookupLocations);
|
|
125884
|
-
primaryResult.affectingLocations = updateResolutionField(primaryResult.affectingLocations, affectingLocations);
|
|
125885
|
-
primaryResult.resolutionDiagnostics = updateResolutionField(primaryResult.resolutionDiagnostics, resolutionDiagnostics);
|
|
125886
|
-
return primaryResult;
|
|
125887
|
-
}
|
|
125979
|
+
function closeDirectoryWatchesOfFailedLookup(watcher, path) {
|
|
125980
|
+
if (watcher.refCount === 0) {
|
|
125981
|
+
directoryWatchesOfFailedLookups.delete(path);
|
|
125982
|
+
watcher.watcher.close();
|
|
125888
125983
|
}
|
|
125889
|
-
return primaryResult;
|
|
125890
125984
|
}
|
|
125891
|
-
function
|
|
125892
|
-
|
|
125893
|
-
|
|
125894
|
-
|
|
125895
|
-
|
|
125896
|
-
|
|
125897
|
-
options,
|
|
125898
|
-
redirectedReference,
|
|
125899
|
-
resoluionMode
|
|
125900
|
-
)
|
|
125901
|
-
};
|
|
125985
|
+
function closeFileWatcherOfAffectingLocation(watcher, path) {
|
|
125986
|
+
var _a;
|
|
125987
|
+
if (watcher.files === 0 && watcher.resolutions === 0 && !((_a = watcher.symlinks) == null ? void 0 : _a.size)) {
|
|
125988
|
+
fileWatchesOfAffectingLocations.delete(path);
|
|
125989
|
+
watcher.watcher.close();
|
|
125990
|
+
}
|
|
125902
125991
|
}
|
|
125903
125992
|
function resolveNamesWithLocalCache({
|
|
125904
125993
|
entries,
|
|
@@ -125935,9 +126024,11 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
125935
126024
|
resolutionHost.onDiscoveredSymlink();
|
|
125936
126025
|
}
|
|
125937
126026
|
resolutionsInFile.set(name, mode, resolution);
|
|
125938
|
-
|
|
125939
|
-
|
|
125940
|
-
|
|
126027
|
+
if (resolution !== existingResolution) {
|
|
126028
|
+
watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName, deferWatchingNonRelativeResolution);
|
|
126029
|
+
if (existingResolution) {
|
|
126030
|
+
stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolutionWithResolvedFileName);
|
|
126031
|
+
}
|
|
125941
126032
|
}
|
|
125942
126033
|
if (logChanges && filesWithChangedSetOfUnresolvedImports && !resolutionIsEqualTo(existingResolution, resolution)) {
|
|
125943
126034
|
filesWithChangedSetOfUnresolvedImports.push(path);
|
|
@@ -126026,10 +126117,12 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
126026
126117
|
options,
|
|
126027
126118
|
reusedNames,
|
|
126028
126119
|
perFileCache: resolvedModuleNames,
|
|
126029
|
-
loader:
|
|
126120
|
+
loader: createModuleResolutionLoaderUsingGlobalCache(
|
|
126030
126121
|
containingFile,
|
|
126031
126122
|
redirectedReference,
|
|
126032
|
-
options
|
|
126123
|
+
options,
|
|
126124
|
+
resolutionHost,
|
|
126125
|
+
moduleResolutionCache
|
|
126033
126126
|
),
|
|
126034
126127
|
getResolutionWithResolvedFileName: getResolvedModule,
|
|
126035
126128
|
shouldRetryResolution: (resolution) => !resolution.resolvedModule || !resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension),
|
|
@@ -126083,7 +126176,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
126083
126176
|
);
|
|
126084
126177
|
if (resolution && !resolution.isInvalidated)
|
|
126085
126178
|
return resolution;
|
|
126086
|
-
return
|
|
126179
|
+
return resolveModuleNameUsingGlobalCache(resolutionHost, moduleResolutionCache, moduleName, containingFile, resolutionHost.getCompilationSettings());
|
|
126087
126180
|
}
|
|
126088
126181
|
function isNodeModulesAtTypesDirectory(dirPath) {
|
|
126089
126182
|
return endsWith(dirPath, "/node_modules/@types");
|
|
@@ -126183,52 +126276,63 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
126183
126276
|
return;
|
|
126184
126277
|
}
|
|
126185
126278
|
let locationToWatch = affectingLocation;
|
|
126279
|
+
let isSymlink = false;
|
|
126280
|
+
let symlinkWatcher;
|
|
126186
126281
|
if (resolutionHost.realpath) {
|
|
126187
126282
|
locationToWatch = resolutionHost.realpath(affectingLocation);
|
|
126188
126283
|
if (affectingLocation !== locationToWatch) {
|
|
126189
|
-
|
|
126190
|
-
|
|
126191
|
-
|
|
126192
|
-
|
|
126193
|
-
|
|
126194
|
-
|
|
126195
|
-
|
|
126196
|
-
|
|
126197
|
-
|
|
126198
|
-
|
|
126199
|
-
|
|
126284
|
+
isSymlink = true;
|
|
126285
|
+
symlinkWatcher = fileWatchesOfAffectingLocations.get(locationToWatch);
|
|
126286
|
+
}
|
|
126287
|
+
}
|
|
126288
|
+
const resolutions = forResolution ? 1 : 0;
|
|
126289
|
+
const files = forResolution ? 0 : 1;
|
|
126290
|
+
if (!isSymlink || !symlinkWatcher) {
|
|
126291
|
+
const watcher = {
|
|
126292
|
+
watcher: canWatchAffectingLocation(resolutionHost.toPath(locationToWatch)) ? resolutionHost.watchAffectingFileLocation(locationToWatch, (fileName, eventKind) => {
|
|
126293
|
+
cachedDirectoryStructureHost == null ? void 0 : cachedDirectoryStructureHost.addOrDeleteFile(fileName, resolutionHost.toPath(locationToWatch), eventKind);
|
|
126294
|
+
invalidateAffectingFileWatcher(locationToWatch, moduleResolutionCache.getPackageJsonInfoCache().getInternalMap());
|
|
126295
|
+
resolutionHost.scheduleInvalidateResolutionsOfFailedLookupLocations();
|
|
126296
|
+
}) : noopFileWatcher,
|
|
126297
|
+
resolutions: isSymlink ? 0 : resolutions,
|
|
126298
|
+
files: isSymlink ? 0 : files,
|
|
126299
|
+
symlinks: void 0
|
|
126300
|
+
};
|
|
126301
|
+
fileWatchesOfAffectingLocations.set(locationToWatch, watcher);
|
|
126302
|
+
if (isSymlink)
|
|
126303
|
+
symlinkWatcher = watcher;
|
|
126200
126304
|
}
|
|
126201
|
-
|
|
126202
|
-
|
|
126203
|
-
|
|
126204
|
-
|
|
126205
|
-
|
|
126206
|
-
|
|
126207
|
-
|
|
126208
|
-
|
|
126209
|
-
|
|
126210
|
-
|
|
126211
|
-
|
|
126212
|
-
|
|
126213
|
-
|
|
126214
|
-
|
|
126215
|
-
|
|
126216
|
-
|
|
126217
|
-
|
|
126218
|
-
actualWatcher.close();
|
|
126219
|
-
actualWatcher = noopFileWatcher;
|
|
126220
|
-
}
|
|
126221
|
-
} : actualWatcher,
|
|
126222
|
-
resolutions: forResolution ? 1 : 0,
|
|
126223
|
-
files: forResolution ? 0 : 1,
|
|
126224
|
-
paths
|
|
126225
|
-
};
|
|
126226
|
-
fileWatchesOfAffectingLocations.set(locationToWatch, watcher);
|
|
126227
|
-
if (affectingLocation !== locationToWatch) {
|
|
126305
|
+
if (isSymlink) {
|
|
126306
|
+
Debug.assert(!!symlinkWatcher);
|
|
126307
|
+
const watcher = {
|
|
126308
|
+
watcher: {
|
|
126309
|
+
close: () => {
|
|
126310
|
+
var _a;
|
|
126311
|
+
const symlinkWatcher2 = fileWatchesOfAffectingLocations.get(locationToWatch);
|
|
126312
|
+
if (((_a = symlinkWatcher2 == null ? void 0 : symlinkWatcher2.symlinks) == null ? void 0 : _a.delete(affectingLocation)) && !symlinkWatcher2.symlinks.size && !symlinkWatcher2.resolutions && !symlinkWatcher2.files) {
|
|
126313
|
+
fileWatchesOfAffectingLocations.delete(locationToWatch);
|
|
126314
|
+
symlinkWatcher2.watcher.close();
|
|
126315
|
+
}
|
|
126316
|
+
}
|
|
126317
|
+
},
|
|
126318
|
+
resolutions,
|
|
126319
|
+
files,
|
|
126320
|
+
symlinks: void 0
|
|
126321
|
+
};
|
|
126228
126322
|
fileWatchesOfAffectingLocations.set(affectingLocation, watcher);
|
|
126229
|
-
|
|
126323
|
+
(symlinkWatcher.symlinks ?? (symlinkWatcher.symlinks = /* @__PURE__ */ new Set())).add(affectingLocation);
|
|
126230
126324
|
}
|
|
126231
126325
|
}
|
|
126326
|
+
function invalidateAffectingFileWatcher(path, packageJsonMap) {
|
|
126327
|
+
var _a;
|
|
126328
|
+
const watcher = fileWatchesOfAffectingLocations.get(path);
|
|
126329
|
+
if (watcher == null ? void 0 : watcher.resolutions)
|
|
126330
|
+
(affectingPathChecks ?? (affectingPathChecks = /* @__PURE__ */ new Set())).add(path);
|
|
126331
|
+
if (watcher == null ? void 0 : watcher.files)
|
|
126332
|
+
(affectingPathChecksForFile ?? (affectingPathChecksForFile = /* @__PURE__ */ new Set())).add(path);
|
|
126333
|
+
(_a = watcher == null ? void 0 : watcher.symlinks) == null ? void 0 : _a.forEach((path2) => invalidateAffectingFileWatcher(path2, packageJsonMap));
|
|
126334
|
+
packageJsonMap == null ? void 0 : packageJsonMap.delete(resolutionHost.toPath(path));
|
|
126335
|
+
}
|
|
126232
126336
|
function watchFailedLookupLocationOfNonRelativeModuleResolutions(resolutions, name) {
|
|
126233
126337
|
const program = resolutionHost.getCurrentProgram();
|
|
126234
126338
|
if (!program || !program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(name)) {
|
|
@@ -126250,7 +126354,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
126250
126354
|
directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir, dirPath, nonRecursive), refCount: 1, nonRecursive });
|
|
126251
126355
|
}
|
|
126252
126356
|
}
|
|
126253
|
-
function stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot) {
|
|
126357
|
+
function stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot, syncDirWatcherRemove) {
|
|
126254
126358
|
const failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation);
|
|
126255
126359
|
const toWatch = getDirectoryToWatchFailedLookupLocation(
|
|
126256
126360
|
failedLookupLocation,
|
|
@@ -126265,12 +126369,12 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
126265
126369
|
if (dirPath === rootPath) {
|
|
126266
126370
|
removeAtRoot = true;
|
|
126267
126371
|
} else {
|
|
126268
|
-
removeDirectoryWatcher(dirPath);
|
|
126372
|
+
removeDirectoryWatcher(dirPath, syncDirWatcherRemove);
|
|
126269
126373
|
}
|
|
126270
126374
|
}
|
|
126271
126375
|
return removeAtRoot;
|
|
126272
126376
|
}
|
|
126273
|
-
function stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName) {
|
|
126377
|
+
function stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName, syncDirWatcherRemove) {
|
|
126274
126378
|
Debug.checkDefined(resolution.files).delete(filePath);
|
|
126275
126379
|
resolution.refCount--;
|
|
126276
126380
|
if (resolution.refCount) {
|
|
@@ -126288,13 +126392,13 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
126288
126392
|
let removeAtRoot = false;
|
|
126289
126393
|
if (failedLookupLocations) {
|
|
126290
126394
|
for (const failedLookupLocation of failedLookupLocations) {
|
|
126291
|
-
removeAtRoot = stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot);
|
|
126395
|
+
removeAtRoot = stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot, syncDirWatcherRemove);
|
|
126292
126396
|
}
|
|
126293
126397
|
}
|
|
126294
126398
|
if (node10Result)
|
|
126295
|
-
removeAtRoot = stopWatchFailedLookupLocation(node10Result, removeAtRoot);
|
|
126399
|
+
removeAtRoot = stopWatchFailedLookupLocation(node10Result, removeAtRoot, syncDirWatcherRemove);
|
|
126296
126400
|
if (removeAtRoot)
|
|
126297
|
-
removeDirectoryWatcher(rootPath);
|
|
126401
|
+
removeDirectoryWatcher(rootPath, syncDirWatcherRemove);
|
|
126298
126402
|
} else if (affectingLocations == null ? void 0 : affectingLocations.length) {
|
|
126299
126403
|
resolutionsWithOnlyAffectingLocations.delete(resolution);
|
|
126300
126404
|
}
|
|
@@ -126302,12 +126406,16 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
126302
126406
|
for (const affectingLocation of affectingLocations) {
|
|
126303
126407
|
const watcher = fileWatchesOfAffectingLocations.get(affectingLocation);
|
|
126304
126408
|
watcher.resolutions--;
|
|
126409
|
+
if (syncDirWatcherRemove)
|
|
126410
|
+
closeFileWatcherOfAffectingLocation(watcher, affectingLocation);
|
|
126305
126411
|
}
|
|
126306
126412
|
}
|
|
126307
126413
|
}
|
|
126308
|
-
function removeDirectoryWatcher(dirPath) {
|
|
126414
|
+
function removeDirectoryWatcher(dirPath, syncDirWatcherRemove) {
|
|
126309
126415
|
const dirWatcher = directoryWatchesOfFailedLookups.get(dirPath);
|
|
126310
126416
|
dirWatcher.refCount--;
|
|
126417
|
+
if (syncDirWatcherRemove)
|
|
126418
|
+
closeDirectoryWatchesOfFailedLookup(dirWatcher, dirPath);
|
|
126311
126419
|
}
|
|
126312
126420
|
function createDirectoryWatcher(directory, dirPath, nonRecursive) {
|
|
126313
126421
|
return resolutionHost.watchDirectoryOfFailedLookupLocation(directory, (fileOrDirectory) => {
|
|
@@ -126318,10 +126426,17 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
126318
126426
|
scheduleInvalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath);
|
|
126319
126427
|
}, nonRecursive ? 0 /* None */ : 1 /* Recursive */);
|
|
126320
126428
|
}
|
|
126321
|
-
function removeResolutionsOfFileFromCache(cache, filePath, getResolutionWithResolvedFileName) {
|
|
126429
|
+
function removeResolutionsOfFileFromCache(cache, filePath, getResolutionWithResolvedFileName, syncDirWatcherRemove) {
|
|
126322
126430
|
const resolutions = cache.get(filePath);
|
|
126323
126431
|
if (resolutions) {
|
|
126324
|
-
resolutions.forEach(
|
|
126432
|
+
resolutions.forEach(
|
|
126433
|
+
(resolution) => stopWatchFailedLookupLocationOfResolution(
|
|
126434
|
+
resolution,
|
|
126435
|
+
filePath,
|
|
126436
|
+
getResolutionWithResolvedFileName,
|
|
126437
|
+
syncDirWatcherRemove
|
|
126438
|
+
)
|
|
126439
|
+
);
|
|
126325
126440
|
cache.delete(filePath);
|
|
126326
126441
|
}
|
|
126327
126442
|
}
|
|
@@ -126336,9 +126451,9 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
126336
126451
|
return;
|
|
126337
126452
|
resolvedProjectReference.commandLine.fileNames.forEach((f) => removeResolutionsOfFile(resolutionHost.toPath(f)));
|
|
126338
126453
|
}
|
|
126339
|
-
function removeResolutionsOfFile(filePath) {
|
|
126340
|
-
removeResolutionsOfFileFromCache(resolvedModuleNames, filePath, getResolvedModule);
|
|
126341
|
-
removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath, getResolvedTypeReferenceDirective);
|
|
126454
|
+
function removeResolutionsOfFile(filePath, syncDirWatcherRemove) {
|
|
126455
|
+
removeResolutionsOfFileFromCache(resolvedModuleNames, filePath, getResolvedModule, syncDirWatcherRemove);
|
|
126456
|
+
removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath, getResolvedTypeReferenceDirective, syncDirWatcherRemove);
|
|
126342
126457
|
}
|
|
126343
126458
|
function invalidateResolutions(resolutions, canInvalidate) {
|
|
126344
126459
|
if (!resolutions)
|
|
@@ -126992,8 +127107,7 @@ function createCompilerHostFromProgramHost(host, getCompilerOptions, directorySt
|
|
|
126992
127107
|
(fileName, encoding) => !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding),
|
|
126993
127108
|
getCompilerOptions,
|
|
126994
127109
|
/*setParentNodes*/
|
|
126995
|
-
void 0
|
|
126996
|
-
host.skipNonSemanticJSDocParsing
|
|
127110
|
+
void 0
|
|
126997
127111
|
),
|
|
126998
127112
|
getDefaultLibLocation: maybeBind(host, host.getDefaultLibLocation),
|
|
126999
127113
|
getDefaultLibFileName: (options) => host.getDefaultLibFileName(options),
|
|
@@ -127015,7 +127129,8 @@ function createCompilerHostFromProgramHost(host, getCompilerOptions, directorySt
|
|
|
127015
127129
|
getEnvironmentVariable: maybeBind(host, host.getEnvironmentVariable) || (() => ""),
|
|
127016
127130
|
createHash: maybeBind(host, host.createHash),
|
|
127017
127131
|
readDirectory: maybeBind(host, host.readDirectory),
|
|
127018
|
-
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit
|
|
127132
|
+
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
|
|
127133
|
+
jsDocParsingMode: host.jsDocParsingMode
|
|
127019
127134
|
};
|
|
127020
127135
|
return compilerHost;
|
|
127021
127136
|
}
|
|
@@ -127179,12 +127294,11 @@ function readBuilderProgram(compilerOptions, host) {
|
|
|
127179
127294
|
return void 0;
|
|
127180
127295
|
return createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, host);
|
|
127181
127296
|
}
|
|
127182
|
-
function createIncrementalCompilerHost(options, system = sys
|
|
127297
|
+
function createIncrementalCompilerHost(options, system = sys) {
|
|
127183
127298
|
const host = createCompilerHostWorker(
|
|
127184
127299
|
options,
|
|
127185
127300
|
/*setParentNodes*/
|
|
127186
127301
|
void 0,
|
|
127187
|
-
skipNonSemanticJSDocParsing,
|
|
127188
127302
|
system
|
|
127189
127303
|
);
|
|
127190
127304
|
host.createHash = maybeBind(system, system.createHash);
|
|
@@ -127326,7 +127440,7 @@ function createWatchProgram(host) {
|
|
|
127326
127440
|
watchConfigFileWildCardDirectories();
|
|
127327
127441
|
if (configFileName)
|
|
127328
127442
|
updateExtendedConfigFilesWatches(toPath3(configFileName), compilerOptions, watchOptions, WatchType.ExtendedConfigFile);
|
|
127329
|
-
return configFileName ? { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, close } : { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, updateRootFileNames, close };
|
|
127443
|
+
return configFileName ? { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, close, getResolutionCache } : { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, updateRootFileNames, close, getResolutionCache };
|
|
127330
127444
|
function close() {
|
|
127331
127445
|
clearInvalidateResolutionsOfFailedLookupLocations();
|
|
127332
127446
|
resolutionCache.clear();
|
|
@@ -127366,6 +127480,9 @@ function createWatchProgram(host) {
|
|
|
127366
127480
|
parsedConfigs = void 0;
|
|
127367
127481
|
}
|
|
127368
127482
|
}
|
|
127483
|
+
function getResolutionCache() {
|
|
127484
|
+
return resolutionCache;
|
|
127485
|
+
}
|
|
127369
127486
|
function getCurrentBuilderProgram() {
|
|
127370
127487
|
return builderProgram;
|
|
127371
127488
|
}
|
|
@@ -132091,7 +132208,7 @@ function makeImport(defaultImport, namedImports, moduleSpecifier, quotePreferenc
|
|
|
132091
132208
|
void 0,
|
|
132092
132209
|
defaultImport || namedImports ? factory.createImportClause(!!isTypeOnly, defaultImport, namedImports && namedImports.length ? factory.createNamedImports(namedImports) : void 0) : void 0,
|
|
132093
132210
|
typeof moduleSpecifier === "string" ? makeStringLiteral(moduleSpecifier, quotePreference) : moduleSpecifier,
|
|
132094
|
-
/*
|
|
132211
|
+
/*attributes*/
|
|
132095
132212
|
void 0
|
|
132096
132213
|
);
|
|
132097
132214
|
}
|
|
@@ -132736,7 +132853,7 @@ function indexInTextChange(change, name) {
|
|
|
132736
132853
|
return idx === -1 ? -1 : idx + 1;
|
|
132737
132854
|
}
|
|
132738
132855
|
function needsParentheses(expression) {
|
|
132739
|
-
return isBinaryExpression(expression) && expression.operatorToken.kind === 28 /* CommaToken */ || isObjectLiteralExpression(expression) || isAsExpression(expression) && isObjectLiteralExpression(expression.expression);
|
|
132856
|
+
return isBinaryExpression(expression) && expression.operatorToken.kind === 28 /* CommaToken */ || isObjectLiteralExpression(expression) || (isAsExpression(expression) || isSatisfiesExpression(expression)) && isObjectLiteralExpression(expression.expression);
|
|
132740
132857
|
}
|
|
132741
132858
|
function getContextualTypeFromParent(node, checker, contextFlags) {
|
|
132742
132859
|
const parent2 = walkUpParenthesizedExpressions(node.parent);
|
|
@@ -135108,10 +135225,10 @@ var DocumentHighlights;
|
|
|
135108
135225
|
function isDocumentRegistryEntry(entry) {
|
|
135109
135226
|
return !!entry.sourceFile;
|
|
135110
135227
|
}
|
|
135111
|
-
function createDocumentRegistry(useCaseSensitiveFileNames2, currentDirectory) {
|
|
135112
|
-
return createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory);
|
|
135228
|
+
function createDocumentRegistry(useCaseSensitiveFileNames2, currentDirectory, jsDocParsingMode) {
|
|
135229
|
+
return createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory, jsDocParsingMode);
|
|
135113
135230
|
}
|
|
135114
|
-
function createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory = "", externalCache) {
|
|
135231
|
+
function createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirectory = "", jsDocParsingMode, externalCache) {
|
|
135115
135232
|
const buckets = /* @__PURE__ */ new Map();
|
|
135116
135233
|
const getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames2);
|
|
135117
135234
|
function reportStats() {
|
|
@@ -135195,9 +135312,11 @@ function createDocumentRegistryInternal(useCaseSensitiveFileNames2, currentDirec
|
|
|
135195
135312
|
const sourceFileOptions = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions : {
|
|
135196
135313
|
languageVersion: scriptTarget,
|
|
135197
135314
|
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),
|
|
135198
|
-
setExternalModuleIndicator: getSetExternalModuleIndicator(compilationSettings)
|
|
135315
|
+
setExternalModuleIndicator: getSetExternalModuleIndicator(compilationSettings),
|
|
135316
|
+
jsDocParsingMode
|
|
135199
135317
|
};
|
|
135200
135318
|
sourceFileOptions.languageVersion = scriptTarget;
|
|
135319
|
+
Debug.assertEqual(jsDocParsingMode, sourceFileOptions.jsDocParsingMode);
|
|
135201
135320
|
const oldBucketCount = buckets.size;
|
|
135202
135321
|
const keyWithMode = getDocumentRegistryBucketKeyWithMode(key, sourceFileOptions.impliedNodeFormat);
|
|
135203
135322
|
const bucket = getOrUpdate(buckets, keyWithMode, () => /* @__PURE__ */ new Map());
|
|
@@ -135449,14 +135568,13 @@ function combinePathsSafe(pathA, pathB) {
|
|
|
135449
135568
|
return ensurePathIsNonModuleName(combineNormal(pathA, pathB));
|
|
135450
135569
|
}
|
|
135451
135570
|
function getSourceFileToImport(importedModuleSymbol, importLiteral, importingSourceFile, program, host, oldToNew) {
|
|
135452
|
-
var _a, _b;
|
|
135453
135571
|
if (importedModuleSymbol) {
|
|
135454
135572
|
const oldFileName = find(importedModuleSymbol.declarations, isSourceFile).fileName;
|
|
135455
135573
|
const newFileName = oldToNew(oldFileName);
|
|
135456
135574
|
return newFileName === void 0 ? { newFileName: oldFileName, updated: false } : { newFileName, updated: true };
|
|
135457
135575
|
} else {
|
|
135458
135576
|
const mode = getModeForUsageLocation(importingSourceFile, importLiteral);
|
|
135459
|
-
const resolved = host.resolveModuleNameLiterals || !host.resolveModuleNames ?
|
|
135577
|
+
const resolved = host.resolveModuleNameLiterals || !host.resolveModuleNames ? program.getResolvedModule(importingSourceFile, importLiteral.text, mode) : host.getResolvedModuleWithFailedLookupLocationsFromCache && host.getResolvedModuleWithFailedLookupLocationsFromCache(importLiteral.text, importingSourceFile.fileName, mode);
|
|
135460
135578
|
return getSourceFileToImportFromResolved(importLiteral, resolved, oldToNew, program.getSourceFiles());
|
|
135461
135579
|
}
|
|
135462
135580
|
}
|
|
@@ -136351,7 +136469,7 @@ function createSourceFileLike(text, lineMap) {
|
|
|
136351
136469
|
// src/services/suggestionDiagnostics.ts
|
|
136352
136470
|
var visitedNestedConvertibleFunctions = /* @__PURE__ */ new Map();
|
|
136353
136471
|
function computeSuggestionDiagnostics(sourceFile, program, cancellationToken) {
|
|
136354
|
-
var _a
|
|
136472
|
+
var _a;
|
|
136355
136473
|
program.getSemanticDiagnostics(sourceFile, cancellationToken);
|
|
136356
136474
|
const diags = [];
|
|
136357
136475
|
const checker = program.getTypeChecker();
|
|
@@ -136368,7 +136486,7 @@ function computeSuggestionDiagnostics(sourceFile, program, cancellationToken) {
|
|
|
136368
136486
|
const name = importNameForConvertToDefaultImport(importNode);
|
|
136369
136487
|
if (!name)
|
|
136370
136488
|
continue;
|
|
136371
|
-
const module2 = (
|
|
136489
|
+
const module2 = (_a = program.getResolvedModule(sourceFile, moduleSpecifier.text, getModeForUsageLocation(sourceFile, moduleSpecifier))) == null ? void 0 : _a.resolvedModule;
|
|
136372
136490
|
const resolvedFile = module2 && program.getSourceFile(module2.resolvedFileName);
|
|
136373
136491
|
if (resolvedFile && resolvedFile.externalModuleIndicator && resolvedFile.externalModuleIndicator !== true && isExportAssignment(resolvedFile.externalModuleIndicator) && resolvedFile.externalModuleIndicator.isExportEquals) {
|
|
136374
136492
|
diags.push(createDiagnosticForNode(name, Diagnostics.Import_may_be_converted_to_a_default_import));
|
|
@@ -136618,7 +136736,8 @@ function transpileModule(input, transpileOptions) {
|
|
|
136618
136736
|
compilerHost,
|
|
136619
136737
|
options
|
|
136620
136738
|
),
|
|
136621
|
-
setExternalModuleIndicator: getSetExternalModuleIndicator(options)
|
|
136739
|
+
setExternalModuleIndicator: getSetExternalModuleIndicator(options),
|
|
136740
|
+
jsDocParsingMode: 1 /* ParseNone */
|
|
136622
136741
|
}
|
|
136623
136742
|
);
|
|
136624
136743
|
if (transpileOptions.moduleName) {
|
|
@@ -137802,7 +137921,7 @@ function changeDefaultToNamedImport(importingSourceFile, ref, changes, exportNam
|
|
|
137802
137921
|
}
|
|
137803
137922
|
case 205 /* ImportType */:
|
|
137804
137923
|
const importTypeNode = parent2;
|
|
137805
|
-
changes.replaceNode(importingSourceFile, parent2, factory.createImportTypeNode(importTypeNode.argument, importTypeNode.
|
|
137924
|
+
changes.replaceNode(importingSourceFile, parent2, factory.createImportTypeNode(importTypeNode.argument, importTypeNode.attributes, factory.createIdentifier(exportName), importTypeNode.typeArguments, importTypeNode.isTypeOf));
|
|
137806
137925
|
break;
|
|
137807
137926
|
default:
|
|
137808
137927
|
Debug.failBadSyntaxKind(parent2);
|
|
@@ -138077,7 +138196,7 @@ function updateImport(old, defaultImportName, elements) {
|
|
|
138077
138196
|
elements && elements.length ? factory.createNamedImports(elements) : void 0
|
|
138078
138197
|
),
|
|
138079
138198
|
old.moduleSpecifier,
|
|
138080
|
-
/*
|
|
138199
|
+
/*attributes*/
|
|
138081
138200
|
void 0
|
|
138082
138201
|
);
|
|
138083
138202
|
}
|
|
@@ -138771,10 +138890,10 @@ function getTargetFileImportsAndAddExportInOldFile(oldFile, targetFile, importsT
|
|
|
138771
138890
|
const targetSourceFile = program.getSourceFile(targetFile);
|
|
138772
138891
|
for (const oldStatement of oldFile.statements) {
|
|
138773
138892
|
forEachImportInStatement(oldStatement, (i) => {
|
|
138774
|
-
var _a
|
|
138893
|
+
var _a;
|
|
138775
138894
|
const moduleSpecifier = moduleSpecifierFromImport(i);
|
|
138776
|
-
const resolved =
|
|
138777
|
-
const fileName = (
|
|
138895
|
+
const resolved = program.getResolvedModule(oldFile, moduleSpecifier.text, getModeForUsageLocation(oldFile, moduleSpecifier));
|
|
138896
|
+
const fileName = (_a = resolved == null ? void 0 : resolved.resolvedModule) == null ? void 0 : _a.resolvedFileName;
|
|
138778
138897
|
if (fileName && targetSourceFile) {
|
|
138779
138898
|
const newModuleSpecifier = getModuleSpecifier(program.getCompilerOptions(), targetSourceFile, targetSourceFile.path, fileName, createModuleSpecifierResolutionHost(program, host));
|
|
138780
138899
|
append(copiedOldImports, filterImport(i, makeStringLiteral(newModuleSpecifier, quotePreference), (name) => importsToCopy.has(checker.getSymbolAtLocation(name))));
|
|
@@ -138919,7 +139038,7 @@ function updateNamespaceLikeImportNode(node, newNamespaceName, newModuleSpecifie
|
|
|
138919
139038
|
factory.createNamespaceImport(newNamespaceId)
|
|
138920
139039
|
),
|
|
138921
139040
|
newModuleString,
|
|
138922
|
-
/*
|
|
139041
|
+
/*attributes*/
|
|
138923
139042
|
void 0
|
|
138924
139043
|
);
|
|
138925
139044
|
case 271 /* ImportEqualsDeclaration */:
|
|
@@ -139208,7 +139327,7 @@ function filterImport(i, moduleSpecifier, keep) {
|
|
|
139208
139327
|
void 0,
|
|
139209
139328
|
factory.createImportClause(clause.isTypeOnly, defaultImport, namedBindings),
|
|
139210
139329
|
getSynthesizedDeepClone(moduleSpecifier),
|
|
139211
|
-
/*
|
|
139330
|
+
/*attributes*/
|
|
139212
139331
|
void 0
|
|
139213
139332
|
) : void 0;
|
|
139214
139333
|
}
|
|
@@ -139532,7 +139651,7 @@ function moveStatementsToTargetFile(changes, program, statements, targetFile, to
|
|
|
139532
139651
|
continue;
|
|
139533
139652
|
}
|
|
139534
139653
|
if (length(updatedElements) < length(elements)) {
|
|
139535
|
-
changes.replaceNode(targetFile, exportDeclaration, factory.updateExportDeclaration(exportDeclaration, exportDeclaration.modifiers, exportDeclaration.isTypeOnly, factory.updateNamedExports(exportDeclaration.exportClause, factory.createNodeArray(updatedElements, elements.hasTrailingComma)), exportDeclaration.moduleSpecifier, exportDeclaration.
|
|
139654
|
+
changes.replaceNode(targetFile, exportDeclaration, factory.updateExportDeclaration(exportDeclaration, exportDeclaration.modifiers, exportDeclaration.isTypeOnly, factory.updateNamedExports(exportDeclaration.exportClause, factory.createNodeArray(updatedElements, elements.hasTrailingComma)), exportDeclaration.moduleSpecifier, exportDeclaration.attributes));
|
|
139536
139655
|
}
|
|
139537
139656
|
}
|
|
139538
139657
|
}
|
|
@@ -143813,7 +143932,9 @@ var SyntaxTreeCache = class {
|
|
|
143813
143932
|
this.host,
|
|
143814
143933
|
this.host.getCompilationSettings()
|
|
143815
143934
|
),
|
|
143816
|
-
setExternalModuleIndicator: getSetExternalModuleIndicator(this.host.getCompilationSettings())
|
|
143935
|
+
setExternalModuleIndicator: getSetExternalModuleIndicator(this.host.getCompilationSettings()),
|
|
143936
|
+
// These files are used to produce syntax-based highlighting, which reads JSDoc, so we must use ParseAll.
|
|
143937
|
+
jsDocParsingMode: 0 /* ParseAll */
|
|
143817
143938
|
};
|
|
143818
143939
|
sourceFile = createLanguageServiceSourceFile(
|
|
143819
143940
|
fileName,
|
|
@@ -143873,7 +143994,8 @@ function updateLanguageServiceSourceFile(sourceFile, scriptSnapshot, version2, t
|
|
|
143873
143994
|
const options = {
|
|
143874
143995
|
languageVersion: sourceFile.languageVersion,
|
|
143875
143996
|
impliedNodeFormat: sourceFile.impliedNodeFormat,
|
|
143876
|
-
setExternalModuleIndicator: sourceFile.setExternalModuleIndicator
|
|
143997
|
+
setExternalModuleIndicator: sourceFile.setExternalModuleIndicator,
|
|
143998
|
+
jsDocParsingMode: sourceFile.jsDocParsingMode
|
|
143877
143999
|
};
|
|
143878
144000
|
return createLanguageServiceSourceFile(
|
|
143879
144001
|
sourceFile.fileName,
|
|
@@ -144075,7 +144197,8 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
|
|
|
144075
144197
|
resolveTypeReferenceDirectiveReferences: maybeBind(host, host.resolveTypeReferenceDirectiveReferences),
|
|
144076
144198
|
resolveLibrary: maybeBind(host, host.resolveLibrary),
|
|
144077
144199
|
useSourceOfProjectReferenceRedirect: maybeBind(host, host.useSourceOfProjectReferenceRedirect),
|
|
144078
|
-
getParsedCommandLine
|
|
144200
|
+
getParsedCommandLine,
|
|
144201
|
+
jsDocParsingMode: host.jsDocParsingMode
|
|
144079
144202
|
};
|
|
144080
144203
|
const originalGetSourceFile = compilerHost.getSourceFile;
|
|
144081
144204
|
const { getSourceFileWithCache } = changeCompilerHostLikeToUseCache(
|
|
@@ -145319,6 +145442,9 @@ var LanguageServiceShimHostAdapter = class {
|
|
|
145319
145442
|
return map(typeDirectiveNames, (name) => getProperty(typeDirectivesForFile, isString(name) ? name : toFileNameLowerCase(name.fileName)));
|
|
145320
145443
|
};
|
|
145321
145444
|
}
|
|
145445
|
+
if ("jsDocParsingMode" in this.shimHost) {
|
|
145446
|
+
this.jsDocParsingMode = this.shimHost.jsDocParsingMode;
|
|
145447
|
+
}
|
|
145322
145448
|
}
|
|
145323
145449
|
log(s) {
|
|
145324
145450
|
if (this.loggingEnabled) {
|
|
@@ -149060,9 +149186,9 @@ registerCodeFix({
|
|
|
149060
149186
|
}
|
|
149061
149187
|
});
|
|
149062
149188
|
function fixImportOfModuleExports(importingFile, exportingFile, program, changes, quotePreference) {
|
|
149063
|
-
var _a
|
|
149189
|
+
var _a;
|
|
149064
149190
|
for (const moduleSpecifier of importingFile.imports) {
|
|
149065
|
-
const imported = (
|
|
149191
|
+
const imported = (_a = program.getResolvedModule(importingFile, moduleSpecifier.text, getModeForUsageLocation(importingFile, moduleSpecifier))) == null ? void 0 : _a.resolvedModule;
|
|
149066
149192
|
if (!imported || imported.resolvedFileName !== exportingFile.fileName) {
|
|
149067
149193
|
continue;
|
|
149068
149194
|
}
|
|
@@ -149659,7 +149785,7 @@ function fixSingleExportDeclaration(changes, exportSpecifier, context) {
|
|
|
149659
149785
|
false,
|
|
149660
149786
|
factory.updateNamedExports(exportClause, filter(exportClause.elements, (e) => !contains(typeExportSpecifiers, e))),
|
|
149661
149787
|
exportDeclaration.moduleSpecifier,
|
|
149662
|
-
/*
|
|
149788
|
+
/*attributes*/
|
|
149663
149789
|
void 0
|
|
149664
149790
|
);
|
|
149665
149791
|
const typeExportDeclaration = factory.createExportDeclaration(
|
|
@@ -149669,7 +149795,7 @@ function fixSingleExportDeclaration(changes, exportSpecifier, context) {
|
|
|
149669
149795
|
true,
|
|
149670
149796
|
factory.createNamedExports(typeExportSpecifiers),
|
|
149671
149797
|
exportDeclaration.moduleSpecifier,
|
|
149672
|
-
/*
|
|
149798
|
+
/*attributes*/
|
|
149673
149799
|
void 0
|
|
149674
149800
|
);
|
|
149675
149801
|
changes.replaceNode(context.sourceFile, exportDeclaration, valueExportDeclaration, {
|
|
@@ -149802,7 +149928,7 @@ function doChange11(changes, sourceFile, declaration) {
|
|
|
149802
149928
|
true
|
|
149803
149929
|
),
|
|
149804
149930
|
getSynthesizedDeepClone(
|
|
149805
|
-
declaration.
|
|
149931
|
+
declaration.attributes,
|
|
149806
149932
|
/*includeTrivia*/
|
|
149807
149933
|
true
|
|
149808
149934
|
)
|
|
@@ -149830,7 +149956,7 @@ function doChange11(changes, sourceFile, declaration) {
|
|
|
149830
149956
|
true
|
|
149831
149957
|
),
|
|
149832
149958
|
getSynthesizedDeepClone(
|
|
149833
|
-
declaration.
|
|
149959
|
+
declaration.attributes,
|
|
149834
149960
|
/*includeTrivia*/
|
|
149835
149961
|
true
|
|
149836
149962
|
)
|
|
@@ -149853,7 +149979,7 @@ function doChange11(changes, sourceFile, declaration) {
|
|
|
149853
149979
|
true,
|
|
149854
149980
|
importClause.name,
|
|
149855
149981
|
newNamedBindings
|
|
149856
|
-
), declaration.moduleSpecifier, declaration.
|
|
149982
|
+
), declaration.moduleSpecifier, declaration.attributes);
|
|
149857
149983
|
changes.replaceNode(sourceFile, declaration, importDeclaration);
|
|
149858
149984
|
}
|
|
149859
149985
|
}
|
|
@@ -151183,11 +151309,11 @@ function promoteFromTypeOnly(changes, aliasDeclaration, program, sourceFile, pre
|
|
|
151183
151309
|
Debug.failBadSyntaxKind(aliasDeclaration);
|
|
151184
151310
|
}
|
|
151185
151311
|
function promoteImportClause(importClause) {
|
|
151186
|
-
var _a
|
|
151312
|
+
var _a;
|
|
151187
151313
|
changes.delete(sourceFile, getTypeKeywordOfTypeOnlyImport(importClause, sourceFile));
|
|
151188
151314
|
if (!compilerOptions.allowImportingTsExtensions) {
|
|
151189
151315
|
const moduleSpecifier = tryGetModuleSpecifierFromDeclaration(importClause.parent);
|
|
151190
|
-
const resolvedModule = moduleSpecifier && ((
|
|
151316
|
+
const resolvedModule = moduleSpecifier && ((_a = program.getResolvedModule(sourceFile, moduleSpecifier.text, getModeForUsageLocation(sourceFile, moduleSpecifier))) == null ? void 0 : _a.resolvedModule);
|
|
151191
151317
|
if (resolvedModule == null ? void 0 : resolvedModule.resolvedUsingTsExtension) {
|
|
151192
151318
|
const changedExtension = changeAnyExtension(moduleSpecifier.text, getOutputExtension(moduleSpecifier.text, compilerOptions));
|
|
151193
151319
|
changes.replaceNode(sourceFile, moduleSpecifier, factory.createStringLiteral(changedExtension));
|
|
@@ -151352,7 +151478,7 @@ function getNewImports(moduleSpecifier, quotePreference, defaultImport, namedImp
|
|
|
151352
151478
|
factory.createNamespaceImport(factory.createIdentifier(namespaceLikeImport.name))
|
|
151353
151479
|
),
|
|
151354
151480
|
quotedModuleSpecifier,
|
|
151355
|
-
/*
|
|
151481
|
+
/*attributes*/
|
|
151356
151482
|
void 0
|
|
151357
151483
|
);
|
|
151358
151484
|
statements = combine(statements, declaration);
|
|
@@ -151855,7 +151981,7 @@ registerCodeFix({
|
|
|
151855
151981
|
}
|
|
151856
151982
|
});
|
|
151857
151983
|
function getInfo7(sourceFile, pos, program) {
|
|
151858
|
-
var _a, _b
|
|
151984
|
+
var _a, _b;
|
|
151859
151985
|
const token = getTokenAtPosition(sourceFile, pos);
|
|
151860
151986
|
if (isIdentifier(token)) {
|
|
151861
151987
|
const importDeclaration = findAncestor(token, isImportDeclaration);
|
|
@@ -151864,18 +151990,19 @@ function getInfo7(sourceFile, pos, program) {
|
|
|
151864
151990
|
const moduleSpecifier = isStringLiteral(importDeclaration.moduleSpecifier) ? importDeclaration.moduleSpecifier.text : void 0;
|
|
151865
151991
|
if (moduleSpecifier === void 0)
|
|
151866
151992
|
return void 0;
|
|
151867
|
-
const resolvedModule = (
|
|
151993
|
+
const resolvedModule = (_a = program.getResolvedModule(
|
|
151994
|
+
sourceFile,
|
|
151868
151995
|
moduleSpecifier,
|
|
151869
151996
|
/*mode*/
|
|
151870
151997
|
void 0
|
|
151871
|
-
)) == null ? void 0 :
|
|
151998
|
+
)) == null ? void 0 : _a.resolvedModule;
|
|
151872
151999
|
if (resolvedModule === void 0)
|
|
151873
152000
|
return void 0;
|
|
151874
152001
|
const moduleSourceFile = program.getSourceFile(resolvedModule.resolvedFileName);
|
|
151875
152002
|
if (moduleSourceFile === void 0 || isSourceFileFromLibrary(program, moduleSourceFile))
|
|
151876
152003
|
return void 0;
|
|
151877
152004
|
const moduleSymbol = moduleSourceFile.symbol;
|
|
151878
|
-
const locals = (
|
|
152005
|
+
const locals = (_b = tryCast(moduleSymbol.valueDeclaration, canHaveLocals)) == null ? void 0 : _b.locals;
|
|
151879
152006
|
if (locals === void 0)
|
|
151880
152007
|
return void 0;
|
|
151881
152008
|
const localSymbol = locals.get(token.escapedText);
|
|
@@ -151930,7 +152057,7 @@ function updateExport(changes, program, sourceFile, node, names) {
|
|
|
151930
152057
|
)
|
|
151931
152058
|
),
|
|
151932
152059
|
node.moduleSpecifier,
|
|
151933
|
-
node.
|
|
152060
|
+
node.attributes
|
|
151934
152061
|
)
|
|
151935
152062
|
);
|
|
151936
152063
|
}
|
|
@@ -151947,7 +152074,7 @@ function createExport(changes, program, sourceFile, names) {
|
|
|
151947
152074
|
)),
|
|
151948
152075
|
/*moduleSpecifier*/
|
|
151949
152076
|
void 0,
|
|
151950
|
-
/*
|
|
152077
|
+
/*attributes*/
|
|
151951
152078
|
void 0
|
|
151952
152079
|
));
|
|
151953
152080
|
}
|
|
@@ -152130,10 +152257,10 @@ function convertSemanticMeaningToSymbolFlags(meaning) {
|
|
|
152130
152257
|
return flags;
|
|
152131
152258
|
}
|
|
152132
152259
|
function getResolvedSourceFileFromImportDeclaration(sourceFile, context, importDeclaration) {
|
|
152133
|
-
var _a
|
|
152260
|
+
var _a;
|
|
152134
152261
|
if (!importDeclaration || !isStringLiteralLike(importDeclaration.moduleSpecifier))
|
|
152135
152262
|
return void 0;
|
|
152136
|
-
const resolvedModule = (
|
|
152263
|
+
const resolvedModule = (_a = context.program.getResolvedModule(sourceFile, importDeclaration.moduleSpecifier.text, getModeForUsageLocation(sourceFile, importDeclaration.moduleSpecifier))) == null ? void 0 : _a.resolvedModule;
|
|
152137
152264
|
if (!resolvedModule)
|
|
152138
152265
|
return void 0;
|
|
152139
152266
|
return context.program.getSourceFile(resolvedModule.resolvedFileName);
|
|
@@ -156622,7 +156749,7 @@ function doChange34(changes, sourceFile, info) {
|
|
|
156622
156749
|
namedImports
|
|
156623
156750
|
),
|
|
156624
156751
|
required,
|
|
156625
|
-
/*
|
|
156752
|
+
/*attributes*/
|
|
156626
156753
|
void 0
|
|
156627
156754
|
)
|
|
156628
156755
|
);
|
|
@@ -156761,7 +156888,7 @@ function doChange36(changes, sourceFile, importType) {
|
|
|
156761
156888
|
const newTypeNode = factory.updateImportTypeNode(
|
|
156762
156889
|
importType,
|
|
156763
156890
|
importType.argument,
|
|
156764
|
-
importType.
|
|
156891
|
+
importType.attributes,
|
|
156765
156892
|
importType.qualifier,
|
|
156766
156893
|
importType.typeArguments,
|
|
156767
156894
|
/*isTypeOf*/
|
|
@@ -156992,7 +157119,7 @@ function splitTypeOnlyImport(changes, importDeclaration, context) {
|
|
|
156992
157119
|
void 0
|
|
156993
157120
|
),
|
|
156994
157121
|
importDeclaration.moduleSpecifier,
|
|
156995
|
-
importDeclaration.
|
|
157122
|
+
importDeclaration.attributes
|
|
156996
157123
|
)
|
|
156997
157124
|
);
|
|
156998
157125
|
changes.insertNodeAfter(
|
|
@@ -157009,7 +157136,7 @@ function splitTypeOnlyImport(changes, importDeclaration, context) {
|
|
|
157009
157136
|
importClause.namedBindings
|
|
157010
157137
|
),
|
|
157011
157138
|
importDeclaration.moduleSpecifier,
|
|
157012
|
-
importDeclaration.
|
|
157139
|
+
importDeclaration.attributes
|
|
157013
157140
|
)
|
|
157014
157141
|
);
|
|
157015
157142
|
}
|
|
@@ -161131,8 +161258,9 @@ function convertStringLiteralCompletions(completion, contextToken, sourceFile, h
|
|
|
161131
161258
|
return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: completion.hasIndexSignature, optionalReplacementSpan, entries };
|
|
161132
161259
|
}
|
|
161133
161260
|
case 2 /* Types */: {
|
|
161261
|
+
const quoteChar = contextToken.kind === 15 /* NoSubstitutionTemplateLiteral */ ? 96 /* backtick */ : startsWith(getTextOfNode(contextToken), "'") ? 39 /* singleQuote */ : 34 /* doubleQuote */;
|
|
161134
161262
|
const entries = completion.types.map((type) => ({
|
|
161135
|
-
name: type.value,
|
|
161263
|
+
name: escapeString(type.value, quoteChar),
|
|
161136
161264
|
kindModifiers: "" /* none */,
|
|
161137
161265
|
kind: "string" /* string */,
|
|
161138
161266
|
sortText: SortText.LocationPriority,
|
|
@@ -162936,7 +163064,7 @@ function declarationIsWriteAccess(decl) {
|
|
|
162936
163064
|
var Core;
|
|
162937
163065
|
((Core2) => {
|
|
162938
163066
|
function getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options = {}, sourceFilesSet = new Set(sourceFiles.map((f) => f.fileName))) {
|
|
162939
|
-
var _a, _b
|
|
163067
|
+
var _a, _b;
|
|
162940
163068
|
node = getAdjustedNode2(node, options);
|
|
162941
163069
|
if (isSourceFile(node)) {
|
|
162942
163070
|
const resolvedRef = ts_GoToDefinition_exports.getReferenceAtPosition(node, position, program);
|
|
@@ -162975,7 +163103,7 @@ var Core;
|
|
|
162975
163103
|
if (!options.implementations && isStringLiteralLike(node)) {
|
|
162976
163104
|
if (isModuleSpecifierLike(node)) {
|
|
162977
163105
|
const fileIncludeReasons = program.getFileIncludeReasons();
|
|
162978
|
-
const referencedFileName = (
|
|
163106
|
+
const referencedFileName = (_b = (_a = program.getResolvedModule(node.getSourceFile(), node.text, getModeForUsageLocation(node.getSourceFile(), node))) == null ? void 0 : _a.resolvedModule) == null ? void 0 : _b.resolvedFileName;
|
|
162979
163107
|
const referencedFile = referencedFileName ? program.getSourceFile(referencedFileName) : void 0;
|
|
162980
163108
|
if (referencedFile) {
|
|
162981
163109
|
return [{ definition: { type: 4 /* String */, node }, references: getReferencesForNonModule(referencedFile, fileIncludeReasons, program) || emptyArray }];
|
|
@@ -164378,7 +164506,7 @@ __export(ts_GoToDefinition_exports, {
|
|
|
164378
164506
|
|
|
164379
164507
|
// src/services/goToDefinition.ts
|
|
164380
164508
|
function getDefinitionAtPosition(program, sourceFile, position, searchOtherFilesOnly, stopAtAlias) {
|
|
164381
|
-
var _a
|
|
164509
|
+
var _a;
|
|
164382
164510
|
const resolvedRef = getReferenceAtPosition(sourceFile, position, program);
|
|
164383
164511
|
const fileReferenceDefinition = resolvedRef && [getDefinitionInfoForFileReference(resolvedRef.reference.fileName, resolvedRef.fileName, resolvedRef.unverified)] || emptyArray;
|
|
164384
164512
|
if (resolvedRef == null ? void 0 : resolvedRef.file) {
|
|
@@ -164451,7 +164579,7 @@ function getDefinitionAtPosition(program, sourceFile, position, searchOtherFiles
|
|
|
164451
164579
|
}
|
|
164452
164580
|
}
|
|
164453
164581
|
if (!symbol && isModuleSpecifierLike(fallbackNode)) {
|
|
164454
|
-
const ref = (
|
|
164582
|
+
const ref = (_a = program.getResolvedModule(sourceFile, fallbackNode.text, getModeForUsageLocation(sourceFile, fallbackNode))) == null ? void 0 : _a.resolvedModule;
|
|
164455
164583
|
if (ref) {
|
|
164456
164584
|
return [{
|
|
164457
164585
|
name: fallbackNode.text,
|
|
@@ -164546,7 +164674,7 @@ function getDefinitionFromOverriddenMember(typeChecker, node) {
|
|
|
164546
164674
|
return getDefinitionFromSymbol(typeChecker, symbol, node);
|
|
164547
164675
|
}
|
|
164548
164676
|
function getReferenceAtPosition(sourceFile, position, program) {
|
|
164549
|
-
var _a, _b
|
|
164677
|
+
var _a, _b;
|
|
164550
164678
|
const referencePath = findReferenceInPosition(sourceFile.referencedFiles, position);
|
|
164551
164679
|
if (referencePath) {
|
|
164552
164680
|
const file = program.getSourceFileFromReference(sourceFile, referencePath);
|
|
@@ -164563,11 +164691,11 @@ function getReferenceAtPosition(sourceFile, position, program) {
|
|
|
164563
164691
|
const file = program.getLibFileFromReference(libReferenceDirective);
|
|
164564
164692
|
return file && { reference: libReferenceDirective, fileName: file.fileName, file, unverified: false };
|
|
164565
164693
|
}
|
|
164566
|
-
|
|
164567
|
-
if (resolvedModules == null ? void 0 : resolvedModules.size()) {
|
|
164694
|
+
if (sourceFile.imports.length || sourceFile.moduleAugmentations.length) {
|
|
164568
164695
|
const node = getTouchingToken(sourceFile, position);
|
|
164569
|
-
|
|
164570
|
-
|
|
164696
|
+
let resolution;
|
|
164697
|
+
if (isModuleSpecifierLike(node) && isExternalModuleNameRelative(node.text) && (resolution = program.getResolvedModule(sourceFile, node.text, getModeForUsageLocation(sourceFile, node)))) {
|
|
164698
|
+
const verifiedFileName = (_b = resolution.resolvedModule) == null ? void 0 : _b.resolvedFileName;
|
|
164571
164699
|
const fileName = verifiedFileName || resolvePath(getDirectoryPath(sourceFile.fileName), node.text);
|
|
164572
164700
|
return {
|
|
164573
164701
|
file: program.getSourceFile(fileName),
|
|
@@ -166098,7 +166226,7 @@ function removeUnusedImports(oldImports, sourceFile, program) {
|
|
|
166098
166226
|
/*importClause*/
|
|
166099
166227
|
void 0,
|
|
166100
166228
|
moduleSpecifier,
|
|
166101
|
-
/*
|
|
166229
|
+
/*attributes*/
|
|
166102
166230
|
void 0
|
|
166103
166231
|
));
|
|
166104
166232
|
} else {
|
|
@@ -166264,7 +166392,7 @@ function coalesceExportsWorker(exportGroup, comparer) {
|
|
|
166264
166392
|
exportDecl.isTypeOnly,
|
|
166265
166393
|
exportDecl.exportClause && (isNamedExports(exportDecl.exportClause) ? factory.updateNamedExports(exportDecl.exportClause, sortedExportSpecifiers) : factory.updateNamespaceExport(exportDecl.exportClause, exportDecl.exportClause.name)),
|
|
166266
166394
|
exportDecl.moduleSpecifier,
|
|
166267
|
-
exportDecl.
|
|
166395
|
+
exportDecl.attributes
|
|
166268
166396
|
)
|
|
166269
166397
|
);
|
|
166270
166398
|
}
|
|
@@ -166296,7 +166424,7 @@ function updateImportDeclarationAndClause(importDeclaration, name, namedBindings
|
|
|
166296
166424
|
factory.updateImportClause(importDeclaration.importClause, importDeclaration.importClause.isTypeOnly, name, namedBindings),
|
|
166297
166425
|
// TODO: GH#18217
|
|
166298
166426
|
importDeclaration.moduleSpecifier,
|
|
166299
|
-
importDeclaration.
|
|
166427
|
+
importDeclaration.attributes
|
|
166300
166428
|
);
|
|
166301
166429
|
}
|
|
166302
166430
|
function sortSpecifiers(specifiers, comparer) {
|
|
@@ -166791,10 +166919,11 @@ function getOutliningSpanForNode(n, sourceFile) {
|
|
|
166791
166919
|
return spanForParenthesizedExpression(n);
|
|
166792
166920
|
case 275 /* NamedImports */:
|
|
166793
166921
|
case 279 /* NamedExports */:
|
|
166922
|
+
case 300 /* ImportAttributes */:
|
|
166794
166923
|
case 300 /* AssertClause */:
|
|
166795
|
-
return
|
|
166924
|
+
return spanForImportExportElements(n);
|
|
166796
166925
|
}
|
|
166797
|
-
function
|
|
166926
|
+
function spanForImportExportElements(node) {
|
|
166798
166927
|
if (!node.elements.length) {
|
|
166799
166928
|
return void 0;
|
|
166800
166929
|
}
|
|
@@ -169329,7 +169458,7 @@ var changesToText;
|
|
|
169329
169458
|
const sourceFile = createSourceFile(
|
|
169330
169459
|
"any file name",
|
|
169331
169460
|
nonFormattedText,
|
|
169332
|
-
99 /* ESNext */,
|
|
169461
|
+
{ languageVersion: 99 /* ESNext */, jsDocParsingMode: 1 /* ParseNone */ },
|
|
169333
169462
|
/*setParentNodes*/
|
|
169334
169463
|
true,
|
|
169335
169464
|
scriptKind
|
|
@@ -172614,6 +172743,7 @@ __export(ts_exports2, {
|
|
|
172614
172743
|
InternalEmitFlags: () => InternalEmitFlags,
|
|
172615
172744
|
InternalSymbolName: () => InternalSymbolName,
|
|
172616
172745
|
InvalidatedProjectKind: () => InvalidatedProjectKind,
|
|
172746
|
+
JSDocParsingMode: () => JSDocParsingMode,
|
|
172617
172747
|
JsDoc: () => ts_JsDoc_exports,
|
|
172618
172748
|
JsTyping: () => ts_JsTyping_exports,
|
|
172619
172749
|
JsxEmit: () => JsxEmit,
|
|
@@ -172941,6 +173071,7 @@ __export(ts_exports2, {
|
|
|
172941
173071
|
createModuleNotFoundChain: () => createModuleNotFoundChain,
|
|
172942
173072
|
createModuleResolutionCache: () => createModuleResolutionCache,
|
|
172943
173073
|
createModuleResolutionLoader: () => createModuleResolutionLoader,
|
|
173074
|
+
createModuleResolutionLoaderUsingGlobalCache: () => createModuleResolutionLoaderUsingGlobalCache,
|
|
172944
173075
|
createModuleSpecifierResolutionHost: () => createModuleSpecifierResolutionHost,
|
|
172945
173076
|
createMultiMap: () => createMultiMap,
|
|
172946
173077
|
createNodeConverters: () => createNodeConverters,
|
|
@@ -173369,6 +173500,7 @@ __export(ts_exports2, {
|
|
|
173369
173500
|
getLeadingCommentRangesOfNode: () => getLeadingCommentRangesOfNode,
|
|
173370
173501
|
getLeftmostAccessExpression: () => getLeftmostAccessExpression,
|
|
173371
173502
|
getLeftmostExpression: () => getLeftmostExpression,
|
|
173503
|
+
getLibraryNameFromLibFileName: () => getLibraryNameFromLibFileName,
|
|
173372
173504
|
getLineAndCharacterOfPosition: () => getLineAndCharacterOfPosition,
|
|
173373
173505
|
getLineInfo: () => getLineInfo,
|
|
173374
173506
|
getLineOfLocalPosition: () => getLineOfLocalPosition,
|
|
@@ -173500,7 +173632,7 @@ __export(ts_exports2, {
|
|
|
173500
173632
|
getRenameLocation: () => getRenameLocation,
|
|
173501
173633
|
getReplacementSpanForContextToken: () => getReplacementSpanForContextToken,
|
|
173502
173634
|
getResolutionDiagnostic: () => getResolutionDiagnostic,
|
|
173503
|
-
|
|
173635
|
+
getResolutionModeOverride: () => getResolutionModeOverride,
|
|
173504
173636
|
getResolveJsonModule: () => getResolveJsonModule,
|
|
173505
173637
|
getResolvePackageJsonExports: () => getResolvePackageJsonExports,
|
|
173506
173638
|
getResolvePackageJsonImports: () => getResolvePackageJsonImports,
|
|
@@ -173632,6 +173764,7 @@ __export(ts_exports2, {
|
|
|
173632
173764
|
hasPropertyAccessExpressionWithName: () => hasPropertyAccessExpressionWithName,
|
|
173633
173765
|
hasQuestionToken: () => hasQuestionToken,
|
|
173634
173766
|
hasRecordedExternalHelpers: () => hasRecordedExternalHelpers,
|
|
173767
|
+
hasResolutionModeOverride: () => hasResolutionModeOverride,
|
|
173635
173768
|
hasRestParameter: () => hasRestParameter,
|
|
173636
173769
|
hasScopeMarker: () => hasScopeMarker,
|
|
173637
173770
|
hasStaticModifier: () => hasStaticModifier,
|
|
@@ -173705,7 +173838,6 @@ __export(ts_exports2, {
|
|
|
173705
173838
|
isAssertClause: () => isAssertClause,
|
|
173706
173839
|
isAssertEntry: () => isAssertEntry,
|
|
173707
173840
|
isAssertionExpression: () => isAssertionExpression,
|
|
173708
|
-
isAssertionKey: () => isAssertionKey,
|
|
173709
173841
|
isAssertsKeyword: () => isAssertsKeyword,
|
|
173710
173842
|
isAssignmentDeclaration: () => isAssignmentDeclaration,
|
|
173711
173843
|
isAssignmentExpression: () => isAssignmentExpression,
|
|
@@ -173913,6 +174045,9 @@ __export(ts_exports2, {
|
|
|
173913
174045
|
isIfStatement: () => isIfStatement,
|
|
173914
174046
|
isIgnoredFileFromWildCardWatching: () => isIgnoredFileFromWildCardWatching,
|
|
173915
174047
|
isImplicitGlob: () => isImplicitGlob,
|
|
174048
|
+
isImportAttribute: () => isImportAttribute,
|
|
174049
|
+
isImportAttributeName: () => isImportAttributeName,
|
|
174050
|
+
isImportAttributes: () => isImportAttributes,
|
|
173916
174051
|
isImportCall: () => isImportCall,
|
|
173917
174052
|
isImportClause: () => isImportClause,
|
|
173918
174053
|
isImportDeclaration: () => isImportDeclaration,
|
|
@@ -173923,6 +174058,7 @@ __export(ts_exports2, {
|
|
|
173923
174058
|
isImportOrExportSpecifierName: () => isImportOrExportSpecifierName,
|
|
173924
174059
|
isImportSpecifier: () => isImportSpecifier,
|
|
173925
174060
|
isImportTypeAssertionContainer: () => isImportTypeAssertionContainer,
|
|
174061
|
+
isImportTypeAttributes: () => isImportTypeAttributes,
|
|
173926
174062
|
isImportTypeNode: () => isImportTypeNode,
|
|
173927
174063
|
isImportableFile: () => isImportableFile,
|
|
173928
174064
|
isInComment: () => isInComment,
|
|
@@ -174104,7 +174240,6 @@ __export(ts_exports2, {
|
|
|
174104
174240
|
isNamespaceReexportDeclaration: () => isNamespaceReexportDeclaration,
|
|
174105
174241
|
isNewExpression: () => isNewExpression,
|
|
174106
174242
|
isNewExpressionTarget: () => isNewExpressionTarget,
|
|
174107
|
-
isNightly: () => isNightly,
|
|
174108
174243
|
isNoSubstitutionTemplateLiteral: () => isNoSubstitutionTemplateLiteral,
|
|
174109
174244
|
isNode: () => isNode,
|
|
174110
174245
|
isNodeArray: () => isNodeArray,
|
|
@@ -176577,6 +176712,7 @@ var Project3 = class _Project {
|
|
|
176577
176712
|
this.directoryStructureHost = directoryStructureHost;
|
|
176578
176713
|
this.currentDirectory = this.projectService.getNormalizedAbsolutePath(currentDirectory);
|
|
176579
176714
|
this.getCanonicalFileName = this.projectService.toCanonicalFileName;
|
|
176715
|
+
this.jsDocParsingMode = this.projectService.jsDocParsingMode;
|
|
176580
176716
|
this.cancellationToken = new ThrottledCancellationToken(this.projectService.cancellationToken, this.projectService.throttleWaitMilliseconds);
|
|
176581
176717
|
if (!this.compilerOptions) {
|
|
176582
176718
|
this.compilerOptions = getDefaultCompilerOptions2();
|
|
@@ -176701,8 +176837,8 @@ var Project3 = class _Project {
|
|
|
176701
176837
|
}
|
|
176702
176838
|
if (this.program && !this.symlinks.hasProcessedResolutions()) {
|
|
176703
176839
|
this.symlinks.setSymlinksFromResolutions(
|
|
176704
|
-
this.program.
|
|
176705
|
-
this.program.
|
|
176840
|
+
this.program.forEachResolvedModule,
|
|
176841
|
+
this.program.forEachResolvedTypeReferenceDirective,
|
|
176706
176842
|
this.program.getAutomaticTypeDirectiveResolutions()
|
|
176707
176843
|
);
|
|
176708
176844
|
}
|
|
@@ -177485,12 +177621,23 @@ var Project3 = class _Project {
|
|
|
177485
177621
|
for (const f of oldProgram.getSourceFiles()) {
|
|
177486
177622
|
const newFile = this.program.getSourceFileByPath(f.resolvedPath);
|
|
177487
177623
|
if (!newFile || f.resolvedPath === f.path && newFile.resolvedPath !== f.path) {
|
|
177488
|
-
this.detachScriptInfoFromProject(
|
|
177624
|
+
this.detachScriptInfoFromProject(
|
|
177625
|
+
f.fileName,
|
|
177626
|
+
!!this.program.getSourceFileByPath(f.path),
|
|
177627
|
+
/*syncDirWatcherRemove*/
|
|
177628
|
+
true
|
|
177629
|
+
);
|
|
177489
177630
|
}
|
|
177490
177631
|
}
|
|
177491
177632
|
oldProgram.forEachResolvedProjectReference((resolvedProjectReference) => {
|
|
177492
177633
|
if (!this.program.getResolvedProjectReferenceByPath(resolvedProjectReference.sourceFile.path)) {
|
|
177493
|
-
this.detachScriptInfoFromProject(
|
|
177634
|
+
this.detachScriptInfoFromProject(
|
|
177635
|
+
resolvedProjectReference.sourceFile.fileName,
|
|
177636
|
+
/*noRemoveResolution*/
|
|
177637
|
+
void 0,
|
|
177638
|
+
/*syncDirWatcherRemove*/
|
|
177639
|
+
true
|
|
177640
|
+
);
|
|
177494
177641
|
}
|
|
177495
177642
|
});
|
|
177496
177643
|
}
|
|
@@ -177530,6 +177677,7 @@ var Project3 = class _Project {
|
|
|
177530
177677
|
this.resolutionCache.updateTypeRootsWatch();
|
|
177531
177678
|
}
|
|
177532
177679
|
}
|
|
177680
|
+
this.projectService.verifyProgram(this);
|
|
177533
177681
|
if (this.exportMapCache && !this.exportMapCache.isEmpty()) {
|
|
177534
177682
|
this.exportMapCache.releaseSymbols();
|
|
177535
177683
|
if (this.hasAddedorRemovedFiles || oldProgram && !this.program.structureIsReused) {
|
|
@@ -177602,12 +177750,12 @@ var Project3 = class _Project {
|
|
|
177602
177750
|
sendPerformanceEvent(kind, durationMs) {
|
|
177603
177751
|
this.projectService.sendPerformanceEvent(kind, durationMs);
|
|
177604
177752
|
}
|
|
177605
|
-
detachScriptInfoFromProject(uncheckedFileName, noRemoveResolution) {
|
|
177753
|
+
detachScriptInfoFromProject(uncheckedFileName, noRemoveResolution, syncDirWatcherRemove) {
|
|
177606
177754
|
const scriptInfoToDetach = this.projectService.getScriptInfo(uncheckedFileName);
|
|
177607
177755
|
if (scriptInfoToDetach) {
|
|
177608
177756
|
scriptInfoToDetach.detachFromProject(this);
|
|
177609
177757
|
if (!noRemoveResolution) {
|
|
177610
|
-
this.resolutionCache.removeResolutionsOfFile(scriptInfoToDetach.path);
|
|
177758
|
+
this.resolutionCache.removeResolutionsOfFile(scriptInfoToDetach.path, syncDirWatcherRemove);
|
|
177611
177759
|
}
|
|
177612
177760
|
}
|
|
177613
177761
|
}
|
|
@@ -178118,16 +178266,12 @@ function getUnresolvedImports(program, cachedUnresolvedImportsPerFile) {
|
|
|
178118
178266
|
}
|
|
178119
178267
|
function extractUnresolvedImportsFromSourceFile(program, file, ambientModules, cachedUnresolvedImportsPerFile) {
|
|
178120
178268
|
return getOrUpdate(cachedUnresolvedImportsPerFile, file.path, () => {
|
|
178121
|
-
var _a;
|
|
178122
|
-
const resolvedModules = (_a = program.resolvedModules) == null ? void 0 : _a.get(file.path);
|
|
178123
|
-
if (!resolvedModules)
|
|
178124
|
-
return emptyArray2;
|
|
178125
178269
|
let unresolvedImports;
|
|
178126
|
-
|
|
178270
|
+
program.forEachResolvedModule(({ resolvedModule }, name) => {
|
|
178127
178271
|
if ((!resolvedModule || !resolutionExtensionIsTSOrJson(resolvedModule.extension)) && !isExternalModuleNameRelative(name) && !ambientModules.some((m) => m === name)) {
|
|
178128
178272
|
unresolvedImports = append(unresolvedImports, parsePackageName(name).packageName);
|
|
178129
178273
|
}
|
|
178130
|
-
});
|
|
178274
|
+
}, file);
|
|
178131
178275
|
return unresolvedImports || emptyArray2;
|
|
178132
178276
|
});
|
|
178133
178277
|
}
|
|
@@ -178370,11 +178514,12 @@ var _AutoImportProviderProject = class _AutoImportProviderProject extends Projec
|
|
|
178370
178514
|
);
|
|
178371
178515
|
if (entrypoints) {
|
|
178372
178516
|
const real = (_a2 = host.realpath) == null ? void 0 : _a2.call(host, packageJson.packageDirectory);
|
|
178373
|
-
const
|
|
178517
|
+
const realPath2 = real ? hostProject.toPath(real) : void 0;
|
|
178518
|
+
const isSymlink = realPath2 && realPath2 !== hostProject.toPath(packageJson.packageDirectory);
|
|
178374
178519
|
if (isSymlink) {
|
|
178375
178520
|
symlinkCache.setSymlinkedDirectory(packageJson.packageDirectory, {
|
|
178376
178521
|
real,
|
|
178377
|
-
realPath:
|
|
178522
|
+
realPath: realPath2
|
|
178378
178523
|
});
|
|
178379
178524
|
}
|
|
178380
178525
|
return mapDefined(entrypoints, (entrypoint) => {
|
|
@@ -179128,6 +179273,8 @@ var _ProjectService = class _ProjectService {
|
|
|
179128
179273
|
this.extendedConfigCache = /* @__PURE__ */ new Map();
|
|
179129
179274
|
/** @internal */
|
|
179130
179275
|
this.verifyDocumentRegistry = noop;
|
|
179276
|
+
/** @internal */
|
|
179277
|
+
this.verifyProgram = noop;
|
|
179131
179278
|
var _a;
|
|
179132
179279
|
this.host = opts.host;
|
|
179133
179280
|
this.logger = opts.logger;
|
|
@@ -179143,6 +179290,7 @@ var _ProjectService = class _ProjectService {
|
|
|
179143
179290
|
this.allowLocalPluginLoads = !!opts.allowLocalPluginLoads;
|
|
179144
179291
|
this.typesMapLocation = opts.typesMapLocation === void 0 ? combinePaths(getDirectoryPath(this.getExecutingFilePath()), "typesMap.json") : opts.typesMapLocation;
|
|
179145
179292
|
this.session = opts.session;
|
|
179293
|
+
this.jsDocParsingMode = opts.jsDocParsingMode;
|
|
179146
179294
|
if (opts.serverMode !== void 0) {
|
|
179147
179295
|
this.serverMode = opts.serverMode;
|
|
179148
179296
|
} else {
|
|
@@ -179168,7 +179316,7 @@ var _ProjectService = class _ProjectService {
|
|
|
179168
179316
|
hostInfo: "Unknown host",
|
|
179169
179317
|
extraFileExtensions: []
|
|
179170
179318
|
};
|
|
179171
|
-
this.documentRegistry = createDocumentRegistryInternal(this.host.useCaseSensitiveFileNames, this.currentDirectory, this);
|
|
179319
|
+
this.documentRegistry = createDocumentRegistryInternal(this.host.useCaseSensitiveFileNames, this.currentDirectory, this.jsDocParsingMode, this);
|
|
179172
179320
|
const watchLogLevel = this.logger.hasLevel(3 /* verbose */) ? 2 /* Verbose */ : this.logger.loggingEnabled() ? 1 /* TriggerOnly */ : 0 /* None */;
|
|
179173
179321
|
const log = watchLogLevel !== 0 /* None */ ? (s) => this.logger.info(s) : noop;
|
|
179174
179322
|
this.packageJsonCache = createPackageJsonCache(this);
|
|
@@ -187179,6 +187327,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
187179
187327
|
InternalEmitFlags,
|
|
187180
187328
|
InternalSymbolName,
|
|
187181
187329
|
InvalidatedProjectKind,
|
|
187330
|
+
JSDocParsingMode,
|
|
187182
187331
|
JsDoc,
|
|
187183
187332
|
JsTyping,
|
|
187184
187333
|
JsxEmit,
|
|
@@ -187506,6 +187655,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
187506
187655
|
createModuleNotFoundChain,
|
|
187507
187656
|
createModuleResolutionCache,
|
|
187508
187657
|
createModuleResolutionLoader,
|
|
187658
|
+
createModuleResolutionLoaderUsingGlobalCache,
|
|
187509
187659
|
createModuleSpecifierResolutionHost,
|
|
187510
187660
|
createMultiMap,
|
|
187511
187661
|
createNodeConverters,
|
|
@@ -187934,6 +188084,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
187934
188084
|
getLeadingCommentRangesOfNode,
|
|
187935
188085
|
getLeftmostAccessExpression,
|
|
187936
188086
|
getLeftmostExpression,
|
|
188087
|
+
getLibraryNameFromLibFileName,
|
|
187937
188088
|
getLineAndCharacterOfPosition,
|
|
187938
188089
|
getLineInfo,
|
|
187939
188090
|
getLineOfLocalPosition,
|
|
@@ -188065,7 +188216,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
188065
188216
|
getRenameLocation,
|
|
188066
188217
|
getReplacementSpanForContextToken,
|
|
188067
188218
|
getResolutionDiagnostic,
|
|
188068
|
-
|
|
188219
|
+
getResolutionModeOverride,
|
|
188069
188220
|
getResolveJsonModule,
|
|
188070
188221
|
getResolvePackageJsonExports,
|
|
188071
188222
|
getResolvePackageJsonImports,
|
|
@@ -188197,6 +188348,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
188197
188348
|
hasPropertyAccessExpressionWithName,
|
|
188198
188349
|
hasQuestionToken,
|
|
188199
188350
|
hasRecordedExternalHelpers,
|
|
188351
|
+
hasResolutionModeOverride,
|
|
188200
188352
|
hasRestParameter,
|
|
188201
188353
|
hasScopeMarker,
|
|
188202
188354
|
hasStaticModifier,
|
|
@@ -188270,7 +188422,6 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
188270
188422
|
isAssertClause,
|
|
188271
188423
|
isAssertEntry,
|
|
188272
188424
|
isAssertionExpression,
|
|
188273
|
-
isAssertionKey,
|
|
188274
188425
|
isAssertsKeyword,
|
|
188275
188426
|
isAssignmentDeclaration,
|
|
188276
188427
|
isAssignmentExpression,
|
|
@@ -188478,6 +188629,9 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
188478
188629
|
isIfStatement,
|
|
188479
188630
|
isIgnoredFileFromWildCardWatching,
|
|
188480
188631
|
isImplicitGlob,
|
|
188632
|
+
isImportAttribute,
|
|
188633
|
+
isImportAttributeName,
|
|
188634
|
+
isImportAttributes,
|
|
188481
188635
|
isImportCall,
|
|
188482
188636
|
isImportClause,
|
|
188483
188637
|
isImportDeclaration,
|
|
@@ -188488,6 +188642,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
188488
188642
|
isImportOrExportSpecifierName,
|
|
188489
188643
|
isImportSpecifier,
|
|
188490
188644
|
isImportTypeAssertionContainer,
|
|
188645
|
+
isImportTypeAttributes,
|
|
188491
188646
|
isImportTypeNode,
|
|
188492
188647
|
isImportableFile,
|
|
188493
188648
|
isInComment,
|
|
@@ -188669,7 +188824,6 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
188669
188824
|
isNamespaceReexportDeclaration,
|
|
188670
188825
|
isNewExpression,
|
|
188671
188826
|
isNewExpressionTarget,
|
|
188672
|
-
isNightly,
|
|
188673
188827
|
isNoSubstitutionTemplateLiteral,
|
|
188674
188828
|
isNode,
|
|
188675
188829
|
isNodeArray,
|