@typescript-deploys/pr-build 5.2.0-pr-54718-7 → 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 +247 -184
- package/lib/tsserver.js +287 -208
- package/lib/tsserverlibrary.d.ts +2 -1
- package/lib/tsserverlibrary.js +286 -208
- package/lib/typescript.d.ts +2 -1
- package/lib/typescript.js +277 -200
- package/lib/typingsInstaller.js +48 -43
- package/package.json +2 -2
package/lib/typescript.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.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 indent;
|
|
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(indent) + 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
|
+
indent = 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
|
+
indent++;
|
|
16489
16497
|
},
|
|
16490
16498
|
decreaseIndent: () => {
|
|
16491
|
-
|
|
16499
|
+
indent--;
|
|
16492
16500
|
},
|
|
16493
|
-
getIndent: () =>
|
|
16501
|
+
getIndent: () => indent,
|
|
16494
16502
|
getTextPos: () => output.length,
|
|
16495
16503
|
getLine: () => lineCount,
|
|
16496
|
-
getColumn: () => lineStart ?
|
|
16504
|
+
getColumn: () => lineStart ? indent * 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
|
}
|
|
@@ -31138,7 +31147,7 @@ ${lanes.join("\n")}
|
|
|
31138
31147
|
if (lastError && lastError.code === Diagnostics._0_expected.code) {
|
|
31139
31148
|
addRelatedInfo(
|
|
31140
31149
|
lastError,
|
|
31141
|
-
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, "{", "}")
|
|
31142
31151
|
);
|
|
31143
31152
|
}
|
|
31144
31153
|
}
|
|
@@ -31604,12 +31613,14 @@ ${lanes.join("\n")}
|
|
|
31604
31613
|
return arrowExpression;
|
|
31605
31614
|
}
|
|
31606
31615
|
const pos = getNodePos();
|
|
31616
|
+
const hasJSDoc = hasPrecedingJSDocComment();
|
|
31607
31617
|
const expr = parseBinaryExpressionOrHigher(0 /* Lowest */);
|
|
31608
31618
|
if (expr.kind === 80 /* Identifier */ && token() === 39 /* EqualsGreaterThanToken */) {
|
|
31609
31619
|
return parseSimpleArrowFunctionExpression(
|
|
31610
31620
|
pos,
|
|
31611
31621
|
expr,
|
|
31612
31622
|
allowReturnTypeInArrowFunction,
|
|
31623
|
+
hasJSDoc,
|
|
31613
31624
|
/*asyncModifier*/
|
|
31614
31625
|
void 0
|
|
31615
31626
|
);
|
|
@@ -31655,7 +31666,7 @@ ${lanes.join("\n")}
|
|
|
31655
31666
|
), pos);
|
|
31656
31667
|
}
|
|
31657
31668
|
}
|
|
31658
|
-
function parseSimpleArrowFunctionExpression(pos, identifier, allowReturnTypeInArrowFunction, asyncModifier) {
|
|
31669
|
+
function parseSimpleArrowFunctionExpression(pos, identifier, allowReturnTypeInArrowFunction, hasJSDoc, asyncModifier) {
|
|
31659
31670
|
Debug.assert(token() === 39 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
|
|
31660
31671
|
const parameter = factory2.createParameterDeclaration(
|
|
31661
31672
|
/*modifiers*/
|
|
@@ -31688,7 +31699,7 @@ ${lanes.join("\n")}
|
|
|
31688
31699
|
equalsGreaterThanToken,
|
|
31689
31700
|
body
|
|
31690
31701
|
);
|
|
31691
|
-
return
|
|
31702
|
+
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
31692
31703
|
}
|
|
31693
31704
|
function tryParseParenthesizedArrowFunctionExpression(allowReturnTypeInArrowFunction) {
|
|
31694
31705
|
const triState = isParenthesizedArrowFunctionExpression();
|
|
@@ -31816,9 +31827,10 @@ ${lanes.join("\n")}
|
|
|
31816
31827
|
if (token() === 134 /* AsyncKeyword */) {
|
|
31817
31828
|
if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === 1 /* True */) {
|
|
31818
31829
|
const pos = getNodePos();
|
|
31830
|
+
const hasJSDoc = hasPrecedingJSDocComment();
|
|
31819
31831
|
const asyncModifier = parseModifiersForArrowFunction();
|
|
31820
31832
|
const expr = parseBinaryExpressionOrHigher(0 /* Lowest */);
|
|
31821
|
-
return parseSimpleArrowFunctionExpression(pos, expr, allowReturnTypeInArrowFunction, asyncModifier);
|
|
31833
|
+
return parseSimpleArrowFunctionExpression(pos, expr, allowReturnTypeInArrowFunction, hasJSDoc, asyncModifier);
|
|
31822
31834
|
}
|
|
31823
31835
|
}
|
|
31824
31836
|
return void 0;
|
|
@@ -34239,7 +34251,7 @@ ${lanes.join("\n")}
|
|
|
34239
34251
|
if (lastError && lastError.code === Diagnostics._0_expected.code) {
|
|
34240
34252
|
addRelatedInfo(
|
|
34241
34253
|
lastError,
|
|
34242
|
-
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, "{", "}")
|
|
34243
34255
|
);
|
|
34244
34256
|
}
|
|
34245
34257
|
}
|
|
@@ -34607,20 +34619,20 @@ ${lanes.join("\n")}
|
|
|
34607
34619
|
function doJSDocScan() {
|
|
34608
34620
|
let state = 1 /* SawAsterisk */;
|
|
34609
34621
|
let margin;
|
|
34610
|
-
let
|
|
34622
|
+
let indent = start - (content.lastIndexOf("\n", start) + 1) + 4;
|
|
34611
34623
|
function pushComment(text) {
|
|
34612
34624
|
if (!margin) {
|
|
34613
|
-
margin =
|
|
34625
|
+
margin = indent;
|
|
34614
34626
|
}
|
|
34615
34627
|
comments.push(text);
|
|
34616
|
-
|
|
34628
|
+
indent += text.length;
|
|
34617
34629
|
}
|
|
34618
34630
|
nextTokenJSDoc();
|
|
34619
34631
|
while (parseOptionalJsdoc(5 /* WhitespaceTrivia */))
|
|
34620
34632
|
;
|
|
34621
34633
|
if (parseOptionalJsdoc(4 /* NewLineTrivia */)) {
|
|
34622
34634
|
state = 0 /* BeginningOfLine */;
|
|
34623
|
-
|
|
34635
|
+
indent = 0;
|
|
34624
34636
|
}
|
|
34625
34637
|
loop:
|
|
34626
34638
|
while (true) {
|
|
@@ -34629,14 +34641,14 @@ ${lanes.join("\n")}
|
|
|
34629
34641
|
removeTrailingWhitespace(comments);
|
|
34630
34642
|
if (!commentsPos)
|
|
34631
34643
|
commentsPos = getNodePos();
|
|
34632
|
-
addTag(parseTag(
|
|
34644
|
+
addTag(parseTag(indent));
|
|
34633
34645
|
state = 0 /* BeginningOfLine */;
|
|
34634
34646
|
margin = void 0;
|
|
34635
34647
|
break;
|
|
34636
34648
|
case 4 /* NewLineTrivia */:
|
|
34637
34649
|
comments.push(scanner2.getTokenText());
|
|
34638
34650
|
state = 0 /* BeginningOfLine */;
|
|
34639
|
-
|
|
34651
|
+
indent = 0;
|
|
34640
34652
|
break;
|
|
34641
34653
|
case 42 /* AsteriskToken */:
|
|
34642
34654
|
const asterisk = scanner2.getTokenText();
|
|
@@ -34646,16 +34658,16 @@ ${lanes.join("\n")}
|
|
|
34646
34658
|
} else {
|
|
34647
34659
|
Debug.assert(state === 0 /* BeginningOfLine */);
|
|
34648
34660
|
state = 1 /* SawAsterisk */;
|
|
34649
|
-
|
|
34661
|
+
indent += asterisk.length;
|
|
34650
34662
|
}
|
|
34651
34663
|
break;
|
|
34652
34664
|
case 5 /* WhitespaceTrivia */:
|
|
34653
34665
|
Debug.assert(state !== 2 /* SavingComments */, "whitespace shouldn't come from the scanner while saving top-level comment text");
|
|
34654
34666
|
const whitespace = scanner2.getTokenText();
|
|
34655
|
-
if (margin !== void 0 &&
|
|
34656
|
-
comments.push(whitespace.slice(margin -
|
|
34667
|
+
if (margin !== void 0 && indent + whitespace.length > margin) {
|
|
34668
|
+
comments.push(whitespace.slice(margin - indent));
|
|
34657
34669
|
}
|
|
34658
|
-
|
|
34670
|
+
indent += whitespace.length;
|
|
34659
34671
|
break;
|
|
34660
34672
|
case 1 /* EndOfFileToken */:
|
|
34661
34673
|
break loop;
|
|
@@ -34857,7 +34869,7 @@ ${lanes.join("\n")}
|
|
|
34857
34869
|
}
|
|
34858
34870
|
return parseTagComments(margin, indentText.slice(margin));
|
|
34859
34871
|
}
|
|
34860
|
-
function parseTagComments(
|
|
34872
|
+
function parseTagComments(indent, initialMargin) {
|
|
34861
34873
|
const commentsPos2 = getNodePos();
|
|
34862
34874
|
let comments2 = [];
|
|
34863
34875
|
const parts2 = [];
|
|
@@ -34866,10 +34878,10 @@ ${lanes.join("\n")}
|
|
|
34866
34878
|
let margin;
|
|
34867
34879
|
function pushComment(text) {
|
|
34868
34880
|
if (!margin) {
|
|
34869
|
-
margin =
|
|
34881
|
+
margin = indent;
|
|
34870
34882
|
}
|
|
34871
34883
|
comments2.push(text);
|
|
34872
|
-
|
|
34884
|
+
indent += text.length;
|
|
34873
34885
|
}
|
|
34874
34886
|
if (initialMargin !== void 0) {
|
|
34875
34887
|
if (initialMargin !== "") {
|
|
@@ -34884,7 +34896,7 @@ ${lanes.join("\n")}
|
|
|
34884
34896
|
case 4 /* NewLineTrivia */:
|
|
34885
34897
|
state = 0 /* BeginningOfLine */;
|
|
34886
34898
|
comments2.push(scanner2.getTokenText());
|
|
34887
|
-
|
|
34899
|
+
indent = 0;
|
|
34888
34900
|
break;
|
|
34889
34901
|
case 60 /* AtToken */:
|
|
34890
34902
|
scanner2.resetTokenState(scanner2.getTokenEnd() - 1);
|
|
@@ -34894,11 +34906,11 @@ ${lanes.join("\n")}
|
|
|
34894
34906
|
case 5 /* WhitespaceTrivia */:
|
|
34895
34907
|
Debug.assert(state !== 2 /* SavingComments */ && state !== 3 /* SavingBackticks */, "whitespace shouldn't come from the scanner while saving comment text");
|
|
34896
34908
|
const whitespace = scanner2.getTokenText();
|
|
34897
|
-
if (margin !== void 0 &&
|
|
34898
|
-
comments2.push(whitespace.slice(margin -
|
|
34909
|
+
if (margin !== void 0 && indent + whitespace.length > margin) {
|
|
34910
|
+
comments2.push(whitespace.slice(margin - indent));
|
|
34899
34911
|
state = 2 /* SavingComments */;
|
|
34900
34912
|
}
|
|
34901
|
-
|
|
34913
|
+
indent += whitespace.length;
|
|
34902
34914
|
break;
|
|
34903
34915
|
case 19 /* OpenBraceToken */:
|
|
34904
34916
|
state = 2 /* SavingComments */;
|
|
@@ -34931,7 +34943,7 @@ ${lanes.join("\n")}
|
|
|
34931
34943
|
case 42 /* AsteriskToken */:
|
|
34932
34944
|
if (state === 0 /* BeginningOfLine */) {
|
|
34933
34945
|
state = 1 /* SawAsterisk */;
|
|
34934
|
-
|
|
34946
|
+
indent += 1;
|
|
34935
34947
|
break;
|
|
34936
34948
|
}
|
|
34937
34949
|
default:
|
|
@@ -34996,8 +35008,8 @@ ${lanes.join("\n")}
|
|
|
34996
35008
|
function isJSDocLinkTag(kind) {
|
|
34997
35009
|
return kind === "link" || kind === "linkcode" || kind === "linkplain";
|
|
34998
35010
|
}
|
|
34999
|
-
function parseUnknownTag(start2, tagName,
|
|
35000
|
-
return finishNode(factory2.createJSDocUnknownTag(tagName, parseTrailingTagComments(start2, getNodePos(),
|
|
35011
|
+
function parseUnknownTag(start2, tagName, indent, indentText) {
|
|
35012
|
+
return finishNode(factory2.createJSDocUnknownTag(tagName, parseTrailingTagComments(start2, getNodePos(), indent, indentText)), start2);
|
|
35001
35013
|
}
|
|
35002
35014
|
function addTag(tag) {
|
|
35003
35015
|
if (!tag) {
|
|
@@ -35044,7 +35056,7 @@ ${lanes.join("\n")}
|
|
|
35044
35056
|
return isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && !node.typeArguments;
|
|
35045
35057
|
}
|
|
35046
35058
|
}
|
|
35047
|
-
function parseParameterOrPropertyTag(start2, tagName, target,
|
|
35059
|
+
function parseParameterOrPropertyTag(start2, tagName, target, indent) {
|
|
35048
35060
|
let typeExpression = tryParseTypeExpression();
|
|
35049
35061
|
let isNameFirst = !typeExpression;
|
|
35050
35062
|
skipWhitespaceOrAsterisk();
|
|
@@ -35053,8 +35065,8 @@ ${lanes.join("\n")}
|
|
|
35053
35065
|
if (isNameFirst && !lookAhead(parseJSDocLinkPrefix)) {
|
|
35054
35066
|
typeExpression = tryParseTypeExpression();
|
|
35055
35067
|
}
|
|
35056
|
-
const comment = parseTrailingTagComments(start2, getNodePos(),
|
|
35057
|
-
const nestedTypeLiteral = parseNestedTypeLiteral(typeExpression, name, target,
|
|
35068
|
+
const comment = parseTrailingTagComments(start2, getNodePos(), indent, indentText);
|
|
35069
|
+
const nestedTypeLiteral = parseNestedTypeLiteral(typeExpression, name, target, indent);
|
|
35058
35070
|
if (nestedTypeLiteral) {
|
|
35059
35071
|
typeExpression = nestedTypeLiteral;
|
|
35060
35072
|
isNameFirst = true;
|
|
@@ -35062,12 +35074,12 @@ ${lanes.join("\n")}
|
|
|
35062
35074
|
const result2 = target === 1 /* Property */ ? factory2.createJSDocPropertyTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment) : factory2.createJSDocParameterTag(tagName, name, isBracketed, typeExpression, isNameFirst, comment);
|
|
35063
35075
|
return finishNode(result2, start2);
|
|
35064
35076
|
}
|
|
35065
|
-
function parseNestedTypeLiteral(typeExpression, name, target,
|
|
35077
|
+
function parseNestedTypeLiteral(typeExpression, name, target, indent) {
|
|
35066
35078
|
if (typeExpression && isObjectOrObjectArrayTypeReference(typeExpression.type)) {
|
|
35067
35079
|
const pos = getNodePos();
|
|
35068
35080
|
let child;
|
|
35069
35081
|
let children;
|
|
35070
|
-
while (child = tryParse(() => parseChildParameterOrPropertyTag(target,
|
|
35082
|
+
while (child = tryParse(() => parseChildParameterOrPropertyTag(target, indent, name))) {
|
|
35071
35083
|
if (child.kind === 348 /* JSDocParameterTag */ || child.kind === 355 /* JSDocPropertyTag */) {
|
|
35072
35084
|
children = append(children, child);
|
|
35073
35085
|
} else if (child.kind === 352 /* JSDocTemplateTag */) {
|
|
@@ -35080,14 +35092,14 @@ ${lanes.join("\n")}
|
|
|
35080
35092
|
}
|
|
35081
35093
|
}
|
|
35082
35094
|
}
|
|
35083
|
-
function parseReturnTag(start2, tagName,
|
|
35095
|
+
function parseReturnTag(start2, tagName, indent, indentText) {
|
|
35084
35096
|
if (some(tags, isJSDocReturnTag)) {
|
|
35085
35097
|
parseErrorAt(tagName.pos, scanner2.getTokenStart(), Diagnostics._0_tag_already_specified, unescapeLeadingUnderscores(tagName.escapedText));
|
|
35086
35098
|
}
|
|
35087
35099
|
const typeExpression = tryParseTypeExpression();
|
|
35088
|
-
return finishNode(factory2.createJSDocReturnTag(tagName, typeExpression, parseTrailingTagComments(start2, getNodePos(),
|
|
35100
|
+
return finishNode(factory2.createJSDocReturnTag(tagName, typeExpression, parseTrailingTagComments(start2, getNodePos(), indent, indentText)), start2);
|
|
35089
35101
|
}
|
|
35090
|
-
function parseTypeTag(start2, tagName,
|
|
35102
|
+
function parseTypeTag(start2, tagName, indent, indentText) {
|
|
35091
35103
|
if (some(tags, isJSDocTypeTag)) {
|
|
35092
35104
|
parseErrorAt(tagName.pos, scanner2.getTokenStart(), Diagnostics._0_tag_already_specified, unescapeLeadingUnderscores(tagName.escapedText));
|
|
35093
35105
|
}
|
|
@@ -35095,25 +35107,25 @@ ${lanes.join("\n")}
|
|
|
35095
35107
|
/*mayOmitBraces*/
|
|
35096
35108
|
true
|
|
35097
35109
|
);
|
|
35098
|
-
const comments2 =
|
|
35110
|
+
const comments2 = indent !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), indent, indentText) : void 0;
|
|
35099
35111
|
return finishNode(factory2.createJSDocTypeTag(tagName, typeExpression, comments2), start2);
|
|
35100
35112
|
}
|
|
35101
|
-
function parseSeeTag(start2, tagName,
|
|
35113
|
+
function parseSeeTag(start2, tagName, indent, indentText) {
|
|
35102
35114
|
const isMarkdownOrJSDocLink = token() === 23 /* OpenBracketToken */ || lookAhead(() => nextTokenJSDoc() === 60 /* AtToken */ && tokenIsIdentifierOrKeyword(nextTokenJSDoc()) && isJSDocLinkTag(scanner2.getTokenValue()));
|
|
35103
35115
|
const nameExpression = isMarkdownOrJSDocLink ? void 0 : parseJSDocNameReference();
|
|
35104
|
-
const comments2 =
|
|
35116
|
+
const comments2 = indent !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), indent, indentText) : void 0;
|
|
35105
35117
|
return finishNode(factory2.createJSDocSeeTag(tagName, nameExpression, comments2), start2);
|
|
35106
35118
|
}
|
|
35107
|
-
function parseThrowsTag(start2, tagName,
|
|
35119
|
+
function parseThrowsTag(start2, tagName, indent, indentText) {
|
|
35108
35120
|
const typeExpression = tryParseTypeExpression();
|
|
35109
|
-
const comment = parseTrailingTagComments(start2, getNodePos(),
|
|
35121
|
+
const comment = parseTrailingTagComments(start2, getNodePos(), indent, indentText);
|
|
35110
35122
|
return finishNode(factory2.createJSDocThrowsTag(tagName, typeExpression, comment), start2);
|
|
35111
35123
|
}
|
|
35112
|
-
function parseAuthorTag(start2, tagName,
|
|
35124
|
+
function parseAuthorTag(start2, tagName, indent, indentText) {
|
|
35113
35125
|
const commentStart = getNodePos();
|
|
35114
35126
|
const textOnly = parseAuthorNameAndEmail();
|
|
35115
35127
|
let commentEnd = scanner2.getTokenFullStart();
|
|
35116
|
-
const comments2 = parseTrailingTagComments(start2, commentEnd,
|
|
35128
|
+
const comments2 = parseTrailingTagComments(start2, commentEnd, indent, indentText);
|
|
35117
35129
|
if (!comments2) {
|
|
35118
35130
|
commentEnd = scanner2.getTokenFullStart();
|
|
35119
35131
|
}
|
|
@@ -35197,19 +35209,19 @@ ${lanes.join("\n")}
|
|
|
35197
35209
|
skipWhitespace();
|
|
35198
35210
|
return finishNode(factory2.createJSDocEnumTag(tagName, typeExpression, parseTrailingTagComments(start2, getNodePos(), margin, indentText)), start2);
|
|
35199
35211
|
}
|
|
35200
|
-
function parseTypedefTag(start2, tagName,
|
|
35212
|
+
function parseTypedefTag(start2, tagName, indent, indentText) {
|
|
35201
35213
|
let typeExpression = tryParseTypeExpression();
|
|
35202
35214
|
skipWhitespaceOrAsterisk();
|
|
35203
35215
|
const fullName = parseJSDocTypeNameWithNamespace();
|
|
35204
35216
|
skipWhitespace();
|
|
35205
|
-
let comment = parseTagComments(
|
|
35217
|
+
let comment = parseTagComments(indent);
|
|
35206
35218
|
let end2;
|
|
35207
35219
|
if (!typeExpression || isObjectOrObjectArrayTypeReference(typeExpression.type)) {
|
|
35208
35220
|
let child;
|
|
35209
35221
|
let childTypeTag;
|
|
35210
35222
|
let jsDocPropertyTags;
|
|
35211
35223
|
let hasChildren = false;
|
|
35212
|
-
while (child = tryParse(() => parseChildPropertyTag(
|
|
35224
|
+
while (child = tryParse(() => parseChildPropertyTag(indent))) {
|
|
35213
35225
|
if (child.kind === 352 /* JSDocTemplateTag */) {
|
|
35214
35226
|
break;
|
|
35215
35227
|
}
|
|
@@ -35218,7 +35230,7 @@ ${lanes.join("\n")}
|
|
|
35218
35230
|
if (childTypeTag) {
|
|
35219
35231
|
const lastError = parseErrorAtCurrentToken(Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);
|
|
35220
35232
|
if (lastError) {
|
|
35221
|
-
addRelatedInfo(lastError, createDetachedDiagnostic(fileName, 0, 0, Diagnostics.
|
|
35233
|
+
addRelatedInfo(lastError, createDetachedDiagnostic(fileName, 0, 0, Diagnostics.The_tag_was_first_specified_here_Colon));
|
|
35222
35234
|
}
|
|
35223
35235
|
break;
|
|
35224
35236
|
} else {
|
|
@@ -35237,7 +35249,7 @@ ${lanes.join("\n")}
|
|
|
35237
35249
|
}
|
|
35238
35250
|
end2 = end2 || comment !== void 0 ? getNodePos() : (fullName ?? typeExpression ?? tagName).end;
|
|
35239
35251
|
if (!comment) {
|
|
35240
|
-
comment = parseTrailingTagComments(start2, end2,
|
|
35252
|
+
comment = parseTrailingTagComments(start2, end2, indent, indentText);
|
|
35241
35253
|
}
|
|
35242
35254
|
const typedefTag = factory2.createJSDocTypedefTag(tagName, typeExpression, fullName, comment);
|
|
35243
35255
|
return finishNode(typedefTag, start2, end2);
|
|
@@ -35267,11 +35279,11 @@ ${lanes.join("\n")}
|
|
|
35267
35279
|
}
|
|
35268
35280
|
return typeNameOrNamespaceName;
|
|
35269
35281
|
}
|
|
35270
|
-
function parseCallbackTagParameters(
|
|
35282
|
+
function parseCallbackTagParameters(indent) {
|
|
35271
35283
|
const pos = getNodePos();
|
|
35272
35284
|
let child;
|
|
35273
35285
|
let parameters;
|
|
35274
|
-
while (child = tryParse(() => parseChildParameterOrPropertyTag(4 /* CallbackParameter */,
|
|
35286
|
+
while (child = tryParse(() => parseChildParameterOrPropertyTag(4 /* CallbackParameter */, indent))) {
|
|
35275
35287
|
if (child.kind === 352 /* JSDocTemplateTag */) {
|
|
35276
35288
|
parseErrorAtRange(child.tagName, Diagnostics.A_JSDoc_template_tag_may_not_follow_a_typedef_callback_or_overload_tag);
|
|
35277
35289
|
break;
|
|
@@ -35280,11 +35292,11 @@ ${lanes.join("\n")}
|
|
|
35280
35292
|
}
|
|
35281
35293
|
return createNodeArray(parameters || [], pos);
|
|
35282
35294
|
}
|
|
35283
|
-
function parseJSDocSignature(start2,
|
|
35284
|
-
const parameters = parseCallbackTagParameters(
|
|
35295
|
+
function parseJSDocSignature(start2, indent) {
|
|
35296
|
+
const parameters = parseCallbackTagParameters(indent);
|
|
35285
35297
|
const returnTag = tryParse(() => {
|
|
35286
35298
|
if (parseOptionalJsdoc(60 /* AtToken */)) {
|
|
35287
|
-
const tag = parseTag(
|
|
35299
|
+
const tag = parseTag(indent);
|
|
35288
35300
|
if (tag && tag.kind === 349 /* JSDocReturnTag */) {
|
|
35289
35301
|
return tag;
|
|
35290
35302
|
}
|
|
@@ -35297,23 +35309,23 @@ ${lanes.join("\n")}
|
|
|
35297
35309
|
returnTag
|
|
35298
35310
|
), start2);
|
|
35299
35311
|
}
|
|
35300
|
-
function parseCallbackTag(start2, tagName,
|
|
35312
|
+
function parseCallbackTag(start2, tagName, indent, indentText) {
|
|
35301
35313
|
const fullName = parseJSDocTypeNameWithNamespace();
|
|
35302
35314
|
skipWhitespace();
|
|
35303
|
-
let comment = parseTagComments(
|
|
35304
|
-
const typeExpression = parseJSDocSignature(start2,
|
|
35315
|
+
let comment = parseTagComments(indent);
|
|
35316
|
+
const typeExpression = parseJSDocSignature(start2, indent);
|
|
35305
35317
|
if (!comment) {
|
|
35306
|
-
comment = parseTrailingTagComments(start2, getNodePos(),
|
|
35318
|
+
comment = parseTrailingTagComments(start2, getNodePos(), indent, indentText);
|
|
35307
35319
|
}
|
|
35308
35320
|
const end2 = comment !== void 0 ? getNodePos() : typeExpression.end;
|
|
35309
35321
|
return finishNode(factory2.createJSDocCallbackTag(tagName, typeExpression, fullName, comment), start2, end2);
|
|
35310
35322
|
}
|
|
35311
|
-
function parseOverloadTag(start2, tagName,
|
|
35323
|
+
function parseOverloadTag(start2, tagName, indent, indentText) {
|
|
35312
35324
|
skipWhitespace();
|
|
35313
|
-
let comment = parseTagComments(
|
|
35314
|
-
const typeExpression = parseJSDocSignature(start2,
|
|
35325
|
+
let comment = parseTagComments(indent);
|
|
35326
|
+
const typeExpression = parseJSDocSignature(start2, indent);
|
|
35315
35327
|
if (!comment) {
|
|
35316
|
-
comment = parseTrailingTagComments(start2, getNodePos(),
|
|
35328
|
+
comment = parseTrailingTagComments(start2, getNodePos(), indent, indentText);
|
|
35317
35329
|
}
|
|
35318
35330
|
const end2 = comment !== void 0 ? getNodePos() : typeExpression.end;
|
|
35319
35331
|
return finishNode(factory2.createJSDocOverloadTag(tagName, typeExpression, comment), start2, end2);
|
|
@@ -35329,17 +35341,17 @@ ${lanes.join("\n")}
|
|
|
35329
35341
|
}
|
|
35330
35342
|
return a.escapedText === b.escapedText;
|
|
35331
35343
|
}
|
|
35332
|
-
function parseChildPropertyTag(
|
|
35333
|
-
return parseChildParameterOrPropertyTag(1 /* Property */,
|
|
35344
|
+
function parseChildPropertyTag(indent) {
|
|
35345
|
+
return parseChildParameterOrPropertyTag(1 /* Property */, indent);
|
|
35334
35346
|
}
|
|
35335
|
-
function parseChildParameterOrPropertyTag(target,
|
|
35347
|
+
function parseChildParameterOrPropertyTag(target, indent, name) {
|
|
35336
35348
|
let canParseTag = true;
|
|
35337
35349
|
let seenAsterisk = false;
|
|
35338
35350
|
while (true) {
|
|
35339
35351
|
switch (nextTokenJSDoc()) {
|
|
35340
35352
|
case 60 /* AtToken */:
|
|
35341
35353
|
if (canParseTag) {
|
|
35342
|
-
const child = tryParseChildTag(target,
|
|
35354
|
+
const child = tryParseChildTag(target, indent);
|
|
35343
35355
|
if (child && (child.kind === 348 /* JSDocParameterTag */ || child.kind === 355 /* JSDocPropertyTag */) && name && (isIdentifier(child.name) || !escapedTextsEqual(name, child.name.left))) {
|
|
35344
35356
|
return false;
|
|
35345
35357
|
}
|
|
@@ -35365,7 +35377,7 @@ ${lanes.join("\n")}
|
|
|
35365
35377
|
}
|
|
35366
35378
|
}
|
|
35367
35379
|
}
|
|
35368
|
-
function tryParseChildTag(target,
|
|
35380
|
+
function tryParseChildTag(target, indent) {
|
|
35369
35381
|
Debug.assert(token() === 60 /* AtToken */);
|
|
35370
35382
|
const start2 = scanner2.getTokenFullStart();
|
|
35371
35383
|
nextTokenJSDoc();
|
|
@@ -35385,14 +35397,14 @@ ${lanes.join("\n")}
|
|
|
35385
35397
|
t = 2 /* Parameter */ | 4 /* CallbackParameter */;
|
|
35386
35398
|
break;
|
|
35387
35399
|
case "template":
|
|
35388
|
-
return parseTemplateTag(start2, tagName,
|
|
35400
|
+
return parseTemplateTag(start2, tagName, indent, indentText);
|
|
35389
35401
|
default:
|
|
35390
35402
|
return false;
|
|
35391
35403
|
}
|
|
35392
35404
|
if (!(target & t)) {
|
|
35393
35405
|
return false;
|
|
35394
35406
|
}
|
|
35395
|
-
return parseParameterOrPropertyTag(start2, tagName, target,
|
|
35407
|
+
return parseParameterOrPropertyTag(start2, tagName, target, indent);
|
|
35396
35408
|
}
|
|
35397
35409
|
function parseTemplateTagTypeParameter() {
|
|
35398
35410
|
const typeParameterPos = getNodePos();
|
|
@@ -35433,10 +35445,10 @@ ${lanes.join("\n")}
|
|
|
35433
35445
|
} while (parseOptionalJsdoc(28 /* CommaToken */));
|
|
35434
35446
|
return createNodeArray(typeParameters, pos);
|
|
35435
35447
|
}
|
|
35436
|
-
function parseTemplateTag(start2, tagName,
|
|
35448
|
+
function parseTemplateTag(start2, tagName, indent, indentText) {
|
|
35437
35449
|
const constraint = token() === 19 /* OpenBraceToken */ ? parseJSDocTypeExpression() : void 0;
|
|
35438
35450
|
const typeParameters = parseTemplateTagTypeParameters();
|
|
35439
|
-
return finishNode(factory2.createJSDocTemplateTag(tagName, constraint, typeParameters, parseTrailingTagComments(start2, getNodePos(),
|
|
35451
|
+
return finishNode(factory2.createJSDocTemplateTag(tagName, constraint, typeParameters, parseTrailingTagComments(start2, getNodePos(), indent, indentText)), start2);
|
|
35440
35452
|
}
|
|
35441
35453
|
function parseOptionalJsdoc(t) {
|
|
35442
35454
|
if (token() === t) {
|
|
@@ -41947,10 +41959,10 @@ ${lanes.join("\n")}
|
|
|
41947
41959
|
const decl = getNameOfDeclaration(declaration) || declaration;
|
|
41948
41960
|
const diag3 = messageNeedsName ? createDiagnosticForNode2(decl, message, getDisplayName(declaration)) : createDiagnosticForNode2(decl, message);
|
|
41949
41961
|
file.bindDiagnostics.push(
|
|
41950
|
-
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
|
|
41951
41963
|
);
|
|
41952
41964
|
if (multipleDefaultExports) {
|
|
41953
|
-
relatedInformation.push(createDiagnosticForNode2(decl, Diagnostics.
|
|
41965
|
+
relatedInformation.push(createDiagnosticForNode2(decl, Diagnostics.The_first_export_default_is_here_Colon));
|
|
41954
41966
|
}
|
|
41955
41967
|
});
|
|
41956
41968
|
const diag2 = messageNeedsName ? createDiagnosticForNode2(declarationName, message, getDisplayName(node)) : createDiagnosticForNode2(declarationName, message);
|
|
@@ -46455,7 +46467,7 @@ ${lanes.join("\n")}
|
|
|
46455
46467
|
if (deprecatedTag) {
|
|
46456
46468
|
addRelatedInfo(
|
|
46457
46469
|
diagnostic,
|
|
46458
|
-
createDiagnosticForNode(deprecatedTag, Diagnostics.
|
|
46470
|
+
createDiagnosticForNode(deprecatedTag, Diagnostics.The_declaration_was_marked_as_deprecated_here_Colon)
|
|
46459
46471
|
);
|
|
46460
46472
|
}
|
|
46461
46473
|
suggestionDiagnostics.add(diagnostic);
|
|
@@ -46650,8 +46662,8 @@ ${lanes.join("\n")}
|
|
|
46650
46662
|
if (adjustedNode === errorNode)
|
|
46651
46663
|
continue;
|
|
46652
46664
|
err.relatedInformation = err.relatedInformation || [];
|
|
46653
|
-
const leadingMessage = createDiagnosticForNode(adjustedNode, Diagnostics.
|
|
46654
|
-
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);
|
|
46655
46667
|
if (length(err.relatedInformation) >= 5 || some(err.relatedInformation, (r) => compareDiagnostics(r, followOnMessage) === 0 /* EqualTo */ || compareDiagnostics(r, leadingMessage) === 0 /* EqualTo */))
|
|
46656
46668
|
continue;
|
|
46657
46669
|
addRelatedInfo(err, !length(err.relatedInformation) ? leadingMessage : followOnMessage);
|
|
@@ -47262,7 +47274,7 @@ ${lanes.join("\n")}
|
|
|
47262
47274
|
if (suggestion.valueDeclaration) {
|
|
47263
47275
|
addRelatedInfo(
|
|
47264
47276
|
diagnostic,
|
|
47265
|
-
createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics.
|
|
47277
|
+
createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics._0_is_declared_here_Colon, suggestionName)
|
|
47266
47278
|
);
|
|
47267
47279
|
}
|
|
47268
47280
|
}
|
|
@@ -47324,7 +47336,7 @@ ${lanes.join("\n")}
|
|
|
47324
47336
|
diagnostic,
|
|
47325
47337
|
createDiagnosticForNode(
|
|
47326
47338
|
typeOnlyDeclaration,
|
|
47327
|
-
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,
|
|
47328
47340
|
unescapedName
|
|
47329
47341
|
)
|
|
47330
47342
|
);
|
|
@@ -47461,7 +47473,7 @@ ${lanes.join("\n")}
|
|
|
47461
47473
|
return true;
|
|
47462
47474
|
}
|
|
47463
47475
|
}
|
|
47464
|
-
error2(errorLocation, Diagnostics.
|
|
47476
|
+
error2(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here_Colon, unescapeLeadingUnderscores(name));
|
|
47465
47477
|
return true;
|
|
47466
47478
|
}
|
|
47467
47479
|
}
|
|
@@ -47503,7 +47515,7 @@ ${lanes.join("\n")}
|
|
|
47503
47515
|
if (isExtendedByInterface(errorLocation)) {
|
|
47504
47516
|
error2(errorLocation, Diagnostics.An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_classes, unescapeLeadingUnderscores(name));
|
|
47505
47517
|
} else {
|
|
47506
|
-
error2(errorLocation, Diagnostics.
|
|
47518
|
+
error2(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Colon, unescapeLeadingUnderscores(name));
|
|
47507
47519
|
}
|
|
47508
47520
|
return true;
|
|
47509
47521
|
}
|
|
@@ -47526,7 +47538,7 @@ ${lanes.join("\n")}
|
|
|
47526
47538
|
} else if (maybeMappedType(errorLocation, symbol)) {
|
|
47527
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");
|
|
47528
47540
|
} else {
|
|
47529
|
-
error2(errorLocation, Diagnostics.
|
|
47541
|
+
error2(errorLocation, Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Colon, rawName);
|
|
47530
47542
|
}
|
|
47531
47543
|
return true;
|
|
47532
47544
|
}
|
|
@@ -47632,7 +47644,7 @@ ${lanes.join("\n")}
|
|
|
47632
47644
|
if (diagnosticMessage) {
|
|
47633
47645
|
addRelatedInfo(
|
|
47634
47646
|
diagnosticMessage,
|
|
47635
|
-
createDiagnosticForNode(declaration, Diagnostics.
|
|
47647
|
+
createDiagnosticForNode(declaration, Diagnostics._0_is_declared_here_Colon, declarationName)
|
|
47636
47648
|
);
|
|
47637
47649
|
}
|
|
47638
47650
|
}
|
|
@@ -47700,7 +47712,7 @@ ${lanes.join("\n")}
|
|
|
47700
47712
|
const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(getSymbolOfDeclaration(node));
|
|
47701
47713
|
const isExport = typeOnlyDeclaration.kind === 281 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 278 /* ExportDeclaration */;
|
|
47702
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;
|
|
47703
|
-
const relatedMessage = isExport ? Diagnostics.
|
|
47715
|
+
const relatedMessage = isExport ? Diagnostics._0_was_exported_here_Colon : Diagnostics._0_was_imported_here_Colon;
|
|
47704
47716
|
const name = typeOnlyDeclaration.kind === 278 /* ExportDeclaration */ ? "*" : unescapeLeadingUnderscores(typeOnlyDeclaration.name.escapedText);
|
|
47705
47717
|
addRelatedInfo(error2(node.moduleReference, message), createDiagnosticForNode(typeOnlyDeclaration, relatedMessage, name));
|
|
47706
47718
|
}
|
|
@@ -48022,7 +48034,7 @@ ${lanes.join("\n")}
|
|
|
48022
48034
|
if (suggestion.valueDeclaration) {
|
|
48023
48035
|
addRelatedInfo(
|
|
48024
48036
|
diagnostic,
|
|
48025
|
-
createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics.
|
|
48037
|
+
createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics._0_is_declared_here_Colon, suggestionName)
|
|
48026
48038
|
);
|
|
48027
48039
|
}
|
|
48028
48040
|
} else {
|
|
@@ -48052,7 +48064,7 @@ ${lanes.join("\n")}
|
|
|
48052
48064
|
if (localSymbol.declarations) {
|
|
48053
48065
|
addRelatedInfo(
|
|
48054
48066
|
diagnostic,
|
|
48055
|
-
...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))
|
|
48056
48068
|
);
|
|
48057
48069
|
}
|
|
48058
48070
|
}
|
|
@@ -54097,11 +54109,11 @@ ${lanes.join("\n")}
|
|
|
54097
54109
|
const exportedMemberName = ((_a = tryCast(exportedMember.valueDeclaration, isNamedDeclaration)) == null ? void 0 : _a.name) || exportedMember.valueDeclaration;
|
|
54098
54110
|
addRelatedInfo(
|
|
54099
54111
|
error2(s.valueDeclaration, Diagnostics.Duplicate_identifier_0, unescapedName),
|
|
54100
|
-
createDiagnosticForNode(exportedMemberName, Diagnostics.
|
|
54112
|
+
createDiagnosticForNode(exportedMemberName, Diagnostics._0_was_also_declared_here_Colon, unescapedName)
|
|
54101
54113
|
);
|
|
54102
54114
|
addRelatedInfo(
|
|
54103
54115
|
error2(exportedMemberName, Diagnostics.Duplicate_identifier_0, unescapedName),
|
|
54104
|
-
createDiagnosticForNode(s.valueDeclaration, Diagnostics.
|
|
54116
|
+
createDiagnosticForNode(s.valueDeclaration, Diagnostics._0_was_also_declared_here_Colon, unescapedName)
|
|
54105
54117
|
);
|
|
54106
54118
|
}
|
|
54107
54119
|
const union = createSymbol(s.flags | exportedMember.flags, name);
|
|
@@ -55336,7 +55348,7 @@ ${lanes.join("\n")}
|
|
|
55336
55348
|
if (lateSymbol.flags & getExcludedSymbolFlags(symbolFlags) || earlySymbol) {
|
|
55337
55349
|
const declarations = earlySymbol ? concatenate(earlySymbol.declarations, lateSymbol.declarations) : lateSymbol.declarations;
|
|
55338
55350
|
const name = !(type.flags & 8192 /* UniqueESSymbol */) && unescapeLeadingUnderscores(memberName) || declarationNameToString(declName);
|
|
55339
|
-
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));
|
|
55340
55352
|
error2(declName || decl, Diagnostics.Duplicate_property_0, name);
|
|
55341
55353
|
lateSymbol = createSymbol(0 /* None */, memberName, 4096 /* Late */);
|
|
55342
55354
|
}
|
|
@@ -57701,7 +57713,7 @@ ${lanes.join("\n")}
|
|
|
57701
57713
|
return ((_a = type.target.localTypeParameters) == null ? void 0 : _a.map(() => errorType)) || emptyArray;
|
|
57702
57714
|
}
|
|
57703
57715
|
const node = type.node;
|
|
57704
|
-
const typeArguments = !node ? emptyArray : node.kind === 183 /* TypeReference */ ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments2(node, type.target.localTypeParameters)) : node.kind === 188 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements,
|
|
57716
|
+
const typeArguments = !node ? emptyArray : node.kind === 183 /* TypeReference */ ? concatenate(type.target.outerTypeParameters, getEffectiveTypeArguments2(node, type.target.localTypeParameters)) : node.kind === 188 /* ArrayType */ ? [getTypeFromTypeNode(node.elementType)] : map(node.elements, getTypeFromTypeNode);
|
|
57705
57717
|
if (popTypeResolution()) {
|
|
57706
57718
|
type.resolvedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments;
|
|
57707
57719
|
} else {
|
|
@@ -60248,7 +60260,7 @@ ${lanes.join("\n")}
|
|
|
60248
60260
|
if (moduleSymbol.flags & targetMeaning) {
|
|
60249
60261
|
links.resolvedType = resolveImportSymbolType(node, links, moduleSymbol, targetMeaning);
|
|
60250
60262
|
} else {
|
|
60251
|
-
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;
|
|
60252
60264
|
error2(node, errorMessage, node.argument.literal.text);
|
|
60253
60265
|
links.resolvedSymbol = unknownSymbol;
|
|
60254
60266
|
links.resolvedType = errorType;
|
|
@@ -64009,7 +64021,7 @@ ${lanes.join("\n")}
|
|
|
64009
64021
|
);
|
|
64010
64022
|
reportError(Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName, ...getTypeNamesForErrorDisplay(source2, target2));
|
|
64011
64023
|
if (length(unmatchedProperty.declarations)) {
|
|
64012
|
-
associateRelatedInfo(createDiagnosticForNode(unmatchedProperty.declarations[0], Diagnostics.
|
|
64024
|
+
associateRelatedInfo(createDiagnosticForNode(unmatchedProperty.declarations[0], Diagnostics._0_is_declared_here_Colon, propName));
|
|
64013
64025
|
}
|
|
64014
64026
|
if (shouldSkipElaboration && errorInfo) {
|
|
64015
64027
|
overrideNextErrorInfo++;
|
|
@@ -71784,7 +71796,7 @@ ${lanes.join("\n")}
|
|
|
71784
71796
|
if (diagnosticMessage) {
|
|
71785
71797
|
addRelatedInfo(
|
|
71786
71798
|
diagnosticMessage,
|
|
71787
|
-
createDiagnosticForNode(valueDeclaration, Diagnostics.
|
|
71799
|
+
createDiagnosticForNode(valueDeclaration, Diagnostics._0_is_declared_here_Colon, declarationName)
|
|
71788
71800
|
);
|
|
71789
71801
|
}
|
|
71790
71802
|
}
|
|
@@ -71871,7 +71883,7 @@ ${lanes.join("\n")}
|
|
|
71871
71883
|
const suggestedName = symbolName(suggestion);
|
|
71872
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;
|
|
71873
71885
|
errorInfo = chainDiagnosticMessages(errorInfo, message, missingProperty, container, suggestedName);
|
|
71874
|
-
relatedInfo = suggestion.valueDeclaration && createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics.
|
|
71886
|
+
relatedInfo = suggestion.valueDeclaration && createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics._0_is_declared_here_Colon, suggestedName);
|
|
71875
71887
|
} else {
|
|
71876
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;
|
|
71877
71889
|
errorInfo = chainDiagnosticMessages(elaborateNeverIntersection(errorInfo, containingType), diagnostic, missingProperty, container);
|
|
@@ -72588,7 +72600,7 @@ ${lanes.join("\n")}
|
|
|
72588
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);
|
|
72589
72601
|
const tagNameDeclaration = (_a = getSymbolAtLocation(node.tagName)) == null ? void 0 : _a.valueDeclaration;
|
|
72590
72602
|
if (tagNameDeclaration) {
|
|
72591
|
-
addRelatedInfo(diag2, createDiagnosticForNode(tagNameDeclaration, Diagnostics.
|
|
72603
|
+
addRelatedInfo(diag2, createDiagnosticForNode(tagNameDeclaration, Diagnostics._0_is_declared_here_Colon, entityNameToString(node.tagName)));
|
|
72592
72604
|
}
|
|
72593
72605
|
if (errorOutputContainer && errorOutputContainer.skipLogging) {
|
|
72594
72606
|
(errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag2);
|
|
@@ -73040,7 +73052,7 @@ ${lanes.join("\n")}
|
|
|
73040
73052
|
if (diags) {
|
|
73041
73053
|
for (const d of diags) {
|
|
73042
73054
|
if (last2.declaration && candidatesForArgumentError.length > 3) {
|
|
73043
|
-
addRelatedInfo(d, createDiagnosticForNode(last2.declaration, Diagnostics.
|
|
73055
|
+
addRelatedInfo(d, createDiagnosticForNode(last2.declaration, Diagnostics.The_last_overload_is_declared_here_Colon));
|
|
73044
73056
|
}
|
|
73045
73057
|
addImplementationSuccessElaboration(last2, d);
|
|
73046
73058
|
diagnostics.add(d);
|
|
@@ -78180,7 +78192,7 @@ ${lanes.join("\n")}
|
|
|
78180
78192
|
const errorNode = signature.declaration && isJSDocSignature(signature.declaration) ? signature.declaration.parent.tagName : signature.declaration;
|
|
78181
78193
|
addRelatedInfo(
|
|
78182
78194
|
error2(errorNode, Diagnostics.This_overload_signature_is_not_compatible_with_its_implementation_signature),
|
|
78183
|
-
createDiagnosticForNode(bodyDeclaration, Diagnostics.
|
|
78195
|
+
createDiagnosticForNode(bodyDeclaration, Diagnostics.The_implementation_signature_is_declared_here_Colon)
|
|
78184
78196
|
);
|
|
78185
78197
|
break;
|
|
78186
78198
|
}
|
|
@@ -78646,7 +78658,7 @@ ${lanes.join("\n")}
|
|
|
78646
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);
|
|
78647
78659
|
const aliasDeclaration = find(rootSymbol.declarations || emptyArray, isAliasSymbolDeclaration2);
|
|
78648
78660
|
if (aliasDeclaration) {
|
|
78649
|
-
addRelatedInfo(diag2, createDiagnosticForNode(aliasDeclaration, Diagnostics.
|
|
78661
|
+
addRelatedInfo(diag2, createDiagnosticForNode(aliasDeclaration, Diagnostics._0_was_imported_here_Colon, idText(rootName)));
|
|
78650
78662
|
}
|
|
78651
78663
|
}
|
|
78652
78664
|
}
|
|
@@ -79590,7 +79602,7 @@ ${lanes.join("\n")}
|
|
|
79590
79602
|
if (firstDeclaration) {
|
|
79591
79603
|
addRelatedInfo(
|
|
79592
79604
|
err,
|
|
79593
|
-
createDiagnosticForNode(firstDeclaration, Diagnostics.
|
|
79605
|
+
createDiagnosticForNode(firstDeclaration, Diagnostics._0_was_also_declared_here_Colon, declName)
|
|
79594
79606
|
);
|
|
79595
79607
|
}
|
|
79596
79608
|
}
|
|
@@ -80700,7 +80712,7 @@ ${lanes.join("\n")}
|
|
|
80700
80712
|
typeToString(info.type)
|
|
80701
80713
|
);
|
|
80702
80714
|
if (propDeclaration && errorNode !== propDeclaration) {
|
|
80703
|
-
addRelatedInfo(diagnostic, createDiagnosticForNode(propDeclaration, Diagnostics.
|
|
80715
|
+
addRelatedInfo(diagnostic, createDiagnosticForNode(propDeclaration, Diagnostics._0_is_declared_here_Colon, symbolToString(prop)));
|
|
80704
80716
|
}
|
|
80705
80717
|
diagnostics.add(diagnostic);
|
|
80706
80718
|
}
|
|
@@ -85035,7 +85047,7 @@ ${lanes.join("\n")}
|
|
|
85035
85047
|
createDiagnosticForNode(useStrictDirective, Diagnostics.use_strict_directive_used_here)
|
|
85036
85048
|
);
|
|
85037
85049
|
});
|
|
85038
|
-
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));
|
|
85039
85051
|
addRelatedInfo(error2(useStrictDirective, Diagnostics.use_strict_directive_cannot_be_used_with_non_simple_parameter_list), ...diagnostics2);
|
|
85040
85052
|
return true;
|
|
85041
85053
|
}
|
|
@@ -117719,39 +117731,49 @@ ${lanes.join("\n")}
|
|
|
117719
117731
|
function formatColorAndReset(text, formatStyle) {
|
|
117720
117732
|
return formatStyle + text + resetEscapeSequence;
|
|
117721
117733
|
}
|
|
117722
|
-
function formatCodeSpan(file, start, length2,
|
|
117734
|
+
function formatCodeSpan(file, start, length2, indent, underlineColor, host) {
|
|
117723
117735
|
const { line: firstLine, character: firstLineChar } = getLineAndCharacterOfPosition(file, start);
|
|
117724
117736
|
const { line: lastLine, character: lastLineChar } = getLineAndCharacterOfPosition(file, start + length2);
|
|
117725
117737
|
const lastLineInFile = getLineAndCharacterOfPosition(file, file.text.length).line;
|
|
117738
|
+
const gutterWidth = 1;
|
|
117726
117739
|
const hasMoreThanFiveLines = lastLine - firstLine >= 4;
|
|
117727
|
-
let
|
|
117728
|
-
|
|
117729
|
-
|
|
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));
|
|
117730
117749
|
}
|
|
117731
117750
|
let context = "";
|
|
117732
117751
|
for (let i = firstLine; i <= lastLine; i++) {
|
|
117733
117752
|
context += host.getNewLine();
|
|
117734
117753
|
if (hasMoreThanFiveLines && firstLine + 1 < i && i < lastLine - 1) {
|
|
117735
|
-
context +=
|
|
117754
|
+
context += indent + formatColorAndReset(padLeft(ellipsis, gutterWidth), gutterStyleSequence) + gutterSeparator + host.getNewLine();
|
|
117736
117755
|
i = lastLine - 1;
|
|
117737
117756
|
}
|
|
117738
117757
|
const lineStart = getPositionOfLineAndCharacter(file, i, 0);
|
|
117739
117758
|
const lineEnd = i < lastLineInFile ? getPositionOfLineAndCharacter(file, i + 1, 0) : file.text.length;
|
|
117740
117759
|
let lineContent = file.text.slice(lineStart, lineEnd);
|
|
117760
|
+
lineContent = lineContent.slice(whitespaceToTrim);
|
|
117741
117761
|
lineContent = trimStringEnd(lineContent);
|
|
117742
117762
|
lineContent = lineContent.replace(/\t/g, " ");
|
|
117743
|
-
|
|
117763
|
+
const gutterLine = "|";
|
|
117764
|
+
context += indent + padLeft(gutterLine, gutterWidth) + gutterSeparator;
|
|
117744
117765
|
context += lineContent + host.getNewLine();
|
|
117745
|
-
context +=
|
|
117746
|
-
context +=
|
|
117766
|
+
context += indent + padLeft("", gutterWidth) + gutterSeparator;
|
|
117767
|
+
context += underlineColor;
|
|
117747
117768
|
if (i === firstLine) {
|
|
117748
117769
|
const lastCharForLine = i === lastLine ? lastLineChar : void 0;
|
|
117749
|
-
context += lineContent.slice(0, firstLineChar).replace(/\S/g, " ");
|
|
117750
|
-
|
|
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");
|
|
117751
117773
|
} else if (i === lastLine) {
|
|
117752
|
-
context += lineContent.slice(0, lastLineChar).replace(/./g, "
|
|
117774
|
+
context += lineContent.slice(0, lastLineChar).replace(/./g, "\u2594");
|
|
117753
117775
|
} else {
|
|
117754
|
-
context += lineContent.replace(/./g, "
|
|
117776
|
+
context += lineContent.replace(/./g, "\u2594");
|
|
117755
117777
|
}
|
|
117756
117778
|
context += resetEscapeSequence;
|
|
117757
117779
|
}
|
|
@@ -117769,54 +117791,87 @@ ${lanes.join("\n")}
|
|
|
117769
117791
|
return output;
|
|
117770
117792
|
}
|
|
117771
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 indent = terminalWidth < 60 ? "" : halfIndent;
|
|
117772
117797
|
let output = "";
|
|
117773
117798
|
for (const diagnostic of diagnostics) {
|
|
117774
|
-
|
|
117775
|
-
|
|
117776
|
-
|
|
117777
|
-
|
|
117778
|
-
|
|
117779
|
-
|
|
117780
|
-
|
|
117781
|
-
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));
|
|
117782
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, indent, getCategoryFormat(diagnostic.category), host);
|
|
117783
117819
|
output += host.getNewLine();
|
|
117784
|
-
|
|
117820
|
+
} else {
|
|
117821
|
+
output += formatColorAndReset(bullet, getCategoryFormat(diagnostic.category)) + " " + diagnosticCatNameColored + " " + diagnosticCode;
|
|
117785
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) => indent + text).join(host.getNewLine());
|
|
117831
|
+
output += diagnosticText;
|
|
117832
|
+
output += host.getNewLine();
|
|
117786
117833
|
if (diagnostic.relatedInformation) {
|
|
117787
117834
|
output += host.getNewLine();
|
|
117788
117835
|
for (const { file, start, length: length2, messageText } of diagnostic.relatedInformation) {
|
|
117836
|
+
output += indent + trimStringStart(flattenDiagnosticMessageText(
|
|
117837
|
+
messageText,
|
|
117838
|
+
host.getNewLine(),
|
|
117839
|
+
0,
|
|
117840
|
+
/*pretty*/
|
|
117841
|
+
true
|
|
117842
|
+
));
|
|
117789
117843
|
if (file) {
|
|
117844
|
+
output += " " + formatLocation(file, start, host);
|
|
117790
117845
|
output += host.getNewLine();
|
|
117791
|
-
output +=
|
|
117792
|
-
output += formatCodeSpan(file, start, length2, indent, "\x1B[96m" /* Cyan */, host);
|
|
117846
|
+
output += formatCodeSpan(file, start, length2, indent + " ", "\x1B[96m" /* Cyan */, host);
|
|
117793
117847
|
}
|
|
117794
|
-
output += host.getNewLine();
|
|
117795
|
-
output += indent + flattenDiagnosticMessageText(messageText, host.getNewLine());
|
|
117796
117848
|
}
|
|
117797
117849
|
}
|
|
117798
|
-
output += host.getNewLine();
|
|
117799
117850
|
}
|
|
117800
117851
|
return output;
|
|
117801
117852
|
}
|
|
117802
|
-
function flattenDiagnosticMessageText(diag2, newLine,
|
|
117853
|
+
function flattenDiagnosticMessageText(diag2, newLine, indent = 0, pretty = false) {
|
|
117803
117854
|
if (isString(diag2)) {
|
|
117804
117855
|
return diag2;
|
|
117805
117856
|
} else if (diag2 === void 0) {
|
|
117806
117857
|
return "";
|
|
117807
117858
|
}
|
|
117808
117859
|
let result = "";
|
|
117809
|
-
if (
|
|
117860
|
+
if (indent) {
|
|
117810
117861
|
result += newLine;
|
|
117811
|
-
|
|
117812
|
-
|
|
117813
|
-
|
|
117862
|
+
const indentsToReplaceWithNewLines = pretty ? 1 : 0;
|
|
117863
|
+
if (indent > indentsToReplaceWithNewLines) {
|
|
117864
|
+
for (let i = indentsToReplaceWithNewLines; i < indent; i++) {
|
|
117865
|
+
result += " ";
|
|
117866
|
+
}
|
|
117867
|
+
} else
|
|
117868
|
+
result += newLine;
|
|
117814
117869
|
}
|
|
117815
117870
|
result += diag2.messageText;
|
|
117816
|
-
|
|
117871
|
+
indent++;
|
|
117817
117872
|
if (diag2.next) {
|
|
117818
117873
|
for (const kid of diag2.next) {
|
|
117819
|
-
result += flattenDiagnosticMessageText(kid, newLine,
|
|
117874
|
+
result += flattenDiagnosticMessageText(kid, newLine, indent);
|
|
117820
117875
|
}
|
|
117821
117876
|
}
|
|
117822
117877
|
return result;
|
|
@@ -119371,6 +119426,14 @@ ${lanes.join("\n")}
|
|
|
119371
119426
|
case 265 /* TypeAliasDeclaration */:
|
|
119372
119427
|
diagnostics.push(createDiagnosticForNode2(node, Diagnostics.Type_aliases_can_only_be_used_in_TypeScript_files));
|
|
119373
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;
|
|
119374
119437
|
case 266 /* EnumDeclaration */:
|
|
119375
119438
|
const enumKeyword = Debug.checkDefined(tokenToString(94 /* EnumKeyword */));
|
|
119376
119439
|
diagnostics.push(createDiagnosticForNode2(node, Diagnostics._0_declarations_can_only_be_used_in_TypeScript_files, enumKeyword));
|
|
@@ -120804,16 +120867,16 @@ ${lanes.join("\n")}
|
|
|
120804
120867
|
let message2;
|
|
120805
120868
|
switch (reason.kind) {
|
|
120806
120869
|
case 3 /* Import */:
|
|
120807
|
-
message2 = Diagnostics.
|
|
120870
|
+
message2 = Diagnostics.File_is_included_via_import_here_Colon;
|
|
120808
120871
|
break;
|
|
120809
120872
|
case 4 /* ReferenceFile */:
|
|
120810
|
-
message2 = Diagnostics.
|
|
120873
|
+
message2 = Diagnostics.File_is_included_via_reference_here_Colon;
|
|
120811
120874
|
break;
|
|
120812
120875
|
case 5 /* TypeReferenceDirective */:
|
|
120813
|
-
message2 = Diagnostics.
|
|
120876
|
+
message2 = Diagnostics.File_is_included_via_type_library_reference_here_Colon;
|
|
120814
120877
|
break;
|
|
120815
120878
|
case 7 /* LibReferenceDirective */:
|
|
120816
|
-
message2 = Diagnostics.
|
|
120879
|
+
message2 = Diagnostics.File_is_included_via_library_reference_here_Colon;
|
|
120817
120880
|
break;
|
|
120818
120881
|
default:
|
|
120819
120882
|
Debug.assertNever(reason);
|
|
@@ -120837,14 +120900,14 @@ ${lanes.join("\n")}
|
|
|
120837
120900
|
const matchedByFiles = getMatchedFileSpec(program, fileName);
|
|
120838
120901
|
if (matchedByFiles) {
|
|
120839
120902
|
configFileNode = getTsConfigPropArrayElementValue(options.configFile, "files", matchedByFiles);
|
|
120840
|
-
message = Diagnostics.
|
|
120903
|
+
message = Diagnostics.File_is_matched_by_files_list_specified_here_Colon;
|
|
120841
120904
|
break;
|
|
120842
120905
|
}
|
|
120843
120906
|
const matchedByInclude = getMatchedIncludeSpec(program, fileName);
|
|
120844
120907
|
if (!matchedByInclude || !isString(matchedByInclude))
|
|
120845
120908
|
return void 0;
|
|
120846
120909
|
configFileNode = getTsConfigPropArrayElementValue(options.configFile, "include", matchedByInclude);
|
|
120847
|
-
message = Diagnostics.
|
|
120910
|
+
message = Diagnostics.File_is_matched_by_include_pattern_specified_here_Colon;
|
|
120848
120911
|
break;
|
|
120849
120912
|
case 1 /* SourceFromProjectReference */:
|
|
120850
120913
|
case 2 /* OutputFromProjectReference */:
|
|
@@ -120865,23 +120928,23 @@ ${lanes.join("\n")}
|
|
|
120865
120928
|
return referencesSyntax && referencesSyntax.elements.length > index ? createDiagnosticForNodeInSourceFile(
|
|
120866
120929
|
sourceFile,
|
|
120867
120930
|
referencesSyntax.elements[index],
|
|
120868
|
-
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
|
|
120869
120932
|
) : void 0;
|
|
120870
120933
|
case 8 /* AutomaticTypeDirectiveFile */:
|
|
120871
120934
|
if (!options.types)
|
|
120872
120935
|
return void 0;
|
|
120873
120936
|
configFileNode = getOptionsSyntaxByArrayElementValue("types", reason.typeReference);
|
|
120874
|
-
message = Diagnostics.
|
|
120937
|
+
message = Diagnostics.File_is_entry_point_of_type_library_specified_here_Colon;
|
|
120875
120938
|
break;
|
|
120876
120939
|
case 6 /* LibFile */:
|
|
120877
120940
|
if (reason.index !== void 0) {
|
|
120878
120941
|
configFileNode = getOptionsSyntaxByArrayElementValue("lib", options.lib[reason.index]);
|
|
120879
|
-
message = Diagnostics.
|
|
120942
|
+
message = Diagnostics.File_is_library_specified_here_Colon;
|
|
120880
120943
|
break;
|
|
120881
120944
|
}
|
|
120882
120945
|
const target = forEachEntry(targetOptionDeclaration.type, (value, key) => value === getEmitScriptTarget(options) ? key : void 0);
|
|
120883
120946
|
configFileNode = target ? getOptionsSyntaxByValue("target", target) : void 0;
|
|
120884
|
-
message = Diagnostics.
|
|
120947
|
+
message = Diagnostics.File_is_default_library_for_target_specified_here_Colon;
|
|
120885
120948
|
break;
|
|
120886
120949
|
default:
|
|
120887
120950
|
Debug.assertNever(reason);
|
|
@@ -121373,7 +121436,7 @@ ${lanes.join("\n")}
|
|
|
121373
121436
|
}
|
|
121374
121437
|
Debug.fail("should never ask for module name at index higher than possible module name");
|
|
121375
121438
|
}
|
|
121376
|
-
var ForegroundColorEscapeSequences, gutterStyleSequence, gutterSeparator, resetEscapeSequence, ellipsis, halfIndent,
|
|
121439
|
+
var ForegroundColorEscapeSequences, gutterStyleSequence, gutterSeparator, resetEscapeSequence, ellipsis, halfIndent, bullet, emptyResolution, moduleResolutionNameAndModeGetter, typeReferenceResolutionNameAndModeGetter, inferredTypesContainingFile, plainJSErrors, emitSkippedWithNoDiagnostics;
|
|
121377
121440
|
var init_program = __esm({
|
|
121378
121441
|
"src/compiler/program.ts"() {
|
|
121379
121442
|
"use strict";
|
|
@@ -121392,7 +121455,7 @@ ${lanes.join("\n")}
|
|
|
121392
121455
|
resetEscapeSequence = "\x1B[0m";
|
|
121393
121456
|
ellipsis = "...";
|
|
121394
121457
|
halfIndent = " ";
|
|
121395
|
-
|
|
121458
|
+
bullet = "\u25CF ";
|
|
121396
121459
|
emptyResolution = {
|
|
121397
121460
|
resolvedModule: void 0,
|
|
121398
121461
|
resolvedTypeReferenceDirective: void 0
|
|
@@ -121410,8 +121473,8 @@ ${lanes.join("\n")}
|
|
|
121410
121473
|
// binder errors
|
|
121411
121474
|
Diagnostics.Cannot_redeclare_block_scoped_variable_0.code,
|
|
121412
121475
|
Diagnostics.A_module_cannot_have_multiple_default_exports.code,
|
|
121413
|
-
Diagnostics.
|
|
121414
|
-
Diagnostics.
|
|
121476
|
+
Diagnostics.Another_export_default_is_here_Colon.code,
|
|
121477
|
+
Diagnostics.The_first_export_default_is_here_Colon.code,
|
|
121415
121478
|
Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module.code,
|
|
121416
121479
|
Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode.code,
|
|
121417
121480
|
Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here.code,
|
|
@@ -130136,7 +130199,7 @@ ${lanes.join("\n")}
|
|
|
130136
130199
|
const absoluteMaximumLength = defaultMaximumTruncationLength * 10;
|
|
130137
130200
|
let displayParts;
|
|
130138
130201
|
let lineStart;
|
|
130139
|
-
let
|
|
130202
|
+
let indent;
|
|
130140
130203
|
let length2;
|
|
130141
130204
|
resetWriter();
|
|
130142
130205
|
const unknownWrite = (text) => writeKind(text, 17 /* text */);
|
|
@@ -130172,12 +130235,12 @@ ${lanes.join("\n")}
|
|
|
130172
130235
|
hasTrailingWhitespace: () => false,
|
|
130173
130236
|
hasTrailingComment: () => false,
|
|
130174
130237
|
rawWrite: notImplemented,
|
|
130175
|
-
getIndent: () =>
|
|
130238
|
+
getIndent: () => indent,
|
|
130176
130239
|
increaseIndent: () => {
|
|
130177
|
-
|
|
130240
|
+
indent++;
|
|
130178
130241
|
},
|
|
130179
130242
|
decreaseIndent: () => {
|
|
130180
|
-
|
|
130243
|
+
indent--;
|
|
130181
130244
|
},
|
|
130182
130245
|
clear: resetWriter
|
|
130183
130246
|
};
|
|
@@ -130185,7 +130248,7 @@ ${lanes.join("\n")}
|
|
|
130185
130248
|
if (length2 > absoluteMaximumLength)
|
|
130186
130249
|
return;
|
|
130187
130250
|
if (lineStart) {
|
|
130188
|
-
const indentString = getIndentString(
|
|
130251
|
+
const indentString = getIndentString(indent);
|
|
130189
130252
|
if (indentString) {
|
|
130190
130253
|
length2 += indentString.length;
|
|
130191
130254
|
displayParts.push(displayPart(indentString, 16 /* space */));
|
|
@@ -130217,7 +130280,7 @@ ${lanes.join("\n")}
|
|
|
130217
130280
|
function resetWriter() {
|
|
130218
130281
|
displayParts = [];
|
|
130219
130282
|
lineStart = true;
|
|
130220
|
-
|
|
130283
|
+
indent = 0;
|
|
130221
130284
|
length2 = 0;
|
|
130222
130285
|
}
|
|
130223
130286
|
}
|
|
@@ -149694,7 +149757,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
149694
149757
|
Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,
|
|
149695
149758
|
Diagnostics.Cannot_find_namespace_0.code,
|
|
149696
149759
|
Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code,
|
|
149697
|
-
Diagnostics.
|
|
149760
|
+
Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Colon.code,
|
|
149698
149761
|
Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer.code,
|
|
149699
149762
|
Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type.code
|
|
149700
149763
|
];
|
|
@@ -156914,6 +156977,13 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
156914
156977
|
data = originToCompletionEntryData(origin);
|
|
156915
156978
|
hasAction = !importStatementCompletion;
|
|
156916
156979
|
}
|
|
156980
|
+
const parentNamedImportOrExport = findAncestor(location, isNamedImportsOrExports);
|
|
156981
|
+
if ((parentNamedImportOrExport == null ? void 0 : parentNamedImportOrExport.kind) === 275 /* NamedImports */) {
|
|
156982
|
+
const possibleToken = stringToToken(name);
|
|
156983
|
+
if (parentNamedImportOrExport && possibleToken && (possibleToken === 135 /* AwaitKeyword */ || isNonContextualKeyword(possibleToken))) {
|
|
156984
|
+
insertText = `${name} as ${name}_`;
|
|
156985
|
+
}
|
|
156986
|
+
}
|
|
156917
156987
|
return {
|
|
156918
156988
|
name,
|
|
156919
156989
|
kind: ts_SymbolDisplay_exports.getSymbolKind(typeChecker, symbol, location),
|
|
@@ -157694,7 +157764,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
157694
157764
|
}
|
|
157695
157765
|
function getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextToken, origin, symbol, program, host, compilerOptions, sourceFile, position, previousToken, formatContext, preferences, data, source, cancellationToken) {
|
|
157696
157766
|
if (data == null ? void 0 : data.moduleSpecifier) {
|
|
157697
|
-
if (previousToken && getImportStatementCompletionInfo(contextToken || previousToken).replacementSpan) {
|
|
157767
|
+
if (previousToken && getImportStatementCompletionInfo(contextToken || previousToken, sourceFile).replacementSpan) {
|
|
157698
157768
|
return { codeActions: void 0, sourceDisplay: [textPart(data.moduleSpecifier)] };
|
|
157699
157769
|
}
|
|
157700
157770
|
}
|
|
@@ -157907,7 +157977,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
157907
157977
|
let isNewIdentifierLocation = false;
|
|
157908
157978
|
let flags = 0 /* None */;
|
|
157909
157979
|
if (contextToken) {
|
|
157910
|
-
const importStatementCompletionInfo = getImportStatementCompletionInfo(contextToken);
|
|
157980
|
+
const importStatementCompletionInfo = getImportStatementCompletionInfo(contextToken, sourceFile);
|
|
157911
157981
|
if (importStatementCompletionInfo.keywordCompletion) {
|
|
157912
157982
|
if (importStatementCompletionInfo.isKeywordOnlyCompletion) {
|
|
157913
157983
|
return {
|
|
@@ -159538,7 +159608,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
159538
159608
|
}
|
|
159539
159609
|
return void 0;
|
|
159540
159610
|
}
|
|
159541
|
-
function getImportStatementCompletionInfo(contextToken) {
|
|
159611
|
+
function getImportStatementCompletionInfo(contextToken, sourceFile) {
|
|
159542
159612
|
var _a, _b, _c;
|
|
159543
159613
|
let keywordCompletion;
|
|
159544
159614
|
let isKeywordOnlyCompletion = false;
|
|
@@ -159554,6 +159624,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
159554
159624
|
function getCandidate() {
|
|
159555
159625
|
const parent2 = contextToken.parent;
|
|
159556
159626
|
if (isImportEqualsDeclaration(parent2)) {
|
|
159627
|
+
const lastToken = parent2.getLastToken(sourceFile);
|
|
159628
|
+
if (isIdentifier(contextToken) && lastToken !== contextToken) {
|
|
159629
|
+
keywordCompletion = 161 /* FromKeyword */;
|
|
159630
|
+
isKeywordOnlyCompletion = true;
|
|
159631
|
+
return void 0;
|
|
159632
|
+
}
|
|
159557
159633
|
keywordCompletion = contextToken.kind === 156 /* TypeKeyword */ ? void 0 : 156 /* TypeKeyword */;
|
|
159558
159634
|
return isModuleSpecifierMissingOrEmpty(parent2.moduleReference) ? parent2 : void 0;
|
|
159559
159635
|
}
|
|
@@ -160121,7 +160197,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
160121
160197
|
extensionOptions,
|
|
160122
160198
|
host,
|
|
160123
160199
|
/*moduleSpecifierIsRelative*/
|
|
160124
|
-
|
|
160200
|
+
true,
|
|
160125
160201
|
scriptPath
|
|
160126
160202
|
).values());
|
|
160127
160203
|
}
|
|
@@ -167803,8 +167879,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
167803
167879
|
const startPosition = getFirstNonSpaceCharacterPosition(sourceFile.text, lineStartPosition);
|
|
167804
167880
|
const insertAtLineStart = isValidLocationToAddComment(sourceFile, startPosition);
|
|
167805
167881
|
const token = getTouchingToken(sourceFile, insertAtLineStart ? startPosition : position);
|
|
167806
|
-
const
|
|
167807
|
-
const text = `${insertAtLineStart ? "" : this.newLineCharacter}//${commentText}${this.newLineCharacter}${
|
|
167882
|
+
const indent = sourceFile.text.slice(lineStartPosition, startPosition);
|
|
167883
|
+
const text = `${insertAtLineStart ? "" : this.newLineCharacter}//${commentText}${this.newLineCharacter}${indent}`;
|
|
167808
167884
|
this.insertText(sourceFile, token.getStart(sourceFile), text);
|
|
167809
167885
|
}
|
|
167810
167886
|
insertJsdocCommentBefore(sourceFile, node, tag) {
|
|
@@ -167823,8 +167899,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
167823
167899
|
}
|
|
167824
167900
|
}
|
|
167825
167901
|
const startPosition = getPrecedingNonSpaceCharacterPosition(sourceFile.text, fnStart - 1);
|
|
167826
|
-
const
|
|
167827
|
-
this.insertNodeAt(sourceFile, fnStart, tag, { suffix: this.newLineCharacter +
|
|
167902
|
+
const indent = sourceFile.text.slice(startPosition, fnStart);
|
|
167903
|
+
this.insertNodeAt(sourceFile, fnStart, tag, { suffix: this.newLineCharacter + indent });
|
|
167828
167904
|
}
|
|
167829
167905
|
createJSDocText(sourceFile, node) {
|
|
167830
167906
|
const comments = flatMap(node.jsDoc, (jsDoc2) => isString(jsDoc2.comment) ? factory.createJSDocText(jsDoc2.comment) : jsDoc2.comment);
|
|
@@ -173502,6 +173578,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
173502
173578
|
startEndOverlapsWithStartEnd: () => startEndOverlapsWithStartEnd,
|
|
173503
173579
|
startOnNewLine: () => startOnNewLine,
|
|
173504
173580
|
startTracing: () => startTracing,
|
|
173581
|
+
startWhitespaceCount: () => startWhitespaceCount,
|
|
173505
173582
|
startsWith: () => startsWith,
|
|
173506
173583
|
startsWithDirectory: () => startsWithDirectory,
|
|
173507
173584
|
startsWithUnderscore: () => startsWithUnderscore,
|