@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 +266 -198
- package/lib/tsserver.js +310 -222
- package/lib/tsserverlibrary.d.ts +2 -1
- package/lib/tsserverlibrary.js +309 -222
- package/lib/typescript.d.ts +2 -1
- package/lib/typescript.js +300 -214
- package/lib/typingsInstaller.js +59 -45
- package/package.json +2 -2
package/lib/tsserverlibrary.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.2";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20230703`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -1599,6 +1599,13 @@ var ts = (() => {
|
|
|
1599
1599
|
return array.slice(0, index);
|
|
1600
1600
|
}
|
|
1601
1601
|
}
|
|
1602
|
+
function startWhitespaceCount(s) {
|
|
1603
|
+
for (let i = 0; i < s.length; i++) {
|
|
1604
|
+
if (!isWhiteSpaceLike(s.charCodeAt(i)))
|
|
1605
|
+
return i;
|
|
1606
|
+
}
|
|
1607
|
+
return s.length;
|
|
1608
|
+
}
|
|
1602
1609
|
function skipWhile(array, predicate) {
|
|
1603
1610
|
if (array) {
|
|
1604
1611
|
const len = array.length;
|
|
@@ -7021,7 +7028,7 @@ ${lanes.join("\n")}
|
|
|
7021
7028
|
Identifier_expected: diag(1003, 1 /* Error */, "Identifier_expected_1003", "Identifier expected."),
|
|
7022
7029
|
_0_expected: diag(1005, 1 /* Error */, "_0_expected_1005", "'{0}' expected."),
|
|
7023
7030
|
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."),
|
|
7024
|
-
|
|
7031
|
+
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:"),
|
|
7025
7032
|
Trailing_comma_not_allowed: diag(1009, 1 /* Error */, "Trailing_comma_not_allowed_1009", "Trailing comma not allowed."),
|
|
7026
7033
|
Asterisk_Slash_expected: diag(1010, 1 /* Error */, "Asterisk_Slash_expected_1010", "'*/' expected."),
|
|
7027
7034
|
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."),
|
|
@@ -7283,7 +7290,7 @@ ${lanes.join("\n")}
|
|
|
7283
7290
|
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."),
|
|
7284
7291
|
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."),
|
|
7285
7292
|
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."),
|
|
7286
|
-
|
|
7293
|
+
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:"),
|
|
7287
7294
|
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}')'?"),
|
|
7288
7295
|
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."),
|
|
7289
7296
|
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'."),
|
|
@@ -7291,7 +7298,7 @@ ${lanes.join("\n")}
|
|
|
7291
7298
|
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."),
|
|
7292
7299
|
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."),
|
|
7293
7300
|
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."),
|
|
7294
|
-
|
|
7301
|
+
Non_simple_parameter_declared_here_Colon: diag(1348, 1 /* Error */, "Non_simple_parameter_declared_here_Colon_1348", "Non-simple parameter declared here:"),
|
|
7295
7302
|
use_strict_directive_used_here: diag(1349, 1 /* Error */, "use_strict_directive_used_here_1349", "'use strict' directive used here."),
|
|
7296
7303
|
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."),
|
|
7297
7304
|
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."),
|
|
@@ -7315,8 +7322,8 @@ ${lanes.join("\n")}
|
|
|
7315
7322
|
Did_you_mean_0: diag(1369, 3 /* Message */, "Did_you_mean_0_1369", "Did you mean '{0}'?"),
|
|
7316
7323
|
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'."),
|
|
7317
7324
|
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."),
|
|
7318
|
-
|
|
7319
|
-
|
|
7325
|
+
_0_was_imported_here_Colon: diag(1376, 3 /* Message */, "_0_was_imported_here_Colon_1376", "'{0}' was imported here:"),
|
|
7326
|
+
_0_was_exported_here_Colon: diag(1377, 3 /* Message */, "_0_was_exported_here_Colon_1377", "'{0}' was exported here:"),
|
|
7320
7327
|
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."),
|
|
7321
7328
|
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'."),
|
|
7322
7329
|
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'."),
|
|
@@ -7335,34 +7342,34 @@ ${lanes.join("\n")}
|
|
|
7335
7342
|
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"),
|
|
7336
7343
|
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"),
|
|
7337
7344
|
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"),
|
|
7338
|
-
|
|
7345
|
+
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:"),
|
|
7339
7346
|
Referenced_via_0_from_file_1: diag(1400, 3 /* Message */, "Referenced_via_0_from_file_1_1400", "Referenced via '{0}' from file '{1}'"),
|
|
7340
|
-
|
|
7347
|
+
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:"),
|
|
7341
7348
|
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}'"),
|
|
7342
7349
|
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}'"),
|
|
7343
|
-
|
|
7350
|
+
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:"),
|
|
7344
7351
|
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}'"),
|
|
7345
|
-
|
|
7352
|
+
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:"),
|
|
7346
7353
|
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}'"),
|
|
7347
|
-
|
|
7354
|
+
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:"),
|
|
7348
7355
|
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"),
|
|
7349
|
-
|
|
7356
|
+
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:"),
|
|
7350
7357
|
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"),
|
|
7351
7358
|
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'"),
|
|
7352
|
-
|
|
7359
|
+
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:"),
|
|
7353
7360
|
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"),
|
|
7354
7361
|
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'"),
|
|
7355
|
-
|
|
7362
|
+
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:"),
|
|
7356
7363
|
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"),
|
|
7357
7364
|
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}'"),
|
|
7358
|
-
|
|
7365
|
+
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:"),
|
|
7359
7366
|
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}'"),
|
|
7360
7367
|
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}'"),
|
|
7361
7368
|
Library_0_specified_in_compilerOptions: diag(1422, 3 /* Message */, "Library_0_specified_in_compilerOptions_1422", "Library '{0}' specified in compilerOptions"),
|
|
7362
|
-
|
|
7369
|
+
File_is_library_specified_here_Colon: diag(1423, 3 /* Message */, "File_is_library_specified_here_Colon_1423", "File is library specified here:"),
|
|
7363
7370
|
Default_library: diag(1424, 3 /* Message */, "Default_library_1424", "Default library"),
|
|
7364
7371
|
Default_library_for_target_0: diag(1425, 3 /* Message */, "Default_library_for_target_0_1425", "Default library for target '{0}'"),
|
|
7365
|
-
|
|
7372
|
+
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:"),
|
|
7366
7373
|
Root_file_specified_for_compilation: diag(1427, 3 /* Message */, "Root_file_specified_for_compilation_1427", "Root file specified for compilation"),
|
|
7367
7374
|
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}'"),
|
|
7368
7375
|
File_redirects_to_file_0: diag(1429, 3 /* Message */, "File_redirects_to_file_0_1429", "File redirects to file '{0}'"),
|
|
@@ -7815,7 +7822,7 @@ ${lanes.join("\n")}
|
|
|
7815
7822
|
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'?"),
|
|
7816
7823
|
_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}'?"),
|
|
7817
7824
|
_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."),
|
|
7818
|
-
|
|
7825
|
+
_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:"),
|
|
7819
7826
|
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}'."),
|
|
7820
7827
|
Left_side_of_comma_operator_is_unused_and_has_no_side_effects: diag(
|
|
7821
7828
|
2695,
|
|
@@ -7831,7 +7838,7 @@ ${lanes.join("\n")}
|
|
|
7831
7838
|
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}'."),
|
|
7832
7839
|
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."),
|
|
7833
7840
|
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."),
|
|
7834
|
-
|
|
7841
|
+
_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:"),
|
|
7835
7842
|
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."),
|
|
7836
7843
|
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."),
|
|
7837
7844
|
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."),
|
|
@@ -7857,12 +7864,12 @@ ${lanes.join("\n")}
|
|
|
7857
7864
|
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}."),
|
|
7858
7865
|
Cannot_find_lib_definition_for_0: diag(2726, 1 /* Error */, "Cannot_find_lib_definition_for_0_2726", "Cannot find lib definition for '{0}'."),
|
|
7859
7866
|
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}'?"),
|
|
7860
|
-
|
|
7867
|
+
_0_is_declared_here_Colon: diag(2728, 3 /* Message */, "_0_is_declared_here_Colon_2728", "'{0}' is declared here:"),
|
|
7861
7868
|
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."),
|
|
7862
7869
|
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."),
|
|
7863
7870
|
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(...)'."),
|
|
7864
7871
|
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."),
|
|
7865
|
-
|
|
7872
|
+
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:"),
|
|
7866
7873
|
Are_you_missing_a_semicolon: diag(2734, 1 /* Error */, "Are_you_missing_a_semicolon_2734", "Are you missing a semicolon?"),
|
|
7867
7874
|
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}'?"),
|
|
7868
7875
|
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}'."),
|
|
@@ -7879,10 +7886,10 @@ ${lanes.join("\n")}
|
|
|
7879
7886
|
_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}'."),
|
|
7880
7887
|
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."),
|
|
7881
7888
|
_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}'?"),
|
|
7882
|
-
|
|
7889
|
+
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:"),
|
|
7883
7890
|
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."),
|
|
7884
|
-
|
|
7885
|
-
|
|
7891
|
+
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:"),
|
|
7892
|
+
Another_export_default_is_here_Colon: diag(2753, 1 /* Error */, "Another_export_default_is_here_Colon_2753", "Another export default is here:"),
|
|
7886
7893
|
super_may_not_use_type_arguments: diag(2754, 1 /* Error */, "super_may_not_use_type_arguments_2754", "'super' may not use type arguments."),
|
|
7887
7894
|
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."),
|
|
7888
7895
|
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."),
|
|
@@ -7900,7 +7907,7 @@ ${lanes.join("\n")}
|
|
|
7900
7907
|
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."),
|
|
7901
7908
|
No_overload_matches_this_call: diag(2769, 1 /* Error */, "No_overload_matches_this_call_2769", "No overload matches this call."),
|
|
7902
7909
|
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."),
|
|
7903
|
-
|
|
7910
|
+
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:"),
|
|
7904
7911
|
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."),
|
|
7905
7912
|
Did_you_forget_to_use_await: diag(2773, 1 /* Error */, "Did_you_forget_to_use_await_2773", "Did you forget to use 'await'?"),
|
|
7906
7913
|
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?"),
|
|
@@ -7927,7 +7934,7 @@ ${lanes.join("\n")}
|
|
|
7927
7934
|
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."),
|
|
7928
7935
|
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."),
|
|
7929
7936
|
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'."),
|
|
7930
|
-
|
|
7937
|
+
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:"),
|
|
7931
7938
|
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."),
|
|
7932
7939
|
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."),
|
|
7933
7940
|
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."),
|
|
@@ -8364,8 +8371,8 @@ ${lanes.join("\n")}
|
|
|
8364
8371
|
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}"),
|
|
8365
8372
|
Conflicts_are_in_this_file: diag(6201, 3 /* Message */, "Conflicts_are_in_this_file_6201", "Conflicts are in this file."),
|
|
8366
8373
|
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}"),
|
|
8367
|
-
|
|
8368
|
-
|
|
8374
|
+
_0_was_also_declared_here_Colon: diag(6203, 3 /* Message */, "_0_was_also_declared_here_Colon_6203", "'{0}' was also declared here:"),
|
|
8375
|
+
and_here_Colon: diag(6204, 3 /* Message */, "and_here_Colon_6204", "and here:"),
|
|
8369
8376
|
All_type_parameters_are_unused: diag(6205, 1 /* Error */, "All_type_parameters_are_unused_6205", "All type parameters are unused."),
|
|
8370
8377
|
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."),
|
|
8371
8378
|
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}'."),
|
|
@@ -8769,6 +8776,7 @@ ${lanes.join("\n")}
|
|
|
8769
8776
|
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."),
|
|
8770
8777
|
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."),
|
|
8771
8778
|
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."),
|
|
8779
|
+
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."),
|
|
8772
8780
|
Report_errors_in_js_files: diag(8019, 3 /* Message */, "Report_errors_in_js_files_8019", "Report errors in .js files."),
|
|
8773
8781
|
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."),
|
|
8774
8782
|
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."),
|
|
@@ -8784,7 +8792,7 @@ ${lanes.join("\n")}
|
|
|
8784
8792
|
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."),
|
|
8785
8793
|
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}'."),
|
|
8786
8794
|
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."),
|
|
8787
|
-
|
|
8795
|
+
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:"),
|
|
8788
8796
|
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."),
|
|
8789
8797
|
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."),
|
|
8790
8798
|
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."),
|
|
@@ -16411,7 +16419,7 @@ ${lanes.join("\n")}
|
|
|
16411
16419
|
}
|
|
16412
16420
|
function createTextWriter(newLine) {
|
|
16413
16421
|
var output;
|
|
16414
|
-
var
|
|
16422
|
+
var indent2;
|
|
16415
16423
|
var lineStart;
|
|
16416
16424
|
var lineCount;
|
|
16417
16425
|
var linePos;
|
|
@@ -16429,7 +16437,7 @@ ${lanes.join("\n")}
|
|
|
16429
16437
|
function writeText(s) {
|
|
16430
16438
|
if (s && s.length) {
|
|
16431
16439
|
if (lineStart) {
|
|
16432
|
-
s = getIndentString(
|
|
16440
|
+
s = getIndentString(indent2) + s;
|
|
16433
16441
|
lineStart = false;
|
|
16434
16442
|
}
|
|
16435
16443
|
output += s;
|
|
@@ -16448,7 +16456,7 @@ ${lanes.join("\n")}
|
|
|
16448
16456
|
}
|
|
16449
16457
|
function reset2() {
|
|
16450
16458
|
output = "";
|
|
16451
|
-
|
|
16459
|
+
indent2 = 0;
|
|
16452
16460
|
lineStart = true;
|
|
16453
16461
|
lineCount = 0;
|
|
16454
16462
|
linePos = 0;
|
|
@@ -16485,15 +16493,15 @@ ${lanes.join("\n")}
|
|
|
16485
16493
|
writeLiteral,
|
|
16486
16494
|
writeLine,
|
|
16487
16495
|
increaseIndent: () => {
|
|
16488
|
-
|
|
16496
|
+
indent2++;
|
|
16489
16497
|
},
|
|
16490
16498
|
decreaseIndent: () => {
|
|
16491
|
-
|
|
16499
|
+
indent2--;
|
|
16492
16500
|
},
|
|
16493
|
-
getIndent: () =>
|
|
16501
|
+
getIndent: () => indent2,
|
|
16494
16502
|
getTextPos: () => output.length,
|
|
16495
16503
|
getLine: () => lineCount,
|
|
16496
|
-
getColumn: () => lineStart ?
|
|
16504
|
+
getColumn: () => lineStart ? indent2 * getIndentSize() : output.length - linePos,
|
|
16497
16505
|
getText: () => output,
|
|
16498
16506
|
isAtStartOfLine: () => lineStart,
|
|
16499
16507
|
hasTrailingComment: () => hasTrailingComment,
|
|
@@ -29065,7 +29073,8 @@ ${lanes.join("\n")}
|
|
|
29065
29073
|
nextToken();
|
|
29066
29074
|
const statements = parseList(0 /* SourceElements */, parseStatement);
|
|
29067
29075
|
Debug.assert(token() === 1 /* EndOfFileToken */);
|
|
29068
|
-
const
|
|
29076
|
+
const endHasJSDoc = hasPrecedingJSDocComment();
|
|
29077
|
+
const endOfFileToken = withJSDoc(parseTokenNode(), endHasJSDoc);
|
|
29069
29078
|
const sourceFile = createSourceFile2(fileName, languageVersion2, scriptKind2, isDeclarationFile, statements, endOfFileToken, sourceFlags, setExternalModuleIndicator2);
|
|
29070
29079
|
processCommentPragmas(sourceFile, sourceText);
|
|
29071
29080
|
processPragmasIntoFields(sourceFile, reportPragmaDiagnostic);
|
|
@@ -29085,11 +29094,11 @@ ${lanes.join("\n")}
|
|
|
29085
29094
|
parseDiagnostics.push(createDetachedDiagnostic(fileName, pos, end, diagnostic));
|
|
29086
29095
|
}
|
|
29087
29096
|
}
|
|
29088
|
-
function withJSDoc(node, hasJSDoc) {
|
|
29089
|
-
return hasJSDoc ? addJSDocComment(node) : node;
|
|
29090
|
-
}
|
|
29091
29097
|
let hasDeprecatedTag = false;
|
|
29092
|
-
function
|
|
29098
|
+
function withJSDoc(node, hasJSDoc) {
|
|
29099
|
+
if (!hasJSDoc) {
|
|
29100
|
+
return node;
|
|
29101
|
+
}
|
|
29093
29102
|
Debug.assert(!node.jsDoc);
|
|
29094
29103
|
const jsDoc = mapDefined(getJSDocCommentRanges(node, sourceText), (comment) => JSDocParser.parseJSDocComment(node, comment.pos, comment.end - comment.pos));
|
|
29095
29104
|
if (jsDoc.length)
|
|
@@ -29550,7 +29559,7 @@ ${lanes.join("\n")}
|
|
|
29550
29559
|
if (lastError) {
|
|
29551
29560
|
addRelatedInfo(
|
|
29552
29561
|
lastError,
|
|
29553
|
-
createDetachedDiagnostic(fileName, openPosition, 1, Diagnostics.
|
|
29562
|
+
createDetachedDiagnostic(fileName, openPosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here_Colon, tokenToString(openKind), tokenToString(closeKind))
|
|
29554
29563
|
);
|
|
29555
29564
|
}
|
|
29556
29565
|
}
|
|
@@ -29883,6 +29892,9 @@ ${lanes.join("\n")}
|
|
|
29883
29892
|
case 22 /* HeritageClauses */:
|
|
29884
29893
|
return isHeritageClause2();
|
|
29885
29894
|
case 23 /* ImportOrExportSpecifiers */:
|
|
29895
|
+
if (token() === 161 /* FromKeyword */ && lookAhead(nextTokenIsStringLiteral)) {
|
|
29896
|
+
return false;
|
|
29897
|
+
}
|
|
29886
29898
|
return tokenIsIdentifierOrKeyword(token());
|
|
29887
29899
|
case 13 /* JsxAttributes */:
|
|
29888
29900
|
return tokenIsIdentifierOrKeyword(token()) || token() === 19 /* OpenBraceToken */;
|
|
@@ -30241,6 +30253,9 @@ ${lanes.join("\n")}
|
|
|
30241
30253
|
case 22 /* HeritageClauses */:
|
|
30242
30254
|
return parseErrorAtCurrentToken(Diagnostics.Unexpected_token_expected);
|
|
30243
30255
|
case 23 /* ImportOrExportSpecifiers */:
|
|
30256
|
+
if (token() === 161 /* FromKeyword */) {
|
|
30257
|
+
return parseErrorAtCurrentToken(Diagnostics._0_expected, "}");
|
|
30258
|
+
}
|
|
30244
30259
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
30245
30260
|
case 13 /* JsxAttributes */:
|
|
30246
30261
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
@@ -31132,7 +31147,7 @@ ${lanes.join("\n")}
|
|
|
31132
31147
|
if (lastError && lastError.code === Diagnostics._0_expected.code) {
|
|
31133
31148
|
addRelatedInfo(
|
|
31134
31149
|
lastError,
|
|
31135
|
-
createDetachedDiagnostic(fileName, openBracePosition, 1, Diagnostics.
|
|
31150
|
+
createDetachedDiagnostic(fileName, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here_Colon, "{", "}")
|
|
31136
31151
|
);
|
|
31137
31152
|
}
|
|
31138
31153
|
}
|
|
@@ -31598,12 +31613,14 @@ ${lanes.join("\n")}
|
|
|
31598
31613
|
return arrowExpression;
|
|
31599
31614
|
}
|
|
31600
31615
|
const pos = getNodePos();
|
|
31616
|
+
const hasJSDoc = hasPrecedingJSDocComment();
|
|
31601
31617
|
const expr = parseBinaryExpressionOrHigher(0 /* Lowest */);
|
|
31602
31618
|
if (expr.kind === 80 /* Identifier */ && token() === 39 /* EqualsGreaterThanToken */) {
|
|
31603
31619
|
return parseSimpleArrowFunctionExpression(
|
|
31604
31620
|
pos,
|
|
31605
31621
|
expr,
|
|
31606
31622
|
allowReturnTypeInArrowFunction,
|
|
31623
|
+
hasJSDoc,
|
|
31607
31624
|
/*asyncModifier*/
|
|
31608
31625
|
void 0
|
|
31609
31626
|
);
|
|
@@ -31649,7 +31666,7 @@ ${lanes.join("\n")}
|
|
|
31649
31666
|
), pos);
|
|
31650
31667
|
}
|
|
31651
31668
|
}
|
|
31652
|
-
function parseSimpleArrowFunctionExpression(pos, identifier, allowReturnTypeInArrowFunction, asyncModifier) {
|
|
31669
|
+
function parseSimpleArrowFunctionExpression(pos, identifier, allowReturnTypeInArrowFunction, hasJSDoc, asyncModifier) {
|
|
31653
31670
|
Debug.assert(token() === 39 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
|
|
31654
31671
|
const parameter = factory2.createParameterDeclaration(
|
|
31655
31672
|
/*modifiers*/
|
|
@@ -31682,7 +31699,7 @@ ${lanes.join("\n")}
|
|
|
31682
31699
|
equalsGreaterThanToken,
|
|
31683
31700
|
body
|
|
31684
31701
|
);
|
|
31685
|
-
return
|
|
31702
|
+
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
31686
31703
|
}
|
|
31687
31704
|
function tryParseParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) {
|
|
31688
31705
|
const triState = isParenthesizedArrowFunctionExpression();
|
|
@@ -31810,9 +31827,10 @@ ${lanes.join("\n")}
|
|
|
31810
31827
|
if (token() === 134 /* AsyncKeyword */) {
|
|
31811
31828
|
if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === 1 /* True */) {
|
|
31812
31829
|
const pos = getNodePos();
|
|
31830
|
+
const hasJSDoc = hasPrecedingJSDocComment();
|
|
31813
31831
|
const asyncModifier = parseModifiersForArrowFunction();
|
|
31814
31832
|
const expr = parseBinaryExpressionOrHigher(0 /* Lowest */);
|
|
31815
|
-
return parseSimpleArrowFunctionExpression(pos, expr, allowReturnTypeInArrowFunction, asyncModifier);
|
|
31833
|
+
return parseSimpleArrowFunctionExpression(pos, expr, allowReturnTypeInArrowFunction, hasJSDoc, asyncModifier);
|
|
31816
31834
|
}
|
|
31817
31835
|
}
|
|
31818
31836
|
return void 0;
|
|
@@ -33486,6 +33504,9 @@ ${lanes.join("\n")}
|
|
|
33486
33504
|
return void 0;
|
|
33487
33505
|
}
|
|
33488
33506
|
}
|
|
33507
|
+
function nextTokenIsStringLiteral() {
|
|
33508
|
+
return nextToken() === 11 /* StringLiteral */;
|
|
33509
|
+
}
|
|
33489
33510
|
function nextTokenIsIdentifierOrStringLiteralOnSameLine() {
|
|
33490
33511
|
nextToken();
|
|
33491
33512
|
return !scanner2.hasPrecedingLineBreak() && (isIdentifier2() || token() === 11 /* StringLiteral */);
|
|
@@ -34230,7 +34251,7 @@ ${lanes.join("\n")}
|
|
|
34230
34251
|
if (lastError && lastError.code === Diagnostics._0_expected.code) {
|
|
34231
34252
|
addRelatedInfo(
|
|
34232
34253
|
lastError,
|
|
34233
|
-
createDetachedDiagnostic(fileName, openBracePosition, 1, Diagnostics.
|
|
34254
|
+
createDetachedDiagnostic(fileName, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here_Colon, "{", "}")
|
|
34234
34255
|
);
|
|
34235
34256
|
}
|
|
34236
34257
|
}
|
|
@@ -34598,20 +34619,20 @@ ${lanes.join("\n")}
|
|
|
34598
34619
|
function doJSDocScan() {
|
|
34599
34620
|
let state = 1 /* SawAsterisk */;
|
|
34600
34621
|
let margin;
|
|
34601
|
-
let
|
|
34622
|
+
let indent2 = start - (content.lastIndexOf("\n", start) + 1) + 4;
|
|
34602
34623
|
function pushComment(text) {
|
|
34603
34624
|
if (!margin) {
|
|
34604
|
-
margin =
|
|
34625
|
+
margin = indent2;
|
|
34605
34626
|
}
|
|
34606
34627
|
comments.push(text);
|
|
34607
|
-
|
|
34628
|
+
indent2 += text.length;
|
|
34608
34629
|
}
|
|
34609
34630
|
nextTokenJSDoc();
|
|
34610
34631
|
while (parseOptionalJsdoc(5 /* WhitespaceTrivia */))
|
|
34611
34632
|
;
|
|
34612
34633
|
if (parseOptionalJsdoc(4 /* NewLineTrivia */)) {
|
|
34613
34634
|
state = 0 /* BeginningOfLine */;
|
|
34614
|
-
|
|
34635
|
+
indent2 = 0;
|
|
34615
34636
|
}
|
|
34616
34637
|
loop:
|
|
34617
34638
|
while (true) {
|
|
@@ -34620,14 +34641,14 @@ ${lanes.join("\n")}
|
|
|
34620
34641
|
removeTrailingWhitespace(comments);
|
|
34621
34642
|
if (!commentsPos)
|
|
34622
34643
|
commentsPos = getNodePos();
|
|
34623
|
-
addTag(parseTag(
|
|
34644
|
+
addTag(parseTag(indent2));
|
|
34624
34645
|
state = 0 /* BeginningOfLine */;
|
|
34625
34646
|
margin = void 0;
|
|
34626
34647
|
break;
|
|
34627
34648
|
case 4 /* NewLineTrivia */:
|
|
34628
34649
|
comments.push(scanner2.getTokenText());
|
|
34629
34650
|
state = 0 /* BeginningOfLine */;
|
|
34630
|
-
|
|
34651
|
+
indent2 = 0;
|
|
34631
34652
|
break;
|
|
34632
34653
|
case 42 /* AsteriskToken */:
|
|
34633
34654
|
const asterisk = scanner2.getTokenText();
|
|
@@ -34637,16 +34658,16 @@ ${lanes.join("\n")}
|
|
|
34637
34658
|
} else {
|
|
34638
34659
|
Debug.assert(state === 0 /* BeginningOfLine */);
|
|
34639
34660
|
state = 1 /* SawAsterisk */;
|
|
34640
|
-
|
|
34661
|
+
indent2 += asterisk.length;
|
|
34641
34662
|
}
|
|
34642
34663
|
break;
|
|
34643
34664
|
case 5 /* WhitespaceTrivia */:
|
|
34644
34665
|
Debug.assert(state !== 2 /* SavingComments */, "whitespace shouldn't come from the scanner while saving top-level comment text");
|
|
34645
34666
|
const whitespace = scanner2.getTokenText();
|
|
34646
|
-
if (margin !== void 0 &&
|
|
34647
|
-
comments.push(whitespace.slice(margin -
|
|
34667
|
+
if (margin !== void 0 && indent2 + whitespace.length > margin) {
|
|
34668
|
+
comments.push(whitespace.slice(margin - indent2));
|
|
34648
34669
|
}
|
|
34649
|
-
|
|
34670
|
+
indent2 += whitespace.length;
|
|
34650
34671
|
break;
|
|
34651
34672
|
case 1 /* EndOfFileToken */:
|
|
34652
34673
|
break loop;
|
|
@@ -34848,7 +34869,7 @@ ${lanes.join("\n")}
|
|
|
34848
34869
|
}
|
|
34849
34870
|
return parseTagComments(margin, indentText.slice(margin));
|
|
34850
34871
|
}
|
|
34851
|
-
function parseTagComments(
|
|
34872
|
+
function parseTagComments(indent2, initialMargin) {
|
|
34852
34873
|
const commentsPos2 = getNodePos();
|
|
34853
34874
|
let comments2 = [];
|
|
34854
34875
|
const parts2 = [];
|
|
@@ -34857,10 +34878,10 @@ ${lanes.join("\n")}
|
|
|
34857
34878
|
let margin;
|
|
34858
34879
|
function pushComment(text) {
|
|
34859
34880
|
if (!margin) {
|
|
34860
|
-
margin =
|
|
34881
|
+
margin = indent2;
|
|
34861
34882
|
}
|
|
34862
34883
|
comments2.push(text);
|
|
34863
|
-
|
|
34884
|
+
indent2 += text.length;
|
|
34864
34885
|
}
|
|
34865
34886
|
if (initialMargin !== void 0) {
|
|
34866
34887
|
if (initialMargin !== "") {
|
|
@@ -34875,7 +34896,7 @@ ${lanes.join("\n")}
|
|
|
34875
34896
|
case 4 /* NewLineTrivia */:
|
|
34876
34897
|
state = 0 /* BeginningOfLine */;
|
|
34877
34898
|
comments2.push(scanner2.getTokenText());
|
|
34878
|
-
|
|
34899
|
+
indent2 = 0;
|
|
34879
34900
|
break;
|
|
34880
34901
|
case 60 /* AtToken */:
|
|
34881
34902
|
scanner2.resetTokenState(scanner2.getTokenEnd() - 1);
|
|
@@ -34885,11 +34906,11 @@ ${lanes.join("\n")}
|
|
|
34885
34906
|
case 5 /* WhitespaceTrivia */:
|
|
34886
34907
|
Debug.assert(state !== 2 /* SavingComments */ && state !== 3 /* SavingBackticks */, "whitespace shouldn't come from the scanner while saving comment text");
|
|
34887
34908
|
const whitespace = scanner2.getTokenText();
|
|
34888
|
-
if (margin !== void 0 &&
|
|
34889
|
-
comments2.push(whitespace.slice(margin -
|
|
34909
|
+
if (margin !== void 0 && indent2 + whitespace.length > margin) {
|
|
34910
|
+
comments2.push(whitespace.slice(margin - indent2));
|
|
34890
34911
|
state = 2 /* SavingComments */;
|
|
34891
34912
|
}
|
|
34892
|
-
|
|
34913
|
+
indent2 += whitespace.length;
|
|
34893
34914
|
break;
|
|
34894
34915
|
case 19 /* OpenBraceToken */:
|
|
34895
34916
|
state = 2 /* SavingComments */;
|
|
@@ -34922,7 +34943,7 @@ ${lanes.join("\n")}
|
|
|
34922
34943
|
case 42 /* AsteriskToken */:
|
|
34923
34944
|
if (state === 0 /* BeginningOfLine */) {
|
|
34924
34945
|
state = 1 /* SawAsterisk */;
|
|
34925
|
-
|
|
34946
|
+
indent2 += 1;
|
|
34926
34947
|
break;
|
|
34927
34948
|
}
|
|
34928
34949
|
default:
|
|
@@ -34987,8 +35008,8 @@ ${lanes.join("\n")}
|
|
|
34987
35008
|
function isJSDocLinkTag(kind) {
|
|
34988
35009
|
return kind === "link" || kind === "linkcode" || kind === "linkplain";
|
|
34989
35010
|
}
|
|
34990
|
-
function parseUnknownTag(start2, tagName,
|
|
34991
|
-
return finishNode(factory2.createJSDocUnknownTag(tagName, parseTrailingTagComments(start2, getNodePos(),
|
|
35011
|
+
function parseUnknownTag(start2, tagName, indent2, indentText) {
|
|
35012
|
+
return finishNode(factory2.createJSDocUnknownTag(tagName, parseTrailingTagComments(start2, getNodePos(), indent2, indentText)), start2);
|
|
34992
35013
|
}
|
|
34993
35014
|
function addTag(tag) {
|
|
34994
35015
|
if (!tag) {
|
|
@@ -35035,7 +35056,7 @@ ${lanes.join("\n")}
|
|
|
35035
35056
|
return isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments;
|
|
35036
35057
|
}
|
|
35037
35058
|
}
|
|
35038
|
-
function parseParameterOrPropertyTag(start2, tagName, target,
|
|
35059
|
+
function parseParameterOrPropertyTag(start2, tagName, target, indent2) {
|
|
35039
35060
|
let typeExpression = tryParseTypeExpression();
|
|
35040
35061
|
let isNameFirst = !typeExpression;
|
|
35041
35062
|
skipWhitespaceOrAsterisk();
|
|
@@ -35044,8 +35065,8 @@ ${lanes.join("\n")}
|
|
|
35044
35065
|
if (isNameFirst && !lookAhead(parseJSDocLinkPrefix)) {
|
|
35045
35066
|
typeExpression = tryParseTypeExpression();
|
|
35046
35067
|
}
|
|
35047
|
-
const comment = parseTrailingTagComments(start2, getNodePos(),
|
|
35048
|
-
const nestedTypeLiteral =
|
|
35068
|
+
const comment = parseTrailingTagComments(start2, getNodePos(), indent2, indentText);
|
|
35069
|
+
const nestedTypeLiteral = parseNestedTypeLiteral(typeExpression, name, target, indent2);
|
|
35049
35070
|
if (nestedTypeLiteral) {
|
|
35050
35071
|
typeExpression = nestedTypeLiteral;
|
|
35051
35072
|
isNameFirst = true;
|
|
@@ -35053,12 +35074,12 @@ ${lanes.join("\n")}
|
|
|
35053
35074
|
const result2 = target === 1 /* Property */ ? factory2.createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) : factory2.createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment);
|
|
35054
35075
|
return finishNode(result2, start2);
|
|
35055
35076
|
}
|
|
35056
|
-
function parseNestedTypeLiteral(typeExpression, name, target,
|
|
35077
|
+
function parseNestedTypeLiteral(typeExpression, name, target, indent2) {
|
|
35057
35078
|
if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) {
|
|
35058
35079
|
const pos = getNodePos();
|
|
35059
35080
|
let child;
|
|
35060
35081
|
let children;
|
|
35061
|
-
while (child = tryParse(() => parseChildParameterOrPropertyTag(target,
|
|
35082
|
+
while (child = tryParse(() => parseChildParameterOrPropertyTag(target, indent2, name))) {
|
|
35062
35083
|
if (child.kind === 348 /* JSDocParameterTag */ || child.kind === 355 /* JSDocPropertyTag */) {
|
|
35063
35084
|
children = append(children, child);
|
|
35064
35085
|
} else if (child.kind === 352 /* JSDocTemplateTag */) {
|
|
@@ -35071,14 +35092,14 @@ ${lanes.join("\n")}
|
|
|
35071
35092
|
}
|
|
35072
35093
|
}
|
|
35073
35094
|
}
|
|
35074
|
-
function parseReturnTag(start2, tagName,
|
|
35095
|
+
function parseReturnTag(start2, tagName, indent2, indentText) {
|
|
35075
35096
|
if (some(tags, isJSDocReturnTag)) {
|
|
35076
35097
|
parseErrorAt(tagName.pos, scanner2.getTokenStart(), Diagnostics._0_tag_already_specified, unescapeLeadingUnderscores(tagName.escapedText));
|
|
35077
35098
|
}
|
|
35078
35099
|
const typeExpression = tryParseTypeExpression();
|
|
35079
|
-
return finishNode(factory2.createJSDocReturnTag(tagName, typeExpression, parseTrailingTagComments(start2, getNodePos(),
|
|
35100
|
+
return finishNode(factory2.createJSDocReturnTag(tagName, typeExpression, parseTrailingTagComments(start2, getNodePos(), indent2, indentText)), start2);
|
|
35080
35101
|
}
|
|
35081
|
-
function parseTypeTag(start2, tagName,
|
|
35102
|
+
function parseTypeTag(start2, tagName, indent2, indentText) {
|
|
35082
35103
|
if (some(tags, isJSDocTypeTag)) {
|
|
35083
35104
|
parseErrorAt(tagName.pos, scanner2.getTokenStart(), Diagnostics._0_tag_already_specified, unescapeLeadingUnderscores(tagName.escapedText));
|
|
35084
35105
|
}
|
|
@@ -35086,25 +35107,25 @@ ${lanes.join("\n")}
|
|
|
35086
35107
|
/*mayOmitBraces*/
|
|
35087
35108
|
true
|
|
35088
35109
|
);
|
|
35089
|
-
const comments2 =
|
|
35110
|
+
const comments2 = indent2 !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), indent2, indentText) : void 0;
|
|
35090
35111
|
return finishNode(factory2.createJSDocTypeTag(tagName, typeExpression, comments2), start2);
|
|
35091
35112
|
}
|
|
35092
|
-
function parseSeeTag(start2, tagName,
|
|
35113
|
+
function parseSeeTag(start2, tagName, indent2, indentText) {
|
|
35093
35114
|
const isMarkdownOrJSDocLink = token() === 23 /* OpenBracketToken */ || lookAhead(() => nextTokenJSDoc() === 60 /* AtToken */ && tokenIsIdentifierOrKeyword(nextTokenJSDoc()) && isJSDocLinkTag(scanner2.getTokenValue()));
|
|
35094
35115
|
const nameExpression = isMarkdownOrJSDocLink ? void 0 : parseJSDocNameReference();
|
|
35095
|
-
const comments2 =
|
|
35116
|
+
const comments2 = indent2 !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), indent2, indentText) : void 0;
|
|
35096
35117
|
return finishNode(factory2.createJSDocSeeTag(tagName, nameExpression, comments2), start2);
|
|
35097
35118
|
}
|
|
35098
|
-
function parseThrowsTag(start2, tagName,
|
|
35119
|
+
function parseThrowsTag(start2, tagName, indent2, indentText) {
|
|
35099
35120
|
const typeExpression = tryParseTypeExpression();
|
|
35100
|
-
const comment = parseTrailingTagComments(start2, getNodePos(),
|
|
35121
|
+
const comment = parseTrailingTagComments(start2, getNodePos(), indent2, indentText);
|
|
35101
35122
|
return finishNode(factory2.createJSDocThrowsTag(tagName, typeExpression, comment), start2);
|
|
35102
35123
|
}
|
|
35103
|
-
function parseAuthorTag(start2, tagName,
|
|
35124
|
+
function parseAuthorTag(start2, tagName, indent2, indentText) {
|
|
35104
35125
|
const commentStart = getNodePos();
|
|
35105
35126
|
const textOnly = parseAuthorNameAndEmail();
|
|
35106
35127
|
let commentEnd = scanner2.getTokenFullStart();
|
|
35107
|
-
const comments2 = parseTrailingTagComments(start2, commentEnd,
|
|
35128
|
+
const comments2 = parseTrailingTagComments(start2, commentEnd, indent2, indentText);
|
|
35108
35129
|
if (!comments2) {
|
|
35109
35130
|
commentEnd = scanner2.getTokenFullStart();
|
|
35110
35131
|
}
|
|
@@ -35188,19 +35209,19 @@ ${lanes.join("\n")}
|
|
|
35188
35209
|
skipWhitespace();
|
|
35189
35210
|
return finishNode(factory2.createJSDocEnumTag(tagName, typeExpression, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2);
|
|
35190
35211
|
}
|
|
35191
|
-
function parseTypedefTag(start2, tagName,
|
|
35212
|
+
function parseTypedefTag(start2, tagName, indent2, indentText) {
|
|
35192
35213
|
let typeExpression = tryParseTypeExpression();
|
|
35193
35214
|
skipWhitespaceOrAsterisk();
|
|
35194
35215
|
const fullName = parseJSDocTypeNameWithNamespace();
|
|
35195
35216
|
skipWhitespace();
|
|
35196
|
-
let comment = parseTagComments(
|
|
35217
|
+
let comment = parseTagComments(indent2);
|
|
35197
35218
|
let end2;
|
|
35198
35219
|
if (!typeExpression || isObjectOrObjectArrayTypeReference(typeExpression.type)) {
|
|
35199
35220
|
let child;
|
|
35200
35221
|
let childTypeTag;
|
|
35201
35222
|
let jsDocPropertyTags;
|
|
35202
35223
|
let hasChildren = false;
|
|
35203
|
-
while (child = tryParse(() => parseChildPropertyTag(
|
|
35224
|
+
while (child = tryParse(() => parseChildPropertyTag(indent2))) {
|
|
35204
35225
|
if (child.kind === 352 /* JSDocTemplateTag */) {
|
|
35205
35226
|
break;
|
|
35206
35227
|
}
|
|
@@ -35209,7 +35230,7 @@ ${lanes.join("\n")}
|
|
|
35209
35230
|
if (childTypeTag) {
|
|
35210
35231
|
const lastError = parseErrorAtCurrentToken(Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);
|
|
35211
35232
|
if (lastError) {
|
|
35212
|
-
addRelatedInfo(lastError, createDetachedDiagnostic(fileName, 0, 0, Diagnostics.
|
|
35233
|
+
addRelatedInfo(lastError, createDetachedDiagnostic(fileName, 0, 0, Diagnostics.The_tag_was_first_specified_here_Colon));
|
|
35213
35234
|
}
|
|
35214
35235
|
break;
|
|
35215
35236
|
} else {
|
|
@@ -35228,7 +35249,7 @@ ${lanes.join("\n")}
|
|
|
35228
35249
|
}
|
|
35229
35250
|
end2 = end2 || comment !== void 0 ? getNodePos() : (fullName ?? typeExpression ?? tagName).end;
|
|
35230
35251
|
if (!comment) {
|
|
35231
|
-
comment = parseTrailingTagComments(start2, end2,
|
|
35252
|
+
comment = parseTrailingTagComments(start2, end2, indent2, indentText);
|
|
35232
35253
|
}
|
|
35233
35254
|
const typedefTag = factory2.createJSDocTypedefTag(tagName, typeExpression, fullName, comment);
|
|
35234
35255
|
return finishNode(typedefTag, start2, end2);
|
|
@@ -35258,11 +35279,11 @@ ${lanes.join("\n")}
|
|
|
35258
35279
|
}
|
|
35259
35280
|
return typeNameOrNamespaceName;
|
|
35260
35281
|
}
|
|
35261
|
-
function parseCallbackTagParameters(
|
|
35282
|
+
function parseCallbackTagParameters(indent2) {
|
|
35262
35283
|
const pos = getNodePos();
|
|
35263
35284
|
let child;
|
|
35264
35285
|
let parameters;
|
|
35265
|
-
while (child = tryParse(() => parseChildParameterOrPropertyTag(4 /* CallbackParameter */,
|
|
35286
|
+
while (child = tryParse(() => parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent2))) {
|
|
35266
35287
|
if (child.kind === 352 /* JSDocTemplateTag */) {
|
|
35267
35288
|
parseErrorAtRange(child.tagName, Diagnostics.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag);
|
|
35268
35289
|
break;
|
|
@@ -35271,11 +35292,11 @@ ${lanes.join("\n")}
|
|
|
35271
35292
|
}
|
|
35272
35293
|
return createNodeArray(parameters || [], pos);
|
|
35273
35294
|
}
|
|
35274
|
-
function parseJSDocSignature(start2,
|
|
35275
|
-
const parameters = parseCallbackTagParameters(
|
|
35295
|
+
function parseJSDocSignature(start2, indent2) {
|
|
35296
|
+
const parameters = parseCallbackTagParameters(indent2);
|
|
35276
35297
|
const returnTag = tryParse(() => {
|
|
35277
35298
|
if (parseOptionalJsdoc(60 /* AtToken */)) {
|
|
35278
|
-
const tag = parseTag(
|
|
35299
|
+
const tag = parseTag(indent2);
|
|
35279
35300
|
if (tag && tag.kind === 349 /* JSDocReturnTag */) {
|
|
35280
35301
|
return tag;
|
|
35281
35302
|
}
|
|
@@ -35288,23 +35309,23 @@ ${lanes.join("\n")}
|
|
|
35288
35309
|
returnTag
|
|
35289
35310
|
), start2);
|
|
35290
35311
|
}
|
|
35291
|
-
function parseCallbackTag(start2, tagName,
|
|
35312
|
+
function parseCallbackTag(start2, tagName, indent2, indentText) {
|
|
35292
35313
|
const fullName = parseJSDocTypeNameWithNamespace();
|
|
35293
35314
|
skipWhitespace();
|
|
35294
|
-
let comment = parseTagComments(
|
|
35295
|
-
const typeExpression = parseJSDocSignature(start2,
|
|
35315
|
+
let comment = parseTagComments(indent2);
|
|
35316
|
+
const typeExpression = parseJSDocSignature(start2, indent2);
|
|
35296
35317
|
if (!comment) {
|
|
35297
|
-
comment = parseTrailingTagComments(start2, getNodePos(),
|
|
35318
|
+
comment = parseTrailingTagComments(start2, getNodePos(), indent2, indentText);
|
|
35298
35319
|
}
|
|
35299
35320
|
const end2 = comment !== void 0 ? getNodePos() : typeExpression.end;
|
|
35300
35321
|
return finishNode(factory2.createJSDocCallbackTag(tagName, typeExpression, fullName, comment), start2, end2);
|
|
35301
35322
|
}
|
|
35302
|
-
function parseOverloadTag(start2, tagName,
|
|
35323
|
+
function parseOverloadTag(start2, tagName, indent2, indentText) {
|
|
35303
35324
|
skipWhitespace();
|
|
35304
|
-
let comment = parseTagComments(
|
|
35305
|
-
const typeExpression = parseJSDocSignature(start2,
|
|
35325
|
+
let comment = parseTagComments(indent2);
|
|
35326
|
+
const typeExpression = parseJSDocSignature(start2, indent2);
|
|
35306
35327
|
if (!comment) {
|
|
35307
|
-
comment = parseTrailingTagComments(start2, getNodePos(),
|
|
35328
|
+
comment = parseTrailingTagComments(start2, getNodePos(), indent2, indentText);
|
|
35308
35329
|
}
|
|
35309
35330
|
const end2 = comment !== void 0 ? getNodePos() : typeExpression.end;
|
|
35310
35331
|
return finishNode(factory2.createJSDocOverloadTag(tagName, typeExpression, comment), start2, end2);
|
|
@@ -35320,18 +35341,18 @@ ${lanes.join("\n")}
|
|
|
35320
35341
|
}
|
|
35321
35342
|
return a.escapedText === b.escapedText;
|
|
35322
35343
|
}
|
|
35323
|
-
function parseChildPropertyTag(
|
|
35324
|
-
return parseChildParameterOrPropertyTag(1 /* Property */,
|
|
35344
|
+
function parseChildPropertyTag(indent2) {
|
|
35345
|
+
return parseChildParameterOrPropertyTag(1 /* Property */, indent2);
|
|
35325
35346
|
}
|
|
35326
|
-
function parseChildParameterOrPropertyTag(target,
|
|
35347
|
+
function parseChildParameterOrPropertyTag(target, indent2, name) {
|
|
35327
35348
|
let canParseTag = true;
|
|
35328
35349
|
let seenAsterisk = false;
|
|
35329
35350
|
while (true) {
|
|
35330
35351
|
switch (nextTokenJSDoc()) {
|
|
35331
35352
|
case 60 /* AtToken */:
|
|
35332
35353
|
if (canParseTag) {
|
|
35333
|
-
const child = tryParseChildTag(target,
|
|
35334
|
-
if (child && (child.kind === 348 /* JSDocParameterTag */ || child.kind === 355 /* JSDocPropertyTag */) &&
|
|
35354
|
+
const child = tryParseChildTag(target, indent2);
|
|
35355
|
+
if (child && (child.kind === 348 /* JSDocParameterTag */ || child.kind === 355 /* JSDocPropertyTag */) && name && (isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) {
|
|
35335
35356
|
return false;
|
|
35336
35357
|
}
|
|
35337
35358
|
return child;
|
|
@@ -35356,7 +35377,7 @@ ${lanes.join("\n")}
|
|
|
35356
35377
|
}
|
|
35357
35378
|
}
|
|
35358
35379
|
}
|
|
35359
|
-
function tryParseChildTag(target,
|
|
35380
|
+
function tryParseChildTag(target, indent2) {
|
|
35360
35381
|
Debug.assert(token() === 60 /* AtToken */);
|
|
35361
35382
|
const start2 = scanner2.getTokenFullStart();
|
|
35362
35383
|
nextTokenJSDoc();
|
|
@@ -35376,14 +35397,14 @@ ${lanes.join("\n")}
|
|
|
35376
35397
|
t = 2 /* Parameter */ | 4 /* CallbackParameter */;
|
|
35377
35398
|
break;
|
|
35378
35399
|
case "template":
|
|
35379
|
-
return parseTemplateTag(start2, tagName,
|
|
35400
|
+
return parseTemplateTag(start2, tagName, indent2, indentText);
|
|
35380
35401
|
default:
|
|
35381
35402
|
return false;
|
|
35382
35403
|
}
|
|
35383
35404
|
if (!(target & t)) {
|
|
35384
35405
|
return false;
|
|
35385
35406
|
}
|
|
35386
|
-
return parseParameterOrPropertyTag(start2, tagName, target,
|
|
35407
|
+
return parseParameterOrPropertyTag(start2, tagName, target, indent2);
|
|
35387
35408
|
}
|
|
35388
35409
|
function parseTemplateTagTypeParameter() {
|
|
35389
35410
|
const typeParameterPos = getNodePos();
|
|
@@ -35424,10 +35445,10 @@ ${lanes.join("\n")}
|
|
|
35424
35445
|
} while (parseOptionalJsdoc(28 /* CommaToken */));
|
|
35425
35446
|
return createNodeArray(typeParameters, pos);
|
|
35426
35447
|
}
|
|
35427
|
-
function parseTemplateTag(start2, tagName,
|
|
35448
|
+
function parseTemplateTag(start2, tagName, indent2, indentText) {
|
|
35428
35449
|
const constraint = token() === 19 /* OpenBraceToken */ ? parseJSDocTypeExpression() : void 0;
|
|
35429
35450
|
const typeParameters = parseTemplateTagTypeParameters();
|
|
35430
|
-
return finishNode(factory2.createJSDocTemplateTag(tagName, constraint, typeParameters, parseTrailingTagComments(start2, getNodePos(),
|
|
35451
|
+
return finishNode(factory2.createJSDocTemplateTag(tagName, constraint, typeParameters, parseTrailingTagComments(start2, getNodePos(), indent2, indentText)), start2);
|
|
35431
35452
|
}
|
|
35432
35453
|
function parseOptionalJsdoc(t) {
|
|
35433
35454
|
if (token() === t) {
|
|
@@ -41938,10 +41959,10 @@ ${lanes.join("\n")}
|
|
|
41938
41959
|
const decl = getNameOfDeclaration(declaration) || declaration;
|
|
41939
41960
|
const diag3 = messageNeedsName ? createDiagnosticForNode2(decl, message, getDisplayName(declaration)) : createDiagnosticForNode2(decl, message);
|
|
41940
41961
|
file.bindDiagnostics.push(
|
|
41941
|
-
multipleDefaultExports ? addRelatedInfo(diag3, createDiagnosticForNode2(declarationName, index === 0 ? Diagnostics.
|
|
41962
|
+
multipleDefaultExports ? addRelatedInfo(diag3, createDiagnosticForNode2(declarationName, index === 0 ? Diagnostics.Another_export_default_is_here_Colon : Diagnostics.and_here_Colon)) : diag3
|
|
41942
41963
|
);
|
|
41943
41964
|
if (multipleDefaultExports) {
|
|
41944
|
-
relatedInformation.push(createDiagnosticForNode2(decl, Diagnostics.
|
|
41965
|
+
relatedInformation.push(createDiagnosticForNode2(decl, Diagnostics.The_first_export_default_is_here_Colon));
|
|
41945
41966
|
}
|
|
41946
41967
|
});
|
|
41947
41968
|
const diag2 = messageNeedsName ? createDiagnosticForNode2(declarationName, message, getDisplayName(node)) : createDiagnosticForNode2(declarationName, message);
|
|
@@ -46446,7 +46467,7 @@ ${lanes.join("\n")}
|
|
|
46446
46467
|
if (deprecatedTag) {
|
|
46447
46468
|
addRelatedInfo(
|
|
46448
46469
|
diagnostic,
|
|
46449
|
-
createDiagnosticForNode(deprecatedTag, Diagnostics.
|
|
46470
|
+
createDiagnosticForNode(deprecatedTag, Diagnostics.The_declaration_was_marked_as_deprecated_here_Colon)
|
|
46450
46471
|
);
|
|
46451
46472
|
}
|
|
46452
46473
|
suggestionDiagnostics.add(diagnostic);
|
|
@@ -46641,8 +46662,8 @@ ${lanes.join("\n")}
|
|
|
46641
46662
|
if (adjustedNode === errorNode)
|
|
46642
46663
|
continue;
|
|
46643
46664
|
err.relatedInformation = err.relatedInformation || [];
|
|
46644
|
-
const leadingMessage = createDiagnosticForNode(adjustedNode, Diagnostics.
|
|
46645
|
-
const followOnMessage = createDiagnosticForNode(adjustedNode, Diagnostics.
|
|
46665
|
+
const leadingMessage = createDiagnosticForNode(adjustedNode, Diagnostics._0_was_also_declared_here_Colon, symbolName2);
|
|
46666
|
+
const followOnMessage = createDiagnosticForNode(adjustedNode, Diagnostics.and_here_Colon);
|
|
46646
46667
|
if (length(err.relatedInformation) >= 5 || some(err.relatedInformation, (r) => compareDiagnostics(r, followOnMessage) === 0 /* EqualTo */ || compareDiagnostics(r, leadingMessage) === 0 /* EqualTo */))
|
|
46647
46668
|
continue;
|
|
46648
46669
|
addRelatedInfo(err, !length(err.relatedInformation) ? leadingMessage : followOnMessage);
|
|
@@ -47253,7 +47274,7 @@ ${lanes.join("\n")}
|
|
|
47253
47274
|
if (suggestion.valueDeclaration) {
|
|
47254
47275
|
addRelatedInfo(
|
|
47255
47276
|
diagnostic,
|
|
47256
|
-
createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics.
|
|
47277
|
+
createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics._0_is_declared_here_Colon, suggestionName)
|
|
47257
47278
|
);
|
|
47258
47279
|
}
|
|
47259
47280
|
}
|
|
@@ -47315,7 +47336,7 @@ ${lanes.join("\n")}
|
|
|
47315
47336
|
diagnostic,
|
|
47316
47337
|
createDiagnosticForNode(
|
|
47317
47338
|
typeOnlyDeclaration,
|
|
47318
|
-
typeOnlyDeclaration.kind === 281 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 278 /* ExportDeclaration */ || typeOnlyDeclaration.kind === 280 /* NamespaceExport */ ? Diagnostics.
|
|
47339
|
+
typeOnlyDeclaration.kind === 281 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 278 /* ExportDeclaration */ || typeOnlyDeclaration.kind === 280 /* NamespaceExport */ ? Diagnostics._0_was_exported_here_Colon : Diagnostics._0_was_imported_here_Colon,
|
|
47319
47340
|
unescapedName
|
|
47320
47341
|
)
|
|
47321
47342
|
);
|
|
@@ -47452,7 +47473,7 @@ ${lanes.join("\n")}
|
|
|
47452
47473
|
return true;
|
|
47453
47474
|
}
|
|
47454
47475
|
}
|
|
47455
|
-
error2(errorLocation, Diagnostics.
|
|
47476
|
+
error2(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_Colon, unescapeLeadingUnderscores(name));
|
|
47456
47477
|
return true;
|
|
47457
47478
|
}
|
|
47458
47479
|
}
|
|
@@ -47494,7 +47515,7 @@ ${lanes.join("\n")}
|
|
|
47494
47515
|
if (isExtendedByInterface(errorLocation)) {
|
|
47495
47516
|
error2(errorLocation, Diagnostics.An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_classes, unescapeLeadingUnderscores(name));
|
|
47496
47517
|
} else {
|
|
47497
|
-
error2(errorLocation, Diagnostics.
|
|
47518
|
+
error2(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Colon, unescapeLeadingUnderscores(name));
|
|
47498
47519
|
}
|
|
47499
47520
|
return true;
|
|
47500
47521
|
}
|
|
@@ -47517,7 +47538,7 @@ ${lanes.join("\n")}
|
|
|
47517
47538
|
} else if (maybeMappedType(errorLocation, symbol)) {
|
|
47518
47539
|
error2(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");
|
|
47519
47540
|
} else {
|
|
47520
|
-
error2(errorLocation, Diagnostics.
|
|
47541
|
+
error2(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Colon, rawName);
|
|
47521
47542
|
}
|
|
47522
47543
|
return true;
|
|
47523
47544
|
}
|
|
@@ -47623,7 +47644,7 @@ ${lanes.join("\n")}
|
|
|
47623
47644
|
if (diagnosticMessage) {
|
|
47624
47645
|
addRelatedInfo(
|
|
47625
47646
|
diagnosticMessage,
|
|
47626
|
-
createDiagnosticForNode(declaration, Diagnostics.
|
|
47647
|
+
createDiagnosticForNode(declaration, Diagnostics._0_is_declared_here_Colon, declarationName)
|
|
47627
47648
|
);
|
|
47628
47649
|
}
|
|
47629
47650
|
}
|
|
@@ -47691,7 +47712,7 @@ ${lanes.join("\n")}
|
|
|
47691
47712
|
const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(getSymbolOfDeclaration(node));
|
|
47692
47713
|
const isExport = typeOnlyDeclaration.kind === 281 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 278 /* ExportDeclaration */;
|
|
47693
47714
|
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;
|
|
47694
|
-
const relatedMessage = isExport ? Diagnostics.
|
|
47715
|
+
const relatedMessage = isExport ? Diagnostics._0_was_exported_here_Colon : Diagnostics._0_was_imported_here_Colon;
|
|
47695
47716
|
const name = typeOnlyDeclaration.kind === 278 /* ExportDeclaration */ ? "*" : unescapeLeadingUnderscores(typeOnlyDeclaration.name.escapedText);
|
|
47696
47717
|
addRelatedInfo(error2(node.moduleReference, message), createDiagnosticForNode(typeOnlyDeclaration, relatedMessage, name));
|
|
47697
47718
|
}
|
|
@@ -48013,7 +48034,7 @@ ${lanes.join("\n")}
|
|
|
48013
48034
|
if (suggestion.valueDeclaration) {
|
|
48014
48035
|
addRelatedInfo(
|
|
48015
48036
|
diagnostic,
|
|
48016
|
-
createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics.
|
|
48037
|
+
createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics._0_is_declared_here_Colon, suggestionName)
|
|
48017
48038
|
);
|
|
48018
48039
|
}
|
|
48019
48040
|
} else {
|
|
@@ -48043,7 +48064,7 @@ ${lanes.join("\n")}
|
|
|
48043
48064
|
if (localSymbol.declarations) {
|
|
48044
48065
|
addRelatedInfo(
|
|
48045
48066
|
diagnostic,
|
|
48046
|
-
...map(localSymbol.declarations, (decl, index) => createDiagnosticForNode(decl, index === 0 ? Diagnostics.
|
|
48067
|
+
...map(localSymbol.declarations, (decl, index) => createDiagnosticForNode(decl, index === 0 ? Diagnostics._0_is_declared_here_Colon : Diagnostics.and_here_Colon, declarationName))
|
|
48047
48068
|
);
|
|
48048
48069
|
}
|
|
48049
48070
|
}
|
|
@@ -54088,11 +54109,11 @@ ${lanes.join("\n")}
|
|
|
54088
54109
|
const exportedMemberName = ((_a = tryCast(exportedMember.valueDeclaration, isNamedDeclaration)) == null ? void 0 : _a.name) || exportedMember.valueDeclaration;
|
|
54089
54110
|
addRelatedInfo(
|
|
54090
54111
|
error2(s.valueDeclaration, Diagnostics.Duplicate_identifier_0, unescapedName),
|
|
54091
|
-
createDiagnosticForNode(exportedMemberName, Diagnostics.
|
|
54112
|
+
createDiagnosticForNode(exportedMemberName, Diagnostics._0_was_also_declared_here_Colon, unescapedName)
|
|
54092
54113
|
);
|
|
54093
54114
|
addRelatedInfo(
|
|
54094
54115
|
error2(exportedMemberName, Diagnostics.Duplicate_identifier_0, unescapedName),
|
|
54095
|
-
createDiagnosticForNode(s.valueDeclaration, Diagnostics.
|
|
54116
|
+
createDiagnosticForNode(s.valueDeclaration, Diagnostics._0_was_also_declared_here_Colon, unescapedName)
|
|
54096
54117
|
);
|
|
54097
54118
|
}
|
|
54098
54119
|
const union = createSymbol(s.flags | exportedMember.flags, name);
|
|
@@ -54603,7 +54624,7 @@ ${lanes.join("\n")}
|
|
|
54603
54624
|
return checkFlags & 2 /* SyntheticProperty */ ? checkFlags & 65536 /* DeferredType */ ? getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) : (
|
|
54604
54625
|
// NOTE: cast to TransientSymbol should be safe because only TransientSymbols can have CheckFlags.SyntheticProperty
|
|
54605
54626
|
symbol.links.writeType || symbol.links.type
|
|
54606
|
-
) :
|
|
54627
|
+
) : getTypeOfSymbol(symbol);
|
|
54607
54628
|
}
|
|
54608
54629
|
if (symbol.flags & 98304 /* Accessor */) {
|
|
54609
54630
|
return checkFlags & 1 /* Instantiated */ ? getWriteTypeOfInstantiatedSymbol(symbol) : getWriteTypeOfAccessors(symbol);
|
|
@@ -55327,7 +55348,7 @@ ${lanes.join("\n")}
|
|
|
55327
55348
|
if (lateSymbol.flags & getExcludedSymbolFlags(symbolFlags) || earlySymbol) {
|
|
55328
55349
|
const declarations = earlySymbol ? concatenate(earlySymbol.declarations, lateSymbol.declarations) : lateSymbol.declarations;
|
|
55329
55350
|
const name = !(type.flags & 8192 /* UniqueESSymbol */) && unescapeLeadingUnderscores(memberName) || declarationNameToString(declName);
|
|
55330
|
-
forEach(declarations, (declaration) => error2(getNameOfDeclaration(declaration) || declaration, Diagnostics.
|
|
55351
|
+
forEach(declarations, (declaration) => error2(getNameOfDeclaration(declaration) || declaration, Diagnostics.Property_0_was_also_declared_here_Colon, name));
|
|
55331
55352
|
error2(declName || decl, Diagnostics.Duplicate_property_0, name);
|
|
55332
55353
|
lateSymbol = createSymbol(0 /* None */, memberName, 4096 /* Late */);
|
|
55333
55354
|
}
|
|
@@ -60239,7 +60260,7 @@ ${lanes.join("\n")}
|
|
|
60239
60260
|
if (moduleSymbol.flags & targetMeaning) {
|
|
60240
60261
|
links.resolvedType = resolveImportSymbolType(node, links, moduleSymbol, targetMeaning);
|
|
60241
60262
|
} else {
|
|
60242
|
-
const errorMessage = targetMeaning === 111551 /* Value */ ? Diagnostics.
|
|
60263
|
+
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;
|
|
60243
60264
|
error2(node, errorMessage, node.argument.literal.text);
|
|
60244
60265
|
links.resolvedSymbol = unknownSymbol;
|
|
60245
60266
|
links.resolvedType = errorType;
|
|
@@ -64000,7 +64021,7 @@ ${lanes.join("\n")}
|
|
|
64000
64021
|
);
|
|
64001
64022
|
reportError(Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName, ...getTypeNamesForErrorDisplay(source2, target2));
|
|
64002
64023
|
if (length(unmatchedProperty.declarations)) {
|
|
64003
|
-
associateRelatedInfo(createDiagnosticForNode(unmatchedProperty.declarations[0], Diagnostics.
|
|
64024
|
+
associateRelatedInfo(createDiagnosticForNode(unmatchedProperty.declarations[0], Diagnostics._0_is_declared_here_Colon, propName));
|
|
64004
64025
|
}
|
|
64005
64026
|
if (shouldSkipElaboration && errorInfo) {
|
|
64006
64027
|
overrideNextErrorInfo++;
|
|
@@ -64954,7 +64975,8 @@ ${lanes.join("\n")}
|
|
|
64954
64975
|
return !!elementType && isEmptyLiteralType(elementType);
|
|
64955
64976
|
}
|
|
64956
64977
|
function isTupleLikeType(type) {
|
|
64957
|
-
|
|
64978
|
+
let lengthType;
|
|
64979
|
+
return isTupleType(type) || !!getPropertyOfType(type, "0") || isArrayLikeType(type) && !!(lengthType = getTypeOfPropertyOfType(type, "length")) && everyType(lengthType, (t) => !!(t.flags & 256 /* NumberLiteral */));
|
|
64958
64980
|
}
|
|
64959
64981
|
function isArrayOrTupleLikeType(type) {
|
|
64960
64982
|
return isArrayLikeType(type) || isTupleLikeType(type);
|
|
@@ -68477,15 +68499,7 @@ ${lanes.join("\n")}
|
|
|
68477
68499
|
location = location.parent;
|
|
68478
68500
|
}
|
|
68479
68501
|
if (isExpressionNode(location) && (!isAssignmentTarget(location) || isWriteAccess(location))) {
|
|
68480
|
-
const type = removeOptionalTypeMarker(
|
|
68481
|
-
isWriteAccess(location) && location.kind === 211 /* PropertyAccessExpression */ ? checkPropertyAccessExpression(
|
|
68482
|
-
location,
|
|
68483
|
-
/*checkMode*/
|
|
68484
|
-
void 0,
|
|
68485
|
-
/*writeOnly*/
|
|
68486
|
-
true
|
|
68487
|
-
) : getTypeOfExpression(location)
|
|
68488
|
-
);
|
|
68502
|
+
const type = removeOptionalTypeMarker(getTypeOfExpression(location));
|
|
68489
68503
|
if (getExportSymbolOfValueSymbolIfExported(getNodeLinks(location).resolvedSymbol) === symbol) {
|
|
68490
68504
|
return type;
|
|
68491
68505
|
}
|
|
@@ -70324,6 +70338,10 @@ ${lanes.join("\n")}
|
|
|
70324
70338
|
function hasDefaultValue(node) {
|
|
70325
70339
|
return node.kind === 208 /* BindingElement */ && !!node.initializer || node.kind === 226 /* BinaryExpression */ && node.operatorToken.kind === 64 /* EqualsToken */;
|
|
70326
70340
|
}
|
|
70341
|
+
function isSpreadIntoCallOrNew(node) {
|
|
70342
|
+
const parent2 = walkUpParenthesizedExpressions(node.parent);
|
|
70343
|
+
return isSpreadElement(parent2) && isCallOrNewExpression(parent2.parent);
|
|
70344
|
+
}
|
|
70327
70345
|
function checkArrayLiteral(node, checkMode, forceTuple) {
|
|
70328
70346
|
const elements = node.elements;
|
|
70329
70347
|
const elementCount = elements.length;
|
|
@@ -70331,14 +70349,13 @@ ${lanes.join("\n")}
|
|
|
70331
70349
|
const elementFlags = [];
|
|
70332
70350
|
pushCachedContextualType(node);
|
|
70333
70351
|
const inDestructuringPattern = isAssignmentTarget(node);
|
|
70334
|
-
const
|
|
70335
|
-
const inConstContext = isSpreadIntoCallOrNew || isConstContext(node);
|
|
70352
|
+
const inConstContext = isConstContext(node);
|
|
70336
70353
|
const contextualType = getApparentTypeOfContextualType(
|
|
70337
70354
|
node,
|
|
70338
70355
|
/*contextFlags*/
|
|
70339
70356
|
void 0
|
|
70340
70357
|
);
|
|
70341
|
-
const inTupleContext = isSpreadIntoCallOrNew || !!contextualType && someType(contextualType, isTupleLikeType);
|
|
70358
|
+
const inTupleContext = isSpreadIntoCallOrNew(node) || !!contextualType && someType(contextualType, isTupleLikeType);
|
|
70342
70359
|
let hasOmittedExpression = false;
|
|
70343
70360
|
for (let i = 0; i < elementCount; i++) {
|
|
70344
70361
|
const e = elements[i];
|
|
@@ -71779,7 +71796,7 @@ ${lanes.join("\n")}
|
|
|
71779
71796
|
if (diagnosticMessage) {
|
|
71780
71797
|
addRelatedInfo(
|
|
71781
71798
|
diagnosticMessage,
|
|
71782
|
-
createDiagnosticForNode(valueDeclaration, Diagnostics.
|
|
71799
|
+
createDiagnosticForNode(valueDeclaration, Diagnostics._0_is_declared_here_Colon, declarationName)
|
|
71783
71800
|
);
|
|
71784
71801
|
}
|
|
71785
71802
|
}
|
|
@@ -71866,7 +71883,7 @@ ${lanes.join("\n")}
|
|
|
71866
71883
|
const suggestedName = symbolName(suggestion);
|
|
71867
71884
|
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;
|
|
71868
71885
|
errorInfo = chainDiagnosticMessages(errorInfo, message, missingProperty, container, suggestedName);
|
|
71869
|
-
relatedInfo = suggestion.valueDeclaration && createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics.
|
|
71886
|
+
relatedInfo = suggestion.valueDeclaration && createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics._0_is_declared_here_Colon, suggestedName);
|
|
71870
71887
|
} else {
|
|
71871
71888
|
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;
|
|
71872
71889
|
errorInfo = chainDiagnosticMessages(elaborateNeverIntersection(errorInfo, containingType), diagnostic, missingProperty, container);
|
|
@@ -72583,7 +72600,7 @@ ${lanes.join("\n")}
|
|
|
72583
72600
|
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);
|
|
72584
72601
|
const tagNameDeclaration = (_a = getSymbolAtLocation(node.tagName)) == null ? void 0 : _a.valueDeclaration;
|
|
72585
72602
|
if (tagNameDeclaration) {
|
|
72586
|
-
addRelatedInfo(diag2, createDiagnosticForNode(tagNameDeclaration, Diagnostics.
|
|
72603
|
+
addRelatedInfo(diag2, createDiagnosticForNode(tagNameDeclaration, Diagnostics._0_is_declared_here_Colon, entityNameToString(node.tagName)));
|
|
72587
72604
|
}
|
|
72588
72605
|
if (errorOutputContainer && errorOutputContainer.skipLogging) {
|
|
72589
72606
|
(errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag2);
|
|
@@ -73035,7 +73052,7 @@ ${lanes.join("\n")}
|
|
|
73035
73052
|
if (diags) {
|
|
73036
73053
|
for (const d of diags) {
|
|
73037
73054
|
if (last2.declaration && candidatesForArgumentError.length > 3) {
|
|
73038
|
-
addRelatedInfo(d, createDiagnosticForNode(last2.declaration, Diagnostics.
|
|
73055
|
+
addRelatedInfo(d, createDiagnosticForNode(last2.declaration, Diagnostics.The_last_overload_is_declared_here_Colon));
|
|
73039
73056
|
}
|
|
73040
73057
|
addImplementationSuccessElaboration(last2, d);
|
|
73041
73058
|
diagnostics.add(d);
|
|
@@ -78175,7 +78192,7 @@ ${lanes.join("\n")}
|
|
|
78175
78192
|
const errorNode = signature.declaration && isJSDocSignature(signature.declaration) ? signature.declaration.parent.tagName : signature.declaration;
|
|
78176
78193
|
addRelatedInfo(
|
|
78177
78194
|
error2(errorNode, Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature),
|
|
78178
|
-
createDiagnosticForNode(bodyDeclaration, Diagnostics.
|
|
78195
|
+
createDiagnosticForNode(bodyDeclaration, Diagnostics.The_implementation_signature_is_declared_here_Colon)
|
|
78179
78196
|
);
|
|
78180
78197
|
break;
|
|
78181
78198
|
}
|
|
@@ -78641,7 +78658,7 @@ ${lanes.join("\n")}
|
|
|
78641
78658
|
const diag2 = error2(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);
|
|
78642
78659
|
const aliasDeclaration = find(rootSymbol.declarations || emptyArray, isAliasSymbolDeclaration2);
|
|
78643
78660
|
if (aliasDeclaration) {
|
|
78644
|
-
addRelatedInfo(diag2, createDiagnosticForNode(aliasDeclaration, Diagnostics.
|
|
78661
|
+
addRelatedInfo(diag2, createDiagnosticForNode(aliasDeclaration, Diagnostics._0_was_imported_here_Colon, idText(rootName)));
|
|
78645
78662
|
}
|
|
78646
78663
|
}
|
|
78647
78664
|
}
|
|
@@ -79585,7 +79602,7 @@ ${lanes.join("\n")}
|
|
|
79585
79602
|
if (firstDeclaration) {
|
|
79586
79603
|
addRelatedInfo(
|
|
79587
79604
|
err,
|
|
79588
|
-
createDiagnosticForNode(firstDeclaration, Diagnostics.
|
|
79605
|
+
createDiagnosticForNode(firstDeclaration, Diagnostics._0_was_also_declared_here_Colon, declName)
|
|
79589
79606
|
);
|
|
79590
79607
|
}
|
|
79591
79608
|
}
|
|
@@ -80695,7 +80712,7 @@ ${lanes.join("\n")}
|
|
|
80695
80712
|
typeToString(info.type)
|
|
80696
80713
|
);
|
|
80697
80714
|
if (propDeclaration && errorNode !== propDeclaration) {
|
|
80698
|
-
addRelatedInfo(diagnostic, createDiagnosticForNode(propDeclaration, Diagnostics.
|
|
80715
|
+
addRelatedInfo(diagnostic, createDiagnosticForNode(propDeclaration, Diagnostics._0_is_declared_here_Colon, symbolToString(prop)));
|
|
80699
80716
|
}
|
|
80700
80717
|
diagnostics.add(diagnostic);
|
|
80701
80718
|
}
|
|
@@ -85030,7 +85047,7 @@ ${lanes.join("\n")}
|
|
|
85030
85047
|
createDiagnosticForNode(useStrictDirective, Diagnostics.use_strict_directive_used_here)
|
|
85031
85048
|
);
|
|
85032
85049
|
});
|
|
85033
|
-
const diagnostics2 = nonSimpleParameters.map((parameter, index) => index === 0 ? createDiagnosticForNode(parameter, Diagnostics.
|
|
85050
|
+
const diagnostics2 = nonSimpleParameters.map((parameter, index) => index === 0 ? createDiagnosticForNode(parameter, Diagnostics.Non_simple_parameter_declared_here_Colon) : createDiagnosticForNode(parameter, Diagnostics.and_here_Colon));
|
|
85034
85051
|
addRelatedInfo(error2(useStrictDirective, Diagnostics.use_strict_directive_cannot_be_used_with_non_simple_parameter_list), ...diagnostics2);
|
|
85035
85052
|
return true;
|
|
85036
85053
|
}
|
|
@@ -117714,39 +117731,49 @@ ${lanes.join("\n")}
|
|
|
117714
117731
|
function formatColorAndReset(text, formatStyle) {
|
|
117715
117732
|
return formatStyle + text + resetEscapeSequence;
|
|
117716
117733
|
}
|
|
117717
|
-
function formatCodeSpan(file, start, length2,
|
|
117734
|
+
function formatCodeSpan(file, start, length2, indent2, underlineColor, host) {
|
|
117718
117735
|
const { line: firstLine, character: firstLineChar } = getLineAndCharacterOfPosition(file, start);
|
|
117719
117736
|
const { line: lastLine, character: lastLineChar } = getLineAndCharacterOfPosition(file, start + length2);
|
|
117720
117737
|
const lastLineInFile = getLineAndCharacterOfPosition(file, file.text.length).line;
|
|
117738
|
+
const gutterWidth = 1;
|
|
117721
117739
|
const hasMoreThanFiveLines = lastLine - firstLine >= 4;
|
|
117722
|
-
let
|
|
117723
|
-
|
|
117724
|
-
|
|
117740
|
+
let whitespaceToTrim = Number.MAX_VALUE;
|
|
117741
|
+
for (let i = firstLine; i <= lastLine; i++) {
|
|
117742
|
+
if (hasMoreThanFiveLines && firstLine + 1 < i && i < lastLine - 1) {
|
|
117743
|
+
i = lastLine - 1;
|
|
117744
|
+
}
|
|
117745
|
+
const lineStart = getPositionOfLineAndCharacter(file, i, 0);
|
|
117746
|
+
const lineEnd = i < lastLineInFile ? getPositionOfLineAndCharacter(file, i + 1, 0) : file.text.length;
|
|
117747
|
+
const lineContent = file.text.slice(lineStart, lineEnd);
|
|
117748
|
+
whitespaceToTrim = Math.min(whitespaceToTrim, startWhitespaceCount(lineContent));
|
|
117725
117749
|
}
|
|
117726
117750
|
let context = "";
|
|
117727
117751
|
for (let i = firstLine; i <= lastLine; i++) {
|
|
117728
117752
|
context += host.getNewLine();
|
|
117729
117753
|
if (hasMoreThanFiveLines && firstLine + 1 < i && i < lastLine - 1) {
|
|
117730
|
-
context +=
|
|
117754
|
+
context += indent2 + formatColorAndReset(padLeft(ellipsis, gutterWidth), gutterStyleSequence) + gutterSeparator + host.getNewLine();
|
|
117731
117755
|
i = lastLine - 1;
|
|
117732
117756
|
}
|
|
117733
117757
|
const lineStart = getPositionOfLineAndCharacter(file, i, 0);
|
|
117734
117758
|
const lineEnd = i < lastLineInFile ? getPositionOfLineAndCharacter(file, i + 1, 0) : file.text.length;
|
|
117735
117759
|
let lineContent = file.text.slice(lineStart, lineEnd);
|
|
117760
|
+
lineContent = lineContent.slice(whitespaceToTrim);
|
|
117736
117761
|
lineContent = trimStringEnd(lineContent);
|
|
117737
117762
|
lineContent = lineContent.replace(/\t/g, " ");
|
|
117738
|
-
|
|
117763
|
+
const gutterLine = "|";
|
|
117764
|
+
context += indent2 + padLeft(gutterLine, gutterWidth) + gutterSeparator;
|
|
117739
117765
|
context += lineContent + host.getNewLine();
|
|
117740
|
-
context +=
|
|
117741
|
-
context +=
|
|
117766
|
+
context += indent2 + padLeft("", gutterWidth) + gutterSeparator;
|
|
117767
|
+
context += underlineColor;
|
|
117742
117768
|
if (i === firstLine) {
|
|
117743
117769
|
const lastCharForLine = i === lastLine ? lastLineChar : void 0;
|
|
117744
|
-
context += lineContent.slice(0, firstLineChar).replace(/\S/g, " ");
|
|
117745
|
-
|
|
117770
|
+
context += lineContent.slice(0, firstLineChar - whitespaceToTrim).replace(/\S/g, " ");
|
|
117771
|
+
const amendedLastChar = lastCharForLine ? lastCharForLine - whitespaceToTrim : void 0;
|
|
117772
|
+
context += lineContent.slice(firstLineChar - whitespaceToTrim, amendedLastChar).replace(/./g, "\u2594");
|
|
117746
117773
|
} else if (i === lastLine) {
|
|
117747
|
-
context += lineContent.slice(0, lastLineChar).replace(/./g, "
|
|
117774
|
+
context += lineContent.slice(0, lastLineChar).replace(/./g, "\u2594");
|
|
117748
117775
|
} else {
|
|
117749
|
-
context += lineContent.replace(/./g, "
|
|
117776
|
+
context += lineContent.replace(/./g, "\u2594");
|
|
117750
117777
|
}
|
|
117751
117778
|
context += resetEscapeSequence;
|
|
117752
117779
|
}
|
|
@@ -117764,54 +117791,87 @@ ${lanes.join("\n")}
|
|
|
117764
117791
|
return output;
|
|
117765
117792
|
}
|
|
117766
117793
|
function formatDiagnosticsWithColorAndContext(diagnostics, host) {
|
|
117794
|
+
var _a, _b;
|
|
117795
|
+
const terminalWidth = ((_b = (_a = sys).getWidthOfTerminal) == null ? void 0 : _b.call(_a)) ?? 0;
|
|
117796
|
+
const indent2 = terminalWidth < 60 ? "" : halfIndent;
|
|
117767
117797
|
let output = "";
|
|
117768
117798
|
for (const diagnostic of diagnostics) {
|
|
117769
|
-
|
|
117770
|
-
|
|
117771
|
-
|
|
117772
|
-
|
|
117773
|
-
|
|
117774
|
-
|
|
117775
|
-
|
|
117776
|
-
output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine());
|
|
117799
|
+
const diagnosticCode = "TS" + diagnostic.code;
|
|
117800
|
+
const diagnosticCatName = diagnosticCategoryName(
|
|
117801
|
+
diagnostic,
|
|
117802
|
+
/*lowerCase*/
|
|
117803
|
+
false
|
|
117804
|
+
);
|
|
117805
|
+
const diagnosticCatNameColored = formatColorAndReset(diagnosticCatName, getCategoryFormat(diagnostic.category));
|
|
117777
117806
|
if (diagnostic.file && diagnostic.code !== Diagnostics.File_appears_to_be_binary.code) {
|
|
117807
|
+
const { file, start } = diagnostic;
|
|
117808
|
+
const location = formatLocation(file, start, host);
|
|
117809
|
+
const locationLength = location.replace(/\u001b[[0-9]+m/g, "").length;
|
|
117810
|
+
const codeLength = diagnosticCode.length;
|
|
117811
|
+
output += formatColorAndReset(bullet, getCategoryFormat(diagnostic.category)) + location;
|
|
117812
|
+
const defaultPad = codeLength + 1;
|
|
117813
|
+
let padWidth = terminalWidth < 60 ? defaultPad : terminalWidth - (bullet.length + locationLength + codeLength + diagnosticCatName.length + 2);
|
|
117814
|
+
if (padWidth < diagnosticCode.length)
|
|
117815
|
+
padWidth = defaultPad;
|
|
117816
|
+
output += padLeft(diagnosticCatNameColored, padWidth + (diagnosticCatNameColored.length - diagnosticCatName.length));
|
|
117817
|
+
output += " " + diagnosticCode;
|
|
117818
|
+
output += formatCodeSpan(diagnostic.file, diagnostic.start, diagnostic.length, indent2, getCategoryFormat(diagnostic.category), host);
|
|
117778
117819
|
output += host.getNewLine();
|
|
117779
|
-
|
|
117820
|
+
} else {
|
|
117821
|
+
output += formatColorAndReset(bullet, getCategoryFormat(diagnostic.category)) + " " + diagnosticCatNameColored + " " + diagnosticCode;
|
|
117780
117822
|
}
|
|
117823
|
+
let diagnosticText = flattenDiagnosticMessageText(
|
|
117824
|
+
diagnostic.messageText,
|
|
117825
|
+
host.getNewLine(),
|
|
117826
|
+
0,
|
|
117827
|
+
/*pretty*/
|
|
117828
|
+
true
|
|
117829
|
+
);
|
|
117830
|
+
diagnosticText = diagnosticText.split(host.getNewLine()).map((text) => indent2 + text).join(host.getNewLine());
|
|
117831
|
+
output += diagnosticText;
|
|
117832
|
+
output += host.getNewLine();
|
|
117781
117833
|
if (diagnostic.relatedInformation) {
|
|
117782
117834
|
output += host.getNewLine();
|
|
117783
117835
|
for (const { file, start, length: length2, messageText } of diagnostic.relatedInformation) {
|
|
117836
|
+
output += indent2 + trimStringStart(flattenDiagnosticMessageText(
|
|
117837
|
+
messageText,
|
|
117838
|
+
host.getNewLine(),
|
|
117839
|
+
0,
|
|
117840
|
+
/*pretty*/
|
|
117841
|
+
true
|
|
117842
|
+
));
|
|
117784
117843
|
if (file) {
|
|
117844
|
+
output += " " + formatLocation(file, start, host);
|
|
117785
117845
|
output += host.getNewLine();
|
|
117786
|
-
output +=
|
|
117787
|
-
output += formatCodeSpan(file, start, length2, indent, "\x1B[96m" /* Cyan */, host);
|
|
117846
|
+
output += formatCodeSpan(file, start, length2, indent2 + " ", "\x1B[96m" /* Cyan */, host);
|
|
117788
117847
|
}
|
|
117789
|
-
output += host.getNewLine();
|
|
117790
|
-
output += indent + flattenDiagnosticMessageText(messageText, host.getNewLine());
|
|
117791
117848
|
}
|
|
117792
117849
|
}
|
|
117793
|
-
output += host.getNewLine();
|
|
117794
117850
|
}
|
|
117795
117851
|
return output;
|
|
117796
117852
|
}
|
|
117797
|
-
function flattenDiagnosticMessageText(diag2, newLine,
|
|
117853
|
+
function flattenDiagnosticMessageText(diag2, newLine, indent2 = 0, pretty = false) {
|
|
117798
117854
|
if (isString(diag2)) {
|
|
117799
117855
|
return diag2;
|
|
117800
117856
|
} else if (diag2 === void 0) {
|
|
117801
117857
|
return "";
|
|
117802
117858
|
}
|
|
117803
117859
|
let result = "";
|
|
117804
|
-
if (
|
|
117860
|
+
if (indent2) {
|
|
117805
117861
|
result += newLine;
|
|
117806
|
-
|
|
117807
|
-
|
|
117808
|
-
|
|
117862
|
+
const indentsToReplaceWithNewLines = pretty ? 1 : 0;
|
|
117863
|
+
if (indent2 > indentsToReplaceWithNewLines) {
|
|
117864
|
+
for (let i = indentsToReplaceWithNewLines; i < indent2; i++) {
|
|
117865
|
+
result += " ";
|
|
117866
|
+
}
|
|
117867
|
+
} else
|
|
117868
|
+
result += newLine;
|
|
117809
117869
|
}
|
|
117810
117870
|
result += diag2.messageText;
|
|
117811
|
-
|
|
117871
|
+
indent2++;
|
|
117812
117872
|
if (diag2.next) {
|
|
117813
117873
|
for (const kid of diag2.next) {
|
|
117814
|
-
result += flattenDiagnosticMessageText(kid, newLine,
|
|
117874
|
+
result += flattenDiagnosticMessageText(kid, newLine, indent2);
|
|
117815
117875
|
}
|
|
117816
117876
|
}
|
|
117817
117877
|
return result;
|
|
@@ -119366,6 +119426,14 @@ ${lanes.join("\n")}
|
|
|
119366
119426
|
case 265 /* TypeAliasDeclaration */:
|
|
119367
119427
|
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files));
|
|
119368
119428
|
return "skip";
|
|
119429
|
+
case 176 /* Constructor */:
|
|
119430
|
+
case 174 /* MethodDeclaration */:
|
|
119431
|
+
case 262 /* FunctionDeclaration */:
|
|
119432
|
+
if (!node.body) {
|
|
119433
|
+
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Signature_declarations_can_only_be_used_in_TypeScript_files));
|
|
119434
|
+
return "skip";
|
|
119435
|
+
}
|
|
119436
|
+
return;
|
|
119369
119437
|
case 266 /* EnumDeclaration */:
|
|
119370
119438
|
const enumKeyword = Debug.checkDefined(tokenToString(94 /* EnumKeyword */));
|
|
119371
119439
|
diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword));
|
|
@@ -120799,16 +120867,16 @@ ${lanes.join("\n")}
|
|
|
120799
120867
|
let message2;
|
|
120800
120868
|
switch (reason.kind) {
|
|
120801
120869
|
case 3 /* Import */:
|
|
120802
|
-
message2 = Diagnostics.
|
|
120870
|
+
message2 = Diagnostics.File_is_included_via_import_here_Colon;
|
|
120803
120871
|
break;
|
|
120804
120872
|
case 4 /* ReferenceFile */:
|
|
120805
|
-
message2 = Diagnostics.
|
|
120873
|
+
message2 = Diagnostics.File_is_included_via_reference_here_Colon;
|
|
120806
120874
|
break;
|
|
120807
120875
|
case 5 /* TypeReferenceDirective */:
|
|
120808
|
-
message2 = Diagnostics.
|
|
120876
|
+
message2 = Diagnostics.File_is_included_via_type_library_reference_here_Colon;
|
|
120809
120877
|
break;
|
|
120810
120878
|
case 7 /* LibReferenceDirective */:
|
|
120811
|
-
message2 = Diagnostics.
|
|
120879
|
+
message2 = Diagnostics.File_is_included_via_library_reference_here_Colon;
|
|
120812
120880
|
break;
|
|
120813
120881
|
default:
|
|
120814
120882
|
Debug.assertNever(reason);
|
|
@@ -120832,14 +120900,14 @@ ${lanes.join("\n")}
|
|
|
120832
120900
|
const matchedByFiles = getMatchedFileSpec(program, fileName);
|
|
120833
120901
|
if (matchedByFiles) {
|
|
120834
120902
|
configFileNode = getTsConfigPropArrayElementValue(options.configFile, "files", matchedByFiles);
|
|
120835
|
-
message = Diagnostics.
|
|
120903
|
+
message = Diagnostics.File_is_matched_by_files_list_specified_here_Colon;
|
|
120836
120904
|
break;
|
|
120837
120905
|
}
|
|
120838
120906
|
const matchedByInclude = getMatchedIncludeSpec(program, fileName);
|
|
120839
120907
|
if (!matchedByInclude || !isString(matchedByInclude))
|
|
120840
120908
|
return void 0;
|
|
120841
120909
|
configFileNode = getTsConfigPropArrayElementValue(options.configFile, "include", matchedByInclude);
|
|
120842
|
-
message = Diagnostics.
|
|
120910
|
+
message = Diagnostics.File_is_matched_by_include_pattern_specified_here_Colon;
|
|
120843
120911
|
break;
|
|
120844
120912
|
case 1 /* SourceFromProjectReference */:
|
|
120845
120913
|
case 2 /* OutputFromProjectReference */:
|
|
@@ -120860,23 +120928,23 @@ ${lanes.join("\n")}
|
|
|
120860
120928
|
return referencesSyntax && referencesSyntax.elements.length > index ? createDiagnosticForNodeInSourceFile(
|
|
120861
120929
|
sourceFile,
|
|
120862
120930
|
referencesSyntax.elements[index],
|
|
120863
|
-
reason.kind === 2 /* OutputFromProjectReference */ ? Diagnostics.
|
|
120931
|
+
reason.kind === 2 /* OutputFromProjectReference */ ? Diagnostics.File_is_output_from_referenced_project_specified_here_Colon : Diagnostics.File_is_source_from_referenced_project_specified_here_Colon
|
|
120864
120932
|
) : void 0;
|
|
120865
120933
|
case 8 /* AutomaticTypeDirectiveFile */:
|
|
120866
120934
|
if (!options.types)
|
|
120867
120935
|
return void 0;
|
|
120868
120936
|
configFileNode = getOptionsSyntaxByArrayElementValue("types", reason.typeReference);
|
|
120869
|
-
message = Diagnostics.
|
|
120937
|
+
message = Diagnostics.File_is_entry_point_of_type_library_specified_here_Colon;
|
|
120870
120938
|
break;
|
|
120871
120939
|
case 6 /* LibFile */:
|
|
120872
120940
|
if (reason.index !== void 0) {
|
|
120873
120941
|
configFileNode = getOptionsSyntaxByArrayElementValue("lib", options.lib[reason.index]);
|
|
120874
|
-
message = Diagnostics.
|
|
120942
|
+
message = Diagnostics.File_is_library_specified_here_Colon;
|
|
120875
120943
|
break;
|
|
120876
120944
|
}
|
|
120877
120945
|
const target = forEachEntry(targetOptionDeclaration.type, (value, key) => value === getEmitScriptTarget(options) ? key : void 0);
|
|
120878
120946
|
configFileNode = target ? getOptionsSyntaxByValue("target", target) : void 0;
|
|
120879
|
-
message = Diagnostics.
|
|
120947
|
+
message = Diagnostics.File_is_default_library_for_target_specified_here_Colon;
|
|
120880
120948
|
break;
|
|
120881
120949
|
default:
|
|
120882
120950
|
Debug.assertNever(reason);
|
|
@@ -121368,7 +121436,7 @@ ${lanes.join("\n")}
|
|
|
121368
121436
|
}
|
|
121369
121437
|
Debug.fail("should never ask for module name at index higher than possible module name");
|
|
121370
121438
|
}
|
|
121371
|
-
var ForegroundColorEscapeSequences, gutterStyleSequence, gutterSeparator, resetEscapeSequence, ellipsis, halfIndent,
|
|
121439
|
+
var ForegroundColorEscapeSequences, gutterStyleSequence, gutterSeparator, resetEscapeSequence, ellipsis, halfIndent, bullet, emptyResolution, moduleResolutionNameAndModeGetter, typeReferenceResolutionNameAndModeGetter, inferredTypesContainingFile, plainJSErrors, emitSkippedWithNoDiagnostics;
|
|
121372
121440
|
var init_program = __esm({
|
|
121373
121441
|
"src/compiler/program.ts"() {
|
|
121374
121442
|
"use strict";
|
|
@@ -121387,7 +121455,7 @@ ${lanes.join("\n")}
|
|
|
121387
121455
|
resetEscapeSequence = "\x1B[0m";
|
|
121388
121456
|
ellipsis = "...";
|
|
121389
121457
|
halfIndent = " ";
|
|
121390
|
-
|
|
121458
|
+
bullet = "\u25CF ";
|
|
121391
121459
|
emptyResolution = {
|
|
121392
121460
|
resolvedModule: void 0,
|
|
121393
121461
|
resolvedTypeReferenceDirective: void 0
|
|
@@ -121405,8 +121473,8 @@ ${lanes.join("\n")}
|
|
|
121405
121473
|
// binder errors
|
|
121406
121474
|
Diagnostics.Cannot_redeclare_block_scoped_variable_0.code,
|
|
121407
121475
|
Diagnostics.A_module_cannot_have_multiple_default_exports.code,
|
|
121408
|
-
Diagnostics.
|
|
121409
|
-
Diagnostics.
|
|
121476
|
+
Diagnostics.Another_export_default_is_here_Colon.code,
|
|
121477
|
+
Diagnostics.The_first_export_default_is_here_Colon.code,
|
|
121410
121478
|
Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module.code,
|
|
121411
121479
|
Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode.code,
|
|
121412
121480
|
Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here.code,
|
|
@@ -130116,7 +130184,7 @@ ${lanes.join("\n")}
|
|
|
130116
130184
|
const absoluteMaximumLength = defaultMaximumTruncationLength * 10;
|
|
130117
130185
|
let displayParts;
|
|
130118
130186
|
let lineStart;
|
|
130119
|
-
let
|
|
130187
|
+
let indent2;
|
|
130120
130188
|
let length2;
|
|
130121
130189
|
resetWriter();
|
|
130122
130190
|
const unknownWrite = (text) => writeKind(text, 17 /* text */);
|
|
@@ -130152,12 +130220,12 @@ ${lanes.join("\n")}
|
|
|
130152
130220
|
hasTrailingWhitespace: () => false,
|
|
130153
130221
|
hasTrailingComment: () => false,
|
|
130154
130222
|
rawWrite: notImplemented,
|
|
130155
|
-
getIndent: () =>
|
|
130223
|
+
getIndent: () => indent2,
|
|
130156
130224
|
increaseIndent: () => {
|
|
130157
|
-
|
|
130225
|
+
indent2++;
|
|
130158
130226
|
},
|
|
130159
130227
|
decreaseIndent: () => {
|
|
130160
|
-
|
|
130228
|
+
indent2--;
|
|
130161
130229
|
},
|
|
130162
130230
|
clear: resetWriter
|
|
130163
130231
|
};
|
|
@@ -130165,7 +130233,7 @@ ${lanes.join("\n")}
|
|
|
130165
130233
|
if (length2 > absoluteMaximumLength)
|
|
130166
130234
|
return;
|
|
130167
130235
|
if (lineStart) {
|
|
130168
|
-
const indentString = getIndentString(
|
|
130236
|
+
const indentString = getIndentString(indent2);
|
|
130169
130237
|
if (indentString) {
|
|
130170
130238
|
length2 += indentString.length;
|
|
130171
130239
|
displayParts.push(displayPart(indentString, 16 /* space */));
|
|
@@ -130197,7 +130265,7 @@ ${lanes.join("\n")}
|
|
|
130197
130265
|
function resetWriter() {
|
|
130198
130266
|
displayParts = [];
|
|
130199
130267
|
lineStart = true;
|
|
130200
|
-
|
|
130268
|
+
indent2 = 0;
|
|
130201
130269
|
length2 = 0;
|
|
130202
130270
|
}
|
|
130203
130271
|
}
|
|
@@ -148939,6 +149007,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
148939
149007
|
if (compilerOptions.configFile) {
|
|
148940
149008
|
return getEmitModuleKind(compilerOptions) < 5 /* ES2015 */;
|
|
148941
149009
|
}
|
|
149010
|
+
if (sourceFile.impliedNodeFormat === 1 /* CommonJS */)
|
|
149011
|
+
return true;
|
|
149012
|
+
if (sourceFile.impliedNodeFormat === 99 /* ESNext */)
|
|
149013
|
+
return false;
|
|
148942
149014
|
for (const otherFile of program.getSourceFiles()) {
|
|
148943
149015
|
if (otherFile === sourceFile || !isSourceFileJS(otherFile) || program.isSourceFileFromExternalLibrary(otherFile))
|
|
148944
149016
|
continue;
|
|
@@ -149670,7 +149742,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
149670
149742
|
Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,
|
|
149671
149743
|
Diagnostics.Cannot_find_namespace_0.code,
|
|
149672
149744
|
Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code,
|
|
149673
|
-
Diagnostics.
|
|
149745
|
+
Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Colon.code,
|
|
149674
149746
|
Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer.code,
|
|
149675
149747
|
Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type.code
|
|
149676
149748
|
];
|
|
@@ -156890,6 +156962,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
156890
156962
|
data = originToCompletionEntryData(origin);
|
|
156891
156963
|
hasAction = !importStatementCompletion;
|
|
156892
156964
|
}
|
|
156965
|
+
const parentNamedImportOrExport = findAncestor(location, isNamedImportsOrExports);
|
|
156966
|
+
if ((parentNamedImportOrExport == null ? void 0 : parentNamedImportOrExport.kind) === 275 /* NamedImports */) {
|
|
156967
|
+
const possibleToken = stringToToken(name);
|
|
156968
|
+
if (parentNamedImportOrExport && possibleToken && (possibleToken === 135 /* AwaitKeyword */ || isNonContextualKeyword(possibleToken))) {
|
|
156969
|
+
insertText = `${name} as ${name}_`;
|
|
156970
|
+
}
|
|
156971
|
+
}
|
|
156893
156972
|
return {
|
|
156894
156973
|
name,
|
|
156895
156974
|
kind: ts_SymbolDisplay_exports.getSymbolKind(typeChecker, symbol, location),
|
|
@@ -157670,7 +157749,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
157670
157749
|
}
|
|
157671
157750
|
function getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextToken, origin, symbol, program, host, compilerOptions, sourceFile, position, previousToken, formatContext, preferences, data, source, cancellationToken) {
|
|
157672
157751
|
if (data == null ? void 0 : data.moduleSpecifier) {
|
|
157673
|
-
if (previousToken && getImportStatementCompletionInfo(contextToken || previousToken).replacementSpan) {
|
|
157752
|
+
if (previousToken && getImportStatementCompletionInfo(contextToken || previousToken, sourceFile).replacementSpan) {
|
|
157674
157753
|
return { codeActions: void 0, sourceDisplay: [textPart(data.moduleSpecifier)] };
|
|
157675
157754
|
}
|
|
157676
157755
|
}
|
|
@@ -157883,7 +157962,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
157883
157962
|
let isNewIdentifierLocation = false;
|
|
157884
157963
|
let flags = 0 /* None */;
|
|
157885
157964
|
if (contextToken) {
|
|
157886
|
-
const importStatementCompletionInfo = getImportStatementCompletionInfo(contextToken);
|
|
157965
|
+
const importStatementCompletionInfo = getImportStatementCompletionInfo(contextToken, sourceFile);
|
|
157887
157966
|
if (importStatementCompletionInfo.keywordCompletion) {
|
|
157888
157967
|
if (importStatementCompletionInfo.isKeywordOnlyCompletion) {
|
|
157889
157968
|
return {
|
|
@@ -159514,7 +159593,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
159514
159593
|
}
|
|
159515
159594
|
return void 0;
|
|
159516
159595
|
}
|
|
159517
|
-
function getImportStatementCompletionInfo(contextToken) {
|
|
159596
|
+
function getImportStatementCompletionInfo(contextToken, sourceFile) {
|
|
159518
159597
|
var _a, _b, _c;
|
|
159519
159598
|
let keywordCompletion;
|
|
159520
159599
|
let isKeywordOnlyCompletion = false;
|
|
@@ -159530,6 +159609,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
159530
159609
|
function getCandidate() {
|
|
159531
159610
|
const parent2 = contextToken.parent;
|
|
159532
159611
|
if (isImportEqualsDeclaration(parent2)) {
|
|
159612
|
+
const lastToken = parent2.getLastToken(sourceFile);
|
|
159613
|
+
if (isIdentifier(contextToken) && lastToken !== contextToken) {
|
|
159614
|
+
keywordCompletion = 161 /* FromKeyword */;
|
|
159615
|
+
isKeywordOnlyCompletion = true;
|
|
159616
|
+
return void 0;
|
|
159617
|
+
}
|
|
159533
159618
|
keywordCompletion = contextToken.kind === 156 /* TypeKeyword */ ? void 0 : 156 /* TypeKeyword */;
|
|
159534
159619
|
return isModuleSpecifierMissingOrEmpty(parent2.moduleReference) ? parent2 : void 0;
|
|
159535
159620
|
}
|
|
@@ -160097,7 +160182,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
160097
160182
|
extensionOptions,
|
|
160098
160183
|
host,
|
|
160099
160184
|
/*moduleSpecifierIsRelative*/
|
|
160100
|
-
|
|
160185
|
+
true,
|
|
160101
160186
|
scriptPath
|
|
160102
160187
|
).values());
|
|
160103
160188
|
}
|
|
@@ -167779,8 +167864,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
167779
167864
|
const startPosition = getFirstNonSpaceCharacterPosition(sourceFile.text, lineStartPosition);
|
|
167780
167865
|
const insertAtLineStart = isValidLocationToAddComment(sourceFile, startPosition);
|
|
167781
167866
|
const token = getTouchingToken(sourceFile, insertAtLineStart ? startPosition : position);
|
|
167782
|
-
const
|
|
167783
|
-
const text = `${insertAtLineStart ? "" : this.newLineCharacter}//${commentText}${this.newLineCharacter}${
|
|
167867
|
+
const indent2 = sourceFile.text.slice(lineStartPosition, startPosition);
|
|
167868
|
+
const text = `${insertAtLineStart ? "" : this.newLineCharacter}//${commentText}${this.newLineCharacter}${indent2}`;
|
|
167784
167869
|
this.insertText(sourceFile, token.getStart(sourceFile), text);
|
|
167785
167870
|
}
|
|
167786
167871
|
insertJsdocCommentBefore(sourceFile, node, tag) {
|
|
@@ -167799,8 +167884,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
167799
167884
|
}
|
|
167800
167885
|
}
|
|
167801
167886
|
const startPosition = getPrecedingNonSpaceCharacterPosition(sourceFile.text, fnStart - 1);
|
|
167802
|
-
const
|
|
167803
|
-
this.insertNodeAt(sourceFile, fnStart, tag, { suffix: this.newLineCharacter +
|
|
167887
|
+
const indent2 = sourceFile.text.slice(startPosition, fnStart);
|
|
167888
|
+
this.insertNodeAt(sourceFile, fnStart, tag, { suffix: this.newLineCharacter + indent2 });
|
|
167804
167889
|
}
|
|
167805
167890
|
createJSDocText(sourceFile, node) {
|
|
167806
167891
|
const comments = flatMap(node.jsDoc, (jsDoc2) => isString(jsDoc2.comment) ? factory.createJSDocText(jsDoc2.comment) : jsDoc2.comment);
|
|
@@ -171880,7 +171965,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
171880
171965
|
array.splice(removeIndex, 1);
|
|
171881
171966
|
}
|
|
171882
171967
|
}
|
|
171883
|
-
function
|
|
171968
|
+
function indent(str) {
|
|
171884
171969
|
return indentStr + str.replace(/\n/g, indentStr);
|
|
171885
171970
|
}
|
|
171886
171971
|
function stringifyIndented(json) {
|
|
@@ -178674,7 +178759,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
178674
178759
|
const verboseLogging = logger.hasLevel(3 /* verbose */);
|
|
178675
178760
|
const json = JSON.stringify(msg);
|
|
178676
178761
|
if (verboseLogging) {
|
|
178677
|
-
logger.info(`${msg.type}:${
|
|
178762
|
+
logger.info(`${msg.type}:${indent(JSON.stringify(msg, void 0, " "))}`);
|
|
178678
178763
|
}
|
|
178679
178764
|
const len = byteLength(json, "utf8");
|
|
178680
178765
|
return `Content-Length: ${1 + len}\r
|
|
@@ -179983,9 +180068,9 @@ ${json}${newLine}`;
|
|
|
179983
180068
|
logErrorWorker(err, cmd, fileRequest) {
|
|
179984
180069
|
let msg = "Exception on executing command " + cmd;
|
|
179985
180070
|
if (err.message) {
|
|
179986
|
-
msg += ":\n" +
|
|
180071
|
+
msg += ":\n" + indent(err.message);
|
|
179987
180072
|
if (err.stack) {
|
|
179988
|
-
msg += "\n" +
|
|
180073
|
+
msg += "\n" + indent(err.stack);
|
|
179989
180074
|
}
|
|
179990
180075
|
}
|
|
179991
180076
|
if (this.logger.hasLevel(3 /* verbose */)) {
|
|
@@ -179997,7 +180082,7 @@ ${json}${newLine}`;
|
|
|
179997
180082
|
const text = getSnapshotText(scriptInfo.getSnapshot());
|
|
179998
180083
|
msg += `
|
|
179999
180084
|
|
|
180000
|
-
File text of ${fileRequest.file}:${
|
|
180085
|
+
File text of ${fileRequest.file}:${indent(text)}
|
|
180001
180086
|
`;
|
|
180002
180087
|
}
|
|
180003
180088
|
} catch {
|
|
@@ -181838,7 +181923,7 @@ ${e.message}`;
|
|
|
181838
181923
|
if (this.logger.hasLevel(2 /* requestTime */)) {
|
|
181839
181924
|
start = this.hrtime();
|
|
181840
181925
|
if (this.logger.hasLevel(3 /* verbose */)) {
|
|
181841
|
-
this.logger.info(`request:${
|
|
181926
|
+
this.logger.info(`request:${indent(this.toStringMessage(message))}`);
|
|
181842
181927
|
}
|
|
181843
181928
|
}
|
|
181844
181929
|
let request;
|
|
@@ -182711,7 +182796,7 @@ ${e.message}`;
|
|
|
182711
182796
|
getLocationInNewDocument: () => getLocationInNewDocument,
|
|
182712
182797
|
hasArgument: () => hasArgument,
|
|
182713
182798
|
hasNoTypeScriptSource: () => hasNoTypeScriptSource,
|
|
182714
|
-
indent: () =>
|
|
182799
|
+
indent: () => indent,
|
|
182715
182800
|
isConfigFile: () => isConfigFile,
|
|
182716
182801
|
isConfiguredProject: () => isConfiguredProject,
|
|
182717
182802
|
isDynamicFileName: () => isDynamicFileName,
|
|
@@ -184871,6 +184956,7 @@ ${e.message}`;
|
|
|
184871
184956
|
startEndOverlapsWithStartEnd: () => startEndOverlapsWithStartEnd,
|
|
184872
184957
|
startOnNewLine: () => startOnNewLine,
|
|
184873
184958
|
startTracing: () => startTracing,
|
|
184959
|
+
startWhitespaceCount: () => startWhitespaceCount,
|
|
184874
184960
|
startsWith: () => startsWith,
|
|
184875
184961
|
startsWithDirectory: () => startsWithDirectory,
|
|
184876
184962
|
startsWithUnderscore: () => startsWithUnderscore,
|
|
@@ -185126,7 +185212,7 @@ ${e.message}`;
|
|
|
185126
185212
|
getLocationInNewDocument: () => getLocationInNewDocument,
|
|
185127
185213
|
hasArgument: () => hasArgument,
|
|
185128
185214
|
hasNoTypeScriptSource: () => hasNoTypeScriptSource,
|
|
185129
|
-
indent: () =>
|
|
185215
|
+
indent: () => indent,
|
|
185130
185216
|
isConfigFile: () => isConfigFile,
|
|
185131
185217
|
isConfiguredProject: () => isConfiguredProject,
|
|
185132
185218
|
isDynamicFileName: () => isDynamicFileName,
|
|
@@ -187274,6 +187360,7 @@ ${e.message}`;
|
|
|
187274
187360
|
startEndOverlapsWithStartEnd: () => startEndOverlapsWithStartEnd,
|
|
187275
187361
|
startOnNewLine: () => startOnNewLine,
|
|
187276
187362
|
startTracing: () => startTracing,
|
|
187363
|
+
startWhitespaceCount: () => startWhitespaceCount,
|
|
187277
187364
|
startsWith: () => startsWith,
|
|
187278
187365
|
startsWithDirectory: () => startsWithDirectory,
|
|
187279
187366
|
startsWithUnderscore: () => startsWithUnderscore,
|