@typescript-deploys/pr-build 4.7.0-pr-48112-6 → 4.7.0-pr-48168-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/cs/diagnosticMessages.generated.json +3 -0
- package/lib/es/diagnosticMessages.generated.json +3 -0
- package/lib/it/diagnosticMessages.generated.json +3 -0
- package/lib/pl/diagnosticMessages.generated.json +3 -0
- package/lib/tr/diagnosticMessages.generated.json +3 -0
- package/lib/tsc.js +193 -119
- package/lib/tsserver.js +576 -257
- package/lib/tsserverlibrary.d.ts +4 -1
- package/lib/tsserverlibrary.js +576 -257
- package/lib/typescript.d.ts +4 -1
- package/lib/typescript.js +453 -176
- package/lib/typescriptServices.d.ts +4 -1
- package/lib/typescriptServices.js +453 -176
- package/lib/typingsInstaller.js +209 -131
- package/package.json +1 -1
package/lib/tsserver.js
CHANGED
|
@@ -100,7 +100,7 @@ var ts;
|
|
|
100
100
|
// The following is baselined as a literal template type without intervention
|
|
101
101
|
/** The version of the TypeScript compiler release */
|
|
102
102
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
103
|
-
ts.version = ts.versionMajorMinor + ".0-insiders.
|
|
103
|
+
ts.version = ts.versionMajorMinor + ".0-insiders.20220309";
|
|
104
104
|
/* @internal */
|
|
105
105
|
var Comparison;
|
|
106
106
|
(function (Comparison) {
|
|
@@ -4164,6 +4164,7 @@ var ts;
|
|
|
4164
4164
|
SyntaxKind[SyntaxKind["JSDocFunctionType"] = 316] = "JSDocFunctionType";
|
|
4165
4165
|
SyntaxKind[SyntaxKind["JSDocVariadicType"] = 317] = "JSDocVariadicType";
|
|
4166
4166
|
SyntaxKind[SyntaxKind["JSDocNamepathType"] = 318] = "JSDocNamepathType";
|
|
4167
|
+
/** @deprecated Use SyntaxKind.JSDoc */
|
|
4167
4168
|
SyntaxKind[SyntaxKind["JSDocComment"] = 319] = "JSDocComment";
|
|
4168
4169
|
SyntaxKind[SyntaxKind["JSDocText"] = 320] = "JSDocText";
|
|
4169
4170
|
SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 321] = "JSDocTypeLiteral";
|
|
@@ -4237,6 +4238,7 @@ var ts;
|
|
|
4237
4238
|
SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 346] = "LastJSDocTagNode";
|
|
4238
4239
|
/* @internal */ SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 126] = "FirstContextualKeyword";
|
|
4239
4240
|
/* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 159] = "LastContextualKeyword";
|
|
4241
|
+
SyntaxKind[SyntaxKind["JSDoc"] = 319] = "JSDoc";
|
|
4240
4242
|
})(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {}));
|
|
4241
4243
|
var NodeFlags;
|
|
4242
4244
|
(function (NodeFlags) {
|
|
@@ -8707,7 +8709,6 @@ var ts;
|
|
|
8707
8709
|
Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Did_you_mean_0: diag(2835, ts.DiagnosticCategory.Error, "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2835", "Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean '{0}'?"),
|
|
8708
8710
|
Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls: diag(2836, ts.DiagnosticCategory.Error, "Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls_2836", "Import assertions are not allowed on statements that transpile to commonjs 'require' calls."),
|
|
8709
8711
|
Import_assertion_values_must_be_string_literal_expressions: diag(2837, ts.DiagnosticCategory.Error, "Import_assertion_values_must_be_string_literal_expressions_2837", "Import assertion values must be string literal expressions."),
|
|
8710
|
-
All_declarations_of_0_must_have_identical_constraints: diag(2838, ts.DiagnosticCategory.Error, "All_declarations_of_0_must_have_identical_constraints_2838", "All declarations of '{0}' must have identical constraints."),
|
|
8711
8712
|
Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
8712
8713
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
|
8713
8714
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
|
@@ -9025,7 +9026,6 @@ var ts;
|
|
|
9025
9026
|
Command_line_Options: diag(6171, ts.DiagnosticCategory.Message, "Command_line_Options_6171", "Command-line Options"),
|
|
9026
9027
|
Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3: diag(6179, ts.DiagnosticCategory.Message, "Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3_6179", "Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'."),
|
|
9027
9028
|
Enable_all_strict_type_checking_options: diag(6180, ts.DiagnosticCategory.Message, "Enable_all_strict_type_checking_options_6180", "Enable all strict type-checking options."),
|
|
9028
|
-
List_of_language_service_plugins: diag(6181, ts.DiagnosticCategory.Message, "List_of_language_service_plugins_6181", "List of language service plugins."),
|
|
9029
9029
|
Scoped_package_detected_looking_in_0: diag(6182, ts.DiagnosticCategory.Message, "Scoped_package_detected_looking_in_0_6182", "Scoped package detected, looking in '{0}'"),
|
|
9030
9030
|
Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2: diag(6183, ts.DiagnosticCategory.Message, "Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_6183", "Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}'."),
|
|
9031
9031
|
Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3: diag(6184, ts.DiagnosticCategory.Message, "Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package__6184", "Reusing resolution of module '{0}' from '{1}' of old program, it was successfully resolved to '{2}' with Package ID '{3}'."),
|
|
@@ -9132,7 +9132,7 @@ var ts;
|
|
|
9132
9132
|
Skipping_build_of_project_0_because_its_dependency_1_has_errors: diag(6362, ts.DiagnosticCategory.Message, "Skipping_build_of_project_0_because_its_dependency_1_has_errors_6362", "Skipping build of project '{0}' because its dependency '{1}' has errors"),
|
|
9133
9133
|
Project_0_can_t_be_built_because_its_dependency_1_has_errors: diag(6363, ts.DiagnosticCategory.Message, "Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363", "Project '{0}' can't be built because its dependency '{1}' has errors"),
|
|
9134
9134
|
Build_one_or_more_projects_and_their_dependencies_if_out_of_date: diag(6364, ts.DiagnosticCategory.Message, "Build_one_or_more_projects_and_their_dependencies_if_out_of_date_6364", "Build one or more projects and their dependencies, if out of date"),
|
|
9135
|
-
Delete_the_outputs_of_all_projects: diag(6365, ts.DiagnosticCategory.Message, "Delete_the_outputs_of_all_projects_6365", "Delete the outputs of all projects"),
|
|
9135
|
+
Delete_the_outputs_of_all_projects: diag(6365, ts.DiagnosticCategory.Message, "Delete_the_outputs_of_all_projects_6365", "Delete the outputs of all projects."),
|
|
9136
9136
|
Show_what_would_be_built_or_deleted_if_specified_with_clean: diag(6367, ts.DiagnosticCategory.Message, "Show_what_would_be_built_or_deleted_if_specified_with_clean_6367", "Show what would be built (or deleted, if specified with '--clean')"),
|
|
9137
9137
|
Option_build_must_be_the_first_command_line_argument: diag(6369, ts.DiagnosticCategory.Error, "Option_build_must_be_the_first_command_line_argument_6369", "Option '--build' must be the first command line argument."),
|
|
9138
9138
|
Options_0_and_1_cannot_be_combined: diag(6370, ts.DiagnosticCategory.Error, "Options_0_and_1_cannot_be_combined_6370", "Options '{0}' and '{1}' cannot be combined."),
|
|
@@ -9143,7 +9143,6 @@ var ts;
|
|
|
9143
9143
|
A_non_dry_build_would_update_output_of_project_0: diag(6375, ts.DiagnosticCategory.Message, "A_non_dry_build_would_update_output_of_project_0_6375", "A non-dry build would update output of project '{0}'"),
|
|
9144
9144
|
Cannot_update_output_of_project_0_because_there_was_error_reading_file_1: diag(6376, ts.DiagnosticCategory.Message, "Cannot_update_output_of_project_0_because_there_was_error_reading_file_1_6376", "Cannot update output of project '{0}' because there was error reading file '{1}'"),
|
|
9145
9145
|
Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1: diag(6377, ts.DiagnosticCategory.Error, "Cannot_write_file_0_because_it_will_overwrite_tsbuildinfo_file_generated_by_referenced_project_1_6377", "Cannot write file '{0}' because it will overwrite '.tsbuildinfo' file generated by referenced project '{1}'"),
|
|
9146
|
-
Enable_incremental_compilation: diag(6378, ts.DiagnosticCategory.Message, "Enable_incremental_compilation_6378", "Enable incremental compilation"),
|
|
9147
9146
|
Composite_projects_may_not_disable_incremental_compilation: diag(6379, ts.DiagnosticCategory.Error, "Composite_projects_may_not_disable_incremental_compilation_6379", "Composite projects may not disable incremental compilation."),
|
|
9148
9147
|
Specify_file_to_store_incremental_compilation_information: diag(6380, ts.DiagnosticCategory.Message, "Specify_file_to_store_incremental_compilation_information_6380", "Specify file to store incremental compilation information"),
|
|
9149
9148
|
Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2: diag(6381, ts.DiagnosticCategory.Message, "Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_curren_6381", "Project '{0}' is out of date because output for it was generated with version '{1}' that differs with current version '{2}'"),
|
|
@@ -9171,13 +9170,13 @@ var ts;
|
|
|
9171
9170
|
File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option: diag(6504, ts.DiagnosticCategory.Error, "File_0_is_a_JavaScript_file_Did_you_mean_to_enable_the_allowJs_option_6504", "File '{0}' is a JavaScript file. Did you mean to enable the 'allowJs' option?"),
|
|
9172
9171
|
Print_names_of_files_and_the_reason_they_are_part_of_the_compilation: diag(6505, ts.DiagnosticCategory.Message, "Print_names_of_files_and_the_reason_they_are_part_of_the_compilation_6505", "Print names of files and the reason they are part of the compilation."),
|
|
9173
9172
|
Consider_adding_a_declare_modifier_to_this_class: diag(6506, ts.DiagnosticCategory.Message, "Consider_adding_a_declare_modifier_to_this_class_6506", "Consider adding a 'declare' modifier to this class."),
|
|
9174
|
-
Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files: diag(6600, ts.DiagnosticCategory.Message, "Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600", "Allow JavaScript files to be a part of your program. Use the
|
|
9173
|
+
Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files: diag(6600, ts.DiagnosticCategory.Message, "Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these__6600", "Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files."),
|
|
9175
9174
|
Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export: diag(6601, ts.DiagnosticCategory.Message, "Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export_6601", "Allow 'import x from y' when a module doesn't have a default export."),
|
|
9176
9175
|
Allow_accessing_UMD_globals_from_modules: diag(6602, ts.DiagnosticCategory.Message, "Allow_accessing_UMD_globals_from_modules_6602", "Allow accessing UMD globals from modules."),
|
|
9177
9176
|
Disable_error_reporting_for_unreachable_code: diag(6603, ts.DiagnosticCategory.Message, "Disable_error_reporting_for_unreachable_code_6603", "Disable error reporting for unreachable code."),
|
|
9178
9177
|
Disable_error_reporting_for_unused_labels: diag(6604, ts.DiagnosticCategory.Message, "Disable_error_reporting_for_unused_labels_6604", "Disable error reporting for unused labels."),
|
|
9179
9178
|
Ensure_use_strict_is_always_emitted: diag(6605, ts.DiagnosticCategory.Message, "Ensure_use_strict_is_always_emitted_6605", "Ensure 'use strict' is always emitted."),
|
|
9180
|
-
Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it: diag(6606, ts.DiagnosticCategory.Message, "Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_wi_6606", "Have recompiles in projects that use
|
|
9179
|
+
Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it: diag(6606, ts.DiagnosticCategory.Message, "Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_wi_6606", "Have recompiles in projects that use 'incremental' and 'watch' mode assume that changes within a file will only affect files directly depending on it."),
|
|
9181
9180
|
Specify_the_base_directory_to_resolve_non_relative_module_names: diag(6607, ts.DiagnosticCategory.Message, "Specify_the_base_directory_to_resolve_non_relative_module_names_6607", "Specify the base directory to resolve non-relative module names."),
|
|
9182
9181
|
No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files: diag(6608, ts.DiagnosticCategory.Message, "No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files_6608", "No longer supported. In early versions, manually set the text encoding for reading files."),
|
|
9183
9182
|
Enable_error_reporting_in_type_checked_JavaScript_files: diag(6609, ts.DiagnosticCategory.Message, "Enable_error_reporting_in_type_checked_JavaScript_files_6609", "Enable error reporting in type-checked JavaScript files."),
|
|
@@ -9190,13 +9189,13 @@ var ts;
|
|
|
9190
9189
|
Reduce_the_number_of_projects_loaded_automatically_by_TypeScript: diag(6617, ts.DiagnosticCategory.Message, "Reduce_the_number_of_projects_loaded_automatically_by_TypeScript_6617", "Reduce the number of projects loaded automatically by TypeScript."),
|
|
9191
9190
|
Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server: diag(6618, ts.DiagnosticCategory.Message, "Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server_6618", "Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server."),
|
|
9192
9191
|
Opt_a_project_out_of_multi_project_reference_checking_when_editing: diag(6619, ts.DiagnosticCategory.Message, "Opt_a_project_out_of_multi_project_reference_checking_when_editing_6619", "Opt a project out of multi-project reference checking when editing."),
|
|
9193
|
-
Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects: diag(6620, ts.DiagnosticCategory.Message, "Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects_6620", "Disable preferring source files instead of declaration files when referencing composite projects"),
|
|
9192
|
+
Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects: diag(6620, ts.DiagnosticCategory.Message, "Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects_6620", "Disable preferring source files instead of declaration files when referencing composite projects."),
|
|
9194
9193
|
Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration: diag(6621, ts.DiagnosticCategory.Message, "Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration_6621", "Emit more compliant, but verbose and less performant JavaScript for iteration."),
|
|
9195
9194
|
Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files: diag(6622, ts.DiagnosticCategory.Message, "Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files_6622", "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files."),
|
|
9196
9195
|
Only_output_d_ts_files_and_not_JavaScript_files: diag(6623, ts.DiagnosticCategory.Message, "Only_output_d_ts_files_and_not_JavaScript_files_6623", "Only output d.ts files and not JavaScript files."),
|
|
9197
9196
|
Emit_design_type_metadata_for_decorated_declarations_in_source_files: diag(6624, ts.DiagnosticCategory.Message, "Emit_design_type_metadata_for_decorated_declarations_in_source_files_6624", "Emit design-type metadata for decorated declarations in source files."),
|
|
9198
9197
|
Disable_the_type_acquisition_for_JavaScript_projects: diag(6625, ts.DiagnosticCategory.Message, "Disable_the_type_acquisition_for_JavaScript_projects_6625", "Disable the type acquisition for JavaScript projects"),
|
|
9199
|
-
Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility: diag(6626, ts.DiagnosticCategory.Message, "Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheti_6626", "Emit additional JavaScript to ease support for importing CommonJS modules. This enables
|
|
9198
|
+
Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility: diag(6626, ts.DiagnosticCategory.Message, "Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheti_6626", "Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility."),
|
|
9200
9199
|
Filters_results_from_the_include_option: diag(6627, ts.DiagnosticCategory.Message, "Filters_results_from_the_include_option_6627", "Filters results from the `include` option."),
|
|
9201
9200
|
Remove_a_list_of_directories_from_the_watch_process: diag(6628, ts.DiagnosticCategory.Message, "Remove_a_list_of_directories_from_the_watch_process_6628", "Remove a list of directories from the watch process."),
|
|
9202
9201
|
Remove_a_list_of_files_from_the_watch_mode_s_processing: diag(6629, ts.DiagnosticCategory.Message, "Remove_a_list_of_files_from_the_watch_mode_s_processing_6629", "Remove a list of files from the watch mode's processing."),
|
|
@@ -9206,7 +9205,7 @@ var ts;
|
|
|
9206
9205
|
Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_are_inherited: diag(6633, ts.DiagnosticCategory.Message, "Specify_one_or_more_path_or_node_module_references_to_base_configuration_files_from_which_settings_a_6633", "Specify one or more path or node module references to base configuration files from which settings are inherited."),
|
|
9207
9206
|
Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers: diag(6634, ts.DiagnosticCategory.Message, "Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers_6634", "Specify what approach the watcher should use if the system runs out of native file watchers."),
|
|
9208
9207
|
Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include: diag(6635, ts.DiagnosticCategory.Message, "Include_a_list_of_files_This_does_not_support_glob_patterns_as_opposed_to_include_6635", "Include a list of files. This does not support glob patterns, as opposed to `include`."),
|
|
9209
|
-
Build_all_projects_including_those_that_appear_to_be_up_to_date: diag(6636, ts.DiagnosticCategory.Message, "Build_all_projects_including_those_that_appear_to_be_up_to_date_6636", "Build all projects, including those that appear to be up to date"),
|
|
9208
|
+
Build_all_projects_including_those_that_appear_to_be_up_to_date: diag(6636, ts.DiagnosticCategory.Message, "Build_all_projects_including_those_that_appear_to_be_up_to_date_6636", "Build all projects, including those that appear to be up to date."),
|
|
9210
9209
|
Ensure_that_casing_is_correct_in_imports: diag(6637, ts.DiagnosticCategory.Message, "Ensure_that_casing_is_correct_in_imports_6637", "Ensure that casing is correct in imports."),
|
|
9211
9210
|
Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging: diag(6638, ts.DiagnosticCategory.Message, "Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging_6638", "Emit a v8 CPU profile of the compiler run for debugging."),
|
|
9212
9211
|
Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file: diag(6639, ts.DiagnosticCategory.Message, "Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file_6639", "Allow importing helper functions from tslib once per project, instead of including them per-file."),
|
|
@@ -9216,77 +9215,76 @@ var ts;
|
|
|
9216
9215
|
Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript: diag(6644, ts.DiagnosticCategory.Message, "Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript_6644", "Include source code in the sourcemaps inside the emitted JavaScript."),
|
|
9217
9216
|
Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports: diag(6645, ts.DiagnosticCategory.Message, "Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports_6645", "Ensure that each file can be safely transpiled without relying on other imports."),
|
|
9218
9217
|
Specify_what_JSX_code_is_generated: diag(6646, ts.DiagnosticCategory.Message, "Specify_what_JSX_code_is_generated_6646", "Specify what JSX code is generated."),
|
|
9219
|
-
Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h: diag(6647, ts.DiagnosticCategory.Message, "Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h_6647", "Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'"),
|
|
9218
|
+
Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h: diag(6647, ts.DiagnosticCategory.Message, "Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h_6647", "Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'."),
|
|
9220
9219
|
Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment: diag(6648, ts.DiagnosticCategory.Message, "Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragme_6648", "Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'."),
|
|
9221
|
-
Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk: diag(6649, ts.DiagnosticCategory.Message, "Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Ast_6649", "Specify module specifier used to import the JSX factory functions when using
|
|
9220
|
+
Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk: diag(6649, ts.DiagnosticCategory.Message, "Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Ast_6649", "Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'."),
|
|
9222
9221
|
Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option: diag(6650, ts.DiagnosticCategory.Message, "Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option_6650", "Make keyof only return strings instead of string, numbers or symbols. Legacy option."),
|
|
9223
9222
|
Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment: diag(6651, ts.DiagnosticCategory.Message, "Specify_a_set_of_bundled_library_declaration_files_that_describe_the_target_runtime_environment_6651", "Specify a set of bundled library declaration files that describe the target runtime environment."),
|
|
9224
9223
|
Print_the_names_of_emitted_files_after_a_compilation: diag(6652, ts.DiagnosticCategory.Message, "Print_the_names_of_emitted_files_after_a_compilation_6652", "Print the names of emitted files after a compilation."),
|
|
9225
9224
|
Print_all_of_the_files_read_during_the_compilation: diag(6653, ts.DiagnosticCategory.Message, "Print_all_of_the_files_read_during_the_compilation_6653", "Print all of the files read during the compilation."),
|
|
9226
9225
|
Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit: diag(6654, ts.DiagnosticCategory.Message, "Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit_6654", "Set the language of the messaging from TypeScript. This does not affect emit."),
|
|
9227
9226
|
Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: diag(6655, ts.DiagnosticCategory.Message, "Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations_6655", "Specify the location where debugger should locate map files instead of generated locations."),
|
|
9228
|
-
Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs: diag(6656, ts.DiagnosticCategory.Message, "Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicabl_6656", "Specify the maximum folder depth used for checking JavaScript files from
|
|
9227
|
+
Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs: diag(6656, ts.DiagnosticCategory.Message, "Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicabl_6656", "Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'."),
|
|
9229
9228
|
Specify_what_module_code_is_generated: diag(6657, ts.DiagnosticCategory.Message, "Specify_what_module_code_is_generated_6657", "Specify what module code is generated."),
|
|
9230
9229
|
Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier: diag(6658, ts.DiagnosticCategory.Message, "Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier_6658", "Specify how TypeScript looks up a file from a given module specifier."),
|
|
9231
9230
|
Set_the_newline_character_for_emitting_files: diag(6659, ts.DiagnosticCategory.Message, "Set_the_newline_character_for_emitting_files_6659", "Set the newline character for emitting files."),
|
|
9232
9231
|
Disable_emitting_files_from_a_compilation: diag(6660, ts.DiagnosticCategory.Message, "Disable_emitting_files_from_a_compilation_6660", "Disable emitting files from a compilation."),
|
|
9233
|
-
Disable_generating_custom_helper_functions_like_extends_in_compiled_output: diag(6661, ts.DiagnosticCategory.Message, "Disable_generating_custom_helper_functions_like_extends_in_compiled_output_6661", "Disable generating custom helper functions like
|
|
9232
|
+
Disable_generating_custom_helper_functions_like_extends_in_compiled_output: diag(6661, ts.DiagnosticCategory.Message, "Disable_generating_custom_helper_functions_like_extends_in_compiled_output_6661", "Disable generating custom helper functions like '__extends' in compiled output."),
|
|
9234
9233
|
Disable_emitting_files_if_any_type_checking_errors_are_reported: diag(6662, ts.DiagnosticCategory.Message, "Disable_emitting_files_if_any_type_checking_errors_are_reported_6662", "Disable emitting files if any type checking errors are reported."),
|
|
9235
9234
|
Disable_truncating_types_in_error_messages: diag(6663, ts.DiagnosticCategory.Message, "Disable_truncating_types_in_error_messages_6663", "Disable truncating types in error messages."),
|
|
9236
9235
|
Enable_error_reporting_for_fallthrough_cases_in_switch_statements: diag(6664, ts.DiagnosticCategory.Message, "Enable_error_reporting_for_fallthrough_cases_in_switch_statements_6664", "Enable error reporting for fallthrough cases in switch statements."),
|
|
9237
|
-
Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type: diag(6665, ts.DiagnosticCategory.Message, "Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type_6665", "Enable error reporting for expressions and declarations with an implied
|
|
9236
|
+
Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type: diag(6665, ts.DiagnosticCategory.Message, "Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type_6665", "Enable error reporting for expressions and declarations with an implied 'any' type."),
|
|
9238
9237
|
Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier: diag(6666, ts.DiagnosticCategory.Message, "Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier_6666", "Ensure overriding members in derived classes are marked with an override modifier."),
|
|
9239
9238
|
Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function: diag(6667, ts.DiagnosticCategory.Message, "Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function_6667", "Enable error reporting for codepaths that do not explicitly return in a function."),
|
|
9240
|
-
Enable_error_reporting_when_this_is_given_the_type_any: diag(6668, ts.DiagnosticCategory.Message, "Enable_error_reporting_when_this_is_given_the_type_any_6668", "Enable error reporting when
|
|
9239
|
+
Enable_error_reporting_when_this_is_given_the_type_any: diag(6668, ts.DiagnosticCategory.Message, "Enable_error_reporting_when_this_is_given_the_type_any_6668", "Enable error reporting when 'this' is given the type 'any'."),
|
|
9241
9240
|
Disable_adding_use_strict_directives_in_emitted_JavaScript_files: diag(6669, ts.DiagnosticCategory.Message, "Disable_adding_use_strict_directives_in_emitted_JavaScript_files_6669", "Disable adding 'use strict' directives in emitted JavaScript files."),
|
|
9242
9241
|
Disable_including_any_library_files_including_the_default_lib_d_ts: diag(6670, ts.DiagnosticCategory.Message, "Disable_including_any_library_files_including_the_default_lib_d_ts_6670", "Disable including any library files, including the default lib.d.ts."),
|
|
9243
|
-
Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type: diag(6671, ts.DiagnosticCategory.Message, "Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type_6671", "Enforces using indexed accessors for keys declared using an indexed type"),
|
|
9244
|
-
Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project: diag(6672, ts.DiagnosticCategory.Message, "Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672", "Disallow
|
|
9242
|
+
Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type: diag(6671, ts.DiagnosticCategory.Message, "Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type_6671", "Enforces using indexed accessors for keys declared using an indexed type."),
|
|
9243
|
+
Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project: diag(6672, ts.DiagnosticCategory.Message, "Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add__6672", "Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project."),
|
|
9245
9244
|
Disable_strict_checking_of_generic_signatures_in_function_types: diag(6673, ts.DiagnosticCategory.Message, "Disable_strict_checking_of_generic_signatures_in_function_types_6673", "Disable strict checking of generic signatures in function types."),
|
|
9246
|
-
Add_undefined_to_a_type_when_accessed_using_an_index: diag(6674, ts.DiagnosticCategory.Message, "Add_undefined_to_a_type_when_accessed_using_an_index_6674", "Add
|
|
9247
|
-
|
|
9248
|
-
Raise_an_error_when_a_function_parameter_isn_t_read: diag(6676, ts.DiagnosticCategory.Message, "Raise_an_error_when_a_function_parameter_isn_t_read_6676", "Raise an error when a function parameter isn't read"),
|
|
9249
|
-
Deprecated_setting_Use_outFile_instead: diag(6677, ts.DiagnosticCategory.Message, "Deprecated_setting_Use_outFile_instead_6677", "Deprecated setting. Use
|
|
9245
|
+
Add_undefined_to_a_type_when_accessed_using_an_index: diag(6674, ts.DiagnosticCategory.Message, "Add_undefined_to_a_type_when_accessed_using_an_index_6674", "Add 'undefined' to a type when accessed using an index."),
|
|
9246
|
+
Enable_error_reporting_when_local_variables_aren_t_read: diag(6675, ts.DiagnosticCategory.Message, "Enable_error_reporting_when_local_variables_aren_t_read_6675", "Enable error reporting when local variables aren't read."),
|
|
9247
|
+
Raise_an_error_when_a_function_parameter_isn_t_read: diag(6676, ts.DiagnosticCategory.Message, "Raise_an_error_when_a_function_parameter_isn_t_read_6676", "Raise an error when a function parameter isn't read."),
|
|
9248
|
+
Deprecated_setting_Use_outFile_instead: diag(6677, ts.DiagnosticCategory.Message, "Deprecated_setting_Use_outFile_instead_6677", "Deprecated setting. Use 'outFile' instead."),
|
|
9250
9249
|
Specify_an_output_folder_for_all_emitted_files: diag(6678, ts.DiagnosticCategory.Message, "Specify_an_output_folder_for_all_emitted_files_6678", "Specify an output folder for all emitted files."),
|
|
9251
|
-
Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output: diag(6679, ts.DiagnosticCategory.Message, "Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designa_6679", "Specify a file that bundles all outputs into one JavaScript file. If
|
|
9250
|
+
Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output: diag(6679, ts.DiagnosticCategory.Message, "Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designa_6679", "Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output."),
|
|
9252
9251
|
Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations: diag(6680, ts.DiagnosticCategory.Message, "Specify_a_set_of_entries_that_re_map_imports_to_additional_lookup_locations_6680", "Specify a set of entries that re-map imports to additional lookup locations."),
|
|
9253
9252
|
Specify_a_list_of_language_service_plugins_to_include: diag(6681, ts.DiagnosticCategory.Message, "Specify_a_list_of_language_service_plugins_to_include_6681", "Specify a list of language service plugins to include."),
|
|
9254
|
-
Disable_erasing_const_enum_declarations_in_generated_code: diag(6682, ts.DiagnosticCategory.Message, "Disable_erasing_const_enum_declarations_in_generated_code_6682", "Disable erasing
|
|
9253
|
+
Disable_erasing_const_enum_declarations_in_generated_code: diag(6682, ts.DiagnosticCategory.Message, "Disable_erasing_const_enum_declarations_in_generated_code_6682", "Disable erasing 'const enum' declarations in generated code."),
|
|
9255
9254
|
Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node: diag(6683, ts.DiagnosticCategory.Message, "Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node_6683", "Disable resolving symlinks to their realpath. This correlates to the same flag in node."),
|
|
9256
|
-
Disable_wiping_the_console_in_watch_mode: diag(6684, ts.DiagnosticCategory.Message, "Disable_wiping_the_console_in_watch_mode_6684", "Disable wiping the console in watch mode"),
|
|
9257
|
-
Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read: diag(6685, ts.DiagnosticCategory.Message, "Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read_6685", "Enable color and formatting in TypeScript's output to make compiler errors easier to read"),
|
|
9258
|
-
Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit: diag(6686, ts.DiagnosticCategory.Message, "Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit_6686", "Specify the object invoked for
|
|
9255
|
+
Disable_wiping_the_console_in_watch_mode: diag(6684, ts.DiagnosticCategory.Message, "Disable_wiping_the_console_in_watch_mode_6684", "Disable wiping the console in watch mode."),
|
|
9256
|
+
Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read: diag(6685, ts.DiagnosticCategory.Message, "Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read_6685", "Enable color and formatting in TypeScript's output to make compiler errors easier to read."),
|
|
9257
|
+
Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit: diag(6686, ts.DiagnosticCategory.Message, "Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit_6686", "Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit."),
|
|
9259
9258
|
Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references: diag(6687, ts.DiagnosticCategory.Message, "Specify_an_array_of_objects_that_specify_paths_for_projects_Used_in_project_references_6687", "Specify an array of objects that specify paths for projects. Used in project references."),
|
|
9260
9259
|
Disable_emitting_comments: diag(6688, ts.DiagnosticCategory.Message, "Disable_emitting_comments_6688", "Disable emitting comments."),
|
|
9261
|
-
Enable_importing_json_files: diag(6689, ts.DiagnosticCategory.Message, "Enable_importing_json_files_6689", "Enable importing .json files"),
|
|
9260
|
+
Enable_importing_json_files: diag(6689, ts.DiagnosticCategory.Message, "Enable_importing_json_files_6689", "Enable importing .json files."),
|
|
9262
9261
|
Specify_the_root_folder_within_your_source_files: diag(6690, ts.DiagnosticCategory.Message, "Specify_the_root_folder_within_your_source_files_6690", "Specify the root folder within your source files."),
|
|
9263
9262
|
Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules: diag(6691, ts.DiagnosticCategory.Message, "Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules_6691", "Allow multiple folders to be treated as one when resolving modules."),
|
|
9264
9263
|
Skip_type_checking_d_ts_files_that_are_included_with_TypeScript: diag(6692, ts.DiagnosticCategory.Message, "Skip_type_checking_d_ts_files_that_are_included_with_TypeScript_6692", "Skip type checking .d.ts files that are included with TypeScript."),
|
|
9265
9264
|
Skip_type_checking_all_d_ts_files: diag(6693, ts.DiagnosticCategory.Message, "Skip_type_checking_all_d_ts_files_6693", "Skip type checking all .d.ts files."),
|
|
9266
9265
|
Create_source_map_files_for_emitted_JavaScript_files: diag(6694, ts.DiagnosticCategory.Message, "Create_source_map_files_for_emitted_JavaScript_files_6694", "Create source map files for emitted JavaScript files."),
|
|
9267
9266
|
Specify_the_root_path_for_debuggers_to_find_the_reference_source_code: diag(6695, ts.DiagnosticCategory.Message, "Specify_the_root_path_for_debuggers_to_find_the_reference_source_code_6695", "Specify the root path for debuggers to find the reference source code."),
|
|
9268
|
-
Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function: diag(6697, ts.DiagnosticCategory.Message, "Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function_6697", "Check that the arguments for
|
|
9267
|
+
Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function: diag(6697, ts.DiagnosticCategory.Message, "Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function_6697", "Check that the arguments for 'bind', 'call', and 'apply' methods match the original function."),
|
|
9269
9268
|
When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible: diag(6698, ts.DiagnosticCategory.Message, "When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible_6698", "When assigning functions, check to ensure parameters and the return values are subtype-compatible."),
|
|
9270
|
-
When_type_checking_take_into_account_null_and_undefined: diag(6699, ts.DiagnosticCategory.Message, "When_type_checking_take_into_account_null_and_undefined_6699", "When type checking, take into account
|
|
9269
|
+
When_type_checking_take_into_account_null_and_undefined: diag(6699, ts.DiagnosticCategory.Message, "When_type_checking_take_into_account_null_and_undefined_6699", "When type checking, take into account 'null' and 'undefined'."),
|
|
9271
9270
|
Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor: diag(6700, ts.DiagnosticCategory.Message, "Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor_6700", "Check for class properties that are declared but not set in the constructor."),
|
|
9272
|
-
Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments: diag(6701, ts.DiagnosticCategory.Message, "Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments_6701", "Disable emitting declarations that have
|
|
9271
|
+
Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments: diag(6701, ts.DiagnosticCategory.Message, "Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments_6701", "Disable emitting declarations that have '@internal' in their JSDoc comments."),
|
|
9273
9272
|
Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals: diag(6702, ts.DiagnosticCategory.Message, "Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals_6702", "Disable reporting of excess property errors during the creation of object literals."),
|
|
9274
|
-
Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures: diag(6703, ts.DiagnosticCategory.Message, "Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures_6703", "Suppress
|
|
9273
|
+
Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures: diag(6703, ts.DiagnosticCategory.Message, "Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures_6703", "Suppress 'noImplicitAny' errors when indexing objects that lack index signatures."),
|
|
9275
9274
|
Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively: diag(6704, ts.DiagnosticCategory.Message, "Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_supp_6704", "Synchronously call callbacks and update the state of directory watchers on platforms that don`t support recursive watching natively."),
|
|
9276
9275
|
Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations: diag(6705, ts.DiagnosticCategory.Message, "Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declaratio_6705", "Set the JavaScript language version for emitted JavaScript and include compatible library declarations."),
|
|
9277
|
-
Log_paths_used_during_the_moduleResolution_process: diag(6706, ts.DiagnosticCategory.Message, "Log_paths_used_during_the_moduleResolution_process_6706", "Log paths used during the
|
|
9276
|
+
Log_paths_used_during_the_moduleResolution_process: diag(6706, ts.DiagnosticCategory.Message, "Log_paths_used_during_the_moduleResolution_process_6706", "Log paths used during the 'moduleResolution' process."),
|
|
9278
9277
|
Specify_the_folder_for_tsbuildinfo_incremental_compilation_files: diag(6707, ts.DiagnosticCategory.Message, "Specify_the_folder_for_tsbuildinfo_incremental_compilation_files_6707", "Specify the folder for .tsbuildinfo incremental compilation files."),
|
|
9279
9278
|
Specify_options_for_automatic_acquisition_of_declaration_files: diag(6709, ts.DiagnosticCategory.Message, "Specify_options_for_automatic_acquisition_of_declaration_files_6709", "Specify options for automatic acquisition of declaration files."),
|
|
9280
|
-
Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types: diag(6710, ts.DiagnosticCategory.Message, "Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types_6710", "Specify multiple folders that act like
|
|
9279
|
+
Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types: diag(6710, ts.DiagnosticCategory.Message, "Specify_multiple_folders_that_act_like_Slashnode_modules_Slash_types_6710", "Specify multiple folders that act like './node_modules/@types'."),
|
|
9281
9280
|
Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file: diag(6711, ts.DiagnosticCategory.Message, "Specify_type_package_names_to_be_included_without_being_referenced_in_a_source_file_6711", "Specify type package names to be included without being referenced in a source file."),
|
|
9282
9281
|
Emit_ECMAScript_standard_compliant_class_fields: diag(6712, ts.DiagnosticCategory.Message, "Emit_ECMAScript_standard_compliant_class_fields_6712", "Emit ECMAScript-standard-compliant class fields."),
|
|
9283
|
-
Enable_verbose_logging: diag(6713, ts.DiagnosticCategory.Message, "Enable_verbose_logging_6713", "Enable verbose logging"),
|
|
9282
|
+
Enable_verbose_logging: diag(6713, ts.DiagnosticCategory.Message, "Enable_verbose_logging_6713", "Enable verbose logging."),
|
|
9284
9283
|
Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality: diag(6714, ts.DiagnosticCategory.Message, "Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality_6714", "Specify how directories are watched on systems that lack recursive file-watching functionality."),
|
|
9285
9284
|
Specify_how_the_TypeScript_watch_mode_works: diag(6715, ts.DiagnosticCategory.Message, "Specify_how_the_TypeScript_watch_mode_works_6715", "Specify how the TypeScript watch mode works."),
|
|
9286
|
-
Include_undefined_in_index_signature_results: diag(6716, ts.DiagnosticCategory.Message, "Include_undefined_in_index_signature_results_6716", "Include 'undefined' in index signature results"),
|
|
9287
9285
|
Require_undeclared_properties_from_index_signatures_to_use_element_accesses: diag(6717, ts.DiagnosticCategory.Message, "Require_undeclared_properties_from_index_signatures_to_use_element_accesses_6717", "Require undeclared properties from index signatures to use element accesses."),
|
|
9288
|
-
Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types: diag(6718, ts.DiagnosticCategory.Message, "Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718", "Specify emit/checking behavior for imports that are only used for types"),
|
|
9289
|
-
|
|
9286
|
+
Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types: diag(6718, ts.DiagnosticCategory.Message, "Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types_6718", "Specify emit/checking behavior for imports that are only used for types."),
|
|
9287
|
+
Default_catch_clause_variables_as_unknown_instead_of_any: diag(6803, ts.DiagnosticCategory.Message, "Default_catch_clause_variables_as_unknown_instead_of_any_6803", "Default catch clause variables as 'unknown' instead of 'any'."),
|
|
9290
9288
|
one_of_Colon: diag(6900, ts.DiagnosticCategory.Message, "one_of_Colon_6900", "one of:"),
|
|
9291
9289
|
one_or_more_Colon: diag(6901, ts.DiagnosticCategory.Message, "one_or_more_Colon_6901", "one or more:"),
|
|
9292
9290
|
type_Colon: diag(6902, ts.DiagnosticCategory.Message, "type_Colon_6902", "type:"),
|
|
@@ -12837,7 +12835,7 @@ var ts;
|
|
|
12837
12835
|
return ts.emptyArray;
|
|
12838
12836
|
}
|
|
12839
12837
|
if (ts.isJSDocTypeAlias(node)) {
|
|
12840
|
-
ts.Debug.assert(node.parent.kind === 319 /*
|
|
12838
|
+
ts.Debug.assert(node.parent.kind === 319 /* JSDoc */);
|
|
12841
12839
|
return ts.flatMap(node.parent.tags, function (tag) { return ts.isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; });
|
|
12842
12840
|
}
|
|
12843
12841
|
if (node.typeParameters) {
|
|
@@ -13784,7 +13782,7 @@ var ts;
|
|
|
13784
13782
|
ts.isJSDocNode = isJSDocNode;
|
|
13785
13783
|
/** True if node is of a kind that may contain comment text. */
|
|
13786
13784
|
function isJSDocCommentContainingNode(node) {
|
|
13787
|
-
return node.kind === 319 /*
|
|
13785
|
+
return node.kind === 319 /* JSDoc */
|
|
13788
13786
|
|| node.kind === 318 /* JSDocNamepathType */
|
|
13789
13787
|
|| node.kind === 320 /* JSDocText */
|
|
13790
13788
|
|| isJSDocLinkLike(node)
|
|
@@ -14834,7 +14832,7 @@ var ts;
|
|
|
14834
14832
|
return name.kind === 161 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression);
|
|
14835
14833
|
}
|
|
14836
14834
|
ts.isComputedNonLiteralName = isComputedNonLiteralName;
|
|
14837
|
-
function
|
|
14835
|
+
function tryGetTextOfPropertyName(name) {
|
|
14838
14836
|
switch (name.kind) {
|
|
14839
14837
|
case 79 /* Identifier */:
|
|
14840
14838
|
case 80 /* PrivateIdentifier */:
|
|
@@ -14846,11 +14844,15 @@ var ts;
|
|
|
14846
14844
|
case 161 /* ComputedPropertyName */:
|
|
14847
14845
|
if (isStringOrNumericLiteralLike(name.expression))
|
|
14848
14846
|
return ts.escapeLeadingUnderscores(name.expression.text);
|
|
14849
|
-
return
|
|
14847
|
+
return undefined;
|
|
14850
14848
|
default:
|
|
14851
14849
|
return ts.Debug.assertNever(name);
|
|
14852
14850
|
}
|
|
14853
14851
|
}
|
|
14852
|
+
ts.tryGetTextOfPropertyName = tryGetTextOfPropertyName;
|
|
14853
|
+
function getTextOfPropertyName(name) {
|
|
14854
|
+
return ts.Debug.checkDefined(tryGetTextOfPropertyName(name));
|
|
14855
|
+
}
|
|
14854
14856
|
ts.getTextOfPropertyName = getTextOfPropertyName;
|
|
14855
14857
|
function entityNameToString(name) {
|
|
14856
14858
|
switch (name.kind) {
|
|
@@ -15402,7 +15404,7 @@ var ts;
|
|
|
15402
15404
|
function getPropertyAssignment(objectLiteral, key, key2) {
|
|
15403
15405
|
return objectLiteral.properties.filter(function (property) {
|
|
15404
15406
|
if (property.kind === 295 /* PropertyAssignment */) {
|
|
15405
|
-
var propName =
|
|
15407
|
+
var propName = tryGetTextOfPropertyName(property.name);
|
|
15406
15408
|
return key === propName || (!!key2 && key2 === propName);
|
|
15407
15409
|
}
|
|
15408
15410
|
return false;
|
|
@@ -18242,7 +18244,7 @@ var ts;
|
|
|
18242
18244
|
ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations;
|
|
18243
18245
|
/** template tags are only available when a typedef isn't already using them */
|
|
18244
18246
|
function isNonTypeAliasTemplate(tag) {
|
|
18245
|
-
return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 319 /*
|
|
18247
|
+
return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 319 /* JSDoc */ && tag.parent.tags.some(isJSDocTypeAlias));
|
|
18246
18248
|
}
|
|
18247
18249
|
/**
|
|
18248
18250
|
* Gets the effective type annotation of the value parameter of a set accessor. If the node
|
|
@@ -21014,7 +21016,6 @@ var ts;
|
|
|
21014
21016
|
parenthesizeExpressionForDisallowedComma: parenthesizeExpressionForDisallowedComma,
|
|
21015
21017
|
parenthesizeExpressionOfExpressionStatement: parenthesizeExpressionOfExpressionStatement,
|
|
21016
21018
|
parenthesizeConciseBodyOfArrowFunction: parenthesizeConciseBodyOfArrowFunction,
|
|
21017
|
-
parenthesizeCheckTypeOfConditionalType: parenthesizeCheckTypeOfConditionalType,
|
|
21018
21019
|
parenthesizeMemberOfConditionalType: parenthesizeMemberOfConditionalType,
|
|
21019
21020
|
parenthesizeMemberOfElementType: parenthesizeMemberOfElementType,
|
|
21020
21021
|
parenthesizeElementTypeOfArrayType: parenthesizeElementTypeOfArrayType,
|
|
@@ -21331,10 +21332,6 @@ var ts;
|
|
|
21331
21332
|
}
|
|
21332
21333
|
return body;
|
|
21333
21334
|
}
|
|
21334
|
-
function parenthesizeCheckTypeOfConditionalType(member) {
|
|
21335
|
-
return ts.isInferTypeNode(member) ? factory.createParenthesizedType(member) :
|
|
21336
|
-
parenthesizeMemberOfConditionalType(member);
|
|
21337
|
-
}
|
|
21338
21335
|
function parenthesizeMemberOfConditionalType(member) {
|
|
21339
21336
|
return member.kind === 188 /* ConditionalType */ ? factory.createParenthesizedType(member) : member;
|
|
21340
21337
|
}
|
|
@@ -21387,7 +21384,6 @@ var ts;
|
|
|
21387
21384
|
parenthesizeExpressionForDisallowedComma: ts.identity,
|
|
21388
21385
|
parenthesizeExpressionOfExpressionStatement: ts.identity,
|
|
21389
21386
|
parenthesizeConciseBodyOfArrowFunction: ts.identity,
|
|
21390
|
-
parenthesizeCheckTypeOfConditionalType: ts.identity,
|
|
21391
21387
|
parenthesizeMemberOfConditionalType: ts.identity,
|
|
21392
21388
|
parenthesizeMemberOfElementType: ts.identity,
|
|
21393
21389
|
parenthesizeElementTypeOfArrayType: ts.identity,
|
|
@@ -23004,7 +23000,7 @@ var ts;
|
|
|
23004
23000
|
// @api
|
|
23005
23001
|
function createConditionalTypeNode(checkType, extendsType, trueType, falseType) {
|
|
23006
23002
|
var node = createBaseNode(188 /* ConditionalType */);
|
|
23007
|
-
node.checkType = parenthesizerRules().
|
|
23003
|
+
node.checkType = parenthesizerRules().parenthesizeMemberOfConditionalType(checkType);
|
|
23008
23004
|
node.extendsType = parenthesizerRules().parenthesizeMemberOfConditionalType(extendsType);
|
|
23009
23005
|
node.trueType = trueType;
|
|
23010
23006
|
node.falseType = falseType;
|
|
@@ -25225,7 +25221,7 @@ var ts;
|
|
|
25225
25221
|
}
|
|
25226
25222
|
// @api
|
|
25227
25223
|
function createJSDocComment(comment, tags) {
|
|
25228
|
-
var node = createBaseNode(319 /*
|
|
25224
|
+
var node = createBaseNode(319 /* JSDoc */);
|
|
25229
25225
|
node.comment = comment;
|
|
25230
25226
|
node.tags = asNodeArray(tags);
|
|
25231
25227
|
return node;
|
|
@@ -28734,7 +28730,7 @@ var ts;
|
|
|
28734
28730
|
}
|
|
28735
28731
|
ts.isJSDocNamepathType = isJSDocNamepathType;
|
|
28736
28732
|
function isJSDoc(node) {
|
|
28737
|
-
return node.kind === 319 /*
|
|
28733
|
+
return node.kind === 319 /* JSDoc */;
|
|
28738
28734
|
}
|
|
28739
28735
|
ts.isJSDoc = isJSDoc;
|
|
28740
28736
|
function isJSDocTypeLiteral(node) {
|
|
@@ -30359,7 +30355,7 @@ var ts;
|
|
|
30359
30355
|
case 316 /* JSDocFunctionType */:
|
|
30360
30356
|
return visitNodes(cbNode, cbNodes, node.parameters) ||
|
|
30361
30357
|
visitNode(cbNode, node.type);
|
|
30362
|
-
case 319 /*
|
|
30358
|
+
case 319 /* JSDoc */:
|
|
30363
30359
|
return (typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment))
|
|
30364
30360
|
|| visitNodes(cbNode, cbNodes, node.tags);
|
|
30365
30361
|
case 345 /* JSDocSeeTag */:
|
|
@@ -32578,9 +32574,6 @@ var ts;
|
|
|
32578
32574
|
return finishNode(factory.createTypeQueryNode(entityName, typeArguments), pos);
|
|
32579
32575
|
}
|
|
32580
32576
|
function parseTypeParameter() {
|
|
32581
|
-
return parseTypeParameterWorker(/*canHaveDefault*/ true);
|
|
32582
|
-
}
|
|
32583
|
-
function parseTypeParameterWorker(canHaveDefault) {
|
|
32584
32577
|
var pos = getNodePos();
|
|
32585
32578
|
var name = parseIdentifier();
|
|
32586
32579
|
var constraint;
|
|
@@ -32604,7 +32597,7 @@ var ts;
|
|
|
32604
32597
|
expression = parseUnaryExpressionOrHigher();
|
|
32605
32598
|
}
|
|
32606
32599
|
}
|
|
32607
|
-
var defaultType =
|
|
32600
|
+
var defaultType = parseOptional(63 /* EqualsToken */) ? parseType() : undefined;
|
|
32608
32601
|
var node = factory.createTypeParameterDeclaration(name, constraint, defaultType);
|
|
32609
32602
|
node.expression = expression;
|
|
32610
32603
|
return finishNode(node, pos);
|
|
@@ -33269,10 +33262,16 @@ var ts;
|
|
|
33269
33262
|
parseExpected(operator);
|
|
33270
33263
|
return finishNode(factory.createTypeOperatorNode(operator, parseTypeOperatorOrHigher()), pos);
|
|
33271
33264
|
}
|
|
33265
|
+
function parseTypeParameterOfInferType() {
|
|
33266
|
+
var pos = getNodePos();
|
|
33267
|
+
return finishNode(factory.createTypeParameterDeclaration(parseIdentifier(),
|
|
33268
|
+
/*constraint*/ undefined,
|
|
33269
|
+
/*defaultType*/ undefined), pos);
|
|
33270
|
+
}
|
|
33272
33271
|
function parseInferType() {
|
|
33273
33272
|
var pos = getNodePos();
|
|
33274
33273
|
parseExpected(137 /* InferKeyword */);
|
|
33275
|
-
return finishNode(factory.createInferTypeNode(
|
|
33274
|
+
return finishNode(factory.createInferTypeNode(parseTypeParameterOfInferType()), pos);
|
|
33276
33275
|
}
|
|
33277
33276
|
function parseTypeOperatorOrHigher() {
|
|
33278
33277
|
var operator = token();
|
|
@@ -38590,7 +38589,7 @@ var ts;
|
|
|
38590
38589
|
shortName: "i",
|
|
38591
38590
|
type: "boolean",
|
|
38592
38591
|
category: ts.Diagnostics.Projects,
|
|
38593
|
-
description: ts.Diagnostics.
|
|
38592
|
+
description: ts.Diagnostics.Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects,
|
|
38594
38593
|
transpileOptionValue: undefined,
|
|
38595
38594
|
defaultValueDescription: ts.Diagnostics.false_unless_composite_is_set
|
|
38596
38595
|
},
|
|
@@ -38990,7 +38989,7 @@ var ts;
|
|
|
38990
38989
|
affectsSemanticDiagnostics: true,
|
|
38991
38990
|
strictFlag: true,
|
|
38992
38991
|
category: ts.Diagnostics.Type_Checking,
|
|
38993
|
-
description: ts.Diagnostics.
|
|
38992
|
+
description: ts.Diagnostics.Default_catch_clause_variables_as_unknown_instead_of_any,
|
|
38994
38993
|
defaultValueDescription: false,
|
|
38995
38994
|
},
|
|
38996
38995
|
{
|
|
@@ -39008,7 +39007,7 @@ var ts;
|
|
|
39008
39007
|
type: "boolean",
|
|
39009
39008
|
affectsSemanticDiagnostics: true,
|
|
39010
39009
|
category: ts.Diagnostics.Type_Checking,
|
|
39011
|
-
description: ts.Diagnostics.
|
|
39010
|
+
description: ts.Diagnostics.Enable_error_reporting_when_local_variables_aren_t_read,
|
|
39012
39011
|
defaultValueDescription: false,
|
|
39013
39012
|
},
|
|
39014
39013
|
{
|
|
@@ -39049,7 +39048,7 @@ var ts;
|
|
|
39049
39048
|
type: "boolean",
|
|
39050
39049
|
affectsSemanticDiagnostics: true,
|
|
39051
39050
|
category: ts.Diagnostics.Type_Checking,
|
|
39052
|
-
description: ts.Diagnostics.
|
|
39051
|
+
description: ts.Diagnostics.Add_undefined_to_a_type_when_accessed_using_an_index,
|
|
39053
39052
|
defaultValueDescription: false,
|
|
39054
39053
|
},
|
|
39055
39054
|
{
|
|
@@ -39240,7 +39239,8 @@ var ts;
|
|
|
39240
39239
|
name: "jsxFragmentFactory",
|
|
39241
39240
|
type: "string",
|
|
39242
39241
|
category: ts.Diagnostics.Language_and_Environment,
|
|
39243
|
-
description: ts.Diagnostics.Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment
|
|
39242
|
+
description: ts.Diagnostics.Specify_the_JSX_Fragment_reference_used_for_fragments_when_targeting_React_JSX_emit_e_g_React_Fragment_or_Fragment,
|
|
39243
|
+
defaultValueDescription: "React.Fragment",
|
|
39244
39244
|
},
|
|
39245
39245
|
{
|
|
39246
39246
|
name: "jsxImportSource",
|
|
@@ -39524,7 +39524,7 @@ var ts;
|
|
|
39524
39524
|
name: "plugin",
|
|
39525
39525
|
type: "object"
|
|
39526
39526
|
},
|
|
39527
|
-
description: ts.Diagnostics.
|
|
39527
|
+
description: ts.Diagnostics.Specify_a_list_of_language_service_plugins_to_include,
|
|
39528
39528
|
category: ts.Diagnostics.Editor_Support,
|
|
39529
39529
|
},
|
|
39530
39530
|
];
|
|
@@ -44329,7 +44329,7 @@ var ts;
|
|
|
44329
44329
|
return ts.isDottedName(expr)
|
|
44330
44330
|
|| (ts.isPropertyAccessExpression(expr) || ts.isNonNullExpression(expr) || ts.isParenthesizedExpression(expr)) && isNarrowableReference(expr.expression)
|
|
44331
44331
|
|| ts.isBinaryExpression(expr) && expr.operatorToken.kind === 27 /* CommaToken */ && isNarrowableReference(expr.right)
|
|
44332
|
-
|| ts.isElementAccessExpression(expr) && ts.isStringOrNumericLiteralLike(expr.argumentExpression) && isNarrowableReference(expr.expression)
|
|
44332
|
+
|| ts.isElementAccessExpression(expr) && (ts.isStringOrNumericLiteralLike(expr.argumentExpression) || ts.isEntityNameExpression(expr.argumentExpression)) && isNarrowableReference(expr.expression)
|
|
44333
44333
|
|| ts.isAssignmentExpression(expr) && isNarrowableReference(expr.left);
|
|
44334
44334
|
}
|
|
44335
44335
|
function containsNarrowableReference(expr) {
|
|
@@ -48607,7 +48607,7 @@ var ts;
|
|
|
48607
48607
|
// - parameters are only in the scope of function body
|
|
48608
48608
|
// This restriction does not apply to JSDoc comment types because they are parented
|
|
48609
48609
|
// at a higher level than type parameters would normally be
|
|
48610
|
-
if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 319 /*
|
|
48610
|
+
if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 319 /* JSDoc */) {
|
|
48611
48611
|
useResult = result.flags & 262144 /* TypeParameter */
|
|
48612
48612
|
// type parameters are visible in parameter list, return type and type parameter list
|
|
48613
48613
|
? lastLocation === location.type ||
|
|
@@ -52565,7 +52565,15 @@ var ts;
|
|
|
52565
52565
|
});
|
|
52566
52566
|
}
|
|
52567
52567
|
}
|
|
52568
|
-
if (
|
|
52568
|
+
if (symbolName === undefined) {
|
|
52569
|
+
var name = ts.firstDefined(symbol.declarations, ts.getNameOfDeclaration);
|
|
52570
|
+
if (name && ts.isComputedPropertyName(name) && ts.isEntityName(name.expression)) {
|
|
52571
|
+
var LHS = createAccessFromSymbolChain(chain, index - 1, stopper);
|
|
52572
|
+
if (ts.isEntityName(LHS)) {
|
|
52573
|
+
return ts.factory.createIndexedAccessTypeNode(ts.factory.createParenthesizedType(ts.factory.createTypeQueryNode(LHS)), ts.factory.createTypeQueryNode(name.expression));
|
|
52574
|
+
}
|
|
52575
|
+
return LHS;
|
|
52576
|
+
}
|
|
52569
52577
|
symbolName = getNameOfSymbolAsWritten(symbol, context);
|
|
52570
52578
|
}
|
|
52571
52579
|
context.approximateLength += symbolName.length + 1;
|
|
@@ -55891,7 +55899,7 @@ var ts;
|
|
|
55891
55899
|
node = paramSymbol.valueDeclaration;
|
|
55892
55900
|
}
|
|
55893
55901
|
break;
|
|
55894
|
-
case 319 /*
|
|
55902
|
+
case 319 /* JSDoc */: {
|
|
55895
55903
|
var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes);
|
|
55896
55904
|
return node.tags
|
|
55897
55905
|
? appendTypeParameters(outerTypeParameters, ts.flatMap(node.tags, function (t) { return ts.isJSDocTemplateTag(t) ? t.typeParameters : undefined; }))
|
|
@@ -59340,7 +59348,7 @@ var ts;
|
|
|
59340
59348
|
function getConditionalFlowTypeOfType(type, node) {
|
|
59341
59349
|
var constraints;
|
|
59342
59350
|
var covariant = true;
|
|
59343
|
-
while (node && !ts.isStatement(node) && node.kind !== 319 /*
|
|
59351
|
+
while (node && !ts.isStatement(node) && node.kind !== 319 /* JSDoc */) {
|
|
59344
59352
|
var parent = node.parent;
|
|
59345
59353
|
// only consider variance flipped by parameter locations - `keyof` types would usually be considered variance inverting, but
|
|
59346
59354
|
// often get used in indexed accesses where they behave sortof invariantly, but our checking is lax
|
|
@@ -60007,6 +60015,10 @@ var ts;
|
|
|
60007
60015
|
return includes;
|
|
60008
60016
|
}
|
|
60009
60017
|
function removeSubtypes(types, hasObjectTypes) {
|
|
60018
|
+
// [] and [T] immediately reduce to [] and [T] respectively
|
|
60019
|
+
if (types.length < 2) {
|
|
60020
|
+
return types;
|
|
60021
|
+
}
|
|
60010
60022
|
var id = getTypeListId(types);
|
|
60011
60023
|
var match = subtypeReductionCache.get(id);
|
|
60012
60024
|
if (match) {
|
|
@@ -65305,7 +65317,7 @@ var ts;
|
|
|
65305
65317
|
var requireOptionalProperties = (relation === subtypeRelation || relation === strictSubtypeRelation) && !isObjectLiteralType(source) && !isEmptyArrayLiteralType(source) && !isTupleType(source);
|
|
65306
65318
|
var unmatchedProperty = getUnmatchedProperty(source, target, requireOptionalProperties, /*matchDiscriminantProperties*/ false);
|
|
65307
65319
|
if (unmatchedProperty) {
|
|
65308
|
-
if (reportErrors) {
|
|
65320
|
+
if (reportErrors && shouldReportUnmatchedPropertyError(source, target)) {
|
|
65309
65321
|
reportUnmatchedProperty(source, target, unmatchedProperty, requireOptionalProperties);
|
|
65310
65322
|
}
|
|
65311
65323
|
return 0 /* False */;
|
|
@@ -65461,6 +65473,19 @@ var ts;
|
|
|
65461
65473
|
}
|
|
65462
65474
|
return result;
|
|
65463
65475
|
}
|
|
65476
|
+
function shouldReportUnmatchedPropertyError(source, target) {
|
|
65477
|
+
var typeCallSignatures = getSignaturesOfStructuredType(source, 0 /* Call */);
|
|
65478
|
+
var typeConstructSignatures = getSignaturesOfStructuredType(source, 1 /* Construct */);
|
|
65479
|
+
var typeProperties = getPropertiesOfObjectType(source);
|
|
65480
|
+
if ((typeCallSignatures.length || typeConstructSignatures.length) && !typeProperties.length) {
|
|
65481
|
+
if ((getSignaturesOfType(target, 0 /* Call */).length && typeCallSignatures.length) ||
|
|
65482
|
+
(getSignaturesOfType(target, 1 /* Construct */).length && typeConstructSignatures.length)) {
|
|
65483
|
+
return true; // target has similar signature kinds to source, still focus on the unmatched property
|
|
65484
|
+
}
|
|
65485
|
+
return false;
|
|
65486
|
+
}
|
|
65487
|
+
return true;
|
|
65488
|
+
}
|
|
65464
65489
|
function reportIncompatibleCallSignatureReturn(siga, sigb) {
|
|
65465
65490
|
if (siga.parameters.length === 0 && sigb.parameters.length === 0) {
|
|
65466
65491
|
return function (source, target) { return reportIncompatibleError(ts.Diagnostics.Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1, typeToString(source), typeToString(target)); };
|
|
@@ -68036,8 +68061,9 @@ var ts;
|
|
|
68036
68061
|
return isMatchingReference(source.expression, target);
|
|
68037
68062
|
case 205 /* PropertyAccessExpression */:
|
|
68038
68063
|
case 206 /* ElementAccessExpression */:
|
|
68039
|
-
|
|
68040
|
-
|
|
68064
|
+
var sourcePropertyName = getAccessedPropertyName(source);
|
|
68065
|
+
var targetPropertyName = ts.isAccessExpression(target) ? getAccessedPropertyName(target) : undefined;
|
|
68066
|
+
return sourcePropertyName !== undefined && targetPropertyName !== undefined && targetPropertyName === sourcePropertyName &&
|
|
68041
68067
|
isMatchingReference(source.expression, target.expression);
|
|
68042
68068
|
case 160 /* QualifiedName */:
|
|
68043
68069
|
return ts.isAccessExpression(target) &&
|
|
@@ -68049,12 +68075,49 @@ var ts;
|
|
|
68049
68075
|
return false;
|
|
68050
68076
|
}
|
|
68051
68077
|
function getAccessedPropertyName(access) {
|
|
68052
|
-
|
|
68053
|
-
|
|
68054
|
-
|
|
68055
|
-
|
|
68056
|
-
|
|
68057
|
-
|
|
68078
|
+
if (ts.isPropertyAccessExpression(access)) {
|
|
68079
|
+
return access.name.escapedText;
|
|
68080
|
+
}
|
|
68081
|
+
if (ts.isElementAccessExpression(access)) {
|
|
68082
|
+
return tryGetElementAccessExpressionName(access);
|
|
68083
|
+
}
|
|
68084
|
+
if (ts.isBindingElement(access)) {
|
|
68085
|
+
var name = getDestructuringPropertyName(access);
|
|
68086
|
+
return name ? ts.escapeLeadingUnderscores(name) : undefined;
|
|
68087
|
+
}
|
|
68088
|
+
if (ts.isParameter(access)) {
|
|
68089
|
+
return ("" + access.parent.parameters.indexOf(access));
|
|
68090
|
+
}
|
|
68091
|
+
return undefined;
|
|
68092
|
+
}
|
|
68093
|
+
function tryGetNameFromType(type) {
|
|
68094
|
+
return type.flags & 8192 /* UniqueESSymbol */ ? type.escapedName :
|
|
68095
|
+
type.flags & 384 /* StringOrNumberLiteral */ ? ts.escapeLeadingUnderscores("" + type.value) : undefined;
|
|
68096
|
+
}
|
|
68097
|
+
function tryGetElementAccessExpressionName(node) {
|
|
68098
|
+
if (ts.isStringOrNumericLiteralLike(node.argumentExpression)) {
|
|
68099
|
+
return ts.escapeLeadingUnderscores(node.argumentExpression.text);
|
|
68100
|
+
}
|
|
68101
|
+
if (ts.isEntityNameExpression(node.argumentExpression)) {
|
|
68102
|
+
var symbol = resolveEntityName(node.argumentExpression, 111551 /* Value */, /*ignoreErrors*/ true);
|
|
68103
|
+
if (!symbol || !isConstVariable(symbol))
|
|
68104
|
+
return undefined;
|
|
68105
|
+
var declaration = symbol.valueDeclaration;
|
|
68106
|
+
if (declaration === undefined)
|
|
68107
|
+
return undefined;
|
|
68108
|
+
var type = tryGetTypeFromEffectiveTypeNode(declaration);
|
|
68109
|
+
if (type) {
|
|
68110
|
+
var name = tryGetNameFromType(type);
|
|
68111
|
+
if (name !== undefined) {
|
|
68112
|
+
return name;
|
|
68113
|
+
}
|
|
68114
|
+
}
|
|
68115
|
+
if (ts.hasOnlyExpressionInitializer(declaration)) {
|
|
68116
|
+
var initializer = ts.getEffectiveInitializer(declaration);
|
|
68117
|
+
return initializer && tryGetNameFromType(getTypeOfExpression(initializer));
|
|
68118
|
+
}
|
|
68119
|
+
}
|
|
68120
|
+
return undefined;
|
|
68058
68121
|
}
|
|
68059
68122
|
function containsMatchingReference(source, target) {
|
|
68060
68123
|
while (ts.isAccessExpression(source)) {
|
|
@@ -71560,11 +71623,21 @@ var ts;
|
|
|
71560
71623
|
}
|
|
71561
71624
|
return false;
|
|
71562
71625
|
}
|
|
71626
|
+
function uniqueStrings(strings) {
|
|
71627
|
+
var unique = new ts.Set(strings);
|
|
71628
|
+
var result = [];
|
|
71629
|
+
unique.forEach(function (str) { return result.push(str); });
|
|
71630
|
+
return result;
|
|
71631
|
+
}
|
|
71563
71632
|
function discriminateContextualTypeByObjectMembers(node, contextualType) {
|
|
71564
|
-
return getMatchingUnionConstituentForObjectLiteral(contextualType, node) || discriminateTypeByDiscriminableItems(contextualType, ts.concatenate(ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 295 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return getContextFreeTypeOfExpression(prop.initializer); }, prop.symbol.escapedName]; }), ts.map(ts.
|
|
71633
|
+
return getMatchingUnionConstituentForObjectLiteral(contextualType, node) || discriminateTypeByDiscriminableItems(contextualType, ts.concatenate(ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 295 /* PropertyAssignment */ && isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName); }), function (prop) { return [function () { return getContextFreeTypeOfExpression(prop.initializer); }, prop.symbol.escapedName]; }), ts.map(uniqueStrings(ts.flatMap(contextualType.types, function (memberType) {
|
|
71634
|
+
return ts.map(ts.filter(getPropertiesOfType(memberType), function (s) { var _a; return !!(s.flags & 16777216 /* Optional */) && !!((_a = node === null || node === void 0 ? void 0 : node.symbol) === null || _a === void 0 ? void 0 : _a.members) && !node.symbol.members.has(s.escapedName) && isDiscriminantProperty(contextualType, s.escapedName); }), function (s) { return s.escapedName; });
|
|
71635
|
+
})), function (name) { return [function () { return undefinedType; }, name]; })), isTypeAssignableTo, contextualType);
|
|
71565
71636
|
}
|
|
71566
71637
|
function discriminateContextualTypeByJSXAttributes(node, contextualType) {
|
|
71567
|
-
return discriminateTypeByDiscriminableItems(contextualType, ts.concatenate(ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 284 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return getContextFreeTypeOfExpression(prop.initializer); }), prop.symbol.escapedName]; }), ts.map(ts.
|
|
71638
|
+
return discriminateTypeByDiscriminableItems(contextualType, ts.concatenate(ts.map(ts.filter(node.properties, function (p) { return !!p.symbol && p.kind === 284 /* JsxAttribute */ && isDiscriminantProperty(contextualType, p.symbol.escapedName) && (!p.initializer || isPossiblyDiscriminantValue(p.initializer)); }), function (prop) { return [!prop.initializer ? (function () { return trueType; }) : (function () { return getContextFreeTypeOfExpression(prop.initializer); }), prop.symbol.escapedName]; }), ts.map(uniqueStrings(ts.flatMap(contextualType.types, function (memberType) {
|
|
71639
|
+
return ts.map(ts.filter(getPropertiesOfType(memberType), function (s) { var _a; return !!(s.flags & 16777216 /* Optional */) && !!((_a = node === null || node === void 0 ? void 0 : node.symbol) === null || _a === void 0 ? void 0 : _a.members) && !node.symbol.members.has(s.escapedName) && isDiscriminantProperty(contextualType, s.escapedName); }), function (s) { return s.escapedName; });
|
|
71640
|
+
})), function (name) { return [function () { return undefinedType; }, name]; })), isTypeAssignableTo, contextualType);
|
|
71568
71641
|
}
|
|
71569
71642
|
// Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily
|
|
71570
71643
|
// be "pushed" onto a node using the contextualType property.
|
|
@@ -73059,21 +73132,20 @@ var ts;
|
|
|
73059
73132
|
// of the property as base classes
|
|
73060
73133
|
var enclosingClass = forEachEnclosingClass(location, function (enclosingDeclaration) {
|
|
73061
73134
|
var enclosingClass = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingDeclaration));
|
|
73062
|
-
return isClassDerivedFromDeclaringClasses(enclosingClass, prop, writing)
|
|
73135
|
+
return isClassDerivedFromDeclaringClasses(enclosingClass, prop, writing);
|
|
73063
73136
|
});
|
|
73064
73137
|
// A protected property is accessible if the property is within the declaring class or classes derived from it
|
|
73065
73138
|
if (!enclosingClass) {
|
|
73066
73139
|
// allow PropertyAccessibility if context is in function with this parameter
|
|
73067
|
-
// static member access is
|
|
73068
|
-
|
|
73069
|
-
|
|
73140
|
+
// static member access is disallowed
|
|
73141
|
+
enclosingClass = getEnclosingClassFromThisParameter(location);
|
|
73142
|
+
enclosingClass = enclosingClass && isClassDerivedFromDeclaringClasses(enclosingClass, prop, writing);
|
|
73143
|
+
if (flags & 32 /* Static */ || !enclosingClass) {
|
|
73070
73144
|
if (errorNode) {
|
|
73071
73145
|
error(errorNode, ts.Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(getDeclaringClass(prop) || containingType));
|
|
73072
73146
|
}
|
|
73073
73147
|
return false;
|
|
73074
73148
|
}
|
|
73075
|
-
var thisType = getTypeFromTypeNode(thisParameter.type);
|
|
73076
|
-
enclosingClass = ((thisType.flags & 262144 /* TypeParameter */) ? getConstraintOfTypeParameter(thisType) : thisType).target;
|
|
73077
73149
|
}
|
|
73078
73150
|
// No further restrictions for static properties
|
|
73079
73151
|
if (flags & 32 /* Static */) {
|
|
@@ -73091,6 +73163,17 @@ var ts;
|
|
|
73091
73163
|
}
|
|
73092
73164
|
return true;
|
|
73093
73165
|
}
|
|
73166
|
+
function getEnclosingClassFromThisParameter(node) {
|
|
73167
|
+
var thisParameter = getThisParameterFromNodeContext(node);
|
|
73168
|
+
var thisType = (thisParameter === null || thisParameter === void 0 ? void 0 : thisParameter.type) && getTypeFromTypeNode(thisParameter.type);
|
|
73169
|
+
if (thisType && thisType.flags & 262144 /* TypeParameter */) {
|
|
73170
|
+
thisType = getConstraintOfTypeParameter(thisType);
|
|
73171
|
+
}
|
|
73172
|
+
if (thisType && ts.getObjectFlags(thisType) & (3 /* ClassOrInterface */ | 4 /* Reference */)) {
|
|
73173
|
+
return getTargetType(thisType);
|
|
73174
|
+
}
|
|
73175
|
+
return undefined;
|
|
73176
|
+
}
|
|
73094
73177
|
function getThisParameterFromNodeContext(node) {
|
|
73095
73178
|
var thisContainer = ts.getThisContainer(node, /* includeArrowFunctions */ false);
|
|
73096
73179
|
return thisContainer && ts.isFunctionLike(thisContainer) ? ts.getThisParameter(thisContainer) : undefined;
|
|
@@ -75199,7 +75282,7 @@ var ts;
|
|
|
75199
75282
|
// then it cannot be instantiated.
|
|
75200
75283
|
// In the case of a merged class-module or class-interface declaration,
|
|
75201
75284
|
// only the class declaration node will have the Abstract flag set.
|
|
75202
|
-
if (constructSignatures
|
|
75285
|
+
if (someSignature(constructSignatures, function (signature) { return !!(signature.flags & 4 /* Abstract */); })) {
|
|
75203
75286
|
error(node, ts.Diagnostics.Cannot_create_an_instance_of_an_abstract_class);
|
|
75204
75287
|
return resolveErrorCall(node);
|
|
75205
75288
|
}
|
|
@@ -75230,6 +75313,12 @@ var ts;
|
|
|
75230
75313
|
invocationError(node.expression, expressionType, 1 /* Construct */);
|
|
75231
75314
|
return resolveErrorCall(node);
|
|
75232
75315
|
}
|
|
75316
|
+
function someSignature(signatures, f) {
|
|
75317
|
+
if (ts.isArray(signatures)) {
|
|
75318
|
+
return ts.some(signatures, function (signature) { return someSignature(signature, f); });
|
|
75319
|
+
}
|
|
75320
|
+
return signatures.compositeKind === 1048576 /* Union */ ? ts.some(signatures.compositeSignatures, f) : f(signatures);
|
|
75321
|
+
}
|
|
75233
75322
|
function typeHasProtectedAccessibleBase(target, type) {
|
|
75234
75323
|
var baseTypes = getBaseTypes(type);
|
|
75235
75324
|
if (!ts.length(baseTypes)) {
|
|
@@ -77072,7 +77161,7 @@ var ts;
|
|
|
77072
77161
|
case 40 /* MinusToken */:
|
|
77073
77162
|
case 54 /* TildeToken */:
|
|
77074
77163
|
checkNonNullType(operandType, node.operand);
|
|
77075
|
-
if (
|
|
77164
|
+
if (maybeTypeOfKindConsideringBaseConstraint(operandType, 12288 /* ESSymbolLike */)) {
|
|
77076
77165
|
error(node.operand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(node.operator));
|
|
77077
77166
|
}
|
|
77078
77167
|
if (node.operator === 39 /* PlusToken */) {
|
|
@@ -77120,6 +77209,13 @@ var ts;
|
|
|
77120
77209
|
// If it's not a bigint type, implicit coercion will result in a number
|
|
77121
77210
|
return numberType;
|
|
77122
77211
|
}
|
|
77212
|
+
function maybeTypeOfKindConsideringBaseConstraint(type, kind) {
|
|
77213
|
+
if (maybeTypeOfKind(type, kind)) {
|
|
77214
|
+
return true;
|
|
77215
|
+
}
|
|
77216
|
+
var baseConstraint = getBaseConstraintOrType(type);
|
|
77217
|
+
return !!baseConstraint && maybeTypeOfKind(baseConstraint, kind);
|
|
77218
|
+
}
|
|
77123
77219
|
// Return true if type might be of the given kind. A union or intersection type might be of a given
|
|
77124
77220
|
// kind if at least one constituent type is of the given kind.
|
|
77125
77221
|
function maybeTypeOfKind(type, kind) {
|
|
@@ -77829,8 +77925,8 @@ var ts;
|
|
|
77829
77925
|
}
|
|
77830
77926
|
// Return true if there was no error, false if there was an error.
|
|
77831
77927
|
function checkForDisallowedESSymbolOperand(operator) {
|
|
77832
|
-
var offendingSymbolOperand =
|
|
77833
|
-
|
|
77928
|
+
var offendingSymbolOperand = maybeTypeOfKindConsideringBaseConstraint(leftType, 12288 /* ESSymbolLike */) ? left :
|
|
77929
|
+
maybeTypeOfKindConsideringBaseConstraint(rightType, 12288 /* ESSymbolLike */) ? right :
|
|
77834
77930
|
undefined;
|
|
77835
77931
|
if (offendingSymbolOperand) {
|
|
77836
77932
|
error(offendingSymbolOperand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(operator));
|
|
@@ -78034,7 +78130,7 @@ var ts;
|
|
|
78034
78130
|
for (var _i = 0, _a = node.templateSpans; _i < _a.length; _i++) {
|
|
78035
78131
|
var span = _a[_i];
|
|
78036
78132
|
var type = checkExpression(span.expression);
|
|
78037
|
-
if (
|
|
78133
|
+
if (maybeTypeOfKindConsideringBaseConstraint(type, 12288 /* ESSymbolLike */)) {
|
|
78038
78134
|
error(span.expression, ts.Diagnostics.Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String);
|
|
78039
78135
|
}
|
|
78040
78136
|
texts.push(span.literal.text);
|
|
@@ -79380,23 +79476,6 @@ var ts;
|
|
|
79380
79476
|
grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type);
|
|
79381
79477
|
}
|
|
79382
79478
|
checkSourceElement(node.typeParameter);
|
|
79383
|
-
var symbol = getSymbolOfNode(node.typeParameter);
|
|
79384
|
-
if (symbol.declarations && symbol.declarations.length > 1) {
|
|
79385
|
-
var links = getSymbolLinks(symbol);
|
|
79386
|
-
if (!links.typeParametersChecked) {
|
|
79387
|
-
links.typeParametersChecked = true;
|
|
79388
|
-
var typeParameter = getDeclaredTypeOfTypeParameter(symbol);
|
|
79389
|
-
var declarations = ts.getDeclarationsOfKind(symbol, 162 /* TypeParameter */);
|
|
79390
|
-
if (!areTypeParametersIdentical(declarations, [typeParameter], function (decl) { return [decl]; })) {
|
|
79391
|
-
// Report an error on every conflicting declaration.
|
|
79392
|
-
var name = symbolToString(symbol);
|
|
79393
|
-
for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) {
|
|
79394
|
-
var declaration = declarations_4[_i];
|
|
79395
|
-
error(declaration.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_constraints, name);
|
|
79396
|
-
}
|
|
79397
|
-
}
|
|
79398
|
-
}
|
|
79399
|
-
}
|
|
79400
79479
|
registerForUnusedIdentifiersCheck(node);
|
|
79401
79480
|
}
|
|
79402
79481
|
function checkTemplateLiteralType(node) {
|
|
@@ -79576,8 +79655,8 @@ var ts;
|
|
|
79576
79655
|
var hasNonAmbientClass = false;
|
|
79577
79656
|
var functionDeclarations = [];
|
|
79578
79657
|
if (declarations) {
|
|
79579
|
-
for (var _i = 0,
|
|
79580
|
-
var current =
|
|
79658
|
+
for (var _i = 0, declarations_4 = declarations; _i < declarations_4.length; _i++) {
|
|
79659
|
+
var current = declarations_4[_i];
|
|
79581
79660
|
var node = current;
|
|
79582
79661
|
var inAmbientContext = node.flags & 8388608 /* Ambient */;
|
|
79583
79662
|
var inAmbientContextOrInterface = node.parent && (node.parent.kind === 257 /* InterfaceDeclaration */ || node.parent.kind === 181 /* TypeLiteral */) || inAmbientContext;
|
|
@@ -80724,8 +80803,8 @@ var ts;
|
|
|
80724
80803
|
: ts.createDiagnosticForNode(declarationList.parent.kind === 236 /* VariableStatement */ ? declarationList.parent : declarationList, ts.Diagnostics.All_variables_are_unused));
|
|
80725
80804
|
}
|
|
80726
80805
|
else {
|
|
80727
|
-
for (var _i = 0,
|
|
80728
|
-
var decl =
|
|
80806
|
+
for (var _i = 0, declarations_5 = declarations; _i < declarations_5.length; _i++) {
|
|
80807
|
+
var decl = declarations_5[_i];
|
|
80729
80808
|
addDiagnostic(decl, 0 /* Local */, ts.createDiagnosticForNode(decl, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, bindingNameText(decl.name)));
|
|
80730
80809
|
}
|
|
80731
80810
|
}
|
|
@@ -82518,23 +82597,23 @@ var ts;
|
|
|
82518
82597
|
return;
|
|
82519
82598
|
}
|
|
82520
82599
|
var type = getDeclaredTypeOfSymbol(symbol);
|
|
82521
|
-
if (!areTypeParametersIdentical(declarations, type.localTypeParameters
|
|
82600
|
+
if (!areTypeParametersIdentical(declarations, type.localTypeParameters)) {
|
|
82522
82601
|
// Report an error on every conflicting declaration.
|
|
82523
82602
|
var name = symbolToString(symbol);
|
|
82524
|
-
for (var _i = 0,
|
|
82525
|
-
var declaration =
|
|
82603
|
+
for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) {
|
|
82604
|
+
var declaration = declarations_6[_i];
|
|
82526
82605
|
error(declaration.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_type_parameters, name);
|
|
82527
82606
|
}
|
|
82528
82607
|
}
|
|
82529
82608
|
}
|
|
82530
82609
|
}
|
|
82531
|
-
function areTypeParametersIdentical(declarations, targetParameters
|
|
82610
|
+
function areTypeParametersIdentical(declarations, targetParameters) {
|
|
82532
82611
|
var maxTypeArgumentCount = ts.length(targetParameters);
|
|
82533
82612
|
var minTypeArgumentCount = getMinTypeArgumentCount(targetParameters);
|
|
82534
|
-
for (var _i = 0,
|
|
82535
|
-
var declaration =
|
|
82613
|
+
for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) {
|
|
82614
|
+
var declaration = declarations_7[_i];
|
|
82536
82615
|
// If this declaration has too few or too many type parameters, we report an error
|
|
82537
|
-
var sourceParameters =
|
|
82616
|
+
var sourceParameters = ts.getEffectiveTypeParameterDeclarations(declaration);
|
|
82538
82617
|
var numTypeParameters = sourceParameters.length;
|
|
82539
82618
|
if (numTypeParameters < minTypeArgumentCount || numTypeParameters > maxTypeArgumentCount) {
|
|
82540
82619
|
return false;
|
|
@@ -83078,7 +83157,7 @@ var ts;
|
|
|
83078
83157
|
}
|
|
83079
83158
|
if (!ts.isStatic(member) && isPropertyWithoutInitializer(member)) {
|
|
83080
83159
|
var propName = member.name;
|
|
83081
|
-
if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName)) {
|
|
83160
|
+
if (ts.isIdentifier(propName) || ts.isPrivateIdentifier(propName) || ts.isComputedPropertyName(propName)) {
|
|
83082
83161
|
var type = getTypeOfSymbol(getSymbolOfNode(member));
|
|
83083
83162
|
if (!(type.flags & 3 /* AnyOrUnknown */ || getFalsyFlags(type) & 32768 /* Undefined */)) {
|
|
83084
83163
|
if (!constructor || !isPropertyInitializedInConstructor(propName, type, constructor)) {
|
|
@@ -83113,7 +83192,9 @@ var ts;
|
|
|
83113
83192
|
return false;
|
|
83114
83193
|
}
|
|
83115
83194
|
function isPropertyInitializedInConstructor(propName, propType, constructor) {
|
|
83116
|
-
var reference = ts.
|
|
83195
|
+
var reference = ts.isComputedPropertyName(propName)
|
|
83196
|
+
? ts.factory.createElementAccessExpression(ts.factory.createThis(), propName.expression)
|
|
83197
|
+
: ts.factory.createPropertyAccessExpression(ts.factory.createThis(), propName);
|
|
83117
83198
|
ts.setParent(reference.expression, reference);
|
|
83118
83199
|
ts.setParent(reference, constructor);
|
|
83119
83200
|
reference.flowNode = constructor.returnFlowNode;
|
|
@@ -83402,8 +83483,8 @@ var ts;
|
|
|
83402
83483
|
function getFirstNonAmbientClassOrFunctionDeclaration(symbol) {
|
|
83403
83484
|
var declarations = symbol.declarations;
|
|
83404
83485
|
if (declarations) {
|
|
83405
|
-
for (var _i = 0,
|
|
83406
|
-
var declaration =
|
|
83486
|
+
for (var _i = 0, declarations_8 = declarations; _i < declarations_8.length; _i++) {
|
|
83487
|
+
var declaration = declarations_8[_i];
|
|
83407
83488
|
if ((declaration.kind === 256 /* ClassDeclaration */ ||
|
|
83408
83489
|
(declaration.kind === 255 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) &&
|
|
83409
83490
|
!(declaration.flags & 8388608 /* Ambient */)) {
|
|
@@ -92670,10 +92751,7 @@ var ts;
|
|
|
92670
92751
|
var substitute = typeof constantValue === "string" ? factory.createStringLiteral(constantValue) : factory.createNumericLiteral(constantValue);
|
|
92671
92752
|
if (!compilerOptions.removeComments) {
|
|
92672
92753
|
var originalNode = ts.getOriginalNode(node, ts.isAccessExpression);
|
|
92673
|
-
|
|
92674
|
-
? ts.declarationNameToString(originalNode.name)
|
|
92675
|
-
: safeMultiLineComment(ts.getTextOfNode(originalNode.argumentExpression));
|
|
92676
|
-
ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " " + propertyName + " ");
|
|
92754
|
+
ts.addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, " " + safeMultiLineComment(ts.getTextOfNode(originalNode)) + " ");
|
|
92677
92755
|
}
|
|
92678
92756
|
return substitute;
|
|
92679
92757
|
}
|
|
@@ -98472,8 +98550,8 @@ var ts;
|
|
|
98472
98550
|
// declarations may not be sorted by position.
|
|
98473
98551
|
// pos should be the minimum* position over all nodes (that's not -1), end should be the maximum end over all nodes.
|
|
98474
98552
|
var pos = -1, end = -1;
|
|
98475
|
-
for (var _i = 0,
|
|
98476
|
-
var node =
|
|
98553
|
+
for (var _i = 0, declarations_9 = declarations; _i < declarations_9.length; _i++) {
|
|
98554
|
+
var node = declarations_9[_i];
|
|
98477
98555
|
pos = pos === -1 ? node.pos : node.pos === -1 ? pos : Math.min(pos, node.pos);
|
|
98478
98556
|
end = Math.max(end, node.end);
|
|
98479
98557
|
}
|
|
@@ -109793,7 +109871,7 @@ var ts;
|
|
|
109793
109871
|
return emitRestOrJSDocVariadicType(node);
|
|
109794
109872
|
case 318 /* JSDocNamepathType */:
|
|
109795
109873
|
return;
|
|
109796
|
-
case 319 /*
|
|
109874
|
+
case 319 /* JSDoc */:
|
|
109797
109875
|
return emitJSDoc(node);
|
|
109798
109876
|
case 321 /* JSDocTypeLiteral */:
|
|
109799
109877
|
return emitJSDocTypeLiteral(node);
|
|
@@ -126539,6 +126617,14 @@ var ts;
|
|
|
126539
126617
|
});
|
|
126540
126618
|
}
|
|
126541
126619
|
ts.signatureToDisplayParts = signatureToDisplayParts;
|
|
126620
|
+
function nodeToDisplayParts(node, enclosingDeclaration) {
|
|
126621
|
+
var file = enclosingDeclaration.getSourceFile();
|
|
126622
|
+
return mapToDisplayParts(function (writer) {
|
|
126623
|
+
var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true });
|
|
126624
|
+
printer.writeNode(4 /* Unspecified */, node, file, writer);
|
|
126625
|
+
});
|
|
126626
|
+
}
|
|
126627
|
+
ts.nodeToDisplayParts = nodeToDisplayParts;
|
|
126542
126628
|
function isImportOrExportSpecifierName(location) {
|
|
126543
126629
|
return !!location.parent && ts.isImportOrExportSpecifier(location.parent) && location.parent.propertyName === location;
|
|
126544
126630
|
}
|
|
@@ -129879,6 +129965,8 @@ var ts;
|
|
|
129879
129965
|
CompletionSource["ClassMemberSnippet"] = "ClassMemberSnippet/";
|
|
129880
129966
|
/** A type-only import that needs to be promoted in order to be used at the completion location */
|
|
129881
129967
|
CompletionSource["TypeOnlyAlias"] = "TypeOnlyAlias/";
|
|
129968
|
+
/** Auto-import that comes attached to an object literal method snippet */
|
|
129969
|
+
CompletionSource["ObjectLiteralMethodSnippet"] = "ObjectLiteralMethodSnippet/";
|
|
129882
129970
|
})(CompletionSource = Completions.CompletionSource || (Completions.CompletionSource = {}));
|
|
129883
129971
|
var SymbolOriginInfoKind;
|
|
129884
129972
|
(function (SymbolOriginInfoKind) {
|
|
@@ -129889,6 +129977,7 @@ var ts;
|
|
|
129889
129977
|
SymbolOriginInfoKind[SymbolOriginInfoKind["Nullable"] = 16] = "Nullable";
|
|
129890
129978
|
SymbolOriginInfoKind[SymbolOriginInfoKind["ResolvedExport"] = 32] = "ResolvedExport";
|
|
129891
129979
|
SymbolOriginInfoKind[SymbolOriginInfoKind["TypeOnlyAlias"] = 64] = "TypeOnlyAlias";
|
|
129980
|
+
SymbolOriginInfoKind[SymbolOriginInfoKind["ObjectLiteralMethod"] = 128] = "ObjectLiteralMethod";
|
|
129892
129981
|
SymbolOriginInfoKind[SymbolOriginInfoKind["SymbolMemberNoExport"] = 2] = "SymbolMemberNoExport";
|
|
129893
129982
|
SymbolOriginInfoKind[SymbolOriginInfoKind["SymbolMemberExport"] = 6] = "SymbolMemberExport";
|
|
129894
129983
|
})(SymbolOriginInfoKind || (SymbolOriginInfoKind = {}));
|
|
@@ -129919,6 +130008,9 @@ var ts;
|
|
|
129919
130008
|
function originIsTypeOnlyAlias(origin) {
|
|
129920
130009
|
return !!(origin && origin.kind & 64 /* TypeOnlyAlias */);
|
|
129921
130010
|
}
|
|
130011
|
+
function originIsObjectLiteralMethod(origin) {
|
|
130012
|
+
return !!(origin && origin.kind & 128 /* ObjectLiteralMethod */);
|
|
130013
|
+
}
|
|
129922
130014
|
var KeywordCompletionFilters;
|
|
129923
130015
|
(function (KeywordCompletionFilters) {
|
|
129924
130016
|
KeywordCompletionFilters[KeywordCompletionFilters["None"] = 0] = "None";
|
|
@@ -130344,6 +130436,22 @@ var ts;
|
|
|
130344
130436
|
source = CompletionSource.ClassMemberSnippet;
|
|
130345
130437
|
}
|
|
130346
130438
|
}
|
|
130439
|
+
if (preferences.includeCompletionsWithObjectLiteralMethodSnippets
|
|
130440
|
+
&& preferences.includeCompletionsWithInsertText
|
|
130441
|
+
&& origin && originIsObjectLiteralMethod(origin)) {
|
|
130442
|
+
var objectLiteral = ts.cast(tryGetObjectLikeCompletionContainer(contextToken), ts.isObjectLiteralExpression);
|
|
130443
|
+
var importAdder = void 0;
|
|
130444
|
+
var entry = getEntryForObjectLiteralMethodCompletion(symbol, name, objectLiteral, program, host, options, preferences, formatContext);
|
|
130445
|
+
if (!entry) {
|
|
130446
|
+
return undefined;
|
|
130447
|
+
}
|
|
130448
|
+
(insertText = entry.insertText, isSnippet = entry.isSnippet, importAdder = entry.importAdder, sourceDisplay = entry.sourceDisplay);
|
|
130449
|
+
source = CompletionSource.ObjectLiteralMethodSnippet;
|
|
130450
|
+
sortText = (parseInt(sortText, 10) + 1).toString();
|
|
130451
|
+
if (importAdder.hasFixes()) {
|
|
130452
|
+
hasAction = true;
|
|
130453
|
+
}
|
|
130454
|
+
}
|
|
130347
130455
|
if (isJsxIdentifierExpected && !isRightOfOpenTag && preferences.includeCompletionsWithSnippetText && preferences.jsxAttributeCompletionStyle && preferences.jsxAttributeCompletionStyle !== "none") {
|
|
130348
130456
|
var useBraces_1 = preferences.jsxAttributeCompletionStyle === "braces";
|
|
130349
130457
|
var type = typeChecker.getTypeOfSymbolAtLocation(symbol, location);
|
|
@@ -130502,27 +130610,15 @@ var ts;
|
|
|
130502
130610
|
completionNodes.push(node);
|
|
130503
130611
|
}, body, 2 /* Property */, isAbstract);
|
|
130504
130612
|
if (completionNodes.length) {
|
|
130613
|
+
var format = 1 /* MultiLine */ | 131072 /* NoTrailingNewLine */;
|
|
130505
130614
|
replacementSpan = modifiersSpan;
|
|
130506
130615
|
// If we have access to formatting settings, we print the nodes using the emitter,
|
|
130507
130616
|
// and then format the printed text.
|
|
130508
130617
|
if (formatContext) {
|
|
130509
|
-
|
|
130510
|
-
text: printer.printSnippetList(1 /* MultiLine */ | 131072 /* NoTrailingNewLine */, ts.factory.createNodeArray(completionNodes), sourceFile),
|
|
130511
|
-
getLineAndCharacterOfPosition: function (pos) {
|
|
130512
|
-
return ts.getLineAndCharacterOfPosition(this, pos);
|
|
130513
|
-
},
|
|
130514
|
-
};
|
|
130515
|
-
var formatOptions_1 = ts.getFormatCodeSettingsForWriting(formatContext, sourceFile);
|
|
130516
|
-
var changes = ts.flatMap(completionNodes, function (node) {
|
|
130517
|
-
var nodeWithPos = ts.textChanges.assignPositionsToNode(node);
|
|
130518
|
-
return ts.formatting.formatNodeGivenIndentation(nodeWithPos, syntheticFile_1, sourceFile.languageVariant,
|
|
130519
|
-
/* indentation */ 0,
|
|
130520
|
-
/* delta */ 0, __assign(__assign({}, formatContext), { options: formatOptions_1 }));
|
|
130521
|
-
});
|
|
130522
|
-
insertText = ts.textChanges.applyChanges(syntheticFile_1.text, changes);
|
|
130618
|
+
insertText = printer.printAndFormatSnippetList(format, ts.factory.createNodeArray(completionNodes), sourceFile, formatContext);
|
|
130523
130619
|
}
|
|
130524
130620
|
else { // Otherwise, just use emitter to print the new nodes.
|
|
130525
|
-
insertText = printer.printSnippetList(
|
|
130621
|
+
insertText = printer.printSnippetList(format, ts.factory.createNodeArray(completionNodes), sourceFile);
|
|
130526
130622
|
}
|
|
130527
130623
|
}
|
|
130528
130624
|
return { insertText: insertText, isSnippet: isSnippet, importAdder: importAdder, replacementSpan: replacementSpan };
|
|
@@ -130572,12 +130668,92 @@ var ts;
|
|
|
130572
130668
|
}
|
|
130573
130669
|
return undefined;
|
|
130574
130670
|
}
|
|
130671
|
+
function getEntryForObjectLiteralMethodCompletion(symbol, name, enclosingDeclaration, program, host, options, preferences, formatContext) {
|
|
130672
|
+
var isSnippet;
|
|
130673
|
+
var insertText = name;
|
|
130674
|
+
var sourceFile = enclosingDeclaration.getSourceFile();
|
|
130675
|
+
var importAdder = ts.codefix.createImportAdder(sourceFile, program, preferences, host);
|
|
130676
|
+
var body;
|
|
130677
|
+
if (preferences.includeCompletionsWithSnippetText) {
|
|
130678
|
+
isSnippet = true;
|
|
130679
|
+
var emptyStmt = ts.factory.createEmptyStatement();
|
|
130680
|
+
body = ts.factory.createBlock([emptyStmt], /* multiline */ true);
|
|
130681
|
+
ts.setSnippetElement(emptyStmt, { kind: 0 /* TabStop */, order: 0 });
|
|
130682
|
+
}
|
|
130683
|
+
else {
|
|
130684
|
+
body = ts.factory.createBlock([], /* multiline */ true);
|
|
130685
|
+
}
|
|
130686
|
+
var method = createObjectLiteralMethod(symbol, enclosingDeclaration, sourceFile, program, host, preferences, importAdder, /*body*/ body);
|
|
130687
|
+
if (!method) {
|
|
130688
|
+
return undefined;
|
|
130689
|
+
}
|
|
130690
|
+
var printer = createSnippetPrinter({
|
|
130691
|
+
removeComments: true,
|
|
130692
|
+
module: options.module,
|
|
130693
|
+
target: options.target,
|
|
130694
|
+
omitTrailingSemicolon: false,
|
|
130695
|
+
newLine: ts.getNewLineKind(ts.getNewLineCharacter(options, ts.maybeBind(host, host.getNewLine))),
|
|
130696
|
+
});
|
|
130697
|
+
if (formatContext) {
|
|
130698
|
+
insertText = printer.printAndFormatSnippetList(16 /* CommaDelimited */ | 64 /* AllowTrailingComma */, ts.factory.createNodeArray([method], /*hasTrailingComma*/ true), sourceFile, formatContext);
|
|
130699
|
+
}
|
|
130700
|
+
else {
|
|
130701
|
+
insertText = printer.printSnippetList(16 /* CommaDelimited */ | 64 /* AllowTrailingComma */, ts.factory.createNodeArray([method], /*hasTrailingComma*/ true), sourceFile);
|
|
130702
|
+
}
|
|
130703
|
+
var methodSignature = ts.factory.createMethodSignature(method.modifiers, method.name, method.questionToken, method.typeParameters, method.parameters, method.type);
|
|
130704
|
+
var sourceDisplay = ts.nodeToDisplayParts(methodSignature, enclosingDeclaration);
|
|
130705
|
+
return { isSnippet: isSnippet, insertText: insertText, importAdder: importAdder, sourceDisplay: sourceDisplay };
|
|
130706
|
+
}
|
|
130707
|
+
;
|
|
130708
|
+
function createObjectLiteralMethod(symbol, enclosingDeclaration, sourceFile, program, host, preferences, importAdder, body) {
|
|
130709
|
+
var declarations = symbol.getDeclarations();
|
|
130710
|
+
if (!(declarations && declarations.length)) {
|
|
130711
|
+
return undefined;
|
|
130712
|
+
}
|
|
130713
|
+
var checker = program.getTypeChecker();
|
|
130714
|
+
var scriptTarget = ts.getEmitScriptTarget(program.getCompilerOptions());
|
|
130715
|
+
var declaration = declarations[0];
|
|
130716
|
+
var name = ts.getSynthesizedDeepClone(ts.getNameOfDeclaration(declaration), /*includeTrivia*/ false);
|
|
130717
|
+
var type = checker.getWidenedType(checker.getTypeOfSymbolAtLocation(symbol, enclosingDeclaration));
|
|
130718
|
+
var quotePreference = ts.getQuotePreference(sourceFile, preferences);
|
|
130719
|
+
var builderFlags = quotePreference === 0 /* Single */ ? 268435456 /* UseSingleQuotesForStringLiteralType */ : undefined;
|
|
130720
|
+
switch (declaration.kind) {
|
|
130721
|
+
case 165 /* PropertySignature */:
|
|
130722
|
+
case 166 /* PropertyDeclaration */:
|
|
130723
|
+
case 167 /* MethodSignature */:
|
|
130724
|
+
case 168 /* MethodDeclaration */: {
|
|
130725
|
+
var signatures = checker.getSignaturesOfType(type, 0 /* Call */);
|
|
130726
|
+
if (signatures.length > 1) {
|
|
130727
|
+
// We don't support overloads in object literals.
|
|
130728
|
+
return undefined;
|
|
130729
|
+
}
|
|
130730
|
+
var typeNode = checker.typeToTypeNode(type, enclosingDeclaration, builderFlags, ts.codefix.getNoopSymbolTrackerWithResolver({ program: program, host: host }));
|
|
130731
|
+
var importableReference = ts.codefix.tryGetAutoImportableReferenceFromTypeNode(typeNode, scriptTarget);
|
|
130732
|
+
if (importableReference) {
|
|
130733
|
+
typeNode = importableReference.typeNode;
|
|
130734
|
+
ts.codefix.importSymbols(importAdder, importableReference.symbols);
|
|
130735
|
+
}
|
|
130736
|
+
if (!typeNode) {
|
|
130737
|
+
return undefined;
|
|
130738
|
+
}
|
|
130739
|
+
ts.Debug.assertNode(typeNode, ts.isFunctionTypeNode);
|
|
130740
|
+
return ts.factory.createMethodDeclaration(
|
|
130741
|
+
/*decorators*/ undefined,
|
|
130742
|
+
/*modifiers*/ undefined,
|
|
130743
|
+
/*asteriskToken*/ undefined, name,
|
|
130744
|
+
/*questionToken*/ undefined, typeNode.typeParameters, typeNode.parameters, typeNode.type, body);
|
|
130745
|
+
}
|
|
130746
|
+
default:
|
|
130747
|
+
return undefined;
|
|
130748
|
+
}
|
|
130749
|
+
}
|
|
130575
130750
|
function createSnippetPrinter(printerOptions) {
|
|
130576
130751
|
var baseWriter = ts.textChanges.createWriter(ts.getNewLineCharacter(printerOptions));
|
|
130577
130752
|
var printer = ts.createPrinter(printerOptions, baseWriter);
|
|
130578
130753
|
var writer = __assign(__assign({}, baseWriter), { write: function (s) { return baseWriter.write(ts.escapeSnippetText(s)); }, nonEscapingWrite: baseWriter.write, writeLiteral: function (s) { return baseWriter.writeLiteral(ts.escapeSnippetText(s)); }, writeStringLiteral: function (s) { return baseWriter.writeStringLiteral(ts.escapeSnippetText(s)); }, writeSymbol: function (s, symbol) { return baseWriter.writeSymbol(ts.escapeSnippetText(s), symbol); }, writeParameter: function (s) { return baseWriter.writeParameter(ts.escapeSnippetText(s)); }, writeComment: function (s) { return baseWriter.writeComment(ts.escapeSnippetText(s)); }, writeProperty: function (s) { return baseWriter.writeProperty(ts.escapeSnippetText(s)); } });
|
|
130579
130754
|
return {
|
|
130580
130755
|
printSnippetList: printSnippetList,
|
|
130756
|
+
printAndFormatSnippetList: printAndFormatSnippetList,
|
|
130581
130757
|
};
|
|
130582
130758
|
/* Snippet-escaping version of `printer.printList`. */
|
|
130583
130759
|
function printSnippetList(format, list, sourceFile) {
|
|
@@ -130585,6 +130761,22 @@ var ts;
|
|
|
130585
130761
|
printer.writeList(format, list, sourceFile, writer);
|
|
130586
130762
|
return writer.getText();
|
|
130587
130763
|
}
|
|
130764
|
+
function printAndFormatSnippetList(format, list, sourceFile, formatContext) {
|
|
130765
|
+
var syntheticFile = {
|
|
130766
|
+
text: printSnippetList(format, list, sourceFile),
|
|
130767
|
+
getLineAndCharacterOfPosition: function (pos) {
|
|
130768
|
+
return ts.getLineAndCharacterOfPosition(this, pos);
|
|
130769
|
+
},
|
|
130770
|
+
};
|
|
130771
|
+
var formatOptions = ts.getFormatCodeSettingsForWriting(formatContext, sourceFile);
|
|
130772
|
+
var changes = ts.flatMap(list, function (node) {
|
|
130773
|
+
var nodeWithPos = ts.textChanges.assignPositionsToNode(node);
|
|
130774
|
+
return ts.formatting.formatNodeGivenIndentation(nodeWithPos, syntheticFile, sourceFile.languageVariant,
|
|
130775
|
+
/* indentation */ 0,
|
|
130776
|
+
/* delta */ 0, __assign(__assign({}, formatContext), { options: formatOptions }));
|
|
130777
|
+
});
|
|
130778
|
+
return ts.textChanges.applyChanges(syntheticFile.text, changes);
|
|
130779
|
+
}
|
|
130588
130780
|
}
|
|
130589
130781
|
function originToCompletionEntryData(origin) {
|
|
130590
130782
|
var ambientModuleName = origin.fileName ? undefined : ts.stripQuotes(origin.moduleSymbol.name);
|
|
@@ -130697,7 +130889,7 @@ var ts;
|
|
|
130697
130889
|
var symbol = symbols[i];
|
|
130698
130890
|
var origin = symbolToOriginInfoMap === null || symbolToOriginInfoMap === void 0 ? void 0 : symbolToOriginInfoMap[i];
|
|
130699
130891
|
var info = getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind, !!jsxIdentifierExpected);
|
|
130700
|
-
if (!info || uniques.get(info.name) || kind === 1 /* Global */ && symbolToSortTextIdMap && !shouldIncludeSymbol(symbol, symbolToSortTextIdMap)) {
|
|
130892
|
+
if (!info || (uniques.get(info.name) && (!origin || !originIsObjectLiteralMethod(origin))) || kind === 1 /* Global */ && symbolToSortTextIdMap && !shouldIncludeSymbol(symbol, symbolToSortTextIdMap)) {
|
|
130701
130893
|
continue;
|
|
130702
130894
|
}
|
|
130703
130895
|
var name = info.name, needsConvertPropertyAccess = info.needsConvertPropertyAccess;
|
|
@@ -130828,7 +131020,9 @@ var ts;
|
|
|
130828
131020
|
return ts.firstDefined(symbols, function (symbol, index) {
|
|
130829
131021
|
var origin = symbolToOriginInfoMap[index];
|
|
130830
131022
|
var info = getCompletionEntryDisplayNameForSymbol(symbol, ts.getEmitScriptTarget(compilerOptions), origin, completionKind, completionData.isJsxIdentifierExpected);
|
|
130831
|
-
return info && info.name === entryId.name && (entryId.source === CompletionSource.ClassMemberSnippet && symbol.flags & 106500 /* ClassMember */
|
|
131023
|
+
return info && info.name === entryId.name && (entryId.source === CompletionSource.ClassMemberSnippet && symbol.flags & 106500 /* ClassMember */
|
|
131024
|
+
|| entryId.source === CompletionSource.ObjectLiteralMethodSnippet && symbol.flags & (4 /* Property */ | 8192 /* Method */)
|
|
131025
|
+
|| getSourceFromOrigin(origin) === entryId.source)
|
|
130832
131026
|
? { type: "symbol", symbol: symbol, location: location, origin: origin, contextToken: contextToken, previousToken: previousToken, isJsxInitializer: isJsxInitializer, isTypeOnlyLocation: isTypeOnlyLocation }
|
|
130833
131027
|
: undefined;
|
|
130834
131028
|
}) || { type: "none" };
|
|
@@ -130910,6 +131104,20 @@ var ts;
|
|
|
130910
131104
|
};
|
|
130911
131105
|
}
|
|
130912
131106
|
}
|
|
131107
|
+
if (source === CompletionSource.ObjectLiteralMethodSnippet) {
|
|
131108
|
+
var enclosingDeclaration = tryGetObjectLikeCompletionContainer(contextToken);
|
|
131109
|
+
var importAdder = getEntryForObjectLiteralMethodCompletion(symbol, name, enclosingDeclaration, program, host, compilerOptions, preferences, formatContext).importAdder;
|
|
131110
|
+
if (importAdder.hasFixes()) {
|
|
131111
|
+
var changes = ts.textChanges.ChangeTracker.with({ host: host, formatContext: formatContext, preferences: preferences }, importAdder.writeFixes);
|
|
131112
|
+
return {
|
|
131113
|
+
sourceDisplay: undefined,
|
|
131114
|
+
codeActions: [{
|
|
131115
|
+
changes: changes,
|
|
131116
|
+
description: ts.diagnosticToString([ts.Diagnostics.Includes_imports_of_types_referenced_by_0, name]),
|
|
131117
|
+
}],
|
|
131118
|
+
};
|
|
131119
|
+
}
|
|
131120
|
+
}
|
|
130913
131121
|
if (originIsTypeOnlyAlias(origin)) {
|
|
130914
131122
|
var codeAction_1 = ts.codefix.getPromoteTypeOnlyCompletionAction(sourceFile, origin.declaration.name, program, host, formatContext, preferences);
|
|
130915
131123
|
ts.Debug.assertIsDefined(codeAction_1, "Expected to have a code action for promoting type-only alias");
|
|
@@ -131796,6 +132004,45 @@ var ts;
|
|
|
131796
132004
|
symbolToSortTextIdMap[symbolId] = importCompletionNode ? 11 /* LocationPriority */ : 16 /* AutoImportSuggestions */;
|
|
131797
132005
|
symbols.push(symbol);
|
|
131798
132006
|
}
|
|
132007
|
+
/* Mutates `symbols` and `symbolToOriginInfoMap`. */
|
|
132008
|
+
function collectObjectLiteralMethodSymbols(members) {
|
|
132009
|
+
// TODO: support JS files.
|
|
132010
|
+
if (ts.isInJSFile(location)) {
|
|
132011
|
+
return false;
|
|
132012
|
+
}
|
|
132013
|
+
members = members.slice(); // Needed in case `symbol` and `members` are the same array.
|
|
132014
|
+
for (var _i = 0, members_1 = members; _i < members_1.length; _i++) {
|
|
132015
|
+
var member = members_1[_i];
|
|
132016
|
+
if (!isObjectLiteralMethodSymbol(member)) {
|
|
132017
|
+
continue;
|
|
132018
|
+
}
|
|
132019
|
+
var origin = { kind: 128 /* ObjectLiteralMethod */ };
|
|
132020
|
+
symbolToOriginInfoMap[symbols.length] = origin;
|
|
132021
|
+
symbols.push(member);
|
|
132022
|
+
}
|
|
132023
|
+
}
|
|
132024
|
+
function isObjectLiteralMethodSymbol(symbol) {
|
|
132025
|
+
/*
|
|
132026
|
+
For an object type
|
|
132027
|
+
`type Foo = {
|
|
132028
|
+
bar(x: number): void;
|
|
132029
|
+
foo: (x: string) => string;
|
|
132030
|
+
}`,
|
|
132031
|
+
`bar` will have symbol flag `Method`,
|
|
132032
|
+
`foo` will have symbol flag `Property`.
|
|
132033
|
+
*/
|
|
132034
|
+
if (!(symbol.flags & (4 /* Property */ | 8192 /* Method */))) {
|
|
132035
|
+
return false;
|
|
132036
|
+
}
|
|
132037
|
+
if (symbol.flags & 4 /* Property */) {
|
|
132038
|
+
var type = program.getTypeChecker().getTypeOfSymbol(symbol);
|
|
132039
|
+
// We ignore non-function properties.
|
|
132040
|
+
if (!type.getCallSignatures().length) {
|
|
132041
|
+
return false;
|
|
132042
|
+
}
|
|
132043
|
+
}
|
|
132044
|
+
return true;
|
|
132045
|
+
}
|
|
131799
132046
|
/**
|
|
131800
132047
|
* Finds the first node that "embraces" the position, so that one may
|
|
131801
132048
|
* accurately aggregate locals from the closest containing scope.
|
|
@@ -131993,7 +132240,12 @@ var ts;
|
|
|
131993
132240
|
}
|
|
131994
132241
|
if (typeMembers && typeMembers.length > 0) {
|
|
131995
132242
|
// Add filtered items to the completion list
|
|
131996
|
-
|
|
132243
|
+
var filteredMembers = filterObjectMembersList(typeMembers, ts.Debug.checkDefined(existingMembers));
|
|
132244
|
+
symbols = ts.concatenate(symbols, filteredMembers);
|
|
132245
|
+
if (preferences.includeCompletionsWithObjectLiteralMethodSnippets
|
|
132246
|
+
&& objectLikeContainer.kind === 204 /* ObjectLiteralExpression */) {
|
|
132247
|
+
collectObjectLiteralMethodSymbols(filteredMembers);
|
|
132248
|
+
}
|
|
131997
132249
|
}
|
|
131998
132250
|
setSortTextToOptionalMember();
|
|
131999
132251
|
return 1 /* Success */;
|
|
@@ -132125,29 +132377,6 @@ var ts;
|
|
|
132125
132377
|
}
|
|
132126
132378
|
return 1 /* Success */;
|
|
132127
132379
|
}
|
|
132128
|
-
/**
|
|
132129
|
-
* Returns the immediate owning object literal or binding pattern of a context token,
|
|
132130
|
-
* on the condition that one exists and that the context implies completion should be given.
|
|
132131
|
-
*/
|
|
132132
|
-
function tryGetObjectLikeCompletionContainer(contextToken) {
|
|
132133
|
-
if (contextToken) {
|
|
132134
|
-
var parent = contextToken.parent;
|
|
132135
|
-
switch (contextToken.kind) {
|
|
132136
|
-
case 18 /* OpenBraceToken */: // const x = { |
|
|
132137
|
-
case 27 /* CommaToken */: // const x = { a: 0, |
|
|
132138
|
-
if (ts.isObjectLiteralExpression(parent) || ts.isObjectBindingPattern(parent)) {
|
|
132139
|
-
return parent;
|
|
132140
|
-
}
|
|
132141
|
-
break;
|
|
132142
|
-
case 41 /* AsteriskToken */:
|
|
132143
|
-
return ts.isMethodDeclaration(parent) ? ts.tryCast(parent.parent, ts.isObjectLiteralExpression) : undefined;
|
|
132144
|
-
case 79 /* Identifier */:
|
|
132145
|
-
return contextToken.text === "async" && ts.isShorthandPropertyAssignment(contextToken.parent)
|
|
132146
|
-
? contextToken.parent.parent : undefined;
|
|
132147
|
-
}
|
|
132148
|
-
}
|
|
132149
|
-
return undefined;
|
|
132150
|
-
}
|
|
132151
132380
|
function isConstructorParameterCompletion(node) {
|
|
132152
132381
|
return !!node.parent && ts.isParameter(node.parent) && ts.isConstructorDeclaration(node.parent.parent)
|
|
132153
132382
|
&& (ts.isParameterPropertyModifier(node.kind) || ts.isDeclarationName(node));
|
|
@@ -132570,6 +132799,29 @@ var ts;
|
|
|
132570
132799
|
return node.getStart(sourceFile) <= position && position <= node.getEnd();
|
|
132571
132800
|
}
|
|
132572
132801
|
}
|
|
132802
|
+
/**
|
|
132803
|
+
* Returns the immediate owning object literal or binding pattern of a context token,
|
|
132804
|
+
* on the condition that one exists and that the context implies completion should be given.
|
|
132805
|
+
*/
|
|
132806
|
+
function tryGetObjectLikeCompletionContainer(contextToken) {
|
|
132807
|
+
if (contextToken) {
|
|
132808
|
+
var parent = contextToken.parent;
|
|
132809
|
+
switch (contextToken.kind) {
|
|
132810
|
+
case 18 /* OpenBraceToken */: // const x = { |
|
|
132811
|
+
case 27 /* CommaToken */: // const x = { a: 0, |
|
|
132812
|
+
if (ts.isObjectLiteralExpression(parent) || ts.isObjectBindingPattern(parent)) {
|
|
132813
|
+
return parent;
|
|
132814
|
+
}
|
|
132815
|
+
break;
|
|
132816
|
+
case 41 /* AsteriskToken */:
|
|
132817
|
+
return ts.isMethodDeclaration(parent) ? ts.tryCast(parent.parent, ts.isObjectLiteralExpression) : undefined;
|
|
132818
|
+
case 79 /* Identifier */:
|
|
132819
|
+
return contextToken.text === "async" && ts.isShorthandPropertyAssignment(contextToken.parent)
|
|
132820
|
+
? contextToken.parent.parent : undefined;
|
|
132821
|
+
}
|
|
132822
|
+
}
|
|
132823
|
+
return undefined;
|
|
132824
|
+
}
|
|
132573
132825
|
function getRelevantTokens(position, sourceFile) {
|
|
132574
132826
|
var previousToken = ts.findPrecedingToken(position, sourceFile);
|
|
132575
132827
|
if (previousToken && position <= previousToken.end && (ts.isMemberName(previousToken) || ts.isKeyword(previousToken.kind))) {
|
|
@@ -150874,8 +151126,10 @@ var ts;
|
|
|
150874
151126
|
var checker = program.getTypeChecker();
|
|
150875
151127
|
var compilerOptions = program.getCompilerOptions();
|
|
150876
151128
|
var symbolName = getSymbolName(sourceFile, checker, symbolToken, compilerOptions);
|
|
150877
|
-
// "default" is a keyword and not a legal identifier for the import,
|
|
150878
|
-
|
|
151129
|
+
// "default" is a keyword and not a legal identifier for the import, but appears as an identifier.
|
|
151130
|
+
if (symbolName === "default" /* Default */) {
|
|
151131
|
+
return undefined;
|
|
151132
|
+
}
|
|
150879
151133
|
var isValidTypeOnlyUseSite = ts.isValidTypeOnlyAliasUseSite(symbolToken);
|
|
150880
151134
|
var useRequire = shouldUseRequire(sourceFile, program);
|
|
150881
151135
|
var exportInfo = getExportInfos(symbolName, ts.isJSXTagName(symbolToken), ts.getMeaningFromLocation(symbolToken), cancellationToken, sourceFile, program, useAutoImportProvider, host, preferences);
|
|
@@ -154965,6 +155219,7 @@ var ts;
|
|
|
154965
155219
|
if (!ts.some(signatures)) {
|
|
154966
155220
|
break;
|
|
154967
155221
|
}
|
|
155222
|
+
// >> TODO: call `try get auto importable reference from type node` on type nodes?
|
|
154968
155223
|
if (declarations.length === 1) {
|
|
154969
155224
|
ts.Debug.assert(signatures.length === 1, "One declaration implies one signature");
|
|
154970
155225
|
var signature = signatures[0];
|
|
@@ -154995,6 +155250,27 @@ var ts;
|
|
|
154995
155250
|
}
|
|
154996
155251
|
}
|
|
154997
155252
|
codefix.addNewNodeForMemberSymbol = addNewNodeForMemberSymbol;
|
|
155253
|
+
// export function addNewNodeObjectLiteralProperties(
|
|
155254
|
+
// // changes: textChanges.ChangeTracker,
|
|
155255
|
+
// // context: CodeFixContextBase,
|
|
155256
|
+
// sourceFile: SourceFile,
|
|
155257
|
+
// program: Program,
|
|
155258
|
+
// preferences: UserPreferences,
|
|
155259
|
+
// host: LanguageServiceHost,
|
|
155260
|
+
// // info: ObjectLiteralInfo,
|
|
155261
|
+
// properties: Symbol[],
|
|
155262
|
+
// addNodes: (nodes: PropertyAssignment[]) => void,
|
|
155263
|
+
// ): void {
|
|
155264
|
+
// const importAdder = createImportAdder(sourceFile, program, preferences, host);
|
|
155265
|
+
// const quotePreference = getQuotePreference(sourceFile, preferences);
|
|
155266
|
+
// const target = getEmitScriptTarget(program.getCompilerOptions());
|
|
155267
|
+
// const checker = program.getTypeChecker();
|
|
155268
|
+
// const props = map(properties, prop => {
|
|
155269
|
+
// const initializer = tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeOfSymbol(prop));
|
|
155270
|
+
// return factory.createPropertyAssignment(createPropertyNameNodeForIdentifierOrLiteral(prop.name, target, quotePreference === QuotePreference.Single), initializer);
|
|
155271
|
+
// });
|
|
155272
|
+
// addNodes(props);
|
|
155273
|
+
// }
|
|
154998
155274
|
function createSignatureDeclarationFromSignature(kind, context, quotePreference, signature, body, name, modifiers, optional, enclosingDeclaration, importAdder) {
|
|
154999
155275
|
var program = context.program;
|
|
155000
155276
|
var checker = program.getTypeChecker();
|
|
@@ -155164,6 +155440,7 @@ var ts;
|
|
|
155164
155440
|
return createStubbedMethod(modifiers, name, optional,
|
|
155165
155441
|
/*typeParameters*/ undefined, parameters, getReturnTypeFromSignatures(signatures, checker, context, enclosingDeclaration), quotePreference, body);
|
|
155166
155442
|
}
|
|
155443
|
+
codefix.createMethodImplementingSignatures = createMethodImplementingSignatures;
|
|
155167
155444
|
function getReturnTypeFromSignatures(signatures, checker, context, enclosingDeclaration) {
|
|
155168
155445
|
if (ts.length(signatures)) {
|
|
155169
155446
|
var type = checker.getUnionType(ts.map(signatures, checker.getReturnTypeOfSignature));
|
|
@@ -158391,8 +158668,8 @@ var ts;
|
|
|
158391
158668
|
ts.Debug.assert(members.length > 0, "Found no members"); // There must be at least one child, since we extracted from one.
|
|
158392
158669
|
var prevMember;
|
|
158393
158670
|
var allProperties = true;
|
|
158394
|
-
for (var _i = 0,
|
|
158395
|
-
var member =
|
|
158671
|
+
for (var _i = 0, members_2 = members; _i < members_2.length; _i++) {
|
|
158672
|
+
var member = members_2[_i];
|
|
158396
158673
|
if (member.pos > maxPos) {
|
|
158397
158674
|
return prevMember || members[0];
|
|
158398
158675
|
}
|
|
@@ -172352,47 +172629,18 @@ var ts;
|
|
|
172352
172629
|
}
|
|
172353
172630
|
return ts.deduplicate(outputs, ts.equateValues);
|
|
172354
172631
|
}
|
|
172355
|
-
|
|
172356
|
-
|
|
172357
|
-
|
|
172358
|
-
return ts.contains(result, output, areEqual);
|
|
172359
|
-
});
|
|
172360
|
-
}
|
|
172361
|
-
function addToCombineOutputResult(outputs, project, result) {
|
|
172362
|
-
if (result.length)
|
|
172363
|
-
outputs.push({ project: project, result: result });
|
|
172364
|
-
}
|
|
172365
|
-
function combineProjectOutputFromEveryProject(projectService, action, areEqual) {
|
|
172366
|
-
var outputs = [];
|
|
172367
|
-
projectService.loadAncestorProjectTree();
|
|
172368
|
-
projectService.forEachEnabledProject(function (project) {
|
|
172369
|
-
var theseOutputs = action(project);
|
|
172370
|
-
addToCombineOutputResult(outputs, project, ts.filter(theseOutputs, function (output) { return !combineOutputResultContains(outputs, output, areEqual); }));
|
|
172371
|
-
});
|
|
172372
|
-
return outputs;
|
|
172373
|
-
}
|
|
172374
|
-
function flattenCombineOutputResult(outputs) {
|
|
172375
|
-
return ts.flatMap(outputs, function (_a) {
|
|
172376
|
-
var result = _a.result;
|
|
172377
|
-
return result;
|
|
172378
|
-
});
|
|
172379
|
-
}
|
|
172380
|
-
function combineProjectOutputWhileOpeningReferencedProjects(projects, defaultProject, action, getLocation, resultsEqual) {
|
|
172381
|
-
var outputs = [];
|
|
172382
|
-
combineProjectOutputWorker(projects, defaultProject,
|
|
172383
|
-
/*initialLocation*/ undefined, function (project, _, tryAddToTodo) {
|
|
172384
|
-
var theseOutputs = action(project);
|
|
172385
|
-
addToCombineOutputResult(outputs, project, ts.filter(theseOutputs, function (output) { return !combineOutputResultContains(outputs, output, resultsEqual) && !tryAddToTodo(project, getLocation(output)); }));
|
|
172386
|
-
});
|
|
172387
|
-
return outputs;
|
|
172388
|
-
}
|
|
172389
|
-
function combineProjectOutputForRenameLocations(projects, defaultProject, initialLocation, findInStrings, findInComments, hostPreferences) {
|
|
172632
|
+
;
|
|
172633
|
+
function combineProjectOutputForRenameLocations(projects, defaultProject, initialLocation, findInStrings, findInComments, _a) {
|
|
172634
|
+
var providePrefixAndSuffixTextForRename = _a.providePrefixAndSuffixTextForRename;
|
|
172390
172635
|
var outputs = [];
|
|
172391
172636
|
combineProjectOutputWorker(projects, defaultProject, initialLocation, function (project, location, tryAddToTodo) {
|
|
172392
|
-
|
|
172393
|
-
|
|
172394
|
-
|
|
172395
|
-
|
|
172637
|
+
var projectOutputs = project.getLanguageService().findRenameLocations(location.fileName, location.pos, findInStrings, findInComments, providePrefixAndSuffixTextForRename);
|
|
172638
|
+
if (projectOutputs) {
|
|
172639
|
+
for (var _i = 0, projectOutputs_1 = projectOutputs; _i < projectOutputs_1.length; _i++) {
|
|
172640
|
+
var output = projectOutputs_1[_i];
|
|
172641
|
+
if (!ts.contains(outputs, output, ts.documentSpansEqual) && !tryAddToTodo(project, documentSpanLocation(output))) {
|
|
172642
|
+
outputs.push(output);
|
|
172643
|
+
}
|
|
172396
172644
|
}
|
|
172397
172645
|
}
|
|
172398
172646
|
});
|
|
@@ -172407,43 +172655,33 @@ var ts;
|
|
|
172407
172655
|
var outputs = [];
|
|
172408
172656
|
combineProjectOutputWorker(projects, defaultProject, initialLocation, function (project, location, getMappedLocation) {
|
|
172409
172657
|
logger.info("Finding references to " + location.fileName + " position " + location.pos + " in project " + project.getProjectName());
|
|
172410
|
-
var
|
|
172411
|
-
|
|
172412
|
-
var
|
|
172413
|
-
|
|
172414
|
-
|
|
172415
|
-
|
|
172416
|
-
symbolToAddTo = {
|
|
172417
|
-
|
|
172418
|
-
|
|
172419
|
-
|
|
172420
|
-
|
|
172421
|
-
|
|
172422
|
-
|
|
172423
|
-
|
|
172658
|
+
var projectOutputs = project.getLanguageService().findReferences(location.fileName, location.pos);
|
|
172659
|
+
if (projectOutputs) {
|
|
172660
|
+
var _loop_8 = function (referencedSymbol) {
|
|
172661
|
+
var mappedDefinitionFile = getMappedLocation(project, documentSpanLocation(referencedSymbol.definition));
|
|
172662
|
+
var definition = mappedDefinitionFile === undefined ?
|
|
172663
|
+
referencedSymbol.definition : __assign(__assign({}, referencedSymbol.definition), { textSpan: ts.createTextSpan(mappedDefinitionFile.pos, referencedSymbol.definition.textSpan.length), fileName: mappedDefinitionFile.fileName, contextSpan: getMappedContextSpan(referencedSymbol.definition, project) });
|
|
172664
|
+
var symbolToAddTo = ts.find(outputs, function (o) { return ts.documentSpansEqual(o.definition, definition); });
|
|
172665
|
+
if (!symbolToAddTo) {
|
|
172666
|
+
symbolToAddTo = { definition: definition, references: [] };
|
|
172667
|
+
outputs.push(symbolToAddTo);
|
|
172668
|
+
}
|
|
172669
|
+
for (var _a = 0, _b = referencedSymbol.references; _a < _b.length; _a++) {
|
|
172670
|
+
var ref = _b[_a];
|
|
172671
|
+
// If it's in a mapped file, that is added to the todo list by `getMappedLocation`.
|
|
172672
|
+
if (!ts.contains(symbolToAddTo.references, ref, ts.documentSpansEqual) && !getMappedLocation(project, documentSpanLocation(ref))) {
|
|
172673
|
+
symbolToAddTo.references.push(ref);
|
|
172674
|
+
}
|
|
172424
172675
|
}
|
|
172676
|
+
};
|
|
172677
|
+
for (var _i = 0, projectOutputs_2 = projectOutputs; _i < projectOutputs_2.length; _i++) {
|
|
172678
|
+
var referencedSymbol = projectOutputs_2[_i];
|
|
172679
|
+
_loop_8(referencedSymbol);
|
|
172425
172680
|
}
|
|
172426
|
-
};
|
|
172427
|
-
for (var _i = 0, _a = project.getLanguageService().findReferences(location.fileName, location.pos) || server.emptyArray; _i < _a.length; _i++) {
|
|
172428
|
-
var outputReferencedSymbol = _a[_i];
|
|
172429
|
-
_loop_8(outputReferencedSymbol);
|
|
172430
172681
|
}
|
|
172431
172682
|
});
|
|
172432
172683
|
return outputs.filter(function (o) { return o.references.length !== 0; });
|
|
172433
172684
|
}
|
|
172434
|
-
function combineProjectOutputForFileReferences(projects, defaultProject, fileName) {
|
|
172435
|
-
var outputs = [];
|
|
172436
|
-
combineProjectOutputWorker(projects, defaultProject,
|
|
172437
|
-
/*initialLocation*/ undefined, function (project) {
|
|
172438
|
-
for (var _i = 0, _a = project.getLanguageService().getFileReferences(fileName) || server.emptyArray; _i < _a.length; _i++) {
|
|
172439
|
-
var referenceEntry = _a[_i];
|
|
172440
|
-
if (!ts.contains(outputs, referenceEntry, ts.documentSpansEqual)) {
|
|
172441
|
-
outputs.push(referenceEntry);
|
|
172442
|
-
}
|
|
172443
|
-
}
|
|
172444
|
-
});
|
|
172445
|
-
return outputs;
|
|
172446
|
-
}
|
|
172447
172685
|
function forEachProjectInProjects(projects, path, cb) {
|
|
172448
172686
|
for (var _i = 0, _a = ts.isArray(projects) ? projects : projects.projects; _i < _a.length; _i++) {
|
|
172449
172687
|
var project = _a[_i];
|
|
@@ -173782,7 +174020,21 @@ var ts;
|
|
|
173782
174020
|
Session.prototype.getFileReferences = function (args, simplifiedResult) {
|
|
173783
174021
|
var _this = this;
|
|
173784
174022
|
var projects = this.getProjects(args);
|
|
173785
|
-
var
|
|
174023
|
+
var fileName = args.file;
|
|
174024
|
+
var references = [];
|
|
174025
|
+
forEachProjectInProjects(projects, /*path*/ undefined, function (project) {
|
|
174026
|
+
if (project.getCancellationToken().isCancellationRequested())
|
|
174027
|
+
return;
|
|
174028
|
+
var projectOutputs = project.getLanguageService().getFileReferences(fileName);
|
|
174029
|
+
if (projectOutputs) {
|
|
174030
|
+
for (var _i = 0, projectOutputs_3 = projectOutputs; _i < projectOutputs_3.length; _i++) {
|
|
174031
|
+
var referenceEntry = projectOutputs_3[_i];
|
|
174032
|
+
if (!ts.contains(references, referenceEntry, ts.documentSpansEqual)) {
|
|
174033
|
+
references.push(referenceEntry);
|
|
174034
|
+
}
|
|
174035
|
+
}
|
|
174036
|
+
}
|
|
174037
|
+
});
|
|
173786
174038
|
if (!simplifiedResult)
|
|
173787
174039
|
return references;
|
|
173788
174040
|
var refs = references.map(function (entry) { return referenceEntryToReferencesResponseItem(_this.projectService, entry); });
|
|
@@ -174181,10 +174433,13 @@ var ts;
|
|
|
174181
174433
|
Session.prototype.getNavigateToItems = function (args, simplifiedResult) {
|
|
174182
174434
|
var full = this.getFullNavigateToItems(args);
|
|
174183
174435
|
return !simplifiedResult ?
|
|
174184
|
-
flattenCombineOutputResult(full) :
|
|
174185
174436
|
ts.flatMap(full, function (_a) {
|
|
174186
|
-
var
|
|
174187
|
-
return
|
|
174437
|
+
var navigateToItems = _a.navigateToItems;
|
|
174438
|
+
return navigateToItems;
|
|
174439
|
+
}) :
|
|
174440
|
+
ts.flatMap(full, function (_a) {
|
|
174441
|
+
var project = _a.project, navigateToItems = _a.navigateToItems;
|
|
174442
|
+
return navigateToItems.map(function (navItem) {
|
|
174188
174443
|
var scriptInfo = project.getScriptInfo(navItem.fileName);
|
|
174189
174444
|
var bakedItem = {
|
|
174190
174445
|
name: navItem.name,
|
|
@@ -174214,13 +174469,57 @@ var ts;
|
|
|
174214
174469
|
if (currentFileOnly) {
|
|
174215
174470
|
ts.Debug.assertIsDefined(args.file);
|
|
174216
174471
|
var _a = this.getFileAndProject(args), file = _a.file, project = _a.project;
|
|
174217
|
-
return [{ project: project,
|
|
174472
|
+
return [{ project: project, navigateToItems: project.getLanguageService().getNavigateToItems(searchValue, maxResultCount, file) }];
|
|
174473
|
+
}
|
|
174474
|
+
var outputs = [];
|
|
174475
|
+
// This is effectively a hashset with `name` as the custom hash and `navigateToItemIsEqualTo` as the custom equals.
|
|
174476
|
+
// `name` is a very cheap hash function, but we could incorporate other properties to reduce collisions.
|
|
174477
|
+
var seenItems = new ts.Map(); // name to items with that name
|
|
174478
|
+
if (!args.file && !projectFileName) {
|
|
174479
|
+
// VS Code's `Go to symbol in workspaces` sends request like this
|
|
174480
|
+
// TODO (https://github.com/microsoft/TypeScript/issues/47839)
|
|
174481
|
+
// This appears to have been intended to search all projects but, in practice, it seems to only search
|
|
174482
|
+
// those that are downstream from already-loaded projects.
|
|
174483
|
+
// Filtering by !isSourceOfProjectReferenceRedirect is new, but seems appropriate and consistent with
|
|
174484
|
+
// the case below.
|
|
174485
|
+
this.projectService.loadAncestorProjectTree();
|
|
174486
|
+
this.projectService.forEachEnabledProject(function (project) { return addItemsForProject(project); });
|
|
174218
174487
|
}
|
|
174219
|
-
else
|
|
174220
|
-
|
|
174488
|
+
else {
|
|
174489
|
+
// VS's `Go to symbol` sends requests with just a project and doesn't want cascading since it will
|
|
174490
|
+
// send a separate request for each project of interest
|
|
174491
|
+
// TODO (https://github.com/microsoft/TypeScript/issues/47839)
|
|
174492
|
+
// This doesn't really make sense unless it's a single project matching `projectFileName`
|
|
174493
|
+
var projects = this.getProjects(args);
|
|
174494
|
+
forEachProjectInProjects(projects, /*path*/ undefined, function (project) { return addItemsForProject(project); });
|
|
174495
|
+
}
|
|
174496
|
+
return outputs;
|
|
174497
|
+
// Mutates `outputs`
|
|
174498
|
+
function addItemsForProject(project) {
|
|
174499
|
+
var projectItems = project.getLanguageService().getNavigateToItems(searchValue, maxResultCount, /*filename*/ undefined, /*excludeDts*/ project.isNonTsProject());
|
|
174500
|
+
var unseenItems = ts.filter(projectItems, function (item) { return tryAddSeenItem(item) && !getMappedLocation(documentSpanLocation(item), project); });
|
|
174501
|
+
if (unseenItems.length) {
|
|
174502
|
+
outputs.push({ project: project, navigateToItems: unseenItems });
|
|
174503
|
+
}
|
|
174504
|
+
}
|
|
174505
|
+
// Returns true if the item had not been seen before
|
|
174506
|
+
// Mutates `seenItems`
|
|
174507
|
+
function tryAddSeenItem(item) {
|
|
174508
|
+
var name = item.name;
|
|
174509
|
+
if (!seenItems.has(name)) {
|
|
174510
|
+
seenItems.set(name, [item]);
|
|
174511
|
+
return true;
|
|
174512
|
+
}
|
|
174513
|
+
var seen = seenItems.get(name);
|
|
174514
|
+
for (var _i = 0, seen_1 = seen; _i < seen_1.length; _i++) {
|
|
174515
|
+
var seenItem = seen_1[_i];
|
|
174516
|
+
if (navigateToItemIsEqualTo(seenItem, item)) {
|
|
174517
|
+
return false;
|
|
174518
|
+
}
|
|
174519
|
+
}
|
|
174520
|
+
seen.push(item);
|
|
174521
|
+
return true;
|
|
174221
174522
|
}
|
|
174222
|
-
var fileArgs = args;
|
|
174223
|
-
return combineProjectOutputWhileOpeningReferencedProjects(this.getProjects(fileArgs), this.getDefaultProject(fileArgs), function (project) { return project.getLanguageService().getNavigateToItems(searchValue, maxResultCount, /*fileName*/ undefined, /*excludeDts*/ project.isNonTsProject()); }, documentSpanLocation, navigateToItemIsEqualTo);
|
|
174224
174523
|
function navigateToItemIsEqualTo(a, b) {
|
|
174225
174524
|
if (a === b) {
|
|
174226
174525
|
return true;
|
|
@@ -174312,8 +174611,28 @@ var ts;
|
|
|
174312
174611
|
var newPath = server.toNormalizedPath(args.newFilePath);
|
|
174313
174612
|
var formatOptions = this.getHostFormatOptions();
|
|
174314
174613
|
var preferences = this.getHostPreferences();
|
|
174315
|
-
var
|
|
174316
|
-
|
|
174614
|
+
var seenFiles = new ts.Set();
|
|
174615
|
+
var textChanges = [];
|
|
174616
|
+
// TODO (https://github.com/microsoft/TypeScript/issues/47839)
|
|
174617
|
+
// This appears to have been intended to search all projects but, in practice, it seems to only search
|
|
174618
|
+
// those that are downstream from already-loaded projects.
|
|
174619
|
+
this.projectService.loadAncestorProjectTree();
|
|
174620
|
+
this.projectService.forEachEnabledProject(function (project) {
|
|
174621
|
+
var projectTextChanges = project.getLanguageService().getEditsForFileRename(oldPath, newPath, formatOptions, preferences);
|
|
174622
|
+
var projectFiles = [];
|
|
174623
|
+
for (var _i = 0, projectTextChanges_1 = projectTextChanges; _i < projectTextChanges_1.length; _i++) {
|
|
174624
|
+
var textChange = projectTextChanges_1[_i];
|
|
174625
|
+
if (!seenFiles.has(textChange.fileName)) {
|
|
174626
|
+
textChanges.push(textChange);
|
|
174627
|
+
projectFiles.push(textChange.fileName);
|
|
174628
|
+
}
|
|
174629
|
+
}
|
|
174630
|
+
for (var _a = 0, projectFiles_1 = projectFiles; _a < projectFiles_1.length; _a++) {
|
|
174631
|
+
var file = projectFiles_1[_a];
|
|
174632
|
+
seenFiles.add(file);
|
|
174633
|
+
}
|
|
174634
|
+
});
|
|
174635
|
+
return simplifiedResult ? textChanges.map(function (c) { return _this.mapTextChangeToCodeEdit(c); }) : textChanges;
|
|
174317
174636
|
};
|
|
174318
174637
|
Session.prototype.getCodeFixes = function (args, simplifiedResult) {
|
|
174319
174638
|
var _this = this;
|