@typescript-deploys/pr-build 5.2.0-pr-54777-9 → 5.2.0-pr-54838-4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tsc.js CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.2";
21
- var version = `${versionMajorMinor}.0-insiders.20230628`;
21
+ var version = `${versionMajorMinor}.0-insiders.20230703`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -1277,6 +1277,13 @@ function takeWhile(array, predicate) {
1277
1277
  return array.slice(0, index);
1278
1278
  }
1279
1279
  }
1280
+ function startWhitespaceCount(s) {
1281
+ for (let i = 0; i < s.length; i++) {
1282
+ if (!isWhiteSpaceLike(s.charCodeAt(i)))
1283
+ return i;
1284
+ }
1285
+ return s.length;
1286
+ }
1280
1287
  function skipWhile(array, predicate) {
1281
1288
  if (array) {
1282
1289
  const len = array.length;
@@ -5717,7 +5724,7 @@ var Diagnostics = {
5717
5724
  Identifier_expected: diag(1003, 1 /* Error */, "Identifier_expected_1003", "Identifier expected."),
5718
5725
  _0_expected: diag(1005, 1 /* Error */, "_0_expected_1005", "'{0}' expected."),
5719
5726
  A_file_cannot_have_a_reference_to_itself: diag(1006, 1 /* Error */, "A_file_cannot_have_a_reference_to_itself_1006", "A file cannot have a reference to itself."),
5720
- The_parser_expected_to_find_a_1_to_match_the_0_token_here: diag(1007, 1 /* Error */, "The_parser_expected_to_find_a_1_to_match_the_0_token_here_1007", "The parser expected to find a '{1}' to match the '{0}' token here."),
5727
+ The_parser_expected_to_find_a_1_to_match_the_0_token_here_Colon: diag(1007, 1 /* Error */, "The_parser_expected_to_find_a_1_to_match_the_0_token_here_Colon_1007", "The parser expected to find a '{1}' to match the '{0}' token here:"),
5721
5728
  Trailing_comma_not_allowed: diag(1009, 1 /* Error */, "Trailing_comma_not_allowed_1009", "Trailing comma not allowed."),
5722
5729
  Asterisk_Slash_expected: diag(1010, 1 /* Error */, "Asterisk_Slash_expected_1010", "'*/' expected."),
5723
5730
  An_element_access_expression_should_take_an_argument: diag(1011, 1 /* Error */, "An_element_access_expression_should_take_an_argument_1011", "An element access expression should take an argument."),
@@ -5979,7 +5986,7 @@ var Diagnostics = {
5979
5986
  unique_symbol_types_are_not_allowed_here: diag(1335, 1 /* Error */, "unique_symbol_types_are_not_allowed_here_1335", "'unique symbol' types are not allowed here."),
5980
5987
  An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead: diag(1337, 1 /* Error */, "An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_o_1337", "An index signature parameter type cannot be a literal type or generic type. Consider using a mapped object type instead."),
5981
5988
  infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type: diag(1338, 1 /* Error */, "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338", "'infer' declarations are only permitted in the 'extends' clause of a conditional type."),
5982
- Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, 1 /* 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."),
5989
+ Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_Colon: diag(1339, 1 /* Error */, "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_Colon_1339", "Module '{0}' does not refer to a value, but is used as a value here:"),
5983
5990
  Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, 1 /* 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}')'?"),
5984
5991
  Class_constructor_may_not_be_an_accessor: diag(1341, 1 /* Error */, "Class_constructor_may_not_be_an_accessor_1341", "Class constructor may not be an accessor."),
5985
5992
  The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext: diag(1343, 1 /* 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'."),
@@ -5987,7 +5994,7 @@ var Diagnostics = {
5987
5994
  An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, 1 /* Error */, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."),
5988
5995
  This_parameter_is_not_allowed_with_use_strict_directive: diag(1346, 1 /* Error */, "This_parameter_is_not_allowed_with_use_strict_directive_1346", "This parameter is not allowed with 'use strict' directive."),
5989
5996
  use_strict_directive_cannot_be_used_with_non_simple_parameter_list: diag(1347, 1 /* Error */, "use_strict_directive_cannot_be_used_with_non_simple_parameter_list_1347", "'use strict' directive cannot be used with non-simple parameter list."),
5990
- Non_simple_parameter_declared_here: diag(1348, 1 /* Error */, "Non_simple_parameter_declared_here_1348", "Non-simple parameter declared here."),
5997
+ Non_simple_parameter_declared_here_Colon: diag(1348, 1 /* Error */, "Non_simple_parameter_declared_here_Colon_1348", "Non-simple parameter declared here:"),
5991
5998
  use_strict_directive_used_here: diag(1349, 1 /* Error */, "use_strict_directive_used_here_1349", "'use strict' directive used here."),
5992
5999
  Print_the_final_configuration_instead_of_building: diag(1350, 3 /* Message */, "Print_the_final_configuration_instead_of_building_1350", "Print the final configuration instead of building."),
5993
6000
  An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal: diag(1351, 1 /* Error */, "An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal_1351", "An identifier or keyword cannot immediately follow a numeric literal."),
@@ -6011,8 +6018,8 @@ var Diagnostics = {
6011
6018
  Did_you_mean_0: diag(1369, 3 /* Message */, "Did_you_mean_0_1369", "Did you mean '{0}'?"),
6012
6019
  This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set_to_error: diag(1371, 1 /* Error */, "This_import_is_never_used_as_a_value_and_must_use_import_type_because_importsNotUsedAsValues_is_set__1371", "This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'."),
6013
6020
  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, 1 /* 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."),
6014
- _0_was_imported_here: diag(1376, 3 /* Message */, "_0_was_imported_here_1376", "'{0}' was imported here."),
6015
- _0_was_exported_here: diag(1377, 3 /* Message */, "_0_was_exported_here_1377", "'{0}' was exported here."),
6021
+ _0_was_imported_here_Colon: diag(1376, 3 /* Message */, "_0_was_imported_here_Colon_1376", "'{0}' was imported here:"),
6022
+ _0_was_exported_here_Colon: diag(1377, 3 /* Message */, "_0_was_exported_here_Colon_1377", "'{0}' was exported here:"),
6016
6023
  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, 1 /* 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."),
6017
6024
  An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type: diag(1379, 1 /* 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'."),
6018
6025
  An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type: diag(1380, 1 /* 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'."),
@@ -6031,34 +6038,34 @@ var Diagnostics = {
6031
6038
  Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions: diag(1396, 3 /* Message */, "Imported_via_0_from_file_1_with_packageId_2_to_import_importHelpers_as_specified_in_compilerOptions_1396", "Imported via {0} from file '{1}' with packageId '{2}' to import 'importHelpers' as specified in compilerOptions"),
6032
6039
  Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions: diag(1397, 3 /* Message */, "Imported_via_0_from_file_1_to_import_jsx_and_jsxs_factory_functions_1397", "Imported via {0} from file '{1}' to import 'jsx' and 'jsxs' factory functions"),
6033
6040
  Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions: diag(1398, 3 /* Message */, "Imported_via_0_from_file_1_with_packageId_2_to_import_jsx_and_jsxs_factory_functions_1398", "Imported via {0} from file '{1}' with packageId '{2}' to import 'jsx' and 'jsxs' factory functions"),
6034
- File_is_included_via_import_here: diag(1399, 3 /* Message */, "File_is_included_via_import_here_1399", "File is included via import here."),
6041
+ File_is_included_via_import_here_Colon: diag(1399, 3 /* Message */, "File_is_included_via_import_here_Colon_1399", "File is included via import here:"),
6035
6042
  Referenced_via_0_from_file_1: diag(1400, 3 /* Message */, "Referenced_via_0_from_file_1_1400", "Referenced via '{0}' from file '{1}'"),
6036
- File_is_included_via_reference_here: diag(1401, 3 /* Message */, "File_is_included_via_reference_here_1401", "File is included via reference here."),
6043
+ File_is_included_via_reference_here_Colon: diag(1401, 3 /* Message */, "File_is_included_via_reference_here_Colon_1401", "File is included via reference here:"),
6037
6044
  Type_library_referenced_via_0_from_file_1: diag(1402, 3 /* Message */, "Type_library_referenced_via_0_from_file_1_1402", "Type library referenced via '{0}' from file '{1}'"),
6038
6045
  Type_library_referenced_via_0_from_file_1_with_packageId_2: diag(1403, 3 /* Message */, "Type_library_referenced_via_0_from_file_1_with_packageId_2_1403", "Type library referenced via '{0}' from file '{1}' with packageId '{2}'"),
6039
- File_is_included_via_type_library_reference_here: diag(1404, 3 /* Message */, "File_is_included_via_type_library_reference_here_1404", "File is included via type library reference here."),
6046
+ File_is_included_via_type_library_reference_here_Colon: diag(1404, 3 /* Message */, "File_is_included_via_type_library_reference_here_Colon_1404", "File is included via type library reference here:"),
6040
6047
  Library_referenced_via_0_from_file_1: diag(1405, 3 /* Message */, "Library_referenced_via_0_from_file_1_1405", "Library referenced via '{0}' from file '{1}'"),
6041
- File_is_included_via_library_reference_here: diag(1406, 3 /* Message */, "File_is_included_via_library_reference_here_1406", "File is included via library reference here."),
6048
+ File_is_included_via_library_reference_here_Colon: diag(1406, 3 /* Message */, "File_is_included_via_library_reference_here_Colon_1406", "File is included via library reference here:"),
6042
6049
  Matched_by_include_pattern_0_in_1: diag(1407, 3 /* Message */, "Matched_by_include_pattern_0_in_1_1407", "Matched by include pattern '{0}' in '{1}'"),
6043
- File_is_matched_by_include_pattern_specified_here: diag(1408, 3 /* Message */, "File_is_matched_by_include_pattern_specified_here_1408", "File is matched by include pattern specified here."),
6050
+ File_is_matched_by_include_pattern_specified_here_Colon: diag(1408, 3 /* Message */, "File_is_matched_by_include_pattern_specified_here_Colon_1408", "File is matched by include pattern specified here:"),
6044
6051
  Part_of_files_list_in_tsconfig_json: diag(1409, 3 /* Message */, "Part_of_files_list_in_tsconfig_json_1409", "Part of 'files' list in tsconfig.json"),
6045
- File_is_matched_by_files_list_specified_here: diag(1410, 3 /* Message */, "File_is_matched_by_files_list_specified_here_1410", "File is matched by 'files' list specified here."),
6052
+ File_is_matched_by_files_list_specified_here_Colon: diag(1410, 3 /* Message */, "File_is_matched_by_files_list_specified_here_Colon_1410", "File is matched by 'files' list specified here:"),
6046
6053
  Output_from_referenced_project_0_included_because_1_specified: diag(1411, 3 /* Message */, "Output_from_referenced_project_0_included_because_1_specified_1411", "Output from referenced project '{0}' included because '{1}' specified"),
6047
6054
  Output_from_referenced_project_0_included_because_module_is_specified_as_none: diag(1412, 3 /* Message */, "Output_from_referenced_project_0_included_because_module_is_specified_as_none_1412", "Output from referenced project '{0}' included because '--module' is specified as 'none'"),
6048
- File_is_output_from_referenced_project_specified_here: diag(1413, 3 /* Message */, "File_is_output_from_referenced_project_specified_here_1413", "File is output from referenced project specified here."),
6055
+ File_is_output_from_referenced_project_specified_here_Colon: diag(1413, 3 /* Message */, "File_is_output_from_referenced_project_specified_here_Colon_1413", "File is output from referenced project specified here:"),
6049
6056
  Source_from_referenced_project_0_included_because_1_specified: diag(1414, 3 /* Message */, "Source_from_referenced_project_0_included_because_1_specified_1414", "Source from referenced project '{0}' included because '{1}' specified"),
6050
6057
  Source_from_referenced_project_0_included_because_module_is_specified_as_none: diag(1415, 3 /* Message */, "Source_from_referenced_project_0_included_because_module_is_specified_as_none_1415", "Source from referenced project '{0}' included because '--module' is specified as 'none'"),
6051
- File_is_source_from_referenced_project_specified_here: diag(1416, 3 /* Message */, "File_is_source_from_referenced_project_specified_here_1416", "File is source from referenced project specified here."),
6058
+ File_is_source_from_referenced_project_specified_here_Colon: diag(1416, 3 /* Message */, "File_is_source_from_referenced_project_specified_here_Colon_1416", "File is source from referenced project specified here:"),
6052
6059
  Entry_point_of_type_library_0_specified_in_compilerOptions: diag(1417, 3 /* Message */, "Entry_point_of_type_library_0_specified_in_compilerOptions_1417", "Entry point of type library '{0}' specified in compilerOptions"),
6053
6060
  Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1: diag(1418, 3 /* Message */, "Entry_point_of_type_library_0_specified_in_compilerOptions_with_packageId_1_1418", "Entry point of type library '{0}' specified in compilerOptions with packageId '{1}'"),
6054
- File_is_entry_point_of_type_library_specified_here: diag(1419, 3 /* Message */, "File_is_entry_point_of_type_library_specified_here_1419", "File is entry point of type library specified here."),
6061
+ File_is_entry_point_of_type_library_specified_here_Colon: diag(1419, 3 /* Message */, "File_is_entry_point_of_type_library_specified_here_Colon_1419", "File is entry point of type library specified here:"),
6055
6062
  Entry_point_for_implicit_type_library_0: diag(1420, 3 /* Message */, "Entry_point_for_implicit_type_library_0_1420", "Entry point for implicit type library '{0}'"),
6056
6063
  Entry_point_for_implicit_type_library_0_with_packageId_1: diag(1421, 3 /* Message */, "Entry_point_for_implicit_type_library_0_with_packageId_1_1421", "Entry point for implicit type library '{0}' with packageId '{1}'"),
6057
6064
  Library_0_specified_in_compilerOptions: diag(1422, 3 /* Message */, "Library_0_specified_in_compilerOptions_1422", "Library '{0}' specified in compilerOptions"),
6058
- File_is_library_specified_here: diag(1423, 3 /* Message */, "File_is_library_specified_here_1423", "File is library specified here."),
6065
+ File_is_library_specified_here_Colon: diag(1423, 3 /* Message */, "File_is_library_specified_here_Colon_1423", "File is library specified here:"),
6059
6066
  Default_library: diag(1424, 3 /* Message */, "Default_library_1424", "Default library"),
6060
6067
  Default_library_for_target_0: diag(1425, 3 /* Message */, "Default_library_for_target_0_1425", "Default library for target '{0}'"),
6061
- File_is_default_library_for_target_specified_here: diag(1426, 3 /* Message */, "File_is_default_library_for_target_specified_here_1426", "File is default library for target specified here."),
6068
+ File_is_default_library_for_target_specified_here_Colon: diag(1426, 3 /* Message */, "File_is_default_library_for_target_specified_here_Colon_1426", "File is default library for target specified here:"),
6062
6069
  Root_file_specified_for_compilation: diag(1427, 3 /* Message */, "Root_file_specified_for_compilation_1427", "Root file specified for compilation"),
6063
6070
  File_is_output_of_project_reference_source_0: diag(1428, 3 /* Message */, "File_is_output_of_project_reference_source_0_1428", "File is output of project reference source '{0}'"),
6064
6071
  File_redirects_to_file_0: diag(1429, 3 /* Message */, "File_redirects_to_file_0_1429", "File redirects to file '{0}'"),
@@ -6511,7 +6518,7 @@ var Diagnostics = {
6511
6518
  Cannot_extend_an_interface_0_Did_you_mean_implements: diag(2689, 1 /* Error */, "Cannot_extend_an_interface_0_Did_you_mean_implements_2689", "Cannot extend an interface '{0}'. Did you mean 'implements'?"),
6512
6519
  _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0: diag(2690, 1 /* Error */, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0_2690", "'{0}' only refers to a type, but is being used as a value here. Did you mean to use '{1} in {0}'?"),
6513
6520
  _0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible: diag(2692, 1 /* Error */, "_0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible_2692", "'{0}' is a primitive, but '{1}' is a wrapper object. Prefer using '{0}' when possible."),
6514
- _0_only_refers_to_a_type_but_is_being_used_as_a_value_here: diag(2693, 1 /* Error */, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_2693", "'{0}' only refers to a type, but is being used as a value here."),
6521
+ _0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Colon: diag(2693, 1 /* Error */, "_0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Colon_2693", "'{0}' only refers to a type, but is being used as a value here:"),
6515
6522
  Namespace_0_has_no_exported_member_1: diag(2694, 1 /* Error */, "Namespace_0_has_no_exported_member_1_2694", "Namespace '{0}' has no exported member '{1}'."),
6516
6523
  Left_side_of_comma_operator_is_unused_and_has_no_side_effects: diag(
6517
6524
  2695,
@@ -6527,7 +6534,7 @@ var Diagnostics = {
6527
6534
  Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1: diag(2699, 1 /* Error */, "Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1_2699", "Static property '{0}' conflicts with built-in property 'Function.{0}' of constructor function '{1}'."),
6528
6535
  Rest_types_may_only_be_created_from_object_types: diag(2700, 1 /* Error */, "Rest_types_may_only_be_created_from_object_types_2700", "Rest types may only be created from object types."),
6529
6536
  The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access: diag(2701, 1 /* Error */, "The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access_2701", "The target of an object rest assignment must be a variable or a property access."),
6530
- _0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here: diag(2702, 1 /* Error */, "_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_2702", "'{0}' only refers to a type, but is being used as a namespace here."),
6537
+ _0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_Colon: diag(2702, 1 /* Error */, "_0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_Colon_2702", "'{0}' only refers to a type, but is being used as a namespace here:"),
6531
6538
  The_operand_of_a_delete_operator_must_be_a_property_reference: diag(2703, 1 /* Error */, "The_operand_of_a_delete_operator_must_be_a_property_reference_2703", "The operand of a 'delete' operator must be a property reference."),
6532
6539
  The_operand_of_a_delete_operator_cannot_be_a_read_only_property: diag(2704, 1 /* Error */, "The_operand_of_a_delete_operator_cannot_be_a_read_only_property_2704", "The operand of a 'delete' operator cannot be a read-only property."),
6533
6540
  An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option: diag(2705, 1 /* Error */, "An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_de_2705", "An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your '--lib' option."),
@@ -6553,12 +6560,12 @@ var Diagnostics = {
6553
6560
  Class_name_cannot_be_Object_when_targeting_ES5_with_module_0: diag(2725, 1 /* Error */, "Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725", "Class name cannot be 'Object' when targeting ES5 with module {0}."),
6554
6561
  Cannot_find_lib_definition_for_0: diag(2726, 1 /* Error */, "Cannot_find_lib_definition_for_0_2726", "Cannot find lib definition for '{0}'."),
6555
6562
  Cannot_find_lib_definition_for_0_Did_you_mean_1: diag(2727, 1 /* Error */, "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727", "Cannot find lib definition for '{0}'. Did you mean '{1}'?"),
6556
- _0_is_declared_here: diag(2728, 3 /* Message */, "_0_is_declared_here_2728", "'{0}' is declared here."),
6563
+ _0_is_declared_here_Colon: diag(2728, 3 /* Message */, "_0_is_declared_here_Colon_2728", "'{0}' is declared here:"),
6557
6564
  Property_0_is_used_before_its_initialization: diag(2729, 1 /* Error */, "Property_0_is_used_before_its_initialization_2729", "Property '{0}' is used before its initialization."),
6558
6565
  An_arrow_function_cannot_have_a_this_parameter: diag(2730, 1 /* Error */, "An_arrow_function_cannot_have_a_this_parameter_2730", "An arrow function cannot have a 'this' parameter."),
6559
6566
  Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String: diag(2731, 1 /* Error */, "Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_i_2731", "Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'."),
6560
6567
  Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension: diag(2732, 1 /* Error */, "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732", "Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension."),
6561
- Property_0_was_also_declared_here: diag(2733, 1 /* Error */, "Property_0_was_also_declared_here_2733", "Property '{0}' was also declared here."),
6568
+ Property_0_was_also_declared_here_Colon: diag(2733, 1 /* Error */, "Property_0_was_also_declared_here_Colon_2733", "Property '{0}' was also declared here:"),
6562
6569
  Are_you_missing_a_semicolon: diag(2734, 1 /* Error */, "Are_you_missing_a_semicolon_2734", "Are you missing a semicolon?"),
6563
6570
  Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1: diag(2735, 1 /* Error */, "Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1_2735", "Did you mean for '{0}' to be constrained to type 'new (...args: any[]) => {1}'?"),
6564
6571
  Operator_0_cannot_be_applied_to_type_1: diag(2736, 1 /* Error */, "Operator_0_cannot_be_applied_to_type_1_2736", "Operator '{0}' cannot be applied to type '{1}'."),
@@ -6575,10 +6582,10 @@ var Diagnostics = {
6575
6582
  _0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_type_of_1_is_2: diag(2747, 1 /* Error */, "_0_components_don_t_accept_text_as_child_elements_Text_in_JSX_has_the_type_string_but_the_expected_t_2747", "'{0}' components don't accept text as child elements. Text in JSX has the type 'string', but the expected type of '{1}' is '{2}'."),
6576
6583
  Cannot_access_ambient_const_enums_when_0_is_enabled: diag(2748, 1 /* Error */, "Cannot_access_ambient_const_enums_when_0_is_enabled_2748", "Cannot access ambient const enums when '{0}' is enabled."),
6577
6584
  _0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0: diag(2749, 1 /* Error */, "_0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0_2749", "'{0}' refers to a value, but is being used as a type here. Did you mean 'typeof {0}'?"),
6578
- The_implementation_signature_is_declared_here: diag(2750, 1 /* Error */, "The_implementation_signature_is_declared_here_2750", "The implementation signature is declared here."),
6585
+ The_implementation_signature_is_declared_here_Colon: diag(2750, 1 /* Error */, "The_implementation_signature_is_declared_here_Colon_2750", "The implementation signature is declared here:"),
6579
6586
  Circularity_originates_in_type_at_this_location: diag(2751, 1 /* Error */, "Circularity_originates_in_type_at_this_location_2751", "Circularity originates in type at this location."),
6580
- The_first_export_default_is_here: diag(2752, 1 /* Error */, "The_first_export_default_is_here_2752", "The first export default is here."),
6581
- Another_export_default_is_here: diag(2753, 1 /* Error */, "Another_export_default_is_here_2753", "Another export default is here."),
6587
+ The_first_export_default_is_here_Colon: diag(2752, 1 /* Error */, "The_first_export_default_is_here_Colon_2752", "The first export default is here:"),
6588
+ Another_export_default_is_here_Colon: diag(2753, 1 /* Error */, "Another_export_default_is_here_Colon_2753", "Another export default is here:"),
6582
6589
  super_may_not_use_type_arguments: diag(2754, 1 /* Error */, "super_may_not_use_type_arguments_2754", "'super' may not use type arguments."),
6583
6590
  No_constituent_of_type_0_is_callable: diag(2755, 1 /* Error */, "No_constituent_of_type_0_is_callable_2755", "No constituent of type '{0}' is callable."),
6584
6591
  Not_all_constituents_of_type_0_are_callable: diag(2756, 1 /* Error */, "Not_all_constituents_of_type_0_are_callable_2756", "Not all constituents of type '{0}' are callable."),
@@ -6596,7 +6603,7 @@ var Diagnostics = {
6596
6603
  The_0_property_of_an_async_iterator_must_be_a_method: diag(2768, 1 /* Error */, "The_0_property_of_an_async_iterator_must_be_a_method_2768", "The '{0}' property of an async iterator must be a method."),
6597
6604
  No_overload_matches_this_call: diag(2769, 1 /* Error */, "No_overload_matches_this_call_2769", "No overload matches this call."),
6598
6605
  The_last_overload_gave_the_following_error: diag(2770, 1 /* Error */, "The_last_overload_gave_the_following_error_2770", "The last overload gave the following error."),
6599
- The_last_overload_is_declared_here: diag(2771, 1 /* Error */, "The_last_overload_is_declared_here_2771", "The last overload is declared here."),
6606
+ The_last_overload_is_declared_here_Colon: diag(2771, 1 /* Error */, "The_last_overload_is_declared_here_Colon_2771", "The last overload is declared here:"),
6600
6607
  Overload_0_of_1_2_gave_the_following_error: diag(2772, 1 /* Error */, "Overload_0_of_1_2_gave_the_following_error_2772", "Overload {0} of {1}, '{2}', gave the following error."),
6601
6608
  Did_you_forget_to_use_await: diag(2773, 1 /* Error */, "Did_you_forget_to_use_await_2773", "Did you forget to use 'await'?"),
6602
6609
  This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead: diag(2774, 1 /* Error */, "This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_2774", "This condition will always return true since this function is always defined. Did you mean to call it instead?"),
@@ -6623,7 +6630,7 @@ var Diagnostics = {
6623
6630
  The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types: diag(2795, 1 /* Error */, "The_intrinsic_keyword_can_only_be_used_to_declare_compiler_provided_intrinsic_types_2795", "The 'intrinsic' keyword can only be used to declare compiler provided intrinsic types."),
6624
6631
  It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tagged_template_expression_which_cannot_be_invoked: diag(2796, 1 /* Error */, "It_is_likely_that_you_are_missing_a_comma_to_separate_these_two_template_expressions_They_form_a_tag_2796", "It is likely that you are missing a comma to separate these two template expressions. They form a tagged template expression which cannot be invoked."),
6625
6632
  A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_be_declared_abstract: diag(2797, 1 /* Error */, "A_mixin_class_that_extends_from_a_type_variable_containing_an_abstract_construct_signature_must_also_2797", "A mixin class that extends from a type variable containing an abstract construct signature must also be declared 'abstract'."),
6626
- The_declaration_was_marked_as_deprecated_here: diag(2798, 1 /* Error */, "The_declaration_was_marked_as_deprecated_here_2798", "The declaration was marked as deprecated here."),
6633
+ The_declaration_was_marked_as_deprecated_here_Colon: diag(2798, 1 /* Error */, "The_declaration_was_marked_as_deprecated_here_Colon_2798", "The declaration was marked as deprecated here:"),
6627
6634
  Type_produces_a_tuple_type_that_is_too_large_to_represent: diag(2799, 1 /* Error */, "Type_produces_a_tuple_type_that_is_too_large_to_represent_2799", "Type produces a tuple type that is too large to represent."),
6628
6635
  Expression_produces_a_tuple_type_that_is_too_large_to_represent: diag(2800, 1 /* Error */, "Expression_produces_a_tuple_type_that_is_too_large_to_represent_2800", "Expression produces a tuple type that is too large to represent."),
6629
6636
  This_condition_will_always_return_true_since_this_0_is_always_defined: diag(2801, 1 /* Error */, "This_condition_will_always_return_true_since_this_0_is_always_defined_2801", "This condition will always return true since this '{0}' is always defined."),
@@ -7060,8 +7067,8 @@ var Diagnostics = {
7060
7067
  Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0: diag(6200, 1 /* Error */, "Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200", "Definitions of the following identifiers conflict with those in another file: {0}"),
7061
7068
  Conflicts_are_in_this_file: diag(6201, 3 /* Message */, "Conflicts_are_in_this_file_6201", "Conflicts are in this file."),
7062
7069
  Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0: diag(6202, 1 /* Error */, "Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202", "Project references may not form a circular graph. Cycle detected: {0}"),
7063
- _0_was_also_declared_here: diag(6203, 3 /* Message */, "_0_was_also_declared_here_6203", "'{0}' was also declared here."),
7064
- and_here: diag(6204, 3 /* Message */, "and_here_6204", "and here."),
7070
+ _0_was_also_declared_here_Colon: diag(6203, 3 /* Message */, "_0_was_also_declared_here_Colon_6203", "'{0}' was also declared here:"),
7071
+ and_here_Colon: diag(6204, 3 /* Message */, "and_here_Colon_6204", "and here:"),
7065
7072
  All_type_parameters_are_unused: diag(6205, 1 /* Error */, "All_type_parameters_are_unused_6205", "All type parameters are unused."),
7066
7073
  package_json_has_a_typesVersions_field_with_version_specific_path_mappings: diag(6206, 3 /* Message */, "package_json_has_a_typesVersions_field_with_version_specific_path_mappings_6206", "'package.json' has a 'typesVersions' field with version-specific path mappings."),
7067
7074
  package_json_does_not_have_a_typesVersions_entry_that_matches_version_0: diag(6207, 3 /* Message */, "package_json_does_not_have_a_typesVersions_entry_that_matches_version_0_6207", "'package.json' does not have a 'typesVersions' entry that matches version '{0}'."),
@@ -7465,6 +7472,7 @@ var Diagnostics = {
7465
7472
  Parameter_modifiers_can_only_be_used_in_TypeScript_files: diag(8012, 1 /* Error */, "Parameter_modifiers_can_only_be_used_in_TypeScript_files_8012", "Parameter modifiers can only be used in TypeScript files."),
7466
7473
  Non_null_assertions_can_only_be_used_in_TypeScript_files: diag(8013, 1 /* Error */, "Non_null_assertions_can_only_be_used_in_TypeScript_files_8013", "Non-null assertions can only be used in TypeScript files."),
7467
7474
  Type_assertion_expressions_can_only_be_used_in_TypeScript_files: diag(8016, 1 /* Error */, "Type_assertion_expressions_can_only_be_used_in_TypeScript_files_8016", "Type assertion expressions can only be used in TypeScript files."),
7475
+ Signature_declarations_can_only_be_used_in_TypeScript_files: diag(8017, 1 /* Error */, "Signature_declarations_can_only_be_used_in_TypeScript_files_8017", "Signature declarations can only be used in TypeScript files."),
7468
7476
  Report_errors_in_js_files: diag(8019, 3 /* Message */, "Report_errors_in_js_files_8019", "Report errors in .js files."),
7469
7477
  JSDoc_types_can_only_be_used_inside_documentation_comments: diag(8020, 1 /* Error */, "JSDoc_types_can_only_be_used_inside_documentation_comments_8020", "JSDoc types can only be used inside documentation comments."),
7470
7478
  JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags: diag(8021, 1 /* Error */, "JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags_8021", "JSDoc '@typedef' tag should either have a type annotation or be followed by '@property' or '@member' tags."),
@@ -7480,7 +7488,7 @@ var Diagnostics = {
7480
7488
  You_cannot_rename_a_module_via_a_global_import: diag(8031, 1 /* Error */, "You_cannot_rename_a_module_via_a_global_import_8031", "You cannot rename a module via a global import."),
7481
7489
  Qualified_name_0_is_not_allowed_without_a_leading_param_object_1: diag(8032, 1 /* Error */, "Qualified_name_0_is_not_allowed_without_a_leading_param_object_1_8032", "Qualified name '{0}' is not allowed without a leading '@param {object} {1}'."),
7482
7490
  A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags: diag(8033, 1 /* Error */, "A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags_8033", "A JSDoc '@typedef' comment may not contain multiple '@type' tags."),
7483
- The_tag_was_first_specified_here: diag(8034, 1 /* Error */, "The_tag_was_first_specified_here_8034", "The tag was first specified here."),
7491
+ The_tag_was_first_specified_here_Colon: diag(8034, 1 /* Error */, "The_tag_was_first_specified_here_Colon_8034", "The tag was first specified here:"),
7484
7492
  You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder: diag(8035, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder_8035", "You cannot rename elements that are defined in a 'node_modules' folder."),
7485
7493
  You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder: diag(8036, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036", "You cannot rename elements that are defined in another 'node_modules' folder."),
7486
7494
  Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files: diag(8037, 1 /* Error */, "Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files_8037", "Type satisfaction expressions can only be used in TypeScript files."),
@@ -14741,7 +14749,7 @@ function isNightly() {
14741
14749
  }
14742
14750
  function createTextWriter(newLine) {
14743
14751
  var output;
14744
- var indent2;
14752
+ var indent;
14745
14753
  var lineStart;
14746
14754
  var lineCount;
14747
14755
  var linePos;
@@ -14759,7 +14767,7 @@ function createTextWriter(newLine) {
14759
14767
  function writeText(s) {
14760
14768
  if (s && s.length) {
14761
14769
  if (lineStart) {
14762
- s = getIndentString(indent2) + s;
14770
+ s = getIndentString(indent) + s;
14763
14771
  lineStart = false;
14764
14772
  }
14765
14773
  output += s;
@@ -14778,7 +14786,7 @@ function createTextWriter(newLine) {
14778
14786
  }
14779
14787
  function reset() {
14780
14788
  output = "";
14781
- indent2 = 0;
14789
+ indent = 0;
14782
14790
  lineStart = true;
14783
14791
  lineCount = 0;
14784
14792
  linePos = 0;
@@ -14815,15 +14823,15 @@ function createTextWriter(newLine) {
14815
14823
  writeLiteral,
14816
14824
  writeLine,
14817
14825
  increaseIndent: () => {
14818
- indent2++;
14826
+ indent++;
14819
14827
  },
14820
14828
  decreaseIndent: () => {
14821
- indent2--;
14829
+ indent--;
14822
14830
  },
14823
- getIndent: () => indent2,
14831
+ getIndent: () => indent,
14824
14832
  getTextPos: () => output.length,
14825
14833
  getLine: () => lineCount,
14826
- getColumn: () => lineStart ? indent2 * getIndentSize() : output.length - linePos,
14834
+ getColumn: () => lineStart ? indent * getIndentSize() : output.length - linePos,
14827
14835
  getText: () => output,
14828
14836
  isAtStartOfLine: () => lineStart,
14829
14837
  hasTrailingComment: () => hasTrailingComment,
@@ -26594,7 +26602,8 @@ var Parser;
26594
26602
  nextToken();
26595
26603
  const statements = parseList(0 /* SourceElements */, parseStatement);
26596
26604
  Debug.assert(token() === 1 /* EndOfFileToken */);
26597
- const endOfFileToken = addJSDocComment(parseTokenNode());
26605
+ const endHasJSDoc = hasPrecedingJSDocComment();
26606
+ const endOfFileToken = withJSDoc(parseTokenNode(), endHasJSDoc);
26598
26607
  const sourceFile = createSourceFile2(fileName, languageVersion2, scriptKind2, isDeclarationFile, statements, endOfFileToken, sourceFlags, setExternalModuleIndicator2);
26599
26608
  processCommentPragmas(sourceFile, sourceText);
26600
26609
  processPragmasIntoFields(sourceFile, reportPragmaDiagnostic);
@@ -26614,11 +26623,11 @@ var Parser;
26614
26623
  parseDiagnostics.push(createDetachedDiagnostic(fileName, pos, end, diagnostic));
26615
26624
  }
26616
26625
  }
26617
- function withJSDoc(node, hasJSDoc) {
26618
- return hasJSDoc ? addJSDocComment(node) : node;
26619
- }
26620
26626
  let hasDeprecatedTag = false;
26621
- function addJSDocComment(node) {
26627
+ function withJSDoc(node, hasJSDoc) {
26628
+ if (!hasJSDoc) {
26629
+ return node;
26630
+ }
26622
26631
  Debug.assert(!node.jsDoc);
26623
26632
  const jsDoc = mapDefined(getJSDocCommentRanges(node, sourceText), (comment) => JSDocParser.parseJSDocComment(node, comment.pos, comment.end - comment.pos));
26624
26633
  if (jsDoc.length)
@@ -27079,7 +27088,7 @@ var Parser;
27079
27088
  if (lastError) {
27080
27089
  addRelatedInfo(
27081
27090
  lastError,
27082
- createDetachedDiagnostic(fileName, openPosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, tokenToString(openKind), tokenToString(closeKind))
27091
+ createDetachedDiagnostic(fileName, openPosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here_Colon, tokenToString(openKind), tokenToString(closeKind))
27083
27092
  );
27084
27093
  }
27085
27094
  }
@@ -27412,6 +27421,9 @@ var Parser;
27412
27421
  case 22 /* HeritageClauses */:
27413
27422
  return isHeritageClause2();
27414
27423
  case 23 /* ImportOrExportSpecifiers */:
27424
+ if (token() === 161 /* FromKeyword */ && lookAhead(nextTokenIsStringLiteral)) {
27425
+ return false;
27426
+ }
27415
27427
  return tokenIsIdentifierOrKeyword(token());
27416
27428
  case 13 /* JsxAttributes */:
27417
27429
  return tokenIsIdentifierOrKeyword(token()) || token() === 19 /* OpenBraceToken */;
@@ -27770,6 +27782,9 @@ var Parser;
27770
27782
  case 22 /* HeritageClauses */:
27771
27783
  return parseErrorAtCurrentToken(Diagnostics.Unexpected_token_expected);
27772
27784
  case 23 /* ImportOrExportSpecifiers */:
27785
+ if (token() === 161 /* FromKeyword */) {
27786
+ return parseErrorAtCurrentToken(Diagnostics._0_expected, "}");
27787
+ }
27773
27788
  return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
27774
27789
  case 13 /* JsxAttributes */:
27775
27790
  return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
@@ -28661,7 +28676,7 @@ var Parser;
28661
28676
  if (lastError && lastError.code === Diagnostics._0_expected.code) {
28662
28677
  addRelatedInfo(
28663
28678
  lastError,
28664
- createDetachedDiagnostic(fileName, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}")
28679
+ createDetachedDiagnostic(fileName, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here_Colon, "{", "}")
28665
28680
  );
28666
28681
  }
28667
28682
  }
@@ -29127,12 +29142,14 @@ var Parser;
29127
29142
  return arrowExpression;
29128
29143
  }
29129
29144
  const pos = getNodePos();
29145
+ const hasJSDoc = hasPrecedingJSDocComment();
29130
29146
  const expr = parseBinaryExpressionOrHigher(0 /* Lowest */);
29131
29147
  if (expr.kind === 80 /* Identifier */ && token() === 39 /* EqualsGreaterThanToken */) {
29132
29148
  return parseSimpleArrowFunctionExpression(
29133
29149
  pos,
29134
29150
  expr,
29135
29151
  allowReturnTypeInArrowFunction,
29152
+ hasJSDoc,
29136
29153
  /*asyncModifier*/
29137
29154
  void 0
29138
29155
  );
@@ -29178,7 +29195,7 @@ var Parser;
29178
29195
  ), pos);
29179
29196
  }
29180
29197
  }
29181
- function parseSimpleArrowFunctionExpression(pos, identifier, allowReturnTypeInArrowFunction, asyncModifier) {
29198
+ function parseSimpleArrowFunctionExpression(pos, identifier, allowReturnTypeInArrowFunction, hasJSDoc, asyncModifier) {
29182
29199
  Debug.assert(token() === 39 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
29183
29200
  const parameter = factory2.createParameterDeclaration(
29184
29201
  /*modifiers*/
@@ -29211,7 +29228,7 @@ var Parser;
29211
29228
  equalsGreaterThanToken,
29212
29229
  body
29213
29230
  );
29214
- return addJSDocComment(finishNode(node, pos));
29231
+ return withJSDoc(finishNode(node, pos), hasJSDoc);
29215
29232
  }
29216
29233
  function tryParseParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) {
29217
29234
  const triState = isParenthesizedArrowFunctionExpression();
@@ -29339,9 +29356,10 @@ var Parser;
29339
29356
  if (token() === 134 /* AsyncKeyword */) {
29340
29357
  if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === 1 /* True */) {
29341
29358
  const pos = getNodePos();
29359
+ const hasJSDoc = hasPrecedingJSDocComment();
29342
29360
  const asyncModifier = parseModifiersForArrowFunction();
29343
29361
  const expr = parseBinaryExpressionOrHigher(0 /* Lowest */);
29344
- return parseSimpleArrowFunctionExpression(pos, expr, allowReturnTypeInArrowFunction, asyncModifier);
29362
+ return parseSimpleArrowFunctionExpression(pos, expr, allowReturnTypeInArrowFunction, hasJSDoc, asyncModifier);
29345
29363
  }
29346
29364
  }
29347
29365
  return void 0;
@@ -31015,6 +31033,9 @@ var Parser;
31015
31033
  return void 0;
31016
31034
  }
31017
31035
  }
31036
+ function nextTokenIsStringLiteral() {
31037
+ return nextToken() === 11 /* StringLiteral */;
31038
+ }
31018
31039
  function nextTokenIsIdentifierOrStringLiteralOnSameLine() {
31019
31040
  nextToken();
31020
31041
  return !scanner.hasPrecedingLineBreak() && (isIdentifier2() || token() === 11 /* StringLiteral */);
@@ -31759,7 +31780,7 @@ var Parser;
31759
31780
  if (lastError && lastError.code === Diagnostics._0_expected.code) {
31760
31781
  addRelatedInfo(
31761
31782
  lastError,
31762
- createDetachedDiagnostic(fileName, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}")
31783
+ createDetachedDiagnostic(fileName, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here_Colon, "{", "}")
31763
31784
  );
31764
31785
  }
31765
31786
  }
@@ -32127,20 +32148,20 @@ var Parser;
32127
32148
  function doJSDocScan() {
32128
32149
  let state = 1 /* SawAsterisk */;
32129
32150
  let margin;
32130
- let indent2 = start - (content.lastIndexOf("\n", start) + 1) + 4;
32151
+ let indent = start - (content.lastIndexOf("\n", start) + 1) + 4;
32131
32152
  function pushComment(text) {
32132
32153
  if (!margin) {
32133
- margin = indent2;
32154
+ margin = indent;
32134
32155
  }
32135
32156
  comments.push(text);
32136
- indent2 += text.length;
32157
+ indent += text.length;
32137
32158
  }
32138
32159
  nextTokenJSDoc();
32139
32160
  while (parseOptionalJsdoc(5 /* WhitespaceTrivia */))
32140
32161
  ;
32141
32162
  if (parseOptionalJsdoc(4 /* NewLineTrivia */)) {
32142
32163
  state = 0 /* BeginningOfLine */;
32143
- indent2 = 0;
32164
+ indent = 0;
32144
32165
  }
32145
32166
  loop:
32146
32167
  while (true) {
@@ -32149,14 +32170,14 @@ var Parser;
32149
32170
  removeTrailingWhitespace(comments);
32150
32171
  if (!commentsPos)
32151
32172
  commentsPos = getNodePos();
32152
- addTag(parseTag(indent2));
32173
+ addTag(parseTag(indent));
32153
32174
  state = 0 /* BeginningOfLine */;
32154
32175
  margin = void 0;
32155
32176
  break;
32156
32177
  case 4 /* NewLineTrivia */:
32157
32178
  comments.push(scanner.getTokenText());
32158
32179
  state = 0 /* BeginningOfLine */;
32159
- indent2 = 0;
32180
+ indent = 0;
32160
32181
  break;
32161
32182
  case 42 /* AsteriskToken */:
32162
32183
  const asterisk = scanner.getTokenText();
@@ -32166,16 +32187,16 @@ var Parser;
32166
32187
  } else {
32167
32188
  Debug.assert(state === 0 /* BeginningOfLine */);
32168
32189
  state = 1 /* SawAsterisk */;
32169
- indent2 += asterisk.length;
32190
+ indent += asterisk.length;
32170
32191
  }
32171
32192
  break;
32172
32193
  case 5 /* WhitespaceTrivia */:
32173
32194
  Debug.assert(state !== 2 /* SavingComments */, "whitespace shouldn't come from the scanner while saving top-level comment text");
32174
32195
  const whitespace = scanner.getTokenText();
32175
- if (margin !== void 0 && indent2 + whitespace.length > margin) {
32176
- comments.push(whitespace.slice(margin - indent2));
32196
+ if (margin !== void 0 && indent + whitespace.length > margin) {
32197
+ comments.push(whitespace.slice(margin - indent));
32177
32198
  }
32178
- indent2 += whitespace.length;
32199
+ indent += whitespace.length;
32179
32200
  break;
32180
32201
  case 1 /* EndOfFileToken */:
32181
32202
  break loop;
@@ -32377,7 +32398,7 @@ var Parser;
32377
32398
  }
32378
32399
  return parseTagComments(margin, indentText.slice(margin));
32379
32400
  }
32380
- function parseTagComments(indent2, initialMargin) {
32401
+ function parseTagComments(indent, initialMargin) {
32381
32402
  const commentsPos2 = getNodePos();
32382
32403
  let comments2 = [];
32383
32404
  const parts2 = [];
@@ -32386,10 +32407,10 @@ var Parser;
32386
32407
  let margin;
32387
32408
  function pushComment(text) {
32388
32409
  if (!margin) {
32389
- margin = indent2;
32410
+ margin = indent;
32390
32411
  }
32391
32412
  comments2.push(text);
32392
- indent2 += text.length;
32413
+ indent += text.length;
32393
32414
  }
32394
32415
  if (initialMargin !== void 0) {
32395
32416
  if (initialMargin !== "") {
@@ -32404,7 +32425,7 @@ var Parser;
32404
32425
  case 4 /* NewLineTrivia */:
32405
32426
  state = 0 /* BeginningOfLine */;
32406
32427
  comments2.push(scanner.getTokenText());
32407
- indent2 = 0;
32428
+ indent = 0;
32408
32429
  break;
32409
32430
  case 60 /* AtToken */:
32410
32431
  scanner.resetTokenState(scanner.getTokenEnd() - 1);
@@ -32414,11 +32435,11 @@ var Parser;
32414
32435
  case 5 /* WhitespaceTrivia */:
32415
32436
  Debug.assert(state !== 2 /* SavingComments */ && state !== 3 /* SavingBackticks */, "whitespace shouldn't come from the scanner while saving comment text");
32416
32437
  const whitespace = scanner.getTokenText();
32417
- if (margin !== void 0 && indent2 + whitespace.length > margin) {
32418
- comments2.push(whitespace.slice(margin - indent2));
32438
+ if (margin !== void 0 && indent + whitespace.length > margin) {
32439
+ comments2.push(whitespace.slice(margin - indent));
32419
32440
  state = 2 /* SavingComments */;
32420
32441
  }
32421
- indent2 += whitespace.length;
32442
+ indent += whitespace.length;
32422
32443
  break;
32423
32444
  case 19 /* OpenBraceToken */:
32424
32445
  state = 2 /* SavingComments */;
@@ -32451,7 +32472,7 @@ var Parser;
32451
32472
  case 42 /* AsteriskToken */:
32452
32473
  if (state === 0 /* BeginningOfLine */) {
32453
32474
  state = 1 /* SawAsterisk */;
32454
- indent2 += 1;
32475
+ indent += 1;
32455
32476
  break;
32456
32477
  }
32457
32478
  default:
@@ -32516,8 +32537,8 @@ var Parser;
32516
32537
  function isJSDocLinkTag(kind) {
32517
32538
  return kind === "link" || kind === "linkcode" || kind === "linkplain";
32518
32539
  }
32519
- function parseUnknownTag(start2, tagName, indent2, indentText) {
32520
- return finishNode(factory2.createJSDocUnknownTag(tagName, parseTrailingTagComments(start2, getNodePos(), indent2, indentText)), start2);
32540
+ function parseUnknownTag(start2, tagName, indent, indentText) {
32541
+ return finishNode(factory2.createJSDocUnknownTag(tagName, parseTrailingTagComments(start2, getNodePos(), indent, indentText)), start2);
32521
32542
  }
32522
32543
  function addTag(tag) {
32523
32544
  if (!tag) {
@@ -32564,7 +32585,7 @@ var Parser;
32564
32585
  return isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments;
32565
32586
  }
32566
32587
  }
32567
- function parseParameterOrPropertyTag(start2, tagName, target, indent2) {
32588
+ function parseParameterOrPropertyTag(start2, tagName, target, indent) {
32568
32589
  let typeExpression = tryParseTypeExpression();
32569
32590
  let isNameFirst = !typeExpression;
32570
32591
  skipWhitespaceOrAsterisk();
@@ -32573,8 +32594,8 @@ var Parser;
32573
32594
  if (isNameFirst && !lookAhead(parseJSDocLinkPrefix)) {
32574
32595
  typeExpression = tryParseTypeExpression();
32575
32596
  }
32576
- const comment = parseTrailingTagComments(start2, getNodePos(), indent2, indentText);
32577
- const nestedTypeLiteral = target !== 4 /* CallbackParameter */ && parseNestedTypeLiteral(typeExpression, name, target, indent2);
32597
+ const comment = parseTrailingTagComments(start2, getNodePos(), indent, indentText);
32598
+ const nestedTypeLiteral = parseNestedTypeLiteral(typeExpression, name, target, indent);
32578
32599
  if (nestedTypeLiteral) {
32579
32600
  typeExpression = nestedTypeLiteral;
32580
32601
  isNameFirst = true;
@@ -32582,12 +32603,12 @@ var Parser;
32582
32603
  const result2 = target === 1 /* Property */ ? factory2.createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) : factory2.createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment);
32583
32604
  return finishNode(result2, start2);
32584
32605
  }
32585
- function parseNestedTypeLiteral(typeExpression, name, target, indent2) {
32606
+ function parseNestedTypeLiteral(typeExpression, name, target, indent) {
32586
32607
  if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) {
32587
32608
  const pos = getNodePos();
32588
32609
  let child;
32589
32610
  let children;
32590
- while (child = tryParse(() => parseChildParameterOrPropertyTag(target, indent2, name))) {
32611
+ while (child = tryParse(() => parseChildParameterOrPropertyTag(target, indent, name))) {
32591
32612
  if (child.kind === 348 /* JSDocParameterTag */ || child.kind === 355 /* JSDocPropertyTag */) {
32592
32613
  children = append(children, child);
32593
32614
  } else if (child.kind === 352 /* JSDocTemplateTag */) {
@@ -32600,14 +32621,14 @@ var Parser;
32600
32621
  }
32601
32622
  }
32602
32623
  }
32603
- function parseReturnTag(start2, tagName, indent2, indentText) {
32624
+ function parseReturnTag(start2, tagName, indent, indentText) {
32604
32625
  if (some(tags, isJSDocReturnTag)) {
32605
32626
  parseErrorAt(tagName.pos, scanner.getTokenStart(), Diagnostics._0_tag_already_specified, unescapeLeadingUnderscores(tagName.escapedText));
32606
32627
  }
32607
32628
  const typeExpression = tryParseTypeExpression();
32608
- return finishNode(factory2.createJSDocReturnTag(tagName, typeExpression, parseTrailingTagComments(start2, getNodePos(), indent2, indentText)), start2);
32629
+ return finishNode(factory2.createJSDocReturnTag(tagName, typeExpression, parseTrailingTagComments(start2, getNodePos(), indent, indentText)), start2);
32609
32630
  }
32610
- function parseTypeTag(start2, tagName, indent2, indentText) {
32631
+ function parseTypeTag(start2, tagName, indent, indentText) {
32611
32632
  if (some(tags, isJSDocTypeTag)) {
32612
32633
  parseErrorAt(tagName.pos, scanner.getTokenStart(), Diagnostics._0_tag_already_specified, unescapeLeadingUnderscores(tagName.escapedText));
32613
32634
  }
@@ -32615,25 +32636,25 @@ var Parser;
32615
32636
  /*mayOmitBraces*/
32616
32637
  true
32617
32638
  );
32618
- const comments2 = indent2 !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), indent2, indentText) : void 0;
32639
+ const comments2 = indent !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), indent, indentText) : void 0;
32619
32640
  return finishNode(factory2.createJSDocTypeTag(tagName, typeExpression, comments2), start2);
32620
32641
  }
32621
- function parseSeeTag(start2, tagName, indent2, indentText) {
32642
+ function parseSeeTag(start2, tagName, indent, indentText) {
32622
32643
  const isMarkdownOrJSDocLink = token() === 23 /* OpenBracketToken */ || lookAhead(() => nextTokenJSDoc() === 60 /* AtToken */ && tokenIsIdentifierOrKeyword(nextTokenJSDoc()) && isJSDocLinkTag(scanner.getTokenValue()));
32623
32644
  const nameExpression = isMarkdownOrJSDocLink ? void 0 : parseJSDocNameReference();
32624
- const comments2 = indent2 !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), indent2, indentText) : void 0;
32645
+ const comments2 = indent !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), indent, indentText) : void 0;
32625
32646
  return finishNode(factory2.createJSDocSeeTag(tagName, nameExpression, comments2), start2);
32626
32647
  }
32627
- function parseThrowsTag(start2, tagName, indent2, indentText) {
32648
+ function parseThrowsTag(start2, tagName, indent, indentText) {
32628
32649
  const typeExpression = tryParseTypeExpression();
32629
- const comment = parseTrailingTagComments(start2, getNodePos(), indent2, indentText);
32650
+ const comment = parseTrailingTagComments(start2, getNodePos(), indent, indentText);
32630
32651
  return finishNode(factory2.createJSDocThrowsTag(tagName, typeExpression, comment), start2);
32631
32652
  }
32632
- function parseAuthorTag(start2, tagName, indent2, indentText) {
32653
+ function parseAuthorTag(start2, tagName, indent, indentText) {
32633
32654
  const commentStart = getNodePos();
32634
32655
  const textOnly = parseAuthorNameAndEmail();
32635
32656
  let commentEnd = scanner.getTokenFullStart();
32636
- const comments2 = parseTrailingTagComments(start2, commentEnd, indent2, indentText);
32657
+ const comments2 = parseTrailingTagComments(start2, commentEnd, indent, indentText);
32637
32658
  if (!comments2) {
32638
32659
  commentEnd = scanner.getTokenFullStart();
32639
32660
  }
@@ -32717,19 +32738,19 @@ var Parser;
32717
32738
  skipWhitespace();
32718
32739
  return finishNode(factory2.createJSDocEnumTag(tagName, typeExpression, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2);
32719
32740
  }
32720
- function parseTypedefTag(start2, tagName, indent2, indentText) {
32741
+ function parseTypedefTag(start2, tagName, indent, indentText) {
32721
32742
  let typeExpression = tryParseTypeExpression();
32722
32743
  skipWhitespaceOrAsterisk();
32723
32744
  const fullName = parseJSDocTypeNameWithNamespace();
32724
32745
  skipWhitespace();
32725
- let comment = parseTagComments(indent2);
32746
+ let comment = parseTagComments(indent);
32726
32747
  let end2;
32727
32748
  if (!typeExpression || isObjectOrObjectArrayTypeReference(typeExpression.type)) {
32728
32749
  let child;
32729
32750
  let childTypeTag;
32730
32751
  let jsDocPropertyTags;
32731
32752
  let hasChildren = false;
32732
- while (child = tryParse(() => parseChildPropertyTag(indent2))) {
32753
+ while (child = tryParse(() => parseChildPropertyTag(indent))) {
32733
32754
  if (child.kind === 352 /* JSDocTemplateTag */) {
32734
32755
  break;
32735
32756
  }
@@ -32738,7 +32759,7 @@ var Parser;
32738
32759
  if (childTypeTag) {
32739
32760
  const lastError = parseErrorAtCurrentToken(Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);
32740
32761
  if (lastError) {
32741
- addRelatedInfo(lastError, createDetachedDiagnostic(fileName, 0, 0, Diagnostics.The_tag_was_first_specified_here));
32762
+ addRelatedInfo(lastError, createDetachedDiagnostic(fileName, 0, 0, Diagnostics.The_tag_was_first_specified_here_Colon));
32742
32763
  }
32743
32764
  break;
32744
32765
  } else {
@@ -32757,7 +32778,7 @@ var Parser;
32757
32778
  }
32758
32779
  end2 = end2 || comment !== void 0 ? getNodePos() : (fullName ?? typeExpression ?? tagName).end;
32759
32780
  if (!comment) {
32760
- comment = parseTrailingTagComments(start2, end2, indent2, indentText);
32781
+ comment = parseTrailingTagComments(start2, end2, indent, indentText);
32761
32782
  }
32762
32783
  const typedefTag = factory2.createJSDocTypedefTag(tagName, typeExpression, fullName, comment);
32763
32784
  return finishNode(typedefTag, start2, end2);
@@ -32787,11 +32808,11 @@ var Parser;
32787
32808
  }
32788
32809
  return typeNameOrNamespaceName;
32789
32810
  }
32790
- function parseCallbackTagParameters(indent2) {
32811
+ function parseCallbackTagParameters(indent) {
32791
32812
  const pos = getNodePos();
32792
32813
  let child;
32793
32814
  let parameters;
32794
- while (child = tryParse(() => parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent2))) {
32815
+ while (child = tryParse(() => parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent))) {
32795
32816
  if (child.kind === 352 /* JSDocTemplateTag */) {
32796
32817
  parseErrorAtRange(child.tagName, Diagnostics.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag);
32797
32818
  break;
@@ -32800,11 +32821,11 @@ var Parser;
32800
32821
  }
32801
32822
  return createNodeArray(parameters || [], pos);
32802
32823
  }
32803
- function parseJSDocSignature(start2, indent2) {
32804
- const parameters = parseCallbackTagParameters(indent2);
32824
+ function parseJSDocSignature(start2, indent) {
32825
+ const parameters = parseCallbackTagParameters(indent);
32805
32826
  const returnTag = tryParse(() => {
32806
32827
  if (parseOptionalJsdoc(60 /* AtToken */)) {
32807
- const tag = parseTag(indent2);
32828
+ const tag = parseTag(indent);
32808
32829
  if (tag && tag.kind === 349 /* JSDocReturnTag */) {
32809
32830
  return tag;
32810
32831
  }
@@ -32817,23 +32838,23 @@ var Parser;
32817
32838
  returnTag
32818
32839
  ), start2);
32819
32840
  }
32820
- function parseCallbackTag(start2, tagName, indent2, indentText) {
32841
+ function parseCallbackTag(start2, tagName, indent, indentText) {
32821
32842
  const fullName = parseJSDocTypeNameWithNamespace();
32822
32843
  skipWhitespace();
32823
- let comment = parseTagComments(indent2);
32824
- const typeExpression = parseJSDocSignature(start2, indent2);
32844
+ let comment = parseTagComments(indent);
32845
+ const typeExpression = parseJSDocSignature(start2, indent);
32825
32846
  if (!comment) {
32826
- comment = parseTrailingTagComments(start2, getNodePos(), indent2, indentText);
32847
+ comment = parseTrailingTagComments(start2, getNodePos(), indent, indentText);
32827
32848
  }
32828
32849
  const end2 = comment !== void 0 ? getNodePos() : typeExpression.end;
32829
32850
  return finishNode(factory2.createJSDocCallbackTag(tagName, typeExpression, fullName, comment), start2, end2);
32830
32851
  }
32831
- function parseOverloadTag(start2, tagName, indent2, indentText) {
32852
+ function parseOverloadTag(start2, tagName, indent, indentText) {
32832
32853
  skipWhitespace();
32833
- let comment = parseTagComments(indent2);
32834
- const typeExpression = parseJSDocSignature(start2, indent2);
32854
+ let comment = parseTagComments(indent);
32855
+ const typeExpression = parseJSDocSignature(start2, indent);
32835
32856
  if (!comment) {
32836
- comment = parseTrailingTagComments(start2, getNodePos(), indent2, indentText);
32857
+ comment = parseTrailingTagComments(start2, getNodePos(), indent, indentText);
32837
32858
  }
32838
32859
  const end2 = comment !== void 0 ? getNodePos() : typeExpression.end;
32839
32860
  return finishNode(factory2.createJSDocOverloadTag(tagName, typeExpression, comment), start2, end2);
@@ -32849,18 +32870,18 @@ var Parser;
32849
32870
  }
32850
32871
  return a.escapedText === b.escapedText;
32851
32872
  }
32852
- function parseChildPropertyTag(indent2) {
32853
- return parseChildParameterOrPropertyTag(1 /* Property */, indent2);
32873
+ function parseChildPropertyTag(indent) {
32874
+ return parseChildParameterOrPropertyTag(1 /* Property */, indent);
32854
32875
  }
32855
- function parseChildParameterOrPropertyTag(target, indent2, name) {
32876
+ function parseChildParameterOrPropertyTag(target, indent, name) {
32856
32877
  let canParseTag = true;
32857
32878
  let seenAsterisk = false;
32858
32879
  while (true) {
32859
32880
  switch (nextTokenJSDoc()) {
32860
32881
  case 60 /* AtToken */:
32861
32882
  if (canParseTag) {
32862
- const child = tryParseChildTag(target, indent2);
32863
- if (child && (child.kind === 348 /* JSDocParameterTag */ || child.kind === 355 /* JSDocPropertyTag */) && target !== 4 /* CallbackParameter */ && name && (isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) {
32883
+ const child = tryParseChildTag(target, indent);
32884
+ if (child && (child.kind === 348 /* JSDocParameterTag */ || child.kind === 355 /* JSDocPropertyTag */) && name && (isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) {
32864
32885
  return false;
32865
32886
  }
32866
32887
  return child;
@@ -32885,7 +32906,7 @@ var Parser;
32885
32906
  }
32886
32907
  }
32887
32908
  }
32888
- function tryParseChildTag(target, indent2) {
32909
+ function tryParseChildTag(target, indent) {
32889
32910
  Debug.assert(token() === 60 /* AtToken */);
32890
32911
  const start2 = scanner.getTokenFullStart();
32891
32912
  nextTokenJSDoc();
@@ -32905,14 +32926,14 @@ var Parser;
32905
32926
  t = 2 /* Parameter */ | 4 /* CallbackParameter */;
32906
32927
  break;
32907
32928
  case "template":
32908
- return parseTemplateTag(start2, tagName, indent2, indentText);
32929
+ return parseTemplateTag(start2, tagName, indent, indentText);
32909
32930
  default:
32910
32931
  return false;
32911
32932
  }
32912
32933
  if (!(target & t)) {
32913
32934
  return false;
32914
32935
  }
32915
- return parseParameterOrPropertyTag(start2, tagName, target, indent2);
32936
+ return parseParameterOrPropertyTag(start2, tagName, target, indent);
32916
32937
  }
32917
32938
  function parseTemplateTagTypeParameter() {
32918
32939
  const typeParameterPos = getNodePos();
@@ -32953,10 +32974,10 @@ var Parser;
32953
32974
  } while (parseOptionalJsdoc(28 /* CommaToken */));
32954
32975
  return createNodeArray(typeParameters, pos);
32955
32976
  }
32956
- function parseTemplateTag(start2, tagName, indent2, indentText) {
32977
+ function parseTemplateTag(start2, tagName, indent, indentText) {
32957
32978
  const constraint = token() === 19 /* OpenBraceToken */ ? parseJSDocTypeExpression() : void 0;
32958
32979
  const typeParameters = parseTemplateTagTypeParameters();
32959
- return finishNode(factory2.createJSDocTemplateTag(tagName, constraint, typeParameters, parseTrailingTagComments(start2, getNodePos(), indent2, indentText)), start2);
32980
+ return finishNode(factory2.createJSDocTemplateTag(tagName, constraint, typeParameters, parseTrailingTagComments(start2, getNodePos(), indent, indentText)), start2);
32960
32981
  }
32961
32982
  function parseOptionalJsdoc(t) {
32962
32983
  if (token() === t) {
@@ -39462,10 +39483,10 @@ function createBinder() {
39462
39483
  const decl = getNameOfDeclaration(declaration) || declaration;
39463
39484
  const diag3 = messageNeedsName ? createDiagnosticForNode2(decl, message, getDisplayName(declaration)) : createDiagnosticForNode2(decl, message);
39464
39485
  file.bindDiagnostics.push(
39465
- multipleDefaultExports ? addRelatedInfo(diag3, createDiagnosticForNode2(declarationName, index === 0 ? Diagnostics.Another_export_default_is_here : Diagnostics.and_here)) : diag3
39486
+ multipleDefaultExports ? addRelatedInfo(diag3, createDiagnosticForNode2(declarationName, index === 0 ? Diagnostics.Another_export_default_is_here_Colon : Diagnostics.and_here_Colon)) : diag3
39466
39487
  );
39467
39488
  if (multipleDefaultExports) {
39468
- relatedInformation.push(createDiagnosticForNode2(decl, Diagnostics.The_first_export_default_is_here));
39489
+ relatedInformation.push(createDiagnosticForNode2(decl, Diagnostics.The_first_export_default_is_here_Colon));
39469
39490
  }
39470
39491
  });
39471
39492
  const diag2 = messageNeedsName ? createDiagnosticForNode2(declarationName, message, getDisplayName(node)) : createDiagnosticForNode2(declarationName, message);
@@ -44003,7 +44024,7 @@ function createTypeChecker(host) {
44003
44024
  if (deprecatedTag) {
44004
44025
  addRelatedInfo(
44005
44026
  diagnostic,
44006
- createDiagnosticForNode(deprecatedTag, Diagnostics.The_declaration_was_marked_as_deprecated_here)
44027
+ createDiagnosticForNode(deprecatedTag, Diagnostics.The_declaration_was_marked_as_deprecated_here_Colon)
44007
44028
  );
44008
44029
  }
44009
44030
  suggestionDiagnostics.add(diagnostic);
@@ -44198,8 +44219,8 @@ function createTypeChecker(host) {
44198
44219
  if (adjustedNode === errorNode)
44199
44220
  continue;
44200
44221
  err.relatedInformation = err.relatedInformation || [];
44201
- const leadingMessage = createDiagnosticForNode(adjustedNode, Diagnostics._0_was_also_declared_here, symbolName2);
44202
- const followOnMessage = createDiagnosticForNode(adjustedNode, Diagnostics.and_here);
44222
+ const leadingMessage = createDiagnosticForNode(adjustedNode, Diagnostics._0_was_also_declared_here_Colon, symbolName2);
44223
+ const followOnMessage = createDiagnosticForNode(adjustedNode, Diagnostics.and_here_Colon);
44203
44224
  if (length(err.relatedInformation) >= 5 || some(err.relatedInformation, (r) => compareDiagnostics(r, followOnMessage) === 0 /* EqualTo */ || compareDiagnostics(r, leadingMessage) === 0 /* EqualTo */))
44204
44225
  continue;
44205
44226
  addRelatedInfo(err, !length(err.relatedInformation) ? leadingMessage : followOnMessage);
@@ -44810,7 +44831,7 @@ function createTypeChecker(host) {
44810
44831
  if (suggestion.valueDeclaration) {
44811
44832
  addRelatedInfo(
44812
44833
  diagnostic,
44813
- createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics._0_is_declared_here, suggestionName)
44834
+ createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics._0_is_declared_here_Colon, suggestionName)
44814
44835
  );
44815
44836
  }
44816
44837
  }
@@ -44872,7 +44893,7 @@ function createTypeChecker(host) {
44872
44893
  diagnostic,
44873
44894
  createDiagnosticForNode(
44874
44895
  typeOnlyDeclaration,
44875
- typeOnlyDeclaration.kind === 281 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 278 /* ExportDeclaration */ || typeOnlyDeclaration.kind === 280 /* NamespaceExport */ ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here,
44896
+ typeOnlyDeclaration.kind === 281 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 278 /* ExportDeclaration */ || typeOnlyDeclaration.kind === 280 /* NamespaceExport */ ? Diagnostics._0_was_exported_here_Colon : Diagnostics._0_was_imported_here_Colon,
44876
44897
  unescapedName
44877
44898
  )
44878
44899
  );
@@ -45009,7 +45030,7 @@ function createTypeChecker(host) {
45009
45030
  return true;
45010
45031
  }
45011
45032
  }
45012
- error(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here, unescapeLeadingUnderscores(name));
45033
+ error(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_Colon, unescapeLeadingUnderscores(name));
45013
45034
  return true;
45014
45035
  }
45015
45036
  }
@@ -45051,7 +45072,7 @@ function createTypeChecker(host) {
45051
45072
  if (isExtendedByInterface(errorLocation)) {
45052
45073
  error(errorLocation, Diagnostics.An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_classes, unescapeLeadingUnderscores(name));
45053
45074
  } else {
45054
- error(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, unescapeLeadingUnderscores(name));
45075
+ error(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Colon, unescapeLeadingUnderscores(name));
45055
45076
  }
45056
45077
  return true;
45057
45078
  }
@@ -45074,7 +45095,7 @@ function createTypeChecker(host) {
45074
45095
  } else if (maybeMappedType(errorLocation, symbol)) {
45075
45096
  error(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0, rawName, rawName === "K" ? "P" : "K");
45076
45097
  } else {
45077
- error(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, rawName);
45098
+ error(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Colon, rawName);
45078
45099
  }
45079
45100
  return true;
45080
45101
  }
@@ -45180,7 +45201,7 @@ function createTypeChecker(host) {
45180
45201
  if (diagnosticMessage) {
45181
45202
  addRelatedInfo(
45182
45203
  diagnosticMessage,
45183
- createDiagnosticForNode(declaration, Diagnostics._0_is_declared_here, declarationName)
45204
+ createDiagnosticForNode(declaration, Diagnostics._0_is_declared_here_Colon, declarationName)
45184
45205
  );
45185
45206
  }
45186
45207
  }
@@ -45248,7 +45269,7 @@ function createTypeChecker(host) {
45248
45269
  const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(getSymbolOfDeclaration(node));
45249
45270
  const isExport = typeOnlyDeclaration.kind === 281 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 278 /* ExportDeclaration */;
45250
45271
  const message = isExport ? Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type : Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type;
45251
- const relatedMessage = isExport ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here;
45272
+ const relatedMessage = isExport ? Diagnostics._0_was_exported_here_Colon : Diagnostics._0_was_imported_here_Colon;
45252
45273
  const name = typeOnlyDeclaration.kind === 278 /* ExportDeclaration */ ? "*" : unescapeLeadingUnderscores(typeOnlyDeclaration.name.escapedText);
45253
45274
  addRelatedInfo(error(node.moduleReference, message), createDiagnosticForNode(typeOnlyDeclaration, relatedMessage, name));
45254
45275
  }
@@ -45570,7 +45591,7 @@ function createTypeChecker(host) {
45570
45591
  if (suggestion.valueDeclaration) {
45571
45592
  addRelatedInfo(
45572
45593
  diagnostic,
45573
- createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics._0_is_declared_here, suggestionName)
45594
+ createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics._0_is_declared_here_Colon, suggestionName)
45574
45595
  );
45575
45596
  }
45576
45597
  } else {
@@ -45600,7 +45621,7 @@ function createTypeChecker(host) {
45600
45621
  if (localSymbol.declarations) {
45601
45622
  addRelatedInfo(
45602
45623
  diagnostic,
45603
- ...map(localSymbol.declarations, (decl, index) => createDiagnosticForNode(decl, index === 0 ? Diagnostics._0_is_declared_here : Diagnostics.and_here, declarationName))
45624
+ ...map(localSymbol.declarations, (decl, index) => createDiagnosticForNode(decl, index === 0 ? Diagnostics._0_is_declared_here_Colon : Diagnostics.and_here_Colon, declarationName))
45604
45625
  );
45605
45626
  }
45606
45627
  }
@@ -51645,11 +51666,11 @@ function createTypeChecker(host) {
51645
51666
  const exportedMemberName = ((_a = tryCast(exportedMember.valueDeclaration, isNamedDeclaration)) == null ? void 0 : _a.name) || exportedMember.valueDeclaration;
51646
51667
  addRelatedInfo(
51647
51668
  error(s.valueDeclaration, Diagnostics.Duplicate_identifier_0, unescapedName),
51648
- createDiagnosticForNode(exportedMemberName, Diagnostics._0_was_also_declared_here, unescapedName)
51669
+ createDiagnosticForNode(exportedMemberName, Diagnostics._0_was_also_declared_here_Colon, unescapedName)
51649
51670
  );
51650
51671
  addRelatedInfo(
51651
51672
  error(exportedMemberName, Diagnostics.Duplicate_identifier_0, unescapedName),
51652
- createDiagnosticForNode(s.valueDeclaration, Diagnostics._0_was_also_declared_here, unescapedName)
51673
+ createDiagnosticForNode(s.valueDeclaration, Diagnostics._0_was_also_declared_here_Colon, unescapedName)
51653
51674
  );
51654
51675
  }
51655
51676
  const union = createSymbol(s.flags | exportedMember.flags, name);
@@ -52160,7 +52181,7 @@ function createTypeChecker(host) {
52160
52181
  return checkFlags & 2 /* SyntheticProperty */ ? checkFlags & 65536 /* DeferredType */ ? getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) : (
52161
52182
  // NOTE: cast to TransientSymbol should be safe because only TransientSymbols can have CheckFlags.SyntheticProperty
52162
52183
  symbol.links.writeType || symbol.links.type
52163
- ) : removeMissingType(getTypeOfSymbol(symbol), !!(symbol.flags & 16777216 /* Optional */));
52184
+ ) : getTypeOfSymbol(symbol);
52164
52185
  }
52165
52186
  if (symbol.flags & 98304 /* Accessor */) {
52166
52187
  return checkFlags & 1 /* Instantiated */ ? getWriteTypeOfInstantiatedSymbol(symbol) : getWriteTypeOfAccessors(symbol);
@@ -52884,7 +52905,7 @@ function createTypeChecker(host) {
52884
52905
  if (lateSymbol.flags & getExcludedSymbolFlags(symbolFlags) || earlySymbol) {
52885
52906
  const declarations = earlySymbol ? concatenate(earlySymbol.declarations, lateSymbol.declarations) : lateSymbol.declarations;
52886
52907
  const name = !(type.flags & 8192 /* UniqueESSymbol */) && unescapeLeadingUnderscores(memberName) || declarationNameToString(declName);
52887
- forEach(declarations, (declaration) => error(getNameOfDeclaration(declaration) || declaration, Diagnostics.Property_0_was_also_declared_here, name));
52908
+ forEach(declarations, (declaration) => error(getNameOfDeclaration(declaration) || declaration, Diagnostics.Property_0_was_also_declared_here_Colon, name));
52888
52909
  error(declName || decl, Diagnostics.Duplicate_property_0, name);
52889
52910
  lateSymbol = createSymbol(0 /* None */, memberName, 4096 /* Late */);
52890
52911
  }
@@ -57796,7 +57817,7 @@ function createTypeChecker(host) {
57796
57817
  if (moduleSymbol.flags & targetMeaning) {
57797
57818
  links.resolvedType = resolveImportSymbolType(node, links, moduleSymbol, targetMeaning);
57798
57819
  } else {
57799
- const errorMessage = targetMeaning === 111551 /* Value */ ? Diagnostics.Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here : Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0;
57820
+ const errorMessage = targetMeaning === 111551 /* Value */ ? Diagnostics.Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_Colon : Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0;
57800
57821
  error(node, errorMessage, node.argument.literal.text);
57801
57822
  links.resolvedSymbol = unknownSymbol;
57802
57823
  links.resolvedType = errorType;
@@ -61557,7 +61578,7 @@ function createTypeChecker(host) {
61557
61578
  );
61558
61579
  reportError(Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName, ...getTypeNamesForErrorDisplay(source2, target2));
61559
61580
  if (length(unmatchedProperty.declarations)) {
61560
- associateRelatedInfo(createDiagnosticForNode(unmatchedProperty.declarations[0], Diagnostics._0_is_declared_here, propName));
61581
+ associateRelatedInfo(createDiagnosticForNode(unmatchedProperty.declarations[0], Diagnostics._0_is_declared_here_Colon, propName));
61561
61582
  }
61562
61583
  if (shouldSkipElaboration && errorInfo) {
61563
61584
  overrideNextErrorInfo++;
@@ -62511,7 +62532,8 @@ function createTypeChecker(host) {
62511
62532
  return !!elementType && isEmptyLiteralType(elementType);
62512
62533
  }
62513
62534
  function isTupleLikeType(type) {
62514
- return isTupleType(type) || !!getPropertyOfType(type, "0");
62535
+ let lengthType;
62536
+ return isTupleType(type) || !!getPropertyOfType(type, "0") || isArrayLikeType(type) && !!(lengthType = getTypeOfPropertyOfType(type, "length")) && everyType(lengthType, (t) => !!(t.flags & 256 /* NumberLiteral */));
62515
62537
  }
62516
62538
  function isArrayOrTupleLikeType(type) {
62517
62539
  return isArrayLikeType(type) || isTupleLikeType(type);
@@ -66034,15 +66056,7 @@ function createTypeChecker(host) {
66034
66056
  location = location.parent;
66035
66057
  }
66036
66058
  if (isExpressionNode(location) && (!isAssignmentTarget(location) || isWriteAccess(location))) {
66037
- const type = removeOptionalTypeMarker(
66038
- isWriteAccess(location) && location.kind === 211 /* PropertyAccessExpression */ ? checkPropertyAccessExpression(
66039
- location,
66040
- /*checkMode*/
66041
- void 0,
66042
- /*writeOnly*/
66043
- true
66044
- ) : getTypeOfExpression(location)
66045
- );
66059
+ const type = removeOptionalTypeMarker(getTypeOfExpression(location));
66046
66060
  if (getExportSymbolOfValueSymbolIfExported(getNodeLinks(location).resolvedSymbol) === symbol) {
66047
66061
  return type;
66048
66062
  }
@@ -67881,6 +67895,10 @@ function createTypeChecker(host) {
67881
67895
  function hasDefaultValue(node) {
67882
67896
  return node.kind === 208 /* BindingElement */ && !!node.initializer || node.kind === 226 /* BinaryExpression */ && node.operatorToken.kind === 64 /* EqualsToken */;
67883
67897
  }
67898
+ function isSpreadIntoCallOrNew(node) {
67899
+ const parent = walkUpParenthesizedExpressions(node.parent);
67900
+ return isSpreadElement(parent) && isCallOrNewExpression(parent.parent);
67901
+ }
67884
67902
  function checkArrayLiteral(node, checkMode, forceTuple) {
67885
67903
  const elements = node.elements;
67886
67904
  const elementCount = elements.length;
@@ -67888,14 +67906,13 @@ function createTypeChecker(host) {
67888
67906
  const elementFlags = [];
67889
67907
  pushCachedContextualType(node);
67890
67908
  const inDestructuringPattern = isAssignmentTarget(node);
67891
- const isSpreadIntoCallOrNew = isSpreadElement(node.parent) && isCallOrNewExpression(node.parent.parent);
67892
- const inConstContext = isSpreadIntoCallOrNew || isConstContext(node);
67909
+ const inConstContext = isConstContext(node);
67893
67910
  const contextualType = getApparentTypeOfContextualType(
67894
67911
  node,
67895
67912
  /*contextFlags*/
67896
67913
  void 0
67897
67914
  );
67898
- const inTupleContext = isSpreadIntoCallOrNew || !!contextualType && someType(contextualType, isTupleLikeType);
67915
+ const inTupleContext = isSpreadIntoCallOrNew(node) || !!contextualType && someType(contextualType, isTupleLikeType);
67899
67916
  let hasOmittedExpression = false;
67900
67917
  for (let i = 0; i < elementCount; i++) {
67901
67918
  const e = elements[i];
@@ -69336,7 +69353,7 @@ function createTypeChecker(host) {
69336
69353
  if (diagnosticMessage) {
69337
69354
  addRelatedInfo(
69338
69355
  diagnosticMessage,
69339
- createDiagnosticForNode(valueDeclaration, Diagnostics._0_is_declared_here, declarationName)
69356
+ createDiagnosticForNode(valueDeclaration, Diagnostics._0_is_declared_here_Colon, declarationName)
69340
69357
  );
69341
69358
  }
69342
69359
  }
@@ -69423,7 +69440,7 @@ function createTypeChecker(host) {
69423
69440
  const suggestedName = symbolName(suggestion);
69424
69441
  const message = isUncheckedJS ? Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2 : Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2;
69425
69442
  errorInfo = chainDiagnosticMessages(errorInfo, message, missingProperty, container, suggestedName);
69426
- relatedInfo = suggestion.valueDeclaration && createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics._0_is_declared_here, suggestedName);
69443
+ relatedInfo = suggestion.valueDeclaration && createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics._0_is_declared_here_Colon, suggestedName);
69427
69444
  } else {
69428
69445
  const diagnostic = containerSeemsToBeEmptyDomElement(containingType) ? Diagnostics.Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom : Diagnostics.Property_0_does_not_exist_on_type_1;
69429
69446
  errorInfo = chainDiagnosticMessages(elaborateNeverIntersection(errorInfo, containingType), diagnostic, missingProperty, container);
@@ -70140,7 +70157,7 @@ function createTypeChecker(host) {
70140
70157
  const diag2 = createDiagnosticForNode(node.tagName, Diagnostics.Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3, entityNameToString(node.tagName), absoluteMinArgCount, entityNameToString(factory2), maxParamCount);
70141
70158
  const tagNameDeclaration = (_a = getSymbolAtLocation(node.tagName)) == null ? void 0 : _a.valueDeclaration;
70142
70159
  if (tagNameDeclaration) {
70143
- addRelatedInfo(diag2, createDiagnosticForNode(tagNameDeclaration, Diagnostics._0_is_declared_here, entityNameToString(node.tagName)));
70160
+ addRelatedInfo(diag2, createDiagnosticForNode(tagNameDeclaration, Diagnostics._0_is_declared_here_Colon, entityNameToString(node.tagName)));
70144
70161
  }
70145
70162
  if (errorOutputContainer && errorOutputContainer.skipLogging) {
70146
70163
  (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag2);
@@ -70592,7 +70609,7 @@ function createTypeChecker(host) {
70592
70609
  if (diags) {
70593
70610
  for (const d of diags) {
70594
70611
  if (last2.declaration && candidatesForArgumentError.length > 3) {
70595
- addRelatedInfo(d, createDiagnosticForNode(last2.declaration, Diagnostics.The_last_overload_is_declared_here));
70612
+ addRelatedInfo(d, createDiagnosticForNode(last2.declaration, Diagnostics.The_last_overload_is_declared_here_Colon));
70596
70613
  }
70597
70614
  addImplementationSuccessElaboration(last2, d);
70598
70615
  diagnostics.add(d);
@@ -75732,7 +75749,7 @@ function createTypeChecker(host) {
75732
75749
  const errorNode = signature.declaration && isJSDocSignature(signature.declaration) ? signature.declaration.parent.tagName : signature.declaration;
75733
75750
  addRelatedInfo(
75734
75751
  error(errorNode, Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature),
75735
- createDiagnosticForNode(bodyDeclaration, Diagnostics.The_implementation_signature_is_declared_here)
75752
+ createDiagnosticForNode(bodyDeclaration, Diagnostics.The_implementation_signature_is_declared_here_Colon)
75736
75753
  );
75737
75754
  break;
75738
75755
  }
@@ -76198,7 +76215,7 @@ function createTypeChecker(host) {
76198
76215
  const diag2 = error(typeName, Diagnostics.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled);
76199
76216
  const aliasDeclaration = find(rootSymbol.declarations || emptyArray, isAliasSymbolDeclaration);
76200
76217
  if (aliasDeclaration) {
76201
- addRelatedInfo(diag2, createDiagnosticForNode(aliasDeclaration, Diagnostics._0_was_imported_here, idText(rootName)));
76218
+ addRelatedInfo(diag2, createDiagnosticForNode(aliasDeclaration, Diagnostics._0_was_imported_here_Colon, idText(rootName)));
76202
76219
  }
76203
76220
  }
76204
76221
  }
@@ -77142,7 +77159,7 @@ function createTypeChecker(host) {
77142
77159
  if (firstDeclaration) {
77143
77160
  addRelatedInfo(
77144
77161
  err,
77145
- createDiagnosticForNode(firstDeclaration, Diagnostics._0_was_also_declared_here, declName)
77162
+ createDiagnosticForNode(firstDeclaration, Diagnostics._0_was_also_declared_here_Colon, declName)
77146
77163
  );
77147
77164
  }
77148
77165
  }
@@ -78252,7 +78269,7 @@ function createTypeChecker(host) {
78252
78269
  typeToString(info.type)
78253
78270
  );
78254
78271
  if (propDeclaration && errorNode !== propDeclaration) {
78255
- addRelatedInfo(diagnostic, createDiagnosticForNode(propDeclaration, Diagnostics._0_is_declared_here, symbolToString(prop)));
78272
+ addRelatedInfo(diagnostic, createDiagnosticForNode(propDeclaration, Diagnostics._0_is_declared_here_Colon, symbolToString(prop)));
78256
78273
  }
78257
78274
  diagnostics.add(diagnostic);
78258
78275
  }
@@ -82587,7 +82604,7 @@ function createTypeChecker(host) {
82587
82604
  createDiagnosticForNode(useStrictDirective, Diagnostics.use_strict_directive_used_here)
82588
82605
  );
82589
82606
  });
82590
- const diagnostics2 = nonSimpleParameters.map((parameter, index) => index === 0 ? createDiagnosticForNode(parameter, Diagnostics.Non_simple_parameter_declared_here) : createDiagnosticForNode(parameter, Diagnostics.and_here));
82607
+ const diagnostics2 = nonSimpleParameters.map((parameter, index) => index === 0 ? createDiagnosticForNode(parameter, Diagnostics.Non_simple_parameter_declared_here_Colon) : createDiagnosticForNode(parameter, Diagnostics.and_here_Colon));
82591
82608
  addRelatedInfo(error(useStrictDirective, Diagnostics.use_strict_directive_cannot_be_used_with_non_simple_parameter_list), ...diagnostics2);
82592
82609
  return true;
82593
82610
  }
@@ -114694,7 +114711,7 @@ var gutterSeparator = " ";
114694
114711
  var resetEscapeSequence = "\x1B[0m";
114695
114712
  var ellipsis = "...";
114696
114713
  var halfIndent = " ";
114697
- var indent = " ";
114714
+ var bullet = "\u25CF ";
114698
114715
  function getCategoryFormat(category) {
114699
114716
  switch (category) {
114700
114717
  case 1 /* Error */:
@@ -114710,39 +114727,49 @@ function getCategoryFormat(category) {
114710
114727
  function formatColorAndReset(text, formatStyle) {
114711
114728
  return formatStyle + text + resetEscapeSequence;
114712
114729
  }
114713
- function formatCodeSpan(file, start, length2, indent2, squiggleColor, host) {
114730
+ function formatCodeSpan(file, start, length2, indent, underlineColor, host) {
114714
114731
  const { line: firstLine, character: firstLineChar } = getLineAndCharacterOfPosition(file, start);
114715
114732
  const { line: lastLine, character: lastLineChar } = getLineAndCharacterOfPosition(file, start + length2);
114716
114733
  const lastLineInFile = getLineAndCharacterOfPosition(file, file.text.length).line;
114734
+ const gutterWidth = 1;
114717
114735
  const hasMoreThanFiveLines = lastLine - firstLine >= 4;
114718
- let gutterWidth = (lastLine + 1 + "").length;
114719
- if (hasMoreThanFiveLines) {
114720
- gutterWidth = Math.max(ellipsis.length, gutterWidth);
114736
+ let whitespaceToTrim = Number.MAX_VALUE;
114737
+ for (let i = firstLine; i <= lastLine; i++) {
114738
+ if (hasMoreThanFiveLines && firstLine + 1 < i && i < lastLine - 1) {
114739
+ i = lastLine - 1;
114740
+ }
114741
+ const lineStart = getPositionOfLineAndCharacter(file, i, 0);
114742
+ const lineEnd = i < lastLineInFile ? getPositionOfLineAndCharacter(file, i + 1, 0) : file.text.length;
114743
+ const lineContent = file.text.slice(lineStart, lineEnd);
114744
+ whitespaceToTrim = Math.min(whitespaceToTrim, startWhitespaceCount(lineContent));
114721
114745
  }
114722
114746
  let context = "";
114723
114747
  for (let i = firstLine; i <= lastLine; i++) {
114724
114748
  context += host.getNewLine();
114725
114749
  if (hasMoreThanFiveLines && firstLine + 1 < i && i < lastLine - 1) {
114726
- context += indent2 + formatColorAndReset(padLeft(ellipsis, gutterWidth), gutterStyleSequence) + gutterSeparator + host.getNewLine();
114750
+ context += indent + formatColorAndReset(padLeft(ellipsis, gutterWidth), gutterStyleSequence) + gutterSeparator + host.getNewLine();
114727
114751
  i = lastLine - 1;
114728
114752
  }
114729
114753
  const lineStart = getPositionOfLineAndCharacter(file, i, 0);
114730
114754
  const lineEnd = i < lastLineInFile ? getPositionOfLineAndCharacter(file, i + 1, 0) : file.text.length;
114731
114755
  let lineContent = file.text.slice(lineStart, lineEnd);
114756
+ lineContent = lineContent.slice(whitespaceToTrim);
114732
114757
  lineContent = trimStringEnd(lineContent);
114733
114758
  lineContent = lineContent.replace(/\t/g, " ");
114734
- context += indent2 + formatColorAndReset(padLeft(i + 1 + "", gutterWidth), gutterStyleSequence) + gutterSeparator;
114759
+ const gutterLine = "|";
114760
+ context += indent + padLeft(gutterLine, gutterWidth) + gutterSeparator;
114735
114761
  context += lineContent + host.getNewLine();
114736
- context += indent2 + formatColorAndReset(padLeft("", gutterWidth), gutterStyleSequence) + gutterSeparator;
114737
- context += squiggleColor;
114762
+ context += indent + padLeft("", gutterWidth) + gutterSeparator;
114763
+ context += underlineColor;
114738
114764
  if (i === firstLine) {
114739
114765
  const lastCharForLine = i === lastLine ? lastLineChar : void 0;
114740
- context += lineContent.slice(0, firstLineChar).replace(/\S/g, " ");
114741
- context += lineContent.slice(firstLineChar, lastCharForLine).replace(/./g, "~");
114766
+ context += lineContent.slice(0, firstLineChar - whitespaceToTrim).replace(/\S/g, " ");
114767
+ const amendedLastChar = lastCharForLine ? lastCharForLine - whitespaceToTrim : void 0;
114768
+ context += lineContent.slice(firstLineChar - whitespaceToTrim, amendedLastChar).replace(/./g, "\u2594");
114742
114769
  } else if (i === lastLine) {
114743
- context += lineContent.slice(0, lastLineChar).replace(/./g, "~");
114770
+ context += lineContent.slice(0, lastLineChar).replace(/./g, "\u2594");
114744
114771
  } else {
114745
- context += lineContent.replace(/./g, "~");
114772
+ context += lineContent.replace(/./g, "\u2594");
114746
114773
  }
114747
114774
  context += resetEscapeSequence;
114748
114775
  }
@@ -114760,54 +114787,87 @@ function formatLocation(file, start, host, color = formatColorAndReset) {
114760
114787
  return output;
114761
114788
  }
114762
114789
  function formatDiagnosticsWithColorAndContext(diagnostics, host) {
114790
+ var _a, _b;
114791
+ const terminalWidth = ((_b = (_a = sys).getWidthOfTerminal) == null ? void 0 : _b.call(_a)) ?? 0;
114792
+ const indent = terminalWidth < 60 ? "" : halfIndent;
114763
114793
  let output = "";
114764
114794
  for (const diagnostic of diagnostics) {
114765
- if (diagnostic.file) {
114766
- const { file, start } = diagnostic;
114767
- output += formatLocation(file, start, host);
114768
- output += " - ";
114769
- }
114770
- output += formatColorAndReset(diagnosticCategoryName(diagnostic), getCategoryFormat(diagnostic.category));
114771
- output += formatColorAndReset(` TS${diagnostic.code}: `, "\x1B[90m" /* Grey */);
114772
- output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine());
114795
+ const diagnosticCode = "TS" + diagnostic.code;
114796
+ const diagnosticCatName = diagnosticCategoryName(
114797
+ diagnostic,
114798
+ /*lowerCase*/
114799
+ false
114800
+ );
114801
+ const diagnosticCatNameColored = formatColorAndReset(diagnosticCatName, getCategoryFormat(diagnostic.category));
114773
114802
  if (diagnostic.file && diagnostic.code !== Diagnostics.File_appears_to_be_binary.code) {
114803
+ const { file, start } = diagnostic;
114804
+ const location = formatLocation(file, start, host);
114805
+ const locationLength = location.replace(/\u001b[[0-9]+m/g, "").length;
114806
+ const codeLength = diagnosticCode.length;
114807
+ output += formatColorAndReset(bullet, getCategoryFormat(diagnostic.category)) + location;
114808
+ const defaultPad = codeLength + 1;
114809
+ let padWidth = terminalWidth < 60 ? defaultPad : terminalWidth - (bullet.length + locationLength + codeLength + diagnosticCatName.length + 2);
114810
+ if (padWidth < diagnosticCode.length)
114811
+ padWidth = defaultPad;
114812
+ output += padLeft(diagnosticCatNameColored, padWidth + (diagnosticCatNameColored.length - diagnosticCatName.length));
114813
+ output += " " + diagnosticCode;
114814
+ output += formatCodeSpan(diagnostic.file, diagnostic.start, diagnostic.length, indent, getCategoryFormat(diagnostic.category), host);
114774
114815
  output += host.getNewLine();
114775
- output += formatCodeSpan(diagnostic.file, diagnostic.start, diagnostic.length, "", getCategoryFormat(diagnostic.category), host);
114816
+ } else {
114817
+ output += formatColorAndReset(bullet, getCategoryFormat(diagnostic.category)) + " " + diagnosticCatNameColored + " " + diagnosticCode;
114776
114818
  }
114819
+ let diagnosticText = flattenDiagnosticMessageText(
114820
+ diagnostic.messageText,
114821
+ host.getNewLine(),
114822
+ 0,
114823
+ /*pretty*/
114824
+ true
114825
+ );
114826
+ diagnosticText = diagnosticText.split(host.getNewLine()).map((text) => indent + text).join(host.getNewLine());
114827
+ output += diagnosticText;
114828
+ output += host.getNewLine();
114777
114829
  if (diagnostic.relatedInformation) {
114778
114830
  output += host.getNewLine();
114779
114831
  for (const { file, start, length: length2, messageText } of diagnostic.relatedInformation) {
114832
+ output += indent + trimStringStart(flattenDiagnosticMessageText(
114833
+ messageText,
114834
+ host.getNewLine(),
114835
+ 0,
114836
+ /*pretty*/
114837
+ true
114838
+ ));
114780
114839
  if (file) {
114840
+ output += " " + formatLocation(file, start, host);
114781
114841
  output += host.getNewLine();
114782
- output += halfIndent + formatLocation(file, start, host);
114783
- output += formatCodeSpan(file, start, length2, indent, "\x1B[96m" /* Cyan */, host);
114842
+ output += formatCodeSpan(file, start, length2, indent + " ", "\x1B[96m" /* Cyan */, host);
114784
114843
  }
114785
- output += host.getNewLine();
114786
- output += indent + flattenDiagnosticMessageText(messageText, host.getNewLine());
114787
114844
  }
114788
114845
  }
114789
- output += host.getNewLine();
114790
114846
  }
114791
114847
  return output;
114792
114848
  }
114793
- function flattenDiagnosticMessageText(diag2, newLine, indent2 = 0) {
114849
+ function flattenDiagnosticMessageText(diag2, newLine, indent = 0, pretty = false) {
114794
114850
  if (isString(diag2)) {
114795
114851
  return diag2;
114796
114852
  } else if (diag2 === void 0) {
114797
114853
  return "";
114798
114854
  }
114799
114855
  let result = "";
114800
- if (indent2) {
114856
+ if (indent) {
114801
114857
  result += newLine;
114802
- for (let i = 0; i < indent2; i++) {
114803
- result += " ";
114804
- }
114858
+ const indentsToReplaceWithNewLines = pretty ? 1 : 0;
114859
+ if (indent > indentsToReplaceWithNewLines) {
114860
+ for (let i = indentsToReplaceWithNewLines; i < indent; i++) {
114861
+ result += " ";
114862
+ }
114863
+ } else
114864
+ result += newLine;
114805
114865
  }
114806
114866
  result += diag2.messageText;
114807
- indent2++;
114867
+ indent++;
114808
114868
  if (diag2.next) {
114809
114869
  for (const kid of diag2.next) {
114810
- result += flattenDiagnosticMessageText(kid, newLine, indent2);
114870
+ result += flattenDiagnosticMessageText(kid, newLine, indent);
114811
114871
  }
114812
114872
  }
114813
114873
  return result;
@@ -115111,8 +115171,8 @@ var plainJSErrors = /* @__PURE__ */ new Set([
115111
115171
  // binder errors
115112
115172
  Diagnostics.Cannot_redeclare_block_scoped_variable_0.code,
115113
115173
  Diagnostics.A_module_cannot_have_multiple_default_exports.code,
115114
- Diagnostics.Another_export_default_is_here.code,
115115
- Diagnostics.The_first_export_default_is_here.code,
115174
+ Diagnostics.Another_export_default_is_here_Colon.code,
115175
+ Diagnostics.The_first_export_default_is_here_Colon.code,
115116
115176
  Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module.code,
115117
115177
  Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode.code,
115118
115178
  Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here.code,
@@ -116468,6 +116528,14 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
116468
116528
  case 265 /* TypeAliasDeclaration */:
116469
116529
  diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files));
116470
116530
  return "skip";
116531
+ case 176 /* Constructor */:
116532
+ case 174 /* MethodDeclaration */:
116533
+ case 262 /* FunctionDeclaration */:
116534
+ if (!node.body) {
116535
+ diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Signature_declarations_can_only_be_used_in_TypeScript_files));
116536
+ return "skip";
116537
+ }
116538
+ return;
116471
116539
  case 266 /* EnumDeclaration */:
116472
116540
  const enumKeyword = Debug.checkDefined(tokenToString(94 /* EnumKeyword */));
116473
116541
  diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword));
@@ -117901,16 +117969,16 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
117901
117969
  let message2;
117902
117970
  switch (reason.kind) {
117903
117971
  case 3 /* Import */:
117904
- message2 = Diagnostics.File_is_included_via_import_here;
117972
+ message2 = Diagnostics.File_is_included_via_import_here_Colon;
117905
117973
  break;
117906
117974
  case 4 /* ReferenceFile */:
117907
- message2 = Diagnostics.File_is_included_via_reference_here;
117975
+ message2 = Diagnostics.File_is_included_via_reference_here_Colon;
117908
117976
  break;
117909
117977
  case 5 /* TypeReferenceDirective */:
117910
- message2 = Diagnostics.File_is_included_via_type_library_reference_here;
117978
+ message2 = Diagnostics.File_is_included_via_type_library_reference_here_Colon;
117911
117979
  break;
117912
117980
  case 7 /* LibReferenceDirective */:
117913
- message2 = Diagnostics.File_is_included_via_library_reference_here;
117981
+ message2 = Diagnostics.File_is_included_via_library_reference_here_Colon;
117914
117982
  break;
117915
117983
  default:
117916
117984
  Debug.assertNever(reason);
@@ -117934,14 +118002,14 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
117934
118002
  const matchedByFiles = getMatchedFileSpec(program, fileName);
117935
118003
  if (matchedByFiles) {
117936
118004
  configFileNode = getTsConfigPropArrayElementValue(options.configFile, "files", matchedByFiles);
117937
- message = Diagnostics.File_is_matched_by_files_list_specified_here;
118005
+ message = Diagnostics.File_is_matched_by_files_list_specified_here_Colon;
117938
118006
  break;
117939
118007
  }
117940
118008
  const matchedByInclude = getMatchedIncludeSpec(program, fileName);
117941
118009
  if (!matchedByInclude || !isString(matchedByInclude))
117942
118010
  return void 0;
117943
118011
  configFileNode = getTsConfigPropArrayElementValue(options.configFile, "include", matchedByInclude);
117944
- message = Diagnostics.File_is_matched_by_include_pattern_specified_here;
118012
+ message = Diagnostics.File_is_matched_by_include_pattern_specified_here_Colon;
117945
118013
  break;
117946
118014
  case 1 /* SourceFromProjectReference */:
117947
118015
  case 2 /* OutputFromProjectReference */:
@@ -117962,23 +118030,23 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
117962
118030
  return referencesSyntax && referencesSyntax.elements.length > index ? createDiagnosticForNodeInSourceFile(
117963
118031
  sourceFile,
117964
118032
  referencesSyntax.elements[index],
117965
- reason.kind === 2 /* OutputFromProjectReference */ ? Diagnostics.File_is_output_from_referenced_project_specified_here : Diagnostics.File_is_source_from_referenced_project_specified_here
118033
+ reason.kind === 2 /* OutputFromProjectReference */ ? Diagnostics.File_is_output_from_referenced_project_specified_here_Colon : Diagnostics.File_is_source_from_referenced_project_specified_here_Colon
117966
118034
  ) : void 0;
117967
118035
  case 8 /* AutomaticTypeDirectiveFile */:
117968
118036
  if (!options.types)
117969
118037
  return void 0;
117970
118038
  configFileNode = getOptionsSyntaxByArrayElementValue("types", reason.typeReference);
117971
- message = Diagnostics.File_is_entry_point_of_type_library_specified_here;
118039
+ message = Diagnostics.File_is_entry_point_of_type_library_specified_here_Colon;
117972
118040
  break;
117973
118041
  case 6 /* LibFile */:
117974
118042
  if (reason.index !== void 0) {
117975
118043
  configFileNode = getOptionsSyntaxByArrayElementValue("lib", options.lib[reason.index]);
117976
- message = Diagnostics.File_is_library_specified_here;
118044
+ message = Diagnostics.File_is_library_specified_here_Colon;
117977
118045
  break;
117978
118046
  }
117979
118047
  const target = forEachEntry(targetOptionDeclaration.type, (value, key) => value === getEmitScriptTarget(options) ? key : void 0);
117980
118048
  configFileNode = target ? getOptionsSyntaxByValue("target", target) : void 0;
117981
- message = Diagnostics.File_is_default_library_for_target_specified_here;
118049
+ message = Diagnostics.File_is_default_library_for_target_specified_here_Colon;
117982
118050
  break;
117983
118051
  default:
117984
118052
  Debug.assertNever(reason);