typescript 4.7.0-dev.20220502 → 4.7.0-dev.20220505
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/AUTHORS.md +1 -0
- package/lib/de/diagnosticMessages.generated.json +2 -2
- package/lib/es/diagnosticMessages.generated.json +2 -2
- package/lib/ja/diagnosticMessages.generated.json +2 -2
- package/lib/lib.es2020.bigint.d.ts +4 -4
- package/lib/lib.es5.d.ts +14 -14
- package/lib/pl/diagnosticMessages.generated.json +2 -2
- package/lib/tr/diagnosticMessages.generated.json +2 -2
- package/lib/tsc.js +135 -119
- package/lib/tsserver.js +193 -174
- package/lib/tsserverlibrary.d.ts +7 -7
- package/lib/tsserverlibrary.js +193 -174
- package/lib/typescript.d.ts +7 -7
- package/lib/typescript.js +182 -165
- package/lib/typescriptServices.d.ts +7 -7
- package/lib/typescriptServices.js +182 -165
- package/lib/typingsInstaller.js +151 -144
- package/package.json +1 -1
package/lib/tsserver.js
CHANGED
|
@@ -100,7 +100,7 @@ var ts;
|
|
|
100
100
|
// The following is baselined as a literal template type without intervention
|
|
101
101
|
/** The version of the TypeScript compiler release */
|
|
102
102
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
103
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
103
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220505";
|
|
104
104
|
/* @internal */
|
|
105
105
|
var Comparison;
|
|
106
106
|
(function (Comparison) {
|
|
@@ -5276,10 +5276,11 @@ var ts;
|
|
|
5276
5276
|
ModuleResolutionKind[ModuleResolutionKind["Classic"] = 1] = "Classic";
|
|
5277
5277
|
ModuleResolutionKind[ModuleResolutionKind["NodeJs"] = 2] = "NodeJs";
|
|
5278
5278
|
// Starting with node12, node's module resolver has significant departures from traditional cjs resolution
|
|
5279
|
-
// to better support ecmascript modules and their use within node - more features are still being added
|
|
5280
|
-
//
|
|
5281
|
-
// version-
|
|
5282
|
-
|
|
5279
|
+
// to better support ecmascript modules and their use within node - however more features are still being added.
|
|
5280
|
+
// TypeScript's Node ESM support was introduced after Node 12 went end-of-life, and Node 14 is the earliest stable
|
|
5281
|
+
// version that supports both pattern trailers - *but*, Node 16 is the first version that also supports ECMASCript 2022.
|
|
5282
|
+
// In turn, we offer both a `NodeNext` moving resolution target, and a `Node16` version-anchored resolution target
|
|
5283
|
+
ModuleResolutionKind[ModuleResolutionKind["Node16"] = 3] = "Node16";
|
|
5283
5284
|
ModuleResolutionKind[ModuleResolutionKind["NodeNext"] = 99] = "NodeNext";
|
|
5284
5285
|
})(ModuleResolutionKind = ts.ModuleResolutionKind || (ts.ModuleResolutionKind = {}));
|
|
5285
5286
|
var ModuleDetectionKind;
|
|
@@ -5289,7 +5290,7 @@ var ts;
|
|
|
5289
5290
|
*/
|
|
5290
5291
|
ModuleDetectionKind[ModuleDetectionKind["Legacy"] = 1] = "Legacy";
|
|
5291
5292
|
/**
|
|
5292
|
-
* Legacy, but also files with jsx under react-jsx or react-jsxdev and esm mode files under moduleResolution:
|
|
5293
|
+
* Legacy, but also files with jsx under react-jsx or react-jsxdev and esm mode files under moduleResolution: node16+
|
|
5293
5294
|
*/
|
|
5294
5295
|
ModuleDetectionKind[ModuleDetectionKind["Auto"] = 2] = "Auto";
|
|
5295
5296
|
/**
|
|
@@ -5334,8 +5335,8 @@ var ts;
|
|
|
5334
5335
|
ModuleKind[ModuleKind["ES2020"] = 6] = "ES2020";
|
|
5335
5336
|
ModuleKind[ModuleKind["ES2022"] = 7] = "ES2022";
|
|
5336
5337
|
ModuleKind[ModuleKind["ESNext"] = 99] = "ESNext";
|
|
5337
|
-
//
|
|
5338
|
-
ModuleKind[ModuleKind["
|
|
5338
|
+
// Node16+ is an amalgam of commonjs (albeit updated) and es2022+, and represents a distinct module system from es2020/esnext
|
|
5339
|
+
ModuleKind[ModuleKind["Node16"] = 100] = "Node16";
|
|
5339
5340
|
ModuleKind[ModuleKind["NodeNext"] = 199] = "NodeNext";
|
|
5340
5341
|
})(ModuleKind = ts.ModuleKind || (ts.ModuleKind = {}));
|
|
5341
5342
|
var JsxEmit;
|
|
@@ -8257,6 +8258,7 @@ var ts;
|
|
|
8257
8258
|
_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias: diag(1274, ts.DiagnosticCategory.Error, "_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias_1274", "'{0}' modifier can only appear on a type parameter of a class, interface or type alias"),
|
|
8258
8259
|
with_statements_are_not_allowed_in_an_async_function_block: diag(1300, ts.DiagnosticCategory.Error, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
|
|
8259
8260
|
await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, ts.DiagnosticCategory.Error, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."),
|
|
8261
|
+
The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level: diag(1309, ts.DiagnosticCategory.Error, "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309", "The current file is a CommonJS module and cannot use 'await' at the top level."),
|
|
8260
8262
|
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: diag(1312, ts.DiagnosticCategory.Error, "Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312", "Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."),
|
|
8261
8263
|
The_body_of_an_if_statement_cannot_be_the_empty_statement: diag(1313, ts.DiagnosticCategory.Error, "The_body_of_an_if_statement_cannot_be_the_empty_statement_1313", "The body of an 'if' statement cannot be the empty statement."),
|
|
8262
8264
|
Global_module_exports_may_only_appear_in_module_files: diag(1314, ts.DiagnosticCategory.Error, "Global_module_exports_may_only_appear_in_module_files_1314", "Global module exports may only appear in module files."),
|
|
@@ -8268,8 +8270,8 @@ var ts;
|
|
|
8268
8270
|
Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1320, ts.DiagnosticCategory.Error, "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320", "Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member."),
|
|
8269
8271
|
Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1321, ts.DiagnosticCategory.Error, "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321", "Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member."),
|
|
8270
8272
|
Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1322, ts.DiagnosticCategory.Error, "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322", "Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member."),
|
|
8271
|
-
|
|
8272
|
-
|
|
8273
|
+
Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext: diag(1323, ts.DiagnosticCategory.Error, "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323", "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'."),
|
|
8274
|
+
Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext: diag(1324, ts.DiagnosticCategory.Error, "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nod_1324", "Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'."),
|
|
8273
8275
|
Argument_of_dynamic_import_cannot_be_spread_element: diag(1325, ts.DiagnosticCategory.Error, "Argument_of_dynamic_import_cannot_be_spread_element_1325", "Argument of dynamic import cannot be spread element."),
|
|
8274
8276
|
This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments: diag(1326, ts.DiagnosticCategory.Error, "This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326", "This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments."),
|
|
8275
8277
|
String_literal_with_double_quotes_expected: diag(1327, ts.DiagnosticCategory.Error, "String_literal_with_double_quotes_expected_1327", "String literal with double quotes expected."),
|
|
@@ -8286,7 +8288,7 @@ var ts;
|
|
|
8286
8288
|
Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, ts.DiagnosticCategory.Error, "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339", "Module '{0}' does not refer to a value, but is used as a value here."),
|
|
8287
8289
|
Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, ts.DiagnosticCategory.Error, "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340", "Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"),
|
|
8288
8290
|
Type_arguments_cannot_be_used_here: diag(1342, ts.DiagnosticCategory.Error, "Type_arguments_cannot_be_used_here_1342", "Type arguments cannot be used here."),
|
|
8289
|
-
|
|
8291
|
+
The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext: diag(1343, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'."),
|
|
8290
8292
|
A_label_is_not_allowed_here: diag(1344, ts.DiagnosticCategory.Error, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."),
|
|
8291
8293
|
An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, ts.DiagnosticCategory.Error, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."),
|
|
8292
8294
|
This_parameter_is_not_allowed_with_use_strict_directive: diag(1346, ts.DiagnosticCategory.Error, "This_parameter_is_not_allowed_with_use_strict_directive_1346", "This parameter is not allowed with 'use strict' directive."),
|
|
@@ -8317,7 +8319,7 @@ var ts;
|
|
|
8317
8319
|
await_expressions_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(1375, ts.DiagnosticCategory.Error, "await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375", "'await' expressions 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."),
|
|
8318
8320
|
_0_was_imported_here: diag(1376, ts.DiagnosticCategory.Message, "_0_was_imported_here_1376", "'{0}' was imported here."),
|
|
8319
8321
|
_0_was_exported_here: diag(1377, ts.DiagnosticCategory.Message, "_0_was_exported_here_1377", "'{0}' was exported here."),
|
|
8320
|
-
|
|
8322
|
+
Top_level_await_expressions_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(1378, ts.DiagnosticCategory.Error, "Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378", "Top-level 'await' expressions 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."),
|
|
8321
8323
|
An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type: diag(1379, ts.DiagnosticCategory.Error, "An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type_1379", "An import alias cannot reference a declaration that was exported using 'export type'."),
|
|
8322
8324
|
An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type: diag(1380, ts.DiagnosticCategory.Error, "An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380", "An import alias cannot reference a declaration that was imported using 'import type'."),
|
|
8323
8325
|
Unexpected_token_Did_you_mean_or_rbrace: diag(1381, ts.DiagnosticCategory.Error, "Unexpected_token_Did_you_mean_or_rbrace_1381", "Unexpected token. Did you mean `{'}'}` or `}`?"),
|
|
@@ -8369,7 +8371,7 @@ var ts;
|
|
|
8369
8371
|
File_redirects_to_file_0: diag(1429, ts.DiagnosticCategory.Message, "File_redirects_to_file_0_1429", "File redirects to file '{0}'"),
|
|
8370
8372
|
The_file_is_in_the_program_because_Colon: diag(1430, ts.DiagnosticCategory.Message, "The_file_is_in_the_program_because_Colon_1430", "The file is in the program because:"),
|
|
8371
8373
|
for_await_loops_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(1431, ts.DiagnosticCategory.Error, "for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431", "'for await' loops 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."),
|
|
8372
|
-
|
|
8374
|
+
Top_level_for_await_loops_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(1432, ts.DiagnosticCategory.Error, "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432", "Top-level 'for await' loops 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."),
|
|
8373
8375
|
Decorators_may_not_be_applied_to_this_parameters: diag(1433, ts.DiagnosticCategory.Error, "Decorators_may_not_be_applied_to_this_parameters_1433", "Decorators may not be applied to 'this' parameters."),
|
|
8374
8376
|
Unexpected_keyword_or_identifier: diag(1434, ts.DiagnosticCategory.Error, "Unexpected_keyword_or_identifier_1434", "Unexpected keyword or identifier."),
|
|
8375
8377
|
Unknown_keyword_or_identifier_Did_you_mean_0: diag(1435, ts.DiagnosticCategory.Error, "Unknown_keyword_or_identifier_Did_you_mean_0_1435", "Unknown keyword or identifier. Did you mean '{0}'?"),
|
|
@@ -8387,7 +8389,7 @@ var ts;
|
|
|
8387
8389
|
Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed: diag(1449, ts.DiagnosticCategory.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."),
|
|
8388
8390
|
Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments: diag(1450, ts.DiagnosticCategory.Message, "Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450", "Dynamic imports can only accept a module specifier and an optional assertion as arguments"),
|
|
8389
8391
|
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, ts.DiagnosticCategory.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"),
|
|
8390
|
-
|
|
8392
|
+
Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext: diag(1452, ts.DiagnosticCategory.Error, "Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext_1452", "Resolution modes are only supported when `moduleResolution` is `node16` or `nodenext`."),
|
|
8391
8393
|
resolution_mode_should_be_either_require_or_import: diag(1453, ts.DiagnosticCategory.Error, "resolution_mode_should_be_either_require_or_import_1453", "`resolution-mode` should be either `require` or `import`."),
|
|
8392
8394
|
resolution_mode_can_only_be_set_for_type_only_imports: diag(1454, ts.DiagnosticCategory.Error, "resolution_mode_can_only_be_set_for_type_only_imports_1454", "`resolution-mode` can only be set for type-only imports."),
|
|
8393
8395
|
resolution_mode_is_the_only_valid_key_for_type_import_assertions: diag(1455, ts.DiagnosticCategory.Error, "resolution_mode_is_the_only_valid_key_for_type_import_assertions_1455", "`resolution-mode` is the only valid key for type import assertions."),
|
|
@@ -8398,7 +8400,7 @@ var ts;
|
|
|
8398
8400
|
An_import_declaration_can_only_be_used_at_the_top_level_of_a_module: diag(1473, ts.DiagnosticCategory.Error, "An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473", "An import declaration can only be used at the top level of a module."),
|
|
8399
8401
|
An_export_declaration_can_only_be_used_at_the_top_level_of_a_module: diag(1474, ts.DiagnosticCategory.Error, "An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474", "An export declaration can only be used at the top level of a module."),
|
|
8400
8402
|
Control_what_method_is_used_to_detect_module_format_JS_files: diag(1475, ts.DiagnosticCategory.Message, "Control_what_method_is_used_to_detect_module_format_JS_files_1475", "Control what method is used to detect module-format JS files."),
|
|
8401
|
-
|
|
8403
|
+
auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules: diag(1476, ts.DiagnosticCategory.Message, "auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476", "\"auto\": Treat files with imports, exports, import.meta, jsx (with jsx: react-jsx), or esm format (with module: node16+) as modules."),
|
|
8402
8404
|
The_types_of_0_are_incompatible_between_these_types: diag(2200, ts.DiagnosticCategory.Error, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
|
|
8403
8405
|
The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, ts.DiagnosticCategory.Error, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
|
|
8404
8406
|
Call_signature_return_types_0_and_1_are_incompatible: diag(2202, ts.DiagnosticCategory.Error, "Call_signature_return_types_0_and_1_are_incompatible_2202", "Call signature return types '{0}' and '{1}' are incompatible.", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ true),
|
|
@@ -8407,7 +8409,6 @@ var ts;
|
|
|
8407
8409
|
Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1: diag(2205, ts.DiagnosticCategory.Error, "Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2205", "Construct signatures with no arguments have incompatible return types '{0}' and '{1}'.", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ true),
|
|
8408
8410
|
The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement: diag(2206, ts.DiagnosticCategory.Error, "The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement_2206", "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement."),
|
|
8409
8411
|
The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement: diag(2207, ts.DiagnosticCategory.Error, "The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement_2207", "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement."),
|
|
8410
|
-
This_type_parameter_probably_needs_an_extends_object_constraint: diag(2208, ts.DiagnosticCategory.Error, "This_type_parameter_probably_needs_an_extends_object_constraint_2208", "This type parameter probably needs an `extends object` constraint."),
|
|
8411
8412
|
Duplicate_identifier_0: diag(2300, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."),
|
|
8412
8413
|
Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2301, ts.DiagnosticCategory.Error, "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),
|
|
8413
8414
|
Static_members_cannot_reference_class_type_parameters: diag(2302, ts.DiagnosticCategory.Error, "Static_members_cannot_reference_class_type_parameters_2302", "Static members cannot reference class type parameters."),
|
|
@@ -8885,8 +8886,8 @@ var ts;
|
|
|
8885
8886
|
Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext: diag(2821, ts.DiagnosticCategory.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'."),
|
|
8886
8887
|
Import_assertions_cannot_be_used_with_type_only_imports_or_exports: diag(2822, ts.DiagnosticCategory.Error, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."),
|
|
8887
8888
|
Cannot_find_namespace_0_Did_you_mean_1: diag(2833, ts.DiagnosticCategory.Error, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"),
|
|
8888
|
-
|
|
8889
|
-
|
|
8889
|
+
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, ts.DiagnosticCategory.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."),
|
|
8890
|
+
Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0: diag(2835, ts.DiagnosticCategory.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}'?"),
|
|
8890
8891
|
Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls: diag(2836, ts.DiagnosticCategory.Error, "Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls_2836", "Import assertions are not allowed on statements that transpile to commonjs 'require' calls."),
|
|
8891
8892
|
Import_assertion_values_must_be_string_literal_expressions: diag(2837, ts.DiagnosticCategory.Error, "Import_assertion_values_must_be_string_literal_expressions_2837", "Import assertion values must be string literal expressions."),
|
|
8892
8893
|
All_declarations_of_0_must_have_identical_constraints: diag(2838, ts.DiagnosticCategory.Error, "All_declarations_of_0_must_have_identical_constraints_2838", "All declarations of '{0}' must have identical constraints."),
|
|
@@ -9552,7 +9553,6 @@ var ts;
|
|
|
9552
9553
|
This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead: diag(7059, ts.DiagnosticCategory.Error, "This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059", "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead."),
|
|
9553
9554
|
This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint: diag(7060, ts.DiagnosticCategory.Error, "This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060", "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint."),
|
|
9554
9555
|
A_mapped_type_may_not_declare_properties_or_methods: diag(7061, ts.DiagnosticCategory.Error, "A_mapped_type_may_not_declare_properties_or_methods_7061", "A mapped type may not declare properties or methods."),
|
|
9555
|
-
JSON_imports_are_experimental_in_ES_module_mode_imports: diag(7062, ts.DiagnosticCategory.Error, "JSON_imports_are_experimental_in_ES_module_mode_imports_7062", "JSON imports are experimental in ES module mode imports."),
|
|
9556
9556
|
You_cannot_rename_this_element: diag(8000, ts.DiagnosticCategory.Error, "You_cannot_rename_this_element_8000", "You cannot rename this element."),
|
|
9557
9557
|
You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, ts.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."),
|
|
9558
9558
|
import_can_only_be_used_in_TypeScript_files: diag(8002, ts.DiagnosticCategory.Error, "import_can_only_be_used_in_TypeScript_files_8002", "'import ... =' can only be used in TypeScript files."),
|
|
@@ -14845,7 +14845,7 @@ var ts;
|
|
|
14845
14845
|
}
|
|
14846
14846
|
ts.getNonAugmentationDeclaration = getNonAugmentationDeclaration;
|
|
14847
14847
|
function isCommonJSContainingModuleKind(kind) {
|
|
14848
|
-
return kind === ts.ModuleKind.CommonJS || kind === ts.ModuleKind.
|
|
14848
|
+
return kind === ts.ModuleKind.CommonJS || kind === ts.ModuleKind.Node16 || kind === ts.ModuleKind.NodeNext;
|
|
14849
14849
|
}
|
|
14850
14850
|
function isEffectiveExternalModule(node, compilerOptions) {
|
|
14851
14851
|
return ts.isExternalModule(node) || compilerOptions.isolatedModules || (isCommonJSContainingModuleKind(getEmitModuleKind(compilerOptions)) && !!node.commonJsModuleIndicator);
|
|
@@ -20013,7 +20013,7 @@ var ts;
|
|
|
20013
20013
|
file.externalModuleIndicator = ts.isFileProbablyExternalModule(file);
|
|
20014
20014
|
};
|
|
20015
20015
|
case ts.ModuleDetectionKind.Auto:
|
|
20016
|
-
// If module is nodenext or
|
|
20016
|
+
// If module is nodenext or node16, all esm format files are modules
|
|
20017
20017
|
// If jsx is react-jsx or react-jsxdev then jsx tags force module-ness
|
|
20018
20018
|
// otherwise, the presence of import or export statments (or import.meta) implies module-ness
|
|
20019
20019
|
var checks = [ts.isFileProbablyExternalModule];
|
|
@@ -20021,7 +20021,7 @@ var ts;
|
|
|
20021
20021
|
checks.push(isFileModuleFromUsingJSXTag);
|
|
20022
20022
|
}
|
|
20023
20023
|
var moduleKind = getEmitModuleKind(options);
|
|
20024
|
-
if (moduleKind === ts.ModuleKind.
|
|
20024
|
+
if (moduleKind === ts.ModuleKind.Node16 || moduleKind === ts.ModuleKind.NodeNext) {
|
|
20025
20025
|
checks.push(isFileForcedToBeModuleByFormat);
|
|
20026
20026
|
}
|
|
20027
20027
|
var combined_1 = ts.or.apply(void 0, checks);
|
|
@@ -20032,7 +20032,7 @@ var ts;
|
|
|
20032
20032
|
ts.getSetExternalModuleIndicator = getSetExternalModuleIndicator;
|
|
20033
20033
|
function getEmitScriptTarget(compilerOptions) {
|
|
20034
20034
|
return compilerOptions.target ||
|
|
20035
|
-
(compilerOptions.module === ts.ModuleKind.
|
|
20035
|
+
(compilerOptions.module === ts.ModuleKind.Node16 && 9 /* ES2022 */) ||
|
|
20036
20036
|
(compilerOptions.module === ts.ModuleKind.NodeNext && 99 /* ESNext */) ||
|
|
20037
20037
|
0 /* ES3 */;
|
|
20038
20038
|
}
|
|
@@ -20050,8 +20050,8 @@ var ts;
|
|
|
20050
20050
|
case ts.ModuleKind.CommonJS:
|
|
20051
20051
|
moduleResolution = ts.ModuleResolutionKind.NodeJs;
|
|
20052
20052
|
break;
|
|
20053
|
-
case ts.ModuleKind.
|
|
20054
|
-
moduleResolution = ts.ModuleResolutionKind.
|
|
20053
|
+
case ts.ModuleKind.Node16:
|
|
20054
|
+
moduleResolution = ts.ModuleResolutionKind.Node16;
|
|
20055
20055
|
break;
|
|
20056
20056
|
case ts.ModuleKind.NodeNext:
|
|
20057
20057
|
moduleResolution = ts.ModuleResolutionKind.NodeNext;
|
|
@@ -20076,7 +20076,7 @@ var ts;
|
|
|
20076
20076
|
case ts.ModuleKind.ES2020:
|
|
20077
20077
|
case ts.ModuleKind.ES2022:
|
|
20078
20078
|
case ts.ModuleKind.ESNext:
|
|
20079
|
-
case ts.ModuleKind.
|
|
20079
|
+
case ts.ModuleKind.Node16:
|
|
20080
20080
|
case ts.ModuleKind.NodeNext:
|
|
20081
20081
|
return true;
|
|
20082
20082
|
default:
|
|
@@ -20101,7 +20101,7 @@ var ts;
|
|
|
20101
20101
|
return compilerOptions.esModuleInterop;
|
|
20102
20102
|
}
|
|
20103
20103
|
switch (getEmitModuleKind(compilerOptions)) {
|
|
20104
|
-
case ts.ModuleKind.
|
|
20104
|
+
case ts.ModuleKind.Node16:
|
|
20105
20105
|
case ts.ModuleKind.NodeNext:
|
|
20106
20106
|
return true;
|
|
20107
20107
|
}
|
|
@@ -26183,7 +26183,7 @@ var ts;
|
|
|
26183
26183
|
return node;
|
|
26184
26184
|
}
|
|
26185
26185
|
function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) {
|
|
26186
|
-
var node = baseFactory.createBaseSourceFileNode(305 /* SourceFile */);
|
|
26186
|
+
var node = (source.redirectInfo ? Object.create(source.redirectInfo.redirectTarget) : baseFactory.createBaseSourceFileNode(305 /* SourceFile */));
|
|
26187
26187
|
for (var p in source) {
|
|
26188
26188
|
if (p === "emitNode" || ts.hasProperty(node, p) || !ts.hasProperty(source, p))
|
|
26189
26189
|
continue;
|
|
@@ -31308,7 +31308,7 @@ var ts;
|
|
|
31308
31308
|
initializeState("", content, languageVersion, /*syntaxCursor*/ undefined, 1 /* JS */);
|
|
31309
31309
|
// Prime the scanner.
|
|
31310
31310
|
nextToken();
|
|
31311
|
-
var entityName = parseEntityName(/*allowReservedWords*/ true
|
|
31311
|
+
var entityName = parseEntityName(/*allowReservedWords*/ true);
|
|
31312
31312
|
var isInvalid = token() === 1 /* EndOfFileToken */ && !parseDiagnostics.length;
|
|
31313
31313
|
clearState();
|
|
31314
31314
|
return isInvalid ? entityName : undefined;
|
|
@@ -32908,7 +32908,7 @@ var ts;
|
|
|
32908
32908
|
}
|
|
32909
32909
|
return createMissingList();
|
|
32910
32910
|
}
|
|
32911
|
-
function parseEntityName(allowReservedWords,
|
|
32911
|
+
function parseEntityName(allowReservedWords, diagnosticMessage) {
|
|
32912
32912
|
var pos = getNodePos();
|
|
32913
32913
|
var entity = allowReservedWords ? parseIdentifierName(diagnosticMessage) : parseIdentifier(diagnosticMessage);
|
|
32914
32914
|
var dotPos = getNodePos();
|
|
@@ -32919,7 +32919,7 @@ var ts;
|
|
|
32919
32919
|
break;
|
|
32920
32920
|
}
|
|
32921
32921
|
dotPos = getNodePos();
|
|
32922
|
-
entity = finishNode(factory.createQualifiedName(entity, parseRightSideOfDot(allowReservedWords, allowPrivateIdentifiers)), pos);
|
|
32922
|
+
entity = finishNode(factory.createQualifiedName(entity, parseRightSideOfDot(allowReservedWords, /* allowPrivateIdentifiers */ false)), pos);
|
|
32923
32923
|
}
|
|
32924
32924
|
return entity;
|
|
32925
32925
|
}
|
|
@@ -33052,7 +33052,7 @@ var ts;
|
|
|
33052
33052
|
}
|
|
33053
33053
|
// TYPES
|
|
33054
33054
|
function parseEntityNameOfTypeReference() {
|
|
33055
|
-
return parseEntityName(/*allowReservedWords*/ true,
|
|
33055
|
+
return parseEntityName(/*allowReservedWords*/ true, ts.Diagnostics.Type_expected);
|
|
33056
33056
|
}
|
|
33057
33057
|
function parseTypeArgumentsOfTypeReference() {
|
|
33058
33058
|
if (!scanner.hasPrecedingLineBreak() && reScanLessThanToken() === 29 /* LessThanToken */) {
|
|
@@ -33185,7 +33185,7 @@ var ts;
|
|
|
33185
33185
|
function parseTypeQuery() {
|
|
33186
33186
|
var pos = getNodePos();
|
|
33187
33187
|
parseExpected(112 /* TypeOfKeyword */);
|
|
33188
|
-
var entityName = parseEntityName(/*allowReservedWords*/ true
|
|
33188
|
+
var entityName = parseEntityName(/*allowReservedWords*/ true);
|
|
33189
33189
|
// Make sure we perform ASI to prevent parsing the next line's type arguments as part of an instantiation expression.
|
|
33190
33190
|
var typeArguments = !scanner.hasPrecedingLineBreak() ? tryParseTypeArguments() : undefined;
|
|
33191
33191
|
return finishNode(factory.createTypeQueryNode(entityName, typeArguments), pos);
|
|
@@ -34153,10 +34153,10 @@ var ts;
|
|
|
34153
34153
|
setDecoratorContext(/*val*/ false);
|
|
34154
34154
|
}
|
|
34155
34155
|
var pos = getNodePos();
|
|
34156
|
-
var expr = parseAssignmentExpressionOrHigher(
|
|
34156
|
+
var expr = parseAssignmentExpressionOrHigher();
|
|
34157
34157
|
var operatorToken;
|
|
34158
34158
|
while ((operatorToken = parseOptionalToken(27 /* CommaToken */))) {
|
|
34159
|
-
expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher(
|
|
34159
|
+
expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher(), pos);
|
|
34160
34160
|
}
|
|
34161
34161
|
if (saveDecoratorContext) {
|
|
34162
34162
|
setDecoratorContext(/*val*/ true);
|
|
@@ -34164,9 +34164,9 @@ var ts;
|
|
|
34164
34164
|
return expr;
|
|
34165
34165
|
}
|
|
34166
34166
|
function parseInitializer() {
|
|
34167
|
-
return parseOptional(63 /* EqualsToken */) ? parseAssignmentExpressionOrHigher(
|
|
34167
|
+
return parseOptional(63 /* EqualsToken */) ? parseAssignmentExpressionOrHigher() : undefined;
|
|
34168
34168
|
}
|
|
34169
|
-
function parseAssignmentExpressionOrHigher(
|
|
34169
|
+
function parseAssignmentExpressionOrHigher() {
|
|
34170
34170
|
// AssignmentExpression[in,yield]:
|
|
34171
34171
|
// 1) ConditionalExpression[?in,?yield]
|
|
34172
34172
|
// 2) LeftHandSideExpression = AssignmentExpression[?in,?yield]
|
|
@@ -34192,7 +34192,7 @@ var ts;
|
|
|
34192
34192
|
// If we do successfully parse arrow-function, we must *not* recurse for productions 1, 2 or 3. An ArrowFunction is
|
|
34193
34193
|
// not a LeftHandSideExpression, nor does it start a ConditionalExpression. So we are done
|
|
34194
34194
|
// with AssignmentExpression if we see one.
|
|
34195
|
-
var arrowExpression = tryParseParenthesizedArrowFunctionExpression(
|
|
34195
|
+
var arrowExpression = tryParseParenthesizedArrowFunctionExpression() || tryParseAsyncSimpleArrowFunctionExpression();
|
|
34196
34196
|
if (arrowExpression) {
|
|
34197
34197
|
return arrowExpression;
|
|
34198
34198
|
}
|
|
@@ -34211,7 +34211,7 @@ var ts;
|
|
|
34211
34211
|
// parameter ('x => ...') above. We handle it here by checking if the parsed expression was a single
|
|
34212
34212
|
// identifier and the current token is an arrow.
|
|
34213
34213
|
if (expr.kind === 79 /* Identifier */ && token() === 38 /* EqualsGreaterThanToken */) {
|
|
34214
|
-
return parseSimpleArrowFunctionExpression(pos, expr,
|
|
34214
|
+
return parseSimpleArrowFunctionExpression(pos, expr, /*asyncModifier*/ undefined);
|
|
34215
34215
|
}
|
|
34216
34216
|
// Now see if we might be in cases '2' or '3'.
|
|
34217
34217
|
// If the expression was a LHS expression, and we have an assignment operator, then
|
|
@@ -34220,7 +34220,7 @@ var ts;
|
|
|
34220
34220
|
// Note: we call reScanGreaterToken so that we get an appropriately merged token
|
|
34221
34221
|
// for cases like `> > =` becoming `>>=`
|
|
34222
34222
|
if (ts.isLeftHandSideExpression(expr) && ts.isAssignmentOperator(reScanGreaterToken())) {
|
|
34223
|
-
return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher(
|
|
34223
|
+
return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher(), pos);
|
|
34224
34224
|
}
|
|
34225
34225
|
// It wasn't an assignment or a lambda. This is a conditional expression:
|
|
34226
34226
|
return parseConditionalExpressionRest(expr, pos);
|
|
@@ -34263,7 +34263,7 @@ var ts;
|
|
|
34263
34263
|
nextToken();
|
|
34264
34264
|
if (!scanner.hasPrecedingLineBreak() &&
|
|
34265
34265
|
(token() === 41 /* AsteriskToken */ || isStartOfExpression())) {
|
|
34266
|
-
return finishNode(factory.createYieldExpression(parseOptionalToken(41 /* AsteriskToken */), parseAssignmentExpressionOrHigher(
|
|
34266
|
+
return finishNode(factory.createYieldExpression(parseOptionalToken(41 /* AsteriskToken */), parseAssignmentExpressionOrHigher()), pos);
|
|
34267
34267
|
}
|
|
34268
34268
|
else {
|
|
34269
34269
|
// if the next token is not on the same line as yield. or we don't have an '*' or
|
|
@@ -34271,7 +34271,7 @@ var ts;
|
|
|
34271
34271
|
return finishNode(factory.createYieldExpression(/*asteriskToken*/ undefined, /*expression*/ undefined), pos);
|
|
34272
34272
|
}
|
|
34273
34273
|
}
|
|
34274
|
-
function parseSimpleArrowFunctionExpression(pos, identifier,
|
|
34274
|
+
function parseSimpleArrowFunctionExpression(pos, identifier, asyncModifier) {
|
|
34275
34275
|
ts.Debug.assert(token() === 38 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
|
|
34276
34276
|
var parameter = factory.createParameterDeclaration(
|
|
34277
34277
|
/*decorators*/ undefined,
|
|
@@ -34283,11 +34283,11 @@ var ts;
|
|
|
34283
34283
|
finishNode(parameter, identifier.pos);
|
|
34284
34284
|
var parameters = createNodeArray([parameter], parameter.pos, parameter.end);
|
|
34285
34285
|
var equalsGreaterThanToken = parseExpectedToken(38 /* EqualsGreaterThanToken */);
|
|
34286
|
-
var body = parseArrowFunctionExpressionBody(/*isAsync*/ !!asyncModifier
|
|
34286
|
+
var body = parseArrowFunctionExpressionBody(/*isAsync*/ !!asyncModifier);
|
|
34287
34287
|
var node = factory.createArrowFunction(asyncModifier, /*typeParameters*/ undefined, parameters, /*type*/ undefined, equalsGreaterThanToken, body);
|
|
34288
34288
|
return addJSDocComment(finishNode(node, pos));
|
|
34289
34289
|
}
|
|
34290
|
-
function tryParseParenthesizedArrowFunctionExpression(
|
|
34290
|
+
function tryParseParenthesizedArrowFunctionExpression() {
|
|
34291
34291
|
var triState = isParenthesizedArrowFunctionExpression();
|
|
34292
34292
|
if (triState === 0 /* False */) {
|
|
34293
34293
|
// It's definitely not a parenthesized arrow function expression.
|
|
@@ -34298,8 +34298,8 @@ var ts;
|
|
|
34298
34298
|
// it out, but don't allow any ambiguity, and return 'undefined' if this could be an
|
|
34299
34299
|
// expression instead.
|
|
34300
34300
|
return triState === 1 /* True */ ?
|
|
34301
|
-
parseParenthesizedArrowFunctionExpression(/*allowAmbiguity*/ true
|
|
34302
|
-
tryParse(
|
|
34301
|
+
parseParenthesizedArrowFunctionExpression(/*allowAmbiguity*/ true) :
|
|
34302
|
+
tryParse(parsePossibleParenthesizedArrowFunctionExpression);
|
|
34303
34303
|
}
|
|
34304
34304
|
// True -> We definitely expect a parenthesized arrow function here.
|
|
34305
34305
|
// False -> There *cannot* be a parenthesized arrow function here.
|
|
@@ -34429,25 +34429,25 @@ var ts;
|
|
|
34429
34429
|
return 2 /* Unknown */;
|
|
34430
34430
|
}
|
|
34431
34431
|
}
|
|
34432
|
-
function parsePossibleParenthesizedArrowFunctionExpression(
|
|
34432
|
+
function parsePossibleParenthesizedArrowFunctionExpression() {
|
|
34433
34433
|
var tokenPos = scanner.getTokenPos();
|
|
34434
34434
|
if (notParenthesizedArrow === null || notParenthesizedArrow === void 0 ? void 0 : notParenthesizedArrow.has(tokenPos)) {
|
|
34435
34435
|
return undefined;
|
|
34436
34436
|
}
|
|
34437
|
-
var result = parseParenthesizedArrowFunctionExpression(/*allowAmbiguity*/ false
|
|
34437
|
+
var result = parseParenthesizedArrowFunctionExpression(/*allowAmbiguity*/ false);
|
|
34438
34438
|
if (!result) {
|
|
34439
34439
|
(notParenthesizedArrow || (notParenthesizedArrow = new ts.Set())).add(tokenPos);
|
|
34440
34440
|
}
|
|
34441
34441
|
return result;
|
|
34442
34442
|
}
|
|
34443
|
-
function tryParseAsyncSimpleArrowFunctionExpression(
|
|
34443
|
+
function tryParseAsyncSimpleArrowFunctionExpression() {
|
|
34444
34444
|
// We do a check here so that we won't be doing unnecessarily call to "lookAhead"
|
|
34445
34445
|
if (token() === 131 /* AsyncKeyword */) {
|
|
34446
34446
|
if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === 1 /* True */) {
|
|
34447
34447
|
var pos = getNodePos();
|
|
34448
34448
|
var asyncModifier = parseModifiersForArrowFunction();
|
|
34449
34449
|
var expr = parseBinaryExpressionOrHigher(0 /* Lowest */);
|
|
34450
|
-
return parseSimpleArrowFunctionExpression(pos, expr,
|
|
34450
|
+
return parseSimpleArrowFunctionExpression(pos, expr, asyncModifier);
|
|
34451
34451
|
}
|
|
34452
34452
|
}
|
|
34453
34453
|
return undefined;
|
|
@@ -34471,7 +34471,7 @@ var ts;
|
|
|
34471
34471
|
}
|
|
34472
34472
|
return 0 /* False */;
|
|
34473
34473
|
}
|
|
34474
|
-
function parseParenthesizedArrowFunctionExpression(allowAmbiguity
|
|
34474
|
+
function parseParenthesizedArrowFunctionExpression(allowAmbiguity) {
|
|
34475
34475
|
var pos = getNodePos();
|
|
34476
34476
|
var hasJSDoc = hasPrecedingJSDocComment();
|
|
34477
34477
|
var modifiers = parseModifiersForArrowFunction();
|
|
@@ -34506,23 +34506,6 @@ var ts;
|
|
|
34506
34506
|
return undefined;
|
|
34507
34507
|
}
|
|
34508
34508
|
}
|
|
34509
|
-
// Given:
|
|
34510
|
-
// x ? y => ({ y }) : z => ({ z })
|
|
34511
|
-
// We try to parse the body of the first arrow function by looking at:
|
|
34512
|
-
// ({ y }) : z => ({ z })
|
|
34513
|
-
// This is a valid arrow function with "z" as the return type.
|
|
34514
|
-
//
|
|
34515
|
-
// But, if we're in the true side of a conditional expression, this colon
|
|
34516
|
-
// terminates the expression, so we cannot allow a return type if we aren't
|
|
34517
|
-
// certain whether or not the preceding text was parsed as a parameter list.
|
|
34518
|
-
//
|
|
34519
|
-
// For example,
|
|
34520
|
-
// a() ? (b: number, c?: string): void => d() : e
|
|
34521
|
-
// is determined by isParenthesizedArrowFunctionExpression to unambiguously
|
|
34522
|
-
// be an arrow expression, so we allow a return type.
|
|
34523
|
-
if (disallowReturnTypeInArrowFunction && token() === 58 /* ColonToken */) {
|
|
34524
|
-
return undefined;
|
|
34525
|
-
}
|
|
34526
34509
|
var type = parseReturnType(58 /* ColonToken */, /*isType*/ false);
|
|
34527
34510
|
if (type && !allowAmbiguity && typeHasArrowFunctionBlockingParseError(type)) {
|
|
34528
34511
|
return undefined;
|
|
@@ -34551,12 +34534,12 @@ var ts;
|
|
|
34551
34534
|
var lastToken = token();
|
|
34552
34535
|
var equalsGreaterThanToken = parseExpectedToken(38 /* EqualsGreaterThanToken */);
|
|
34553
34536
|
var body = (lastToken === 38 /* EqualsGreaterThanToken */ || lastToken === 18 /* OpenBraceToken */)
|
|
34554
|
-
? parseArrowFunctionExpressionBody(ts.some(modifiers, ts.isAsyncModifier)
|
|
34537
|
+
? parseArrowFunctionExpressionBody(ts.some(modifiers, ts.isAsyncModifier))
|
|
34555
34538
|
: parseIdentifier();
|
|
34556
34539
|
var node = factory.createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body);
|
|
34557
34540
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
34558
34541
|
}
|
|
34559
|
-
function parseArrowFunctionExpressionBody(isAsync
|
|
34542
|
+
function parseArrowFunctionExpressionBody(isAsync) {
|
|
34560
34543
|
if (token() === 18 /* OpenBraceToken */) {
|
|
34561
34544
|
return parseFunctionBlock(isAsync ? 2 /* Await */ : 0 /* None */);
|
|
34562
34545
|
}
|
|
@@ -34584,8 +34567,8 @@ var ts;
|
|
|
34584
34567
|
var savedTopLevel = topLevel;
|
|
34585
34568
|
topLevel = false;
|
|
34586
34569
|
var node = isAsync
|
|
34587
|
-
? doInAwaitContext(
|
|
34588
|
-
: doOutsideOfAwaitContext(
|
|
34570
|
+
? doInAwaitContext(parseAssignmentExpressionOrHigher)
|
|
34571
|
+
: doOutsideOfAwaitContext(parseAssignmentExpressionOrHigher);
|
|
34589
34572
|
topLevel = savedTopLevel;
|
|
34590
34573
|
return node;
|
|
34591
34574
|
}
|
|
@@ -34598,8 +34581,8 @@ var ts;
|
|
|
34598
34581
|
// Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and
|
|
34599
34582
|
// we do not that for the 'whenFalse' part.
|
|
34600
34583
|
var colonToken;
|
|
34601
|
-
return finishNode(factory.createConditionalExpression(leftOperand, questionToken, doOutsideOfContext(disallowInAndDecoratorContext,
|
|
34602
|
-
? parseAssignmentExpressionOrHigher(
|
|
34584
|
+
return finishNode(factory.createConditionalExpression(leftOperand, questionToken, doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher), colonToken = parseExpectedToken(58 /* ColonToken */), ts.nodeIsPresent(colonToken)
|
|
34585
|
+
? parseAssignmentExpressionOrHigher()
|
|
34603
34586
|
: createMissingNode(79 /* Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(58 /* ColonToken */))), pos);
|
|
34604
34587
|
}
|
|
34605
34588
|
function parseBinaryExpressionOrHigher(precedence) {
|
|
@@ -35491,13 +35474,13 @@ var ts;
|
|
|
35491
35474
|
function parseSpreadElement() {
|
|
35492
35475
|
var pos = getNodePos();
|
|
35493
35476
|
parseExpected(25 /* DotDotDotToken */);
|
|
35494
|
-
var expression = parseAssignmentExpressionOrHigher(
|
|
35477
|
+
var expression = parseAssignmentExpressionOrHigher();
|
|
35495
35478
|
return finishNode(factory.createSpreadElement(expression), pos);
|
|
35496
35479
|
}
|
|
35497
35480
|
function parseArgumentOrArrayLiteralElement() {
|
|
35498
35481
|
return token() === 25 /* DotDotDotToken */ ? parseSpreadElement() :
|
|
35499
35482
|
token() === 27 /* CommaToken */ ? finishNode(factory.createOmittedExpression(), getNodePos()) :
|
|
35500
|
-
parseAssignmentExpressionOrHigher(
|
|
35483
|
+
parseAssignmentExpressionOrHigher();
|
|
35501
35484
|
}
|
|
35502
35485
|
function parseArgumentExpression() {
|
|
35503
35486
|
return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement);
|
|
@@ -35515,7 +35498,7 @@ var ts;
|
|
|
35515
35498
|
var pos = getNodePos();
|
|
35516
35499
|
var hasJSDoc = hasPrecedingJSDocComment();
|
|
35517
35500
|
if (parseOptionalToken(25 /* DotDotDotToken */)) {
|
|
35518
|
-
var expression = parseAssignmentExpressionOrHigher(
|
|
35501
|
+
var expression = parseAssignmentExpressionOrHigher();
|
|
35519
35502
|
return withJSDoc(finishNode(factory.createSpreadAssignment(expression), pos), hasJSDoc);
|
|
35520
35503
|
}
|
|
35521
35504
|
var decorators = parseDecorators();
|
|
@@ -35544,7 +35527,7 @@ var ts;
|
|
|
35544
35527
|
var isShorthandPropertyAssignment = tokenIsIdentifier && (token() !== 58 /* ColonToken */);
|
|
35545
35528
|
if (isShorthandPropertyAssignment) {
|
|
35546
35529
|
var equalsToken = parseOptionalToken(63 /* EqualsToken */);
|
|
35547
|
-
var objectAssignmentInitializer = equalsToken ? allowInAnd(
|
|
35530
|
+
var objectAssignmentInitializer = equalsToken ? allowInAnd(parseAssignmentExpressionOrHigher) : undefined;
|
|
35548
35531
|
node = factory.createShorthandPropertyAssignment(name, objectAssignmentInitializer);
|
|
35549
35532
|
// Save equals token for error reporting.
|
|
35550
35533
|
// TODO(rbuckton): Consider manufacturing this when we need to report an error as it is otherwise not useful.
|
|
@@ -35552,7 +35535,7 @@ var ts;
|
|
|
35552
35535
|
}
|
|
35553
35536
|
else {
|
|
35554
35537
|
parseExpected(58 /* ColonToken */);
|
|
35555
|
-
var initializer = allowInAnd(
|
|
35538
|
+
var initializer = allowInAnd(parseAssignmentExpressionOrHigher);
|
|
35556
35539
|
node = factory.createPropertyAssignment(name, initializer);
|
|
35557
35540
|
}
|
|
35558
35541
|
// Decorators, Modifiers, questionToken, and exclamationToken are not supported by property assignments and are reported in the grammar checker
|
|
@@ -35726,7 +35709,7 @@ var ts;
|
|
|
35726
35709
|
}
|
|
35727
35710
|
var node;
|
|
35728
35711
|
if (awaitToken ? parseExpected(160 /* OfKeyword */) : parseOptional(160 /* OfKeyword */)) {
|
|
35729
|
-
var expression = allowInAnd(
|
|
35712
|
+
var expression = allowInAnd(parseAssignmentExpressionOrHigher);
|
|
35730
35713
|
parseExpected(21 /* CloseParenToken */);
|
|
35731
35714
|
node = factory.createForOfStatement(awaitToken, initializer, expression, parseStatement());
|
|
35732
35715
|
}
|
|
@@ -36894,7 +36877,7 @@ var ts;
|
|
|
36894
36877
|
var pos = getNodePos();
|
|
36895
36878
|
var name = ts.tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode(10 /* StringLiteral */);
|
|
36896
36879
|
parseExpected(58 /* ColonToken */);
|
|
36897
|
-
var value = parseAssignmentExpressionOrHigher(
|
|
36880
|
+
var value = parseAssignmentExpressionOrHigher();
|
|
36898
36881
|
return finishNode(factory.createAssertEntry(name, value), pos);
|
|
36899
36882
|
}
|
|
36900
36883
|
function parseAssertClause(skipAssertKeyword) {
|
|
@@ -36954,7 +36937,7 @@ var ts;
|
|
|
36954
36937
|
function parseModuleReference() {
|
|
36955
36938
|
return isExternalModuleReference()
|
|
36956
36939
|
? parseExternalModuleReference()
|
|
36957
|
-
: parseEntityName(/*allowReservedWords*/ false
|
|
36940
|
+
: parseEntityName(/*allowReservedWords*/ false);
|
|
36958
36941
|
}
|
|
36959
36942
|
function parseExternalModuleReference() {
|
|
36960
36943
|
var pos = getNodePos();
|
|
@@ -37133,7 +37116,7 @@ var ts;
|
|
|
37133
37116
|
else {
|
|
37134
37117
|
parseExpected(88 /* DefaultKeyword */);
|
|
37135
37118
|
}
|
|
37136
|
-
var expression = parseAssignmentExpressionOrHigher(
|
|
37119
|
+
var expression = parseAssignmentExpressionOrHigher();
|
|
37137
37120
|
parseSemicolon();
|
|
37138
37121
|
setAwaitContext(savedAwaitContext);
|
|
37139
37122
|
var node = factory.createExportAssignment(decorators, modifiers, isExportEquals, expression);
|
|
@@ -37207,7 +37190,7 @@ var ts;
|
|
|
37207
37190
|
var pos = getNodePos();
|
|
37208
37191
|
var hasBrace = parseOptional(18 /* OpenBraceToken */);
|
|
37209
37192
|
var p2 = getNodePos();
|
|
37210
|
-
var entityName = parseEntityName(/* allowReservedWords*/ false
|
|
37193
|
+
var entityName = parseEntityName(/* allowReservedWords*/ false);
|
|
37211
37194
|
while (token() === 80 /* PrivateIdentifier */) {
|
|
37212
37195
|
reScanHashToken(); // rescan #id as # id
|
|
37213
37196
|
nextTokenJSDoc(); // then skip the #
|
|
@@ -37650,7 +37633,7 @@ var ts;
|
|
|
37650
37633
|
// parseEntityName logs an error for non-identifier, so create a MissingNode ourselves to avoid the error
|
|
37651
37634
|
var p2 = getNodePos();
|
|
37652
37635
|
var name = ts.tokenIsIdentifierOrKeyword(token())
|
|
37653
|
-
? parseEntityName(/*allowReservedWords*/ true
|
|
37636
|
+
? parseEntityName(/*allowReservedWords*/ true)
|
|
37654
37637
|
: undefined;
|
|
37655
37638
|
if (name) {
|
|
37656
37639
|
while (token() === 80 /* PrivateIdentifier */) {
|
|
@@ -39307,7 +39290,7 @@ var ts;
|
|
|
39307
39290
|
es2020: ts.ModuleKind.ES2020,
|
|
39308
39291
|
es2022: ts.ModuleKind.ES2022,
|
|
39309
39292
|
esnext: ts.ModuleKind.ESNext,
|
|
39310
|
-
|
|
39293
|
+
node16: ts.ModuleKind.Node16,
|
|
39311
39294
|
nodenext: ts.ModuleKind.NodeNext,
|
|
39312
39295
|
})),
|
|
39313
39296
|
affectsModuleResolution: true,
|
|
@@ -39661,7 +39644,7 @@ var ts;
|
|
|
39661
39644
|
type: new ts.Map(ts.getEntries({
|
|
39662
39645
|
node: ts.ModuleResolutionKind.NodeJs,
|
|
39663
39646
|
classic: ts.ModuleResolutionKind.Classic,
|
|
39664
|
-
|
|
39647
|
+
node16: ts.ModuleResolutionKind.Node16,
|
|
39665
39648
|
nodenext: ts.ModuleResolutionKind.NodeNext,
|
|
39666
39649
|
})),
|
|
39667
39650
|
affectsModuleResolution: true,
|
|
@@ -40137,7 +40120,7 @@ var ts;
|
|
|
40137
40120
|
affectsModuleResolution: true,
|
|
40138
40121
|
description: ts.Diagnostics.Control_what_method_is_used_to_detect_module_format_JS_files,
|
|
40139
40122
|
category: ts.Diagnostics.Language_and_Environment,
|
|
40140
|
-
defaultValueDescription: ts.Diagnostics.
|
|
40123
|
+
defaultValueDescription: ts.Diagnostics.auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules,
|
|
40141
40124
|
}
|
|
40142
40125
|
];
|
|
40143
40126
|
/* @internal */
|
|
@@ -42373,9 +42356,9 @@ var ts;
|
|
|
42373
42356
|
// set in a non-modal module resolution setting here. Do note that our behavior is not particularly well defined when these mode-overriding imports
|
|
42374
42357
|
// are present in a non-modal project; while in theory we'd like to either ignore the mode or provide faithful modern resolution, depending on what we feel is best,
|
|
42375
42358
|
// in practice, not every cache has the options available to intelligently make the choice to ignore the mode request, and it's unclear how modern "faithful modern
|
|
42376
|
-
// resolution" should be (`
|
|
42359
|
+
// resolution" should be (`node16`? `nodenext`?). As such, witnessing a mode-overriding triple-slash reference in a non-modal module resolution
|
|
42377
42360
|
// context should _probably_ be an error - and that should likely be handled by the `Program` (which is what we do).
|
|
42378
|
-
if (resolutionMode === ts.ModuleKind.ESNext && (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.
|
|
42361
|
+
if (resolutionMode === ts.ModuleKind.ESNext && (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node16 || ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext)) {
|
|
42379
42362
|
features |= NodeResolutionFeatures.EsmMode;
|
|
42380
42363
|
}
|
|
42381
42364
|
var conditions = features & NodeResolutionFeatures.Exports ? features & NodeResolutionFeatures.EsmMode ? ["node", "import", "types"] : ["node", "require", "types"] : [];
|
|
@@ -42464,7 +42447,7 @@ var ts;
|
|
|
42464
42447
|
}
|
|
42465
42448
|
ts.resolveTypeReferenceDirective = resolveTypeReferenceDirective;
|
|
42466
42449
|
function getDefaultNodeResolutionFeatures(options) {
|
|
42467
|
-
return ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.
|
|
42450
|
+
return ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node16 ? NodeResolutionFeatures.Node16Default :
|
|
42468
42451
|
ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext ? NodeResolutionFeatures.NodeNextDefault :
|
|
42469
42452
|
NodeResolutionFeatures.None;
|
|
42470
42453
|
}
|
|
@@ -42822,8 +42805,8 @@ var ts;
|
|
|
42822
42805
|
case ts.ModuleKind.CommonJS:
|
|
42823
42806
|
moduleResolution = ts.ModuleResolutionKind.NodeJs;
|
|
42824
42807
|
break;
|
|
42825
|
-
case ts.ModuleKind.
|
|
42826
|
-
moduleResolution = ts.ModuleResolutionKind.
|
|
42808
|
+
case ts.ModuleKind.Node16:
|
|
42809
|
+
moduleResolution = ts.ModuleResolutionKind.Node16;
|
|
42827
42810
|
break;
|
|
42828
42811
|
case ts.ModuleKind.NodeNext:
|
|
42829
42812
|
moduleResolution = ts.ModuleResolutionKind.NodeNext;
|
|
@@ -42843,8 +42826,8 @@ var ts;
|
|
|
42843
42826
|
}
|
|
42844
42827
|
ts.perfLogger.logStartResolveModule(moduleName /* , containingFile, ModuleResolutionKind[moduleResolution]*/);
|
|
42845
42828
|
switch (moduleResolution) {
|
|
42846
|
-
case ts.ModuleResolutionKind.
|
|
42847
|
-
result =
|
|
42829
|
+
case ts.ModuleResolutionKind.Node16:
|
|
42830
|
+
result = node16ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
42848
42831
|
break;
|
|
42849
42832
|
case ts.ModuleResolutionKind.NodeNext:
|
|
42850
42833
|
result = nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
@@ -43078,15 +43061,15 @@ var ts;
|
|
|
43078
43061
|
// respecting the `.exports` member of packages' package.json files and its (conditional) mappings of export names
|
|
43079
43062
|
NodeResolutionFeatures[NodeResolutionFeatures["Exports"] = 8] = "Exports";
|
|
43080
43063
|
// allowing `*` in the LHS of an export to be followed by more content, eg `"./whatever/*.js"`
|
|
43081
|
-
// not
|
|
43064
|
+
// not supported in node 12 - https://github.com/nodejs/Release/issues/690
|
|
43082
43065
|
NodeResolutionFeatures[NodeResolutionFeatures["ExportsPatternTrailers"] = 16] = "ExportsPatternTrailers";
|
|
43083
43066
|
NodeResolutionFeatures[NodeResolutionFeatures["AllFeatures"] = 30] = "AllFeatures";
|
|
43084
|
-
NodeResolutionFeatures[NodeResolutionFeatures["
|
|
43067
|
+
NodeResolutionFeatures[NodeResolutionFeatures["Node16Default"] = 30] = "Node16Default";
|
|
43085
43068
|
NodeResolutionFeatures[NodeResolutionFeatures["NodeNextDefault"] = 30] = "NodeNextDefault";
|
|
43086
43069
|
NodeResolutionFeatures[NodeResolutionFeatures["EsmMode"] = 32] = "EsmMode";
|
|
43087
43070
|
})(NodeResolutionFeatures || (NodeResolutionFeatures = {}));
|
|
43088
|
-
function
|
|
43089
|
-
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.
|
|
43071
|
+
function node16ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
43072
|
+
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Node16Default, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
43090
43073
|
}
|
|
43091
43074
|
function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
43092
43075
|
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.NodeNextDefault, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
@@ -43126,7 +43109,7 @@ var ts;
|
|
|
43126
43109
|
var _a, _b;
|
|
43127
43110
|
var traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
43128
43111
|
var failedLookupLocations = [];
|
|
43129
|
-
// conditions are only used by the
|
|
43112
|
+
// conditions are only used by the node16/nodenext resolver - there's no priority order in the list,
|
|
43130
43113
|
//it's essentially a set (priority is determined by object insertion order in the object we look at).
|
|
43131
43114
|
var conditions = features & NodeResolutionFeatures.EsmMode ? ["node", "import", "types"] : ["node", "require", "types"];
|
|
43132
43115
|
if (compilerOptions.noDtsResolution) {
|
|
@@ -48513,7 +48496,7 @@ var ts;
|
|
|
48513
48496
|
var enumRelation = new ts.Map();
|
|
48514
48497
|
var builtinGlobals = ts.createSymbolTable();
|
|
48515
48498
|
builtinGlobals.set(undefinedSymbol.escapedName, undefinedSymbol);
|
|
48516
|
-
// Extensions suggested for path imports when module resolution is
|
|
48499
|
+
// Extensions suggested for path imports when module resolution is node16 or higher.
|
|
48517
48500
|
// The first element of each tuple is the extension a file has.
|
|
48518
48501
|
// The second element of each tuple is the extension that should be used in a path import.
|
|
48519
48502
|
// e.g. if we want to import file `foo.mts`, we should write `import {} from "./foo.mjs".
|
|
@@ -50802,7 +50785,7 @@ var ts;
|
|
|
50802
50785
|
if (resolvedModule.isExternalLibraryImport && !ts.resolutionExtensionIsTSOrJson(resolvedModule.extension)) {
|
|
50803
50786
|
errorOnImplicitAnyModule(/*isError*/ false, errorNode, resolvedModule, moduleReference);
|
|
50804
50787
|
}
|
|
50805
|
-
if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.
|
|
50788
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Node16 || ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeNext) {
|
|
50806
50789
|
var isSyncImport = (currentSourceFile.impliedNodeFormat === ts.ModuleKind.CommonJS && !ts.findAncestor(location, ts.isImportCall)) || !!ts.findAncestor(location, ts.isImportEqualsDeclaration);
|
|
50807
50790
|
var overrideClauseHost = ts.findAncestor(location, function (l) { return ts.isImportTypeNode(l) || ts.isExportDeclaration(l) || ts.isImportDeclaration(l); });
|
|
50808
50791
|
var overrideClause = overrideClauseHost && ts.isImportTypeNode(overrideClauseHost) ? (_g = overrideClauseHost.assertions) === null || _g === void 0 ? void 0 : _g.assertClause : overrideClauseHost === null || overrideClauseHost === void 0 ? void 0 : overrideClauseHost.assertClause;
|
|
@@ -50811,9 +50794,6 @@ var ts;
|
|
|
50811
50794
|
if (isSyncImport && sourceFile.impliedNodeFormat === ts.ModuleKind.ESNext && !ts.getResolutionModeOverrideForClause(overrideClause)) {
|
|
50812
50795
|
error(errorNode, ts.Diagnostics.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_synchronously_Use_dynamic_import_instead, moduleReference);
|
|
50813
50796
|
}
|
|
50814
|
-
if (mode === ts.ModuleKind.ESNext && compilerOptions.resolveJsonModule && resolvedModule.extension === ".json" /* Json */) {
|
|
50815
|
-
error(errorNode, ts.Diagnostics.JSON_imports_are_experimental_in_ES_module_mode_imports);
|
|
50816
|
-
}
|
|
50817
50797
|
}
|
|
50818
50798
|
// merged symbol is module declaration symbol combined with all augmentations
|
|
50819
50799
|
return getMergedSymbol(sourceFile.symbol);
|
|
@@ -50866,7 +50846,7 @@ var ts;
|
|
|
50866
50846
|
var tsExtension = ts.tryExtractTSExtension(moduleReference);
|
|
50867
50847
|
var isExtensionlessRelativePathImport = ts.pathIsRelative(moduleReference) && !ts.hasExtension(moduleReference);
|
|
50868
50848
|
var moduleResolutionKind = ts.getEmitModuleResolutionKind(compilerOptions);
|
|
50869
|
-
var
|
|
50849
|
+
var resolutionIsNode16OrNext = moduleResolutionKind === ts.ModuleResolutionKind.Node16 ||
|
|
50870
50850
|
moduleResolutionKind === ts.ModuleResolutionKind.NodeNext;
|
|
50871
50851
|
if (tsExtension) {
|
|
50872
50852
|
var diag = ts.Diagnostics.An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead;
|
|
@@ -50887,17 +50867,17 @@ var ts;
|
|
|
50887
50867
|
ts.hasJsonModuleEmitEnabled(compilerOptions)) {
|
|
50888
50868
|
error(errorNode, ts.Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
|
|
50889
50869
|
}
|
|
50890
|
-
else if (mode === ts.ModuleKind.ESNext &&
|
|
50870
|
+
else if (mode === ts.ModuleKind.ESNext && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) {
|
|
50891
50871
|
var absoluteRef_1 = ts.getNormalizedAbsolutePath(moduleReference, ts.getDirectoryPath(currentSourceFile.path));
|
|
50892
50872
|
var suggestedExt = (_h = suggestedExtensions.find(function (_a) {
|
|
50893
50873
|
var actualExt = _a[0], _importExt = _a[1];
|
|
50894
50874
|
return host.fileExists(absoluteRef_1 + actualExt);
|
|
50895
50875
|
})) === null || _h === void 0 ? void 0 : _h[1];
|
|
50896
50876
|
if (suggestedExt) {
|
|
50897
|
-
error(errorNode, ts.Diagnostics.
|
|
50877
|
+
error(errorNode, ts.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0, moduleReference + suggestedExt);
|
|
50898
50878
|
}
|
|
50899
50879
|
else {
|
|
50900
|
-
error(errorNode, ts.Diagnostics.
|
|
50880
|
+
error(errorNode, ts.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path);
|
|
50901
50881
|
}
|
|
50902
50882
|
}
|
|
50903
50883
|
else {
|
|
@@ -53219,7 +53199,7 @@ var ts;
|
|
|
53219
53199
|
var targetFile = ts.getSourceFileOfModule(chain[0]);
|
|
53220
53200
|
var specifier = void 0;
|
|
53221
53201
|
var assertion = void 0;
|
|
53222
|
-
if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.
|
|
53202
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Node16 || ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeNext) {
|
|
53223
53203
|
// An `import` type directed at an esm format file is only going to resolve in esm mode - set the esm mode assertion
|
|
53224
53204
|
if ((targetFile === null || targetFile === void 0 ? void 0 : targetFile.impliedNodeFormat) === ts.ModuleKind.ESNext && targetFile.impliedNodeFormat !== (contextFile === null || contextFile === void 0 ? void 0 : contextFile.impliedNodeFormat)) {
|
|
53225
53205
|
specifier = getSpecifierForModuleSymbol(chain[0], context, ts.ModuleKind.ESNext);
|
|
@@ -53233,7 +53213,7 @@ var ts;
|
|
|
53233
53213
|
}
|
|
53234
53214
|
if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Classic && specifier.indexOf("/node_modules/") >= 0) {
|
|
53235
53215
|
var oldSpecifier = specifier;
|
|
53236
|
-
if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.
|
|
53216
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Node16 || ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeNext) {
|
|
53237
53217
|
// We might be able to write a portable import type using a mode override; try specifier generation again, but with a different mode set
|
|
53238
53218
|
var swappedMode = (contextFile === null || contextFile === void 0 ? void 0 : contextFile.impliedNodeFormat) === ts.ModuleKind.ESNext ? ts.ModuleKind.CommonJS : ts.ModuleKind.ESNext;
|
|
53239
53219
|
specifier = getSpecifierForModuleSymbol(chain[0], context, swappedMode);
|
|
@@ -64710,7 +64690,6 @@ var ts;
|
|
|
64710
64690
|
return 0 /* False */;
|
|
64711
64691
|
}
|
|
64712
64692
|
function reportErrorResults(originalSource, originalTarget, source, target, headMessage) {
|
|
64713
|
-
var _a, _b;
|
|
64714
64693
|
var sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource);
|
|
64715
64694
|
var targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget);
|
|
64716
64695
|
source = (originalSource.aliasSymbol || sourceHasBase) ? originalSource : source;
|
|
@@ -64751,9 +64730,6 @@ var ts;
|
|
|
64751
64730
|
return;
|
|
64752
64731
|
}
|
|
64753
64732
|
reportRelationError(headMessage, source, target);
|
|
64754
|
-
if (strictNullChecks && source.flags & 8650752 /* TypeVariable */ && ((_b = (_a = source.symbol) === null || _a === void 0 ? void 0 : _a.declarations) === null || _b === void 0 ? void 0 : _b[0]) && !getConstraintOfType(source) && isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864 /* NonPrimitive */))) {
|
|
64755
|
-
associateRelatedInfo(ts.createDiagnosticForNode(source.symbol.declarations[0], ts.Diagnostics.This_type_parameter_probably_needs_an_extends_object_constraint));
|
|
64756
|
-
}
|
|
64757
64733
|
}
|
|
64758
64734
|
function traceUnionsOrIntersectionsTooLarge(source, target) {
|
|
64759
64735
|
if (!ts.tracing) {
|
|
@@ -65526,7 +65502,7 @@ var ts;
|
|
|
65526
65502
|
// IndexedAccess comparisons are handled above in the `targetFlags & TypeFlage.IndexedAccess` branch
|
|
65527
65503
|
if (!(sourceFlags & 8388608 /* IndexedAccess */ && targetFlags & 8388608 /* IndexedAccess */)) {
|
|
65528
65504
|
var constraint = getConstraintOfType(source);
|
|
65529
|
-
if (!
|
|
65505
|
+
if (!constraint || (sourceFlags & 262144 /* TypeParameter */ && constraint.flags & 1 /* Any */)) {
|
|
65530
65506
|
// A type variable with no constraint is not related to the non-primitive object type.
|
|
65531
65507
|
if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864 /* NonPrimitive */), 3 /* Both */)) {
|
|
65532
65508
|
resetErrorInfo(saveErrorInfo);
|
|
@@ -65534,12 +65510,12 @@ var ts;
|
|
|
65534
65510
|
}
|
|
65535
65511
|
}
|
|
65536
65512
|
// hi-speed no-this-instantiation check (less accurate, but avoids costly `this`-instantiation when the constraint will suffice), see #28231 for report on why this is needed
|
|
65537
|
-
else if (
|
|
65513
|
+
else if (result = isRelatedTo(constraint, target, 1 /* Source */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {
|
|
65538
65514
|
resetErrorInfo(saveErrorInfo);
|
|
65539
65515
|
return result;
|
|
65540
65516
|
}
|
|
65541
65517
|
// slower, fuller, this-instantiated check (necessary when comparing raw `this` types from base classes), see `subclassWithPolymorphicThisIsAssignable.ts` test for example
|
|
65542
|
-
else if (
|
|
65518
|
+
else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1 /* Source */, reportErrors && !(targetFlags & sourceFlags & 262144 /* TypeParameter */), /*headMessage*/ undefined, intersectionState)) {
|
|
65543
65519
|
resetErrorInfo(saveErrorInfo);
|
|
65544
65520
|
return result;
|
|
65545
65521
|
}
|
|
@@ -71202,7 +71178,7 @@ var ts;
|
|
|
71202
71178
|
if (ts.isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) {
|
|
71203
71179
|
var parent = declaration.parent.parent;
|
|
71204
71180
|
if (parent.kind === 254 /* VariableDeclaration */ && ts.getCombinedNodeFlags(declaration) & 2 /* Const */ || parent.kind === 164 /* Parameter */) {
|
|
71205
|
-
var links = getNodeLinks(
|
|
71181
|
+
var links = getNodeLinks(parent);
|
|
71206
71182
|
if (!(links.flags & 268435456 /* InCheckIdentifier */)) {
|
|
71207
71183
|
links.flags |= 268435456 /* InCheckIdentifier */;
|
|
71208
71184
|
var parentType = getTypeForBindingElementParent(parent, 0 /* Normal */);
|
|
@@ -77065,13 +77041,13 @@ var ts;
|
|
|
77065
77041
|
}
|
|
77066
77042
|
}
|
|
77067
77043
|
function checkImportMetaProperty(node) {
|
|
77068
|
-
if (moduleKind === ts.ModuleKind.
|
|
77044
|
+
if (moduleKind === ts.ModuleKind.Node16 || moduleKind === ts.ModuleKind.NodeNext) {
|
|
77069
77045
|
if (ts.getSourceFileOfNode(node).impliedNodeFormat !== ts.ModuleKind.ESNext) {
|
|
77070
77046
|
error(node, ts.Diagnostics.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output);
|
|
77071
77047
|
}
|
|
77072
77048
|
}
|
|
77073
77049
|
else if (moduleKind < ts.ModuleKind.ES2020 && moduleKind !== ts.ModuleKind.System) {
|
|
77074
|
-
error(node, ts.Diagnostics.
|
|
77050
|
+
error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext);
|
|
77075
77051
|
}
|
|
77076
77052
|
var file = ts.getSourceFileOfNode(node);
|
|
77077
77053
|
ts.Debug.assert(!!(file.flags & 4194304 /* PossiblyContainsImportMeta */), "Containing file is missing import meta node flag.");
|
|
@@ -78022,15 +77998,30 @@ var ts;
|
|
|
78022
77998
|
if (!hasParseDiagnostics(sourceFile)) {
|
|
78023
77999
|
var span = void 0;
|
|
78024
78000
|
if (!ts.isEffectiveExternalModule(sourceFile, compilerOptions)) {
|
|
78025
|
-
|
|
78026
|
-
span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos);
|
|
78001
|
+
span !== null && span !== void 0 ? span : (span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos));
|
|
78027
78002
|
var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.await_expressions_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);
|
|
78028
78003
|
diagnostics.add(diagnostic);
|
|
78029
78004
|
}
|
|
78030
|
-
|
|
78031
|
-
|
|
78032
|
-
|
|
78033
|
-
|
|
78005
|
+
switch (moduleKind) {
|
|
78006
|
+
case ts.ModuleKind.Node16:
|
|
78007
|
+
case ts.ModuleKind.NodeNext:
|
|
78008
|
+
if (sourceFile.impliedNodeFormat === ts.ModuleKind.CommonJS) {
|
|
78009
|
+
span !== null && span !== void 0 ? span : (span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos));
|
|
78010
|
+
diagnostics.add(ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level));
|
|
78011
|
+
break;
|
|
78012
|
+
}
|
|
78013
|
+
// fallthrough
|
|
78014
|
+
case ts.ModuleKind.ES2022:
|
|
78015
|
+
case ts.ModuleKind.ESNext:
|
|
78016
|
+
case ts.ModuleKind.System:
|
|
78017
|
+
if (languageVersion >= 4 /* ES2017 */) {
|
|
78018
|
+
break;
|
|
78019
|
+
}
|
|
78020
|
+
// fallthrough
|
|
78021
|
+
default:
|
|
78022
|
+
span !== null && span !== void 0 ? span : (span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos));
|
|
78023
|
+
diagnostics.add(ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.Top_level_await_expressions_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));
|
|
78024
|
+
break;
|
|
78034
78025
|
}
|
|
78035
78026
|
}
|
|
78036
78027
|
}
|
|
@@ -80472,8 +80463,8 @@ var ts;
|
|
|
80472
80463
|
if (node.assertions) {
|
|
80473
80464
|
var override = ts.getResolutionModeOverrideForClause(node.assertions.assertClause, grammarErrorOnNode);
|
|
80474
80465
|
if (override) {
|
|
80475
|
-
if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.
|
|
80476
|
-
grammarErrorOnNode(node.assertions.assertClause, ts.Diagnostics.
|
|
80466
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Node16 && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeNext) {
|
|
80467
|
+
grammarErrorOnNode(node.assertions.assertClause, ts.Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
|
|
80477
80468
|
}
|
|
80478
80469
|
}
|
|
80479
80470
|
}
|
|
@@ -81923,7 +81914,7 @@ var ts;
|
|
|
81923
81914
|
}
|
|
81924
81915
|
function checkCollisionWithRequireExportsInGeneratedCode(node, name) {
|
|
81925
81916
|
// No need to check for require or exports for ES6 modules and later
|
|
81926
|
-
if (moduleKind >= ts.ModuleKind.ES2015 && !(moduleKind >= ts.ModuleKind.
|
|
81917
|
+
if (moduleKind >= ts.ModuleKind.ES2015 && !(moduleKind >= ts.ModuleKind.Node16 && ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS)) {
|
|
81927
81918
|
return;
|
|
81928
81919
|
}
|
|
81929
81920
|
if (!name || !needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) {
|
|
@@ -84843,8 +84834,8 @@ var ts;
|
|
|
84843
84834
|
var validForTypeAssertions = ts.isExclusivelyTypeOnlyImportOrExport(declaration);
|
|
84844
84835
|
var override = ts.getResolutionModeOverrideForClause(declaration.assertClause, validForTypeAssertions ? grammarErrorOnNode : undefined);
|
|
84845
84836
|
if (validForTypeAssertions && override) {
|
|
84846
|
-
if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.
|
|
84847
|
-
return grammarErrorOnNode(declaration.assertClause, ts.Diagnostics.
|
|
84837
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Node16 && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeNext) {
|
|
84838
|
+
return grammarErrorOnNode(declaration.assertClause, ts.Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
|
|
84848
84839
|
}
|
|
84849
84840
|
return; // Other grammar checks do not apply to type-only imports with resolution mode assertions
|
|
84850
84841
|
}
|
|
@@ -88031,8 +88022,24 @@ var ts;
|
|
|
88031
88022
|
if (!ts.isEffectiveExternalModule(sourceFile, compilerOptions)) {
|
|
88032
88023
|
diagnostics.add(ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.for_await_loops_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));
|
|
88033
88024
|
}
|
|
88034
|
-
|
|
88035
|
-
|
|
88025
|
+
switch (moduleKind) {
|
|
88026
|
+
case ts.ModuleKind.Node16:
|
|
88027
|
+
case ts.ModuleKind.NodeNext:
|
|
88028
|
+
if (sourceFile.impliedNodeFormat === ts.ModuleKind.CommonJS) {
|
|
88029
|
+
diagnostics.add(ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level));
|
|
88030
|
+
break;
|
|
88031
|
+
}
|
|
88032
|
+
// fallthrough
|
|
88033
|
+
case ts.ModuleKind.ES2022:
|
|
88034
|
+
case ts.ModuleKind.ESNext:
|
|
88035
|
+
case ts.ModuleKind.System:
|
|
88036
|
+
if (languageVersion >= 4 /* ES2017 */) {
|
|
88037
|
+
break;
|
|
88038
|
+
}
|
|
88039
|
+
// fallthrough
|
|
88040
|
+
default:
|
|
88041
|
+
diagnostics.add(ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.Top_level_for_await_loops_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));
|
|
88042
|
+
break;
|
|
88036
88043
|
}
|
|
88037
88044
|
}
|
|
88038
88045
|
}
|
|
@@ -88727,7 +88734,7 @@ var ts;
|
|
|
88727
88734
|
}
|
|
88728
88735
|
function checkGrammarImportCallExpression(node) {
|
|
88729
88736
|
if (moduleKind === ts.ModuleKind.ES2015) {
|
|
88730
|
-
return grammarErrorOnNode(node, ts.Diagnostics.
|
|
88737
|
+
return grammarErrorOnNode(node, ts.Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext);
|
|
88731
88738
|
}
|
|
88732
88739
|
if (node.typeArguments) {
|
|
88733
88740
|
return grammarErrorOnNode(node, ts.Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments);
|
|
@@ -88738,7 +88745,7 @@ var ts;
|
|
|
88738
88745
|
checkGrammarForDisallowedTrailingComma(nodeArguments);
|
|
88739
88746
|
if (nodeArguments.length > 1) {
|
|
88740
88747
|
var assertionArgument = nodeArguments[1];
|
|
88741
|
-
return grammarErrorOnNode(assertionArgument, ts.Diagnostics.
|
|
88748
|
+
return grammarErrorOnNode(assertionArgument, ts.Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext);
|
|
88742
88749
|
}
|
|
88743
88750
|
}
|
|
88744
88751
|
if (nodeArguments.length === 0 || nodeArguments.length > 2) {
|
|
@@ -109004,7 +109011,7 @@ var ts;
|
|
|
109004
109011
|
return ts.transformECMAScriptModule;
|
|
109005
109012
|
case ts.ModuleKind.System:
|
|
109006
109013
|
return ts.transformSystemModule;
|
|
109007
|
-
case ts.ModuleKind.
|
|
109014
|
+
case ts.ModuleKind.Node16:
|
|
109008
109015
|
case ts.ModuleKind.NodeNext:
|
|
109009
109016
|
return ts.transformNodeModule;
|
|
109010
109017
|
default:
|
|
@@ -116027,7 +116034,7 @@ var ts;
|
|
|
116027
116034
|
*/
|
|
116028
116035
|
function getImpliedNodeFormatForFile(fileName, packageJsonInfoCache, host, options) {
|
|
116029
116036
|
switch (ts.getEmitModuleResolutionKind(options)) {
|
|
116030
|
-
case ts.ModuleResolutionKind.
|
|
116037
|
+
case ts.ModuleResolutionKind.Node16:
|
|
116031
116038
|
case ts.ModuleResolutionKind.NodeNext:
|
|
116032
116039
|
return ts.fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".mjs" /* Mjs */]) ? ts.ModuleKind.ESNext :
|
|
116033
116040
|
ts.fileExtensionIsOneOf(fileName, [".d.cts" /* Dcts */, ".cts" /* Cts */, ".cjs" /* Cjs */]) ? ts.ModuleKind.CommonJS :
|
|
@@ -116326,7 +116333,7 @@ var ts;
|
|
|
116326
116333
|
var containingFilename = ts.combinePaths(containingDirectory, ts.inferredTypesContainingFile);
|
|
116327
116334
|
var resolutions = resolveTypeReferenceDirectiveNamesWorker(typeReferences, containingFilename);
|
|
116328
116335
|
for (var i = 0; i < typeReferences.length; i++) {
|
|
116329
|
-
// under
|
|
116336
|
+
// under node16/nodenext module resolution, load `types`/ata include names as cjs resolution results by passing an `undefined` mode
|
|
116330
116337
|
processTypeReferenceDirective(typeReferences[i], /*mode*/ undefined, resolutions[i], { kind: ts.FileIncludeKind.AutomaticTypeDirectiveFile, typeReference: typeReferences[i], packageId: (_c = resolutions[i]) === null || _c === void 0 ? void 0 : _c.packageId });
|
|
116331
116338
|
}
|
|
116332
116339
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
@@ -117979,8 +117986,8 @@ var ts;
|
|
|
117979
117986
|
var fileName = ts.toFileNameLowerCase(ref.fileName);
|
|
117980
117987
|
ts.setResolvedTypeReferenceDirective(file, fileName, resolvedTypeReferenceDirective);
|
|
117981
117988
|
var mode = ref.resolutionMode || file.impliedNodeFormat;
|
|
117982
|
-
if (mode && ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.
|
|
117983
|
-
programDiagnostics.add(ts.createDiagnosticForRange(file, ref, ts.Diagnostics.
|
|
117989
|
+
if (mode && ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.Node16 && ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeNext) {
|
|
117990
|
+
programDiagnostics.add(ts.createDiagnosticForRange(file, ref, ts.Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext));
|
|
117984
117991
|
}
|
|
117985
117992
|
processTypeReferenceDirective(fileName, mode, resolvedTypeReferenceDirective, { kind: ts.FileIncludeKind.TypeReferenceDirective, file: file.path, index: index, });
|
|
117986
117993
|
}
|
|
@@ -118342,7 +118349,7 @@ var ts;
|
|
|
118342
118349
|
}
|
|
118343
118350
|
if (options.resolveJsonModule) {
|
|
118344
118351
|
if (ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeJs &&
|
|
118345
|
-
ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.
|
|
118352
|
+
ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.Node16 &&
|
|
118346
118353
|
ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeNext) {
|
|
118347
118354
|
createDiagnosticForOptionName(ts.Diagnostics.Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy, "resolveJsonModule");
|
|
118348
118355
|
}
|
|
@@ -121482,7 +121489,7 @@ var ts;
|
|
|
121482
121489
|
}
|
|
121483
121490
|
function isFormatRequiringExtensions(compilerOptions, importingSourceFileName, host) {
|
|
121484
121491
|
var _a;
|
|
121485
|
-
if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.
|
|
121492
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Node16
|
|
121486
121493
|
&& ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeNext) {
|
|
121487
121494
|
return false;
|
|
121488
121495
|
}
|
|
@@ -122067,7 +122074,7 @@ var ts;
|
|
|
122067
122074
|
var cachedPackageJson = (_b = (_a = host.getPackageJsonInfoCache) === null || _a === void 0 ? void 0 : _a.call(host)) === null || _b === void 0 ? void 0 : _b.getPackageJsonInfo(packageJsonPath);
|
|
122068
122075
|
if (typeof cachedPackageJson === "object" || cachedPackageJson === undefined && host.fileExists(packageJsonPath)) {
|
|
122069
122076
|
var packageJsonContent = (cachedPackageJson === null || cachedPackageJson === void 0 ? void 0 : cachedPackageJson.packageJsonContent) || JSON.parse(host.readFile(packageJsonPath));
|
|
122070
|
-
if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.
|
|
122077
|
+
if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node16 || ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext) {
|
|
122071
122078
|
// `conditions` *could* be made to go against `importingSourceFile.impliedNodeFormat` if something wanted to generate
|
|
122072
122079
|
// an ImportEqualsDeclaration in an ESM-implied file or an ImportCall in a CJS-implied file. But since this function is
|
|
122073
122080
|
// usually called to conjure an import out of thin air, we don't have an existing usage to call `getModeForUsageAtIndex`
|
|
@@ -127264,11 +127271,11 @@ var ts;
|
|
|
127264
127271
|
}
|
|
127265
127272
|
ts.getModuleSpecifierResolverHost = getModuleSpecifierResolverHost;
|
|
127266
127273
|
function moduleResolutionRespectsExports(moduleResolution) {
|
|
127267
|
-
return moduleResolution >= ts.ModuleResolutionKind.
|
|
127274
|
+
return moduleResolution >= ts.ModuleResolutionKind.Node16 && moduleResolution <= ts.ModuleResolutionKind.NodeNext;
|
|
127268
127275
|
}
|
|
127269
127276
|
ts.moduleResolutionRespectsExports = moduleResolutionRespectsExports;
|
|
127270
127277
|
function moduleResolutionUsesNodeModules(moduleResolution) {
|
|
127271
|
-
return moduleResolution === ts.ModuleResolutionKind.NodeJs || moduleResolution >= ts.ModuleResolutionKind.
|
|
127278
|
+
return moduleResolution === ts.ModuleResolutionKind.NodeJs || moduleResolution >= ts.ModuleResolutionKind.Node16 && moduleResolution <= ts.ModuleResolutionKind.NodeNext;
|
|
127272
127279
|
}
|
|
127273
127280
|
ts.moduleResolutionUsesNodeModules = moduleResolutionUsesNodeModules;
|
|
127274
127281
|
function makeImportIfNecessary(defaultImport, namedImports, moduleSpecifier, quotePreference) {
|
|
@@ -130592,11 +130599,11 @@ var ts;
|
|
|
130592
130599
|
}
|
|
130593
130600
|
function isEmitResolutionKindUsingNodeModules(compilerOptions) {
|
|
130594
130601
|
return ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeJs ||
|
|
130595
|
-
ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.
|
|
130602
|
+
ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Node16 ||
|
|
130596
130603
|
ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeNext;
|
|
130597
130604
|
}
|
|
130598
130605
|
function isEmitModuleResolutionRespectingExportMaps(compilerOptions) {
|
|
130599
|
-
return ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.
|
|
130606
|
+
return ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Node16 ||
|
|
130600
130607
|
ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeNext;
|
|
130601
130608
|
}
|
|
130602
130609
|
function getSupportedExtensionsForModuleResolution(compilerOptions) {
|
|
@@ -131156,7 +131163,7 @@ var ts;
|
|
|
131156
131163
|
KeywordCompletionFilters[KeywordCompletionFilters["TypeAssertionKeywords"] = 6] = "TypeAssertionKeywords";
|
|
131157
131164
|
KeywordCompletionFilters[KeywordCompletionFilters["TypeKeywords"] = 7] = "TypeKeywords";
|
|
131158
131165
|
KeywordCompletionFilters[KeywordCompletionFilters["TypeKeyword"] = 8] = "TypeKeyword";
|
|
131159
|
-
KeywordCompletionFilters[KeywordCompletionFilters["Last"] =
|
|
131166
|
+
KeywordCompletionFilters[KeywordCompletionFilters["Last"] = 8] = "Last";
|
|
131160
131167
|
})(KeywordCompletionFilters || (KeywordCompletionFilters = {}));
|
|
131161
131168
|
var GlobalsSearch;
|
|
131162
131169
|
(function (GlobalsSearch) {
|
|
@@ -131406,7 +131413,7 @@ var ts;
|
|
|
131406
131413
|
var entryNames_1 = new ts.Set(entries.map(function (e) { return e.name; }));
|
|
131407
131414
|
for (var _i = 0, _a = getKeywordCompletions(keywordFilters, !insideJsDocTagTypeExpression && ts.isSourceFileJS(sourceFile)); _i < _a.length; _i++) {
|
|
131408
131415
|
var keywordEntry = _a[_i];
|
|
131409
|
-
if (!entryNames_1.has(keywordEntry.name)) {
|
|
131416
|
+
if (isTypeOnlyLocation && ts.isTypeKeyword(ts.stringToToken(keywordEntry.name)) || !entryNames_1.has(keywordEntry.name)) {
|
|
131410
131417
|
ts.insertSorted(entries, keywordEntry, compareCompletionEntries, /*allowDuplicates*/ true);
|
|
131411
131418
|
}
|
|
131412
131419
|
}
|
|
@@ -133145,7 +133152,7 @@ var ts;
|
|
|
133145
133152
|
return;
|
|
133146
133153
|
}
|
|
133147
133154
|
// Do a relatively cheap check to bail early if all re-exports are non-importable
|
|
133148
|
-
// due to file location or package.json dependency filtering. For non-
|
|
133155
|
+
// due to file location or package.json dependency filtering. For non-node16+
|
|
133149
133156
|
// module resolution modes, getting past this point guarantees that we'll be
|
|
133150
133157
|
// able to generate a suitable module specifier, so we can safely show a completion,
|
|
133151
133158
|
// even if we defer computing the module specifier.
|
|
@@ -133153,7 +133160,7 @@ var ts;
|
|
|
133153
133160
|
if (!firstImportableExportInfo) {
|
|
133154
133161
|
return;
|
|
133155
133162
|
}
|
|
133156
|
-
// In
|
|
133163
|
+
// In node16+, module specifier resolution can fail due to modules being blocked
|
|
133157
133164
|
// by package.json `exports`. If that happens, don't show a completion item.
|
|
133158
133165
|
// N.B. in this resolution mode we always try to resolve module specifiers here,
|
|
133159
133166
|
// because we have to know now if it's going to fail so we can omit the completion
|
|
@@ -134125,7 +134132,7 @@ var ts;
|
|
|
134125
134132
|
function getKeywordCompletions(keywordFilter, filterOutTsOnlyKeywords) {
|
|
134126
134133
|
if (!filterOutTsOnlyKeywords)
|
|
134127
134134
|
return getTypescriptKeywordCompletions(keywordFilter);
|
|
134128
|
-
var index = keywordFilter +
|
|
134135
|
+
var index = keywordFilter + 8 /* Last */ + 1;
|
|
134129
134136
|
return _keywordCompletions[index] ||
|
|
134130
134137
|
(_keywordCompletions[index] = getTypescriptKeywordCompletions(keywordFilter)
|
|
134131
134138
|
.filter(function (entry) { return !isTypeScriptOnlyKeyword(ts.stringToToken(entry.name)); }));
|
|
@@ -138748,7 +138755,7 @@ var ts;
|
|
|
138748
138755
|
(function (ts) {
|
|
138749
138756
|
var GoToDefinition;
|
|
138750
138757
|
(function (GoToDefinition) {
|
|
138751
|
-
function getDefinitionAtPosition(program, sourceFile, position, searchOtherFilesOnly) {
|
|
138758
|
+
function getDefinitionAtPosition(program, sourceFile, position, searchOtherFilesOnly, stopAtAlias) {
|
|
138752
138759
|
var _a;
|
|
138753
138760
|
var _b;
|
|
138754
138761
|
var resolvedRef = getReferenceAtPosition(sourceFile, position, program);
|
|
@@ -138773,7 +138780,7 @@ var ts;
|
|
|
138773
138780
|
}
|
|
138774
138781
|
if (ts.isStaticModifier(node) && ts.isClassStaticBlockDeclaration(node.parent)) {
|
|
138775
138782
|
var classDecl = node.parent.parent;
|
|
138776
|
-
var _c = getSymbol(classDecl, typeChecker), symbol_1 = _c.symbol, failedAliasResolution_1 = _c.failedAliasResolution;
|
|
138783
|
+
var _c = getSymbol(classDecl, typeChecker, stopAtAlias), symbol_1 = _c.symbol, failedAliasResolution_1 = _c.failedAliasResolution;
|
|
138777
138784
|
var staticBlocks = ts.filter(classDecl.members, ts.isClassStaticBlockDeclaration);
|
|
138778
138785
|
var containerName_1 = symbol_1 ? typeChecker.symbolToString(symbol_1, classDecl) : "";
|
|
138779
138786
|
var sourceFile_1 = node.getSourceFile();
|
|
@@ -138783,14 +138790,14 @@ var ts;
|
|
|
138783
138790
|
return createDefinitionInfoFromName(typeChecker, staticBlock, "constructor" /* constructorImplementationElement */, "static {}", containerName_1, /*unverified*/ false, failedAliasResolution_1, { start: pos, length: "static".length });
|
|
138784
138791
|
});
|
|
138785
138792
|
}
|
|
138786
|
-
var _d = getSymbol(node, typeChecker), symbol = _d.symbol, failedAliasResolution = _d.failedAliasResolution;
|
|
138793
|
+
var _d = getSymbol(node, typeChecker, stopAtAlias), symbol = _d.symbol, failedAliasResolution = _d.failedAliasResolution;
|
|
138787
138794
|
var fallbackNode = node;
|
|
138788
138795
|
if (searchOtherFilesOnly && failedAliasResolution) {
|
|
138789
138796
|
// We couldn't resolve the specific import, try on the module specifier.
|
|
138790
138797
|
var importDeclaration = ts.forEach(__spreadArray([node], (symbol === null || symbol === void 0 ? void 0 : symbol.declarations) || ts.emptyArray, true), function (n) { return ts.findAncestor(n, ts.isAnyImportOrBareOrAccessedRequire); });
|
|
138791
138798
|
var moduleSpecifier = importDeclaration && ts.tryGetModuleSpecifierFromDeclaration(importDeclaration);
|
|
138792
138799
|
if (moduleSpecifier) {
|
|
138793
|
-
(_a = getSymbol(moduleSpecifier, typeChecker), symbol = _a.symbol, failedAliasResolution = _a.failedAliasResolution);
|
|
138800
|
+
(_a = getSymbol(moduleSpecifier, typeChecker, stopAtAlias), symbol = _a.symbol, failedAliasResolution = _a.failedAliasResolution);
|
|
138794
138801
|
fallbackNode = moduleSpecifier;
|
|
138795
138802
|
}
|
|
138796
138803
|
}
|
|
@@ -138964,7 +138971,7 @@ var ts;
|
|
|
138964
138971
|
if (ts.isImportMeta(node.parent) && node.parent.name === node) {
|
|
138965
138972
|
return definitionFromType(typeChecker.getTypeAtLocation(node.parent), typeChecker, node.parent, /*failedAliasResolution*/ false);
|
|
138966
138973
|
}
|
|
138967
|
-
var _a = getSymbol(node, typeChecker), symbol = _a.symbol, failedAliasResolution = _a.failedAliasResolution;
|
|
138974
|
+
var _a = getSymbol(node, typeChecker, /*stopAtAlias*/ false), symbol = _a.symbol, failedAliasResolution = _a.failedAliasResolution;
|
|
138968
138975
|
if (!symbol)
|
|
138969
138976
|
return undefined;
|
|
138970
138977
|
var typeAtLocation = typeChecker.getTypeOfSymbolAtLocation(symbol, node);
|
|
@@ -139015,14 +139022,14 @@ var ts;
|
|
|
139015
139022
|
function getDefinitionInfoForIndexSignatures(node, checker) {
|
|
139016
139023
|
return ts.mapDefined(checker.getIndexInfosAtLocation(node), function (info) { return info.declaration && createDefinitionFromSignatureDeclaration(checker, info.declaration); });
|
|
139017
139024
|
}
|
|
139018
|
-
function getSymbol(node, checker) {
|
|
139025
|
+
function getSymbol(node, checker, stopAtAlias) {
|
|
139019
139026
|
var symbol = checker.getSymbolAtLocation(node);
|
|
139020
139027
|
// If this is an alias, and the request came at the declaration location
|
|
139021
139028
|
// get the aliased symbol instead. This allows for goto def on an import e.g.
|
|
139022
139029
|
// import {A, B} from "mod";
|
|
139023
139030
|
// to jump to the implementation directly.
|
|
139024
139031
|
var failedAliasResolution = false;
|
|
139025
|
-
if ((symbol === null || symbol === void 0 ? void 0 : symbol.declarations) && symbol.flags & 2097152 /* Alias */ && shouldSkipAlias(node, symbol.declarations[0])) {
|
|
139032
|
+
if ((symbol === null || symbol === void 0 ? void 0 : symbol.declarations) && symbol.flags & 2097152 /* Alias */ && !stopAtAlias && shouldSkipAlias(node, symbol.declarations[0])) {
|
|
139026
139033
|
var aliased = checker.getAliasedSymbol(symbol);
|
|
139027
139034
|
if (aliased.declarations) {
|
|
139028
139035
|
return { symbol: aliased };
|
|
@@ -146550,6 +146557,9 @@ var ts;
|
|
|
146550
146557
|
consumeTokenAndAdvanceScanner(tokenInfo, node, nodeDynamicIndentation, node);
|
|
146551
146558
|
}
|
|
146552
146559
|
function processChildNode(child, inheritedIndentation, parent, parentDynamicIndentation, parentStartLine, undecoratedParentStartLine, isListItem, isFirstListItem) {
|
|
146560
|
+
if (ts.nodeIsMissing(child)) {
|
|
146561
|
+
return inheritedIndentation;
|
|
146562
|
+
}
|
|
146553
146563
|
var childStartPos = child.getStart(sourceFile);
|
|
146554
146564
|
var childStartLine = sourceFile.getLineAndCharacterOfPosition(childStartPos).line;
|
|
146555
146565
|
var undecoratedChildStartLine = childStartLine;
|
|
@@ -146616,6 +146626,13 @@ var ts;
|
|
|
146616
146626
|
var listStartToken = getOpenTokenForList(parent, nodes);
|
|
146617
146627
|
var listDynamicIndentation = parentDynamicIndentation;
|
|
146618
146628
|
var startLine = parentStartLine;
|
|
146629
|
+
// node range is outside the target range - do not dive inside
|
|
146630
|
+
if (!ts.rangeOverlapsWithStartEnd(originalRange, nodes.pos, nodes.end)) {
|
|
146631
|
+
if (nodes.end < originalRange.pos) {
|
|
146632
|
+
formattingScanner.skipToEndOf(nodes);
|
|
146633
|
+
}
|
|
146634
|
+
return;
|
|
146635
|
+
}
|
|
146619
146636
|
if (listStartToken !== 0 /* Unknown */) {
|
|
146620
146637
|
// introduce a new indentation scope for lists (including list start and end tokens)
|
|
146621
146638
|
while (formattingScanner.isOnToken() && formattingScanner.getStartPos() < originalRange.end) {
|
|
@@ -152608,7 +152625,7 @@ var ts;
|
|
|
152608
152625
|
case ts.ModuleKind.None:
|
|
152609
152626
|
// Fall back to the `import * as ns` style import.
|
|
152610
152627
|
return 2 /* Namespace */;
|
|
152611
|
-
case ts.ModuleKind.
|
|
152628
|
+
case ts.ModuleKind.Node16:
|
|
152612
152629
|
case ts.ModuleKind.NodeNext:
|
|
152613
152630
|
return importingFile.impliedNodeFormat === ts.ModuleKind.ESNext ? 2 /* Namespace */ : 3 /* CommonJS */;
|
|
152614
152631
|
default:
|
|
@@ -154521,8 +154538,8 @@ var ts;
|
|
|
154521
154538
|
(function (codefix) {
|
|
154522
154539
|
codefix.registerCodeFix({
|
|
154523
154540
|
errorCodes: [
|
|
154524
|
-
ts.Diagnostics.
|
|
154525
|
-
ts.Diagnostics.
|
|
154541
|
+
ts.Diagnostics.Top_level_await_expressions_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.code,
|
|
154542
|
+
ts.Diagnostics.Top_level_for_await_loops_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.code,
|
|
154526
154543
|
],
|
|
154527
154544
|
getCodeActions: function getCodeActionsToFixModuleAndTarget(context) {
|
|
154528
154545
|
var compilerOptions = context.program.getCompilerOptions();
|
|
@@ -164405,9 +164422,9 @@ var ts;
|
|
|
164405
164422
|
}
|
|
164406
164423
|
}
|
|
164407
164424
|
/// Goto definition
|
|
164408
|
-
function getDefinitionAtPosition(fileName, position, searchOtherFilesOnly) {
|
|
164425
|
+
function getDefinitionAtPosition(fileName, position, searchOtherFilesOnly, stopAtAlias) {
|
|
164409
164426
|
synchronizeHostData();
|
|
164410
|
-
return ts.GoToDefinition.getDefinitionAtPosition(program, getValidSourceFile(fileName), position, searchOtherFilesOnly);
|
|
164427
|
+
return ts.GoToDefinition.getDefinitionAtPosition(program, getValidSourceFile(fileName), position, searchOtherFilesOnly, stopAtAlias);
|
|
164411
164428
|
}
|
|
164412
164429
|
function getDefinitionAndBoundSpan(fileName, position) {
|
|
164413
164430
|
synchronizeHostData();
|
|
@@ -174357,7 +174374,8 @@ var ts;
|
|
|
174357
174374
|
var providePrefixAndSuffixTextForRename = _a.providePrefixAndSuffixTextForRename;
|
|
174358
174375
|
var outputs = [];
|
|
174359
174376
|
var seen = createDocumentSpanSet();
|
|
174360
|
-
combineProjectOutputWorker(projects, defaultProject, initialLocation,
|
|
174377
|
+
combineProjectOutputWorker(projects, defaultProject, initialLocation,
|
|
174378
|
+
/*isForRename*/ true, function (project, location, tryAddToTodo) {
|
|
174361
174379
|
var projectOutputs = project.getLanguageService().findRenameLocations(location.fileName, location.pos, findInStrings, findInComments, providePrefixAndSuffixTextForRename);
|
|
174362
174380
|
if (projectOutputs) {
|
|
174363
174381
|
for (var _i = 0, projectOutputs_1 = projectOutputs; _i < projectOutputs_1.length; _i++) {
|
|
@@ -174371,14 +174389,15 @@ var ts;
|
|
|
174371
174389
|
});
|
|
174372
174390
|
return outputs;
|
|
174373
174391
|
}
|
|
174374
|
-
function getDefinitionLocation(defaultProject, initialLocation) {
|
|
174375
|
-
var infos = defaultProject.getLanguageService().getDefinitionAtPosition(initialLocation.fileName, initialLocation.pos);
|
|
174392
|
+
function getDefinitionLocation(defaultProject, initialLocation, isForRename) {
|
|
174393
|
+
var infos = defaultProject.getLanguageService().getDefinitionAtPosition(initialLocation.fileName, initialLocation.pos, /*searchOtherFilesOnly*/ false, isForRename);
|
|
174376
174394
|
var info = infos && ts.firstOrUndefined(infos);
|
|
174377
174395
|
return info && !info.isLocal ? { fileName: info.fileName, pos: info.textSpan.start } : undefined;
|
|
174378
174396
|
}
|
|
174379
174397
|
function combineProjectOutputForReferences(projects, defaultProject, initialLocation, logger) {
|
|
174380
174398
|
var outputs = [];
|
|
174381
|
-
combineProjectOutputWorker(projects, defaultProject, initialLocation,
|
|
174399
|
+
combineProjectOutputWorker(projects, defaultProject, initialLocation,
|
|
174400
|
+
/*isForRename*/ false, function (project, location, getMappedLocation) {
|
|
174382
174401
|
logger.info("Finding references to " + location.fileName + " position " + location.pos + " in project " + project.getProjectName());
|
|
174383
174402
|
var projectOutputs = project.getLanguageService().findReferences(location.fileName, location.pos);
|
|
174384
174403
|
if (projectOutputs) {
|
|
@@ -174425,7 +174444,7 @@ var ts;
|
|
|
174425
174444
|
});
|
|
174426
174445
|
}
|
|
174427
174446
|
}
|
|
174428
|
-
function combineProjectOutputWorker(projects, defaultProject, initialLocation, cb) {
|
|
174447
|
+
function combineProjectOutputWorker(projects, defaultProject, initialLocation, isForRename, cb) {
|
|
174429
174448
|
var projectService = defaultProject.projectService;
|
|
174430
174449
|
var toDo;
|
|
174431
174450
|
var seenProjects = new ts.Set();
|
|
@@ -174436,7 +174455,7 @@ var ts;
|
|
|
174436
174455
|
});
|
|
174437
174456
|
// After initial references are collected, go over every other project and see if it has a reference for the symbol definition.
|
|
174438
174457
|
if (initialLocation) {
|
|
174439
|
-
var defaultDefinition_1 = getDefinitionLocation(defaultProject, initialLocation);
|
|
174458
|
+
var defaultDefinition_1 = getDefinitionLocation(defaultProject, initialLocation, isForRename);
|
|
174440
174459
|
if (defaultDefinition_1) {
|
|
174441
174460
|
var getGeneratedDefinition_1 = ts.memoize(function () { return defaultProject.isSourceOfProjectReferenceRedirect(defaultDefinition_1.fileName) ?
|
|
174442
174461
|
defaultDefinition_1 :
|
|
@@ -175492,7 +175511,7 @@ var ts;
|
|
|
175492
175511
|
definitions === null || definitions === void 0 ? void 0 : definitions.forEach(function (d) { return definitionSet_1.add(d); });
|
|
175493
175512
|
var noDtsProject = project.getNoDtsResolutionProject([file]);
|
|
175494
175513
|
var ls = noDtsProject.getLanguageService();
|
|
175495
|
-
var jsDefinitions = (_a = ls.getDefinitionAtPosition(file, position, /*searchOtherFilesOnly*/ true)) === null || _a === void 0 ? void 0 : _a.filter(function (d) { return server.toNormalizedPath(d.fileName) !== file; });
|
|
175514
|
+
var jsDefinitions = (_a = ls.getDefinitionAtPosition(file, position, /*searchOtherFilesOnly*/ true, /*stopAtAlias*/ false)) === null || _a === void 0 ? void 0 : _a.filter(function (d) { return server.toNormalizedPath(d.fileName) !== file; });
|
|
175496
175515
|
if (ts.some(jsDefinitions)) {
|
|
175497
175516
|
for (var _i = 0, jsDefinitions_1 = jsDefinitions; _i < jsDefinitions_1.length; _i++) {
|
|
175498
175517
|
var jsDefinition = jsDefinitions_1[_i];
|
|
@@ -175540,7 +175559,7 @@ var ts;
|
|
|
175540
175559
|
var packageJson = ts.getPackageScopeForPath(project.toPath(packageDirectory + "/package.json"), packageJsonCache, project, compilerOptions);
|
|
175541
175560
|
if (!packageJson)
|
|
175542
175561
|
return undefined;
|
|
175543
|
-
// Use fake options instead of actual compiler options to avoid following export map if the project uses
|
|
175562
|
+
// Use fake options instead of actual compiler options to avoid following export map if the project uses node16 or nodenext -
|
|
175544
175563
|
// Mapping from an export map entry across packages is out of scope for now. Returned entrypoints will only be what can be
|
|
175545
175564
|
// resolved from the package root under --moduleResolution node
|
|
175546
175565
|
var entrypoints = ts.getEntrypointsFromPackageJsonInfo(packageJson, { moduleResolution: ts.ModuleResolutionKind.NodeJs }, project, project.getModuleResolutionCache());
|
|
@@ -175577,7 +175596,7 @@ var ts;
|
|
|
175577
175596
|
var _a;
|
|
175578
175597
|
if (nameInChain === initialNode)
|
|
175579
175598
|
return undefined;
|
|
175580
|
-
var candidates = (_a = ls.getDefinitionAtPosition(file, nameInChain.getStart(), /*searchOtherFilesOnly*/ true)) === null || _a === void 0 ? void 0 : _a.filter(function (d) { return server.toNormalizedPath(d.fileName) !== file && d.isAmbient; }).map(function (d) { return ({
|
|
175599
|
+
var candidates = (_a = ls.getDefinitionAtPosition(file, nameInChain.getStart(), /*searchOtherFilesOnly*/ true, /*stopAtAlias*/ false)) === null || _a === void 0 ? void 0 : _a.filter(function (d) { return server.toNormalizedPath(d.fileName) !== file && d.isAmbient; }).map(function (d) { return ({
|
|
175581
175600
|
fileName: d.fileName,
|
|
175582
175601
|
name: ts.getTextOfIdentifierOrLiteral(initialNode)
|
|
175583
175602
|
}); });
|