@typescript-deploys/pr-build 4.7.0-pr-47172-7 → 4.7.0-pr-48168-8
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 -122
- package/lib/tsserver.js +601 -261
- package/lib/tsserverlibrary.d.ts +3 -1
- package/lib/tsserverlibrary.js +601 -261
- package/lib/typescript.d.ts +3 -1
- package/lib/typescript.js +478 -180
- package/lib/typescriptServices.d.ts +3 -1
- package/lib/typescriptServices.js +478 -180
- package/lib/typingsInstaller.js +241 -137
- 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) {
|
|
@@ -9024,7 +9026,6 @@ var ts;
|
|
|
9024
9026
|
Command_line_Options: diag(6171, ts.DiagnosticCategory.Message, "Command_line_Options_6171", "Command-line Options"),
|
|
9025
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'."),
|
|
9026
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."),
|
|
9027
|
-
List_of_language_service_plugins: diag(6181, ts.DiagnosticCategory.Message, "List_of_language_service_plugins_6181", "List of language service plugins."),
|
|
9028
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}'"),
|
|
9029
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}'."),
|
|
9030
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}'."),
|
|
@@ -9131,7 +9132,7 @@ var ts;
|
|
|
9131
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"),
|
|
9132
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"),
|
|
9133
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"),
|
|
9134
|
-
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."),
|
|
9135
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')"),
|
|
9136
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."),
|
|
9137
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."),
|
|
@@ -9142,7 +9143,6 @@ var ts;
|
|
|
9142
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}'"),
|
|
9143
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}'"),
|
|
9144
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}'"),
|
|
9145
|
-
Enable_incremental_compilation: diag(6378, ts.DiagnosticCategory.Message, "Enable_incremental_compilation_6378", "Enable incremental compilation"),
|
|
9146
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."),
|
|
9147
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"),
|
|
9148
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}'"),
|
|
@@ -9170,13 +9170,13 @@ var ts;
|
|
|
9170
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?"),
|
|
9171
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."),
|
|
9172
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."),
|
|
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
|
|
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."),
|
|
9174
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."),
|
|
9175
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."),
|
|
9176
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."),
|
|
9177
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."),
|
|
9178
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."),
|
|
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
|
|
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."),
|
|
9180
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."),
|
|
9181
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."),
|
|
9182
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."),
|
|
@@ -9189,13 +9189,13 @@ var ts;
|
|
|
9189
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."),
|
|
9190
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."),
|
|
9191
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."),
|
|
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"),
|
|
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."),
|
|
9193
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."),
|
|
9194
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."),
|
|
9195
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."),
|
|
9196
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."),
|
|
9197
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"),
|
|
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
|
|
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."),
|
|
9199
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."),
|
|
9200
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."),
|
|
9201
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."),
|
|
@@ -9205,7 +9205,7 @@ var ts;
|
|
|
9205
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."),
|
|
9206
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."),
|
|
9207
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`."),
|
|
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"),
|
|
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."),
|
|
9209
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."),
|
|
9210
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."),
|
|
9211
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."),
|
|
@@ -9215,77 +9215,76 @@ var ts;
|
|
|
9215
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."),
|
|
9216
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."),
|
|
9217
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."),
|
|
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'"),
|
|
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'."),
|
|
9219
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'."),
|
|
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
|
|
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*'."),
|
|
9221
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."),
|
|
9222
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."),
|
|
9223
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."),
|
|
9224
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."),
|
|
9225
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."),
|
|
9226
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."),
|
|
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
|
|
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'."),
|
|
9228
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."),
|
|
9229
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."),
|
|
9230
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."),
|
|
9231
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."),
|
|
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
|
|
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."),
|
|
9233
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."),
|
|
9234
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."),
|
|
9235
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."),
|
|
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
|
|
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."),
|
|
9237
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."),
|
|
9238
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."),
|
|
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
|
|
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'."),
|
|
9240
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."),
|
|
9241
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."),
|
|
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
|
|
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."),
|
|
9244
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."),
|
|
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
|
|
9246
|
-
|
|
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
|
|
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."),
|
|
9249
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."),
|
|
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
|
|
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."),
|
|
9251
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."),
|
|
9252
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."),
|
|
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
|
|
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."),
|
|
9254
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."),
|
|
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
|
|
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."),
|
|
9258
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."),
|
|
9259
9259
|
Disable_emitting_comments: diag(6688, ts.DiagnosticCategory.Message, "Disable_emitting_comments_6688", "Disable emitting comments."),
|
|
9260
|
-
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."),
|
|
9261
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."),
|
|
9262
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."),
|
|
9263
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."),
|
|
9264
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."),
|
|
9265
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."),
|
|
9266
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."),
|
|
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
|
|
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."),
|
|
9268
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."),
|
|
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
|
|
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'."),
|
|
9270
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."),
|
|
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
|
|
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."),
|
|
9272
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."),
|
|
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
|
|
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."),
|
|
9274
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."),
|
|
9275
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."),
|
|
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
|
|
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."),
|
|
9277
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."),
|
|
9278
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."),
|
|
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
|
|
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'."),
|
|
9280
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."),
|
|
9281
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."),
|
|
9282
|
-
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."),
|
|
9283
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."),
|
|
9284
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."),
|
|
9285
|
-
Include_undefined_in_index_signature_results: diag(6716, ts.DiagnosticCategory.Message, "Include_undefined_in_index_signature_results_6716", "Include 'undefined' in index signature results"),
|
|
9286
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."),
|
|
9287
|
-
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"),
|
|
9288
|
-
|
|
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'."),
|
|
9289
9288
|
one_of_Colon: diag(6900, ts.DiagnosticCategory.Message, "one_of_Colon_6900", "one of:"),
|
|
9290
9289
|
one_or_more_Colon: diag(6901, ts.DiagnosticCategory.Message, "one_or_more_Colon_6901", "one or more:"),
|
|
9291
9290
|
type_Colon: diag(6902, ts.DiagnosticCategory.Message, "type_Colon_6902", "type:"),
|
|
@@ -12836,7 +12835,7 @@ var ts;
|
|
|
12836
12835
|
return ts.emptyArray;
|
|
12837
12836
|
}
|
|
12838
12837
|
if (ts.isJSDocTypeAlias(node)) {
|
|
12839
|
-
ts.Debug.assert(node.parent.kind === 319 /*
|
|
12838
|
+
ts.Debug.assert(node.parent.kind === 319 /* JSDoc */);
|
|
12840
12839
|
return ts.flatMap(node.parent.tags, function (tag) { return ts.isJSDocTemplateTag(tag) ? tag.typeParameters : undefined; });
|
|
12841
12840
|
}
|
|
12842
12841
|
if (node.typeParameters) {
|
|
@@ -13783,7 +13782,7 @@ var ts;
|
|
|
13783
13782
|
ts.isJSDocNode = isJSDocNode;
|
|
13784
13783
|
/** True if node is of a kind that may contain comment text. */
|
|
13785
13784
|
function isJSDocCommentContainingNode(node) {
|
|
13786
|
-
return node.kind === 319 /*
|
|
13785
|
+
return node.kind === 319 /* JSDoc */
|
|
13787
13786
|
|| node.kind === 318 /* JSDocNamepathType */
|
|
13788
13787
|
|| node.kind === 320 /* JSDocText */
|
|
13789
13788
|
|| isJSDocLinkLike(node)
|
|
@@ -14833,7 +14832,7 @@ var ts;
|
|
|
14833
14832
|
return name.kind === 161 /* ComputedPropertyName */ && !isStringOrNumericLiteralLike(name.expression);
|
|
14834
14833
|
}
|
|
14835
14834
|
ts.isComputedNonLiteralName = isComputedNonLiteralName;
|
|
14836
|
-
function
|
|
14835
|
+
function tryGetTextOfPropertyName(name) {
|
|
14837
14836
|
switch (name.kind) {
|
|
14838
14837
|
case 79 /* Identifier */:
|
|
14839
14838
|
case 80 /* PrivateIdentifier */:
|
|
@@ -14845,11 +14844,15 @@ var ts;
|
|
|
14845
14844
|
case 161 /* ComputedPropertyName */:
|
|
14846
14845
|
if (isStringOrNumericLiteralLike(name.expression))
|
|
14847
14846
|
return ts.escapeLeadingUnderscores(name.expression.text);
|
|
14848
|
-
return
|
|
14847
|
+
return undefined;
|
|
14849
14848
|
default:
|
|
14850
14849
|
return ts.Debug.assertNever(name);
|
|
14851
14850
|
}
|
|
14852
14851
|
}
|
|
14852
|
+
ts.tryGetTextOfPropertyName = tryGetTextOfPropertyName;
|
|
14853
|
+
function getTextOfPropertyName(name) {
|
|
14854
|
+
return ts.Debug.checkDefined(tryGetTextOfPropertyName(name));
|
|
14855
|
+
}
|
|
14853
14856
|
ts.getTextOfPropertyName = getTextOfPropertyName;
|
|
14854
14857
|
function entityNameToString(name) {
|
|
14855
14858
|
switch (name.kind) {
|
|
@@ -15344,10 +15347,23 @@ var ts;
|
|
|
15344
15347
|
&& node.parent.parent.kind === 236 /* VariableStatement */;
|
|
15345
15348
|
}
|
|
15346
15349
|
ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement;
|
|
15350
|
+
function isCommonJsExportedExpression(node) {
|
|
15351
|
+
if (!isInJSFile(node))
|
|
15352
|
+
return false;
|
|
15353
|
+
return (ts.isObjectLiteralExpression(node.parent) && ts.isBinaryExpression(node.parent.parent) && getAssignmentDeclarationKind(node.parent.parent) === 2 /* ModuleExports */) ||
|
|
15354
|
+
isCommonJsExportPropertyAssignment(node.parent);
|
|
15355
|
+
}
|
|
15356
|
+
ts.isCommonJsExportedExpression = isCommonJsExportedExpression;
|
|
15357
|
+
function isCommonJsExportPropertyAssignment(node) {
|
|
15358
|
+
if (!isInJSFile(node))
|
|
15359
|
+
return false;
|
|
15360
|
+
return (ts.isBinaryExpression(node) && getAssignmentDeclarationKind(node) === 1 /* ExportsProperty */);
|
|
15361
|
+
}
|
|
15362
|
+
ts.isCommonJsExportPropertyAssignment = isCommonJsExportPropertyAssignment;
|
|
15347
15363
|
function isValidESSymbolDeclaration(node) {
|
|
15348
|
-
return ts.isVariableDeclaration(node) ? isVarConst(node) && ts.isIdentifier(node.name) && isVariableDeclarationInVariableStatement(node) :
|
|
15364
|
+
return (ts.isVariableDeclaration(node) ? isVarConst(node) && ts.isIdentifier(node.name) && isVariableDeclarationInVariableStatement(node) :
|
|
15349
15365
|
ts.isPropertyDeclaration(node) ? hasEffectiveReadonlyModifier(node) && hasStaticModifier(node) :
|
|
15350
|
-
ts.isPropertySignature(node) && hasEffectiveReadonlyModifier(node);
|
|
15366
|
+
ts.isPropertySignature(node) && hasEffectiveReadonlyModifier(node)) || isCommonJsExportPropertyAssignment(node);
|
|
15351
15367
|
}
|
|
15352
15368
|
ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration;
|
|
15353
15369
|
function introducesArgumentsExoticObject(node) {
|
|
@@ -15401,7 +15417,7 @@ var ts;
|
|
|
15401
15417
|
function getPropertyAssignment(objectLiteral, key, key2) {
|
|
15402
15418
|
return objectLiteral.properties.filter(function (property) {
|
|
15403
15419
|
if (property.kind === 295 /* PropertyAssignment */) {
|
|
15404
|
-
var propName =
|
|
15420
|
+
var propName = tryGetTextOfPropertyName(property.name);
|
|
15405
15421
|
return key === propName || (!!key2 && key2 === propName);
|
|
15406
15422
|
}
|
|
15407
15423
|
return false;
|
|
@@ -18241,7 +18257,7 @@ var ts;
|
|
|
18241
18257
|
ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations;
|
|
18242
18258
|
/** template tags are only available when a typedef isn't already using them */
|
|
18243
18259
|
function isNonTypeAliasTemplate(tag) {
|
|
18244
|
-
return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 319 /*
|
|
18260
|
+
return ts.isJSDocTemplateTag(tag) && !(tag.parent.kind === 319 /* JSDoc */ && tag.parent.tags.some(isJSDocTypeAlias));
|
|
18245
18261
|
}
|
|
18246
18262
|
/**
|
|
18247
18263
|
* Gets the effective type annotation of the value parameter of a set accessor. If the node
|
|
@@ -25218,7 +25234,7 @@ var ts;
|
|
|
25218
25234
|
}
|
|
25219
25235
|
// @api
|
|
25220
25236
|
function createJSDocComment(comment, tags) {
|
|
25221
|
-
var node = createBaseNode(319 /*
|
|
25237
|
+
var node = createBaseNode(319 /* JSDoc */);
|
|
25222
25238
|
node.comment = comment;
|
|
25223
25239
|
node.tags = asNodeArray(tags);
|
|
25224
25240
|
return node;
|
|
@@ -28727,7 +28743,7 @@ var ts;
|
|
|
28727
28743
|
}
|
|
28728
28744
|
ts.isJSDocNamepathType = isJSDocNamepathType;
|
|
28729
28745
|
function isJSDoc(node) {
|
|
28730
|
-
return node.kind === 319 /*
|
|
28746
|
+
return node.kind === 319 /* JSDoc */;
|
|
28731
28747
|
}
|
|
28732
28748
|
ts.isJSDoc = isJSDoc;
|
|
28733
28749
|
function isJSDocTypeLiteral(node) {
|
|
@@ -30352,7 +30368,7 @@ var ts;
|
|
|
30352
30368
|
case 316 /* JSDocFunctionType */:
|
|
30353
30369
|
return visitNodes(cbNode, cbNodes, node.parameters) ||
|
|
30354
30370
|
visitNode(cbNode, node.type);
|
|
30355
|
-
case 319 /*
|
|
30371
|
+
case 319 /* JSDoc */:
|
|
30356
30372
|
return (typeof node.comment === "string" ? undefined : visitNodes(cbNode, cbNodes, node.comment))
|
|
30357
30373
|
|| visitNodes(cbNode, cbNodes, node.tags);
|
|
30358
30374
|
case 345 /* JSDocSeeTag */:
|
|
@@ -38586,7 +38602,7 @@ var ts;
|
|
|
38586
38602
|
shortName: "i",
|
|
38587
38603
|
type: "boolean",
|
|
38588
38604
|
category: ts.Diagnostics.Projects,
|
|
38589
|
-
description: ts.Diagnostics.
|
|
38605
|
+
description: ts.Diagnostics.Save_tsbuildinfo_files_to_allow_for_incremental_compilation_of_projects,
|
|
38590
38606
|
transpileOptionValue: undefined,
|
|
38591
38607
|
defaultValueDescription: ts.Diagnostics.false_unless_composite_is_set
|
|
38592
38608
|
},
|
|
@@ -38986,7 +39002,7 @@ var ts;
|
|
|
38986
39002
|
affectsSemanticDiagnostics: true,
|
|
38987
39003
|
strictFlag: true,
|
|
38988
39004
|
category: ts.Diagnostics.Type_Checking,
|
|
38989
|
-
description: ts.Diagnostics.
|
|
39005
|
+
description: ts.Diagnostics.Default_catch_clause_variables_as_unknown_instead_of_any,
|
|
38990
39006
|
defaultValueDescription: false,
|
|
38991
39007
|
},
|
|
38992
39008
|
{
|
|
@@ -39004,7 +39020,7 @@ var ts;
|
|
|
39004
39020
|
type: "boolean",
|
|
39005
39021
|
affectsSemanticDiagnostics: true,
|
|
39006
39022
|
category: ts.Diagnostics.Type_Checking,
|
|
39007
|
-
description: ts.Diagnostics.
|
|
39023
|
+
description: ts.Diagnostics.Enable_error_reporting_when_local_variables_aren_t_read,
|
|
39008
39024
|
defaultValueDescription: false,
|
|
39009
39025
|
},
|
|
39010
39026
|
{
|
|
@@ -39045,7 +39061,7 @@ var ts;
|
|
|
39045
39061
|
type: "boolean",
|
|
39046
39062
|
affectsSemanticDiagnostics: true,
|
|
39047
39063
|
category: ts.Diagnostics.Type_Checking,
|
|
39048
|
-
description: ts.Diagnostics.
|
|
39064
|
+
description: ts.Diagnostics.Add_undefined_to_a_type_when_accessed_using_an_index,
|
|
39049
39065
|
defaultValueDescription: false,
|
|
39050
39066
|
},
|
|
39051
39067
|
{
|
|
@@ -39521,7 +39537,7 @@ var ts;
|
|
|
39521
39537
|
name: "plugin",
|
|
39522
39538
|
type: "object"
|
|
39523
39539
|
},
|
|
39524
|
-
description: ts.Diagnostics.
|
|
39540
|
+
description: ts.Diagnostics.Specify_a_list_of_language_service_plugins_to_include,
|
|
39525
39541
|
category: ts.Diagnostics.Editor_Support,
|
|
39526
39542
|
},
|
|
39527
39543
|
];
|
|
@@ -47666,6 +47682,8 @@ var ts;
|
|
|
47666
47682
|
var templateConstraintType = getUnionType([stringType, numberType, booleanType, bigintType, nullType, undefinedType]);
|
|
47667
47683
|
var restrictiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? getRestrictiveTypeParameter(t) : t; });
|
|
47668
47684
|
var permissiveMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? wildcardType : t; });
|
|
47685
|
+
var uniqueLiteralType = createIntrinsicType(131072 /* Never */, "never"); // `uniqueLiteralType` is a special `never` flagged by union reduction to behave as a literal
|
|
47686
|
+
var uniqueLiteralMapper = makeFunctionTypeMapper(function (t) { return t.flags & 262144 /* TypeParameter */ ? uniqueLiteralType : t; }); // replace all type parameters with the unique literal type (disregarding constraints)
|
|
47669
47687
|
var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
47670
47688
|
var emptyJsxObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
47671
47689
|
emptyJsxObjectType.objectFlags |= 2048 /* JsxAttributes */;
|
|
@@ -48604,7 +48622,7 @@ var ts;
|
|
|
48604
48622
|
// - parameters are only in the scope of function body
|
|
48605
48623
|
// This restriction does not apply to JSDoc comment types because they are parented
|
|
48606
48624
|
// at a higher level than type parameters would normally be
|
|
48607
|
-
if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 319 /*
|
|
48625
|
+
if (meaning & result.flags & 788968 /* Type */ && lastLocation.kind !== 319 /* JSDoc */) {
|
|
48608
48626
|
useResult = result.flags & 262144 /* TypeParameter */
|
|
48609
48627
|
// type parameters are visible in parameter list, return type and type parameter list
|
|
48610
48628
|
? lastLocation === location.type ||
|
|
@@ -51570,10 +51588,16 @@ var ts;
|
|
|
51570
51588
|
var readonlyToken = type.declaration.readonlyToken ? ts.factory.createToken(type.declaration.readonlyToken.kind) : undefined;
|
|
51571
51589
|
var questionToken = type.declaration.questionToken ? ts.factory.createToken(type.declaration.questionToken.kind) : undefined;
|
|
51572
51590
|
var appropriateConstraintTypeNode;
|
|
51591
|
+
var newTypeVariable;
|
|
51573
51592
|
if (isMappedTypeWithKeyofConstraintDeclaration(type)) {
|
|
51574
51593
|
// We have a { [P in keyof T]: X }
|
|
51575
51594
|
// We do this to ensure we retain the toplevel keyof-ness of the type which may be lost due to keyof distribution during `getConstraintTypeFromMappedType`
|
|
51576
|
-
|
|
51595
|
+
if (!(getModifiersTypeFromMappedType(type).flags & 262144 /* TypeParameter */) && context.flags & 4 /* GenerateNamesForShadowedTypeParams */) {
|
|
51596
|
+
var newParam = createTypeParameter(createSymbol(262144 /* TypeParameter */, "T"));
|
|
51597
|
+
var name = typeParameterToName(newParam, context);
|
|
51598
|
+
newTypeVariable = ts.factory.createTypeReferenceNode(name);
|
|
51599
|
+
}
|
|
51600
|
+
appropriateConstraintTypeNode = ts.factory.createTypeOperatorNode(140 /* KeyOfKeyword */, newTypeVariable || typeToTypeNodeHelper(getModifiersTypeFromMappedType(type), context));
|
|
51577
51601
|
}
|
|
51578
51602
|
else {
|
|
51579
51603
|
appropriateConstraintTypeNode = typeToTypeNodeHelper(getConstraintTypeFromMappedType(type), context);
|
|
@@ -51583,7 +51607,14 @@ var ts;
|
|
|
51583
51607
|
var templateTypeNode = typeToTypeNodeHelper(removeMissingType(getTemplateTypeFromMappedType(type), !!(getMappedTypeModifiers(type) & 4 /* IncludeOptional */)), context);
|
|
51584
51608
|
var mappedTypeNode = ts.factory.createMappedTypeNode(readonlyToken, typeParameterNode, nameTypeNode, questionToken, templateTypeNode, /*members*/ undefined);
|
|
51585
51609
|
context.approximateLength += 10;
|
|
51586
|
-
|
|
51610
|
+
var result = ts.setEmitFlags(mappedTypeNode, 1 /* SingleLine */);
|
|
51611
|
+
if (isMappedTypeWithKeyofConstraintDeclaration(type) && !(getModifiersTypeFromMappedType(type).flags & 262144 /* TypeParameter */) && context.flags & 4 /* GenerateNamesForShadowedTypeParams */) {
|
|
51612
|
+
// homomorphic mapped type with a non-homomorphic naive inlining
|
|
51613
|
+
// wrap it with a conditional like `SomeModifiersType extends infer U ? {..the mapped type...} : never` to ensure the resulting
|
|
51614
|
+
// type stays homomorphic
|
|
51615
|
+
return ts.factory.createConditionalTypeNode(typeToTypeNodeHelper(getModifiersTypeFromMappedType(type), context), ts.factory.createInferTypeNode(ts.factory.createTypeParameterDeclaration(ts.factory.cloneNode(newTypeVariable.typeName))), result, ts.factory.createKeywordTypeNode(143 /* NeverKeyword */));
|
|
51616
|
+
}
|
|
51617
|
+
return result;
|
|
51587
51618
|
}
|
|
51588
51619
|
function createAnonymousTypeNode(type) {
|
|
51589
51620
|
var _a;
|
|
@@ -53204,7 +53235,7 @@ var ts;
|
|
|
53204
53235
|
// If it's a class/interface/function: emit a class/interface/function with a `default` modifier
|
|
53205
53236
|
// These forms can merge, eg (`export default 12; export default interface A {}`)
|
|
53206
53237
|
function serializeSymbolWorker(symbol, isPrivate, propertyAsAlias) {
|
|
53207
|
-
var _a, _b;
|
|
53238
|
+
var _a, _b, _c, _d;
|
|
53208
53239
|
var symbolName = ts.unescapeLeadingUnderscores(symbol.escapedName);
|
|
53209
53240
|
var isDefault = symbol.escapedName === "default" /* Default */;
|
|
53210
53241
|
if (isPrivate && !(context.flags & 131072 /* AllowAnonymousIdentifier */) && ts.isStringANonContextualKeyword(symbolName) && !isDefault) {
|
|
@@ -53255,17 +53286,21 @@ var ts;
|
|
|
53255
53286
|
else {
|
|
53256
53287
|
// A Class + Property merge is made for a `module.exports.Member = class {}`, and it doesn't serialize well as either a class _or_ a property symbol - in fact, _it behaves like an alias!_
|
|
53257
53288
|
// `var` is `FunctionScopedVariable`, `const` and `let` are `BlockScopedVariable`, and `module.exports.thing =` is `Property`
|
|
53258
|
-
var flags = !(symbol.flags & 2 /* BlockScopedVariable */)
|
|
53259
|
-
:
|
|
53289
|
+
var flags = !(symbol.flags & 2 /* BlockScopedVariable */)
|
|
53290
|
+
? ((_a = symbol.parent) === null || _a === void 0 ? void 0 : _a.valueDeclaration) && ts.isSourceFile((_b = symbol.parent) === null || _b === void 0 ? void 0 : _b.valueDeclaration)
|
|
53291
|
+
? 2 /* Const */
|
|
53292
|
+
: undefined
|
|
53293
|
+
: isConstVariable(symbol)
|
|
53294
|
+
? 2 /* Const */
|
|
53260
53295
|
: 1 /* Let */;
|
|
53261
53296
|
var name = (needsPostExportDefault || !(symbol.flags & 4 /* Property */)) ? localName : getUnusedName(localName, symbol);
|
|
53262
53297
|
var textRange = symbol.declarations && ts.find(symbol.declarations, function (d) { return ts.isVariableDeclaration(d); });
|
|
53263
53298
|
if (textRange && ts.isVariableDeclarationList(textRange.parent) && textRange.parent.declarations.length === 1) {
|
|
53264
53299
|
textRange = textRange.parent.parent;
|
|
53265
53300
|
}
|
|
53266
|
-
var propertyAccessRequire = (
|
|
53301
|
+
var propertyAccessRequire = (_c = symbol.declarations) === null || _c === void 0 ? void 0 : _c.find(ts.isPropertyAccessExpression);
|
|
53267
53302
|
if (propertyAccessRequire && ts.isBinaryExpression(propertyAccessRequire.parent) && ts.isIdentifier(propertyAccessRequire.parent.right)
|
|
53268
|
-
&& ((
|
|
53303
|
+
&& ((_d = type.symbol) === null || _d === void 0 ? void 0 : _d.valueDeclaration) && ts.isSourceFile(type.symbol.valueDeclaration)) {
|
|
53269
53304
|
var alias = localName === propertyAccessRequire.parent.right.escapedText ? undefined : propertyAccessRequire.parent.right;
|
|
53270
53305
|
addResult(ts.factory.createExportDeclaration(
|
|
53271
53306
|
/*decorators*/ undefined,
|
|
@@ -53345,8 +53380,8 @@ var ts;
|
|
|
53345
53380
|
// synthesize export * from "moduleReference"
|
|
53346
53381
|
// Straightforward - only one thing to do - make an export declaration
|
|
53347
53382
|
if (symbol.declarations) {
|
|
53348
|
-
for (var _i = 0,
|
|
53349
|
-
var node =
|
|
53383
|
+
for (var _i = 0, _e = symbol.declarations; _i < _e.length; _i++) {
|
|
53384
|
+
var node = _e[_i];
|
|
53350
53385
|
var resolvedModule = resolveExternalModuleName(node, node.moduleSpecifier);
|
|
53351
53386
|
if (!resolvedModule)
|
|
53352
53387
|
continue;
|
|
@@ -55152,7 +55187,10 @@ var ts;
|
|
|
55152
55187
|
if (containsSameNamedThisProperty(expression.left, expression.right)) {
|
|
55153
55188
|
return anyType;
|
|
55154
55189
|
}
|
|
55155
|
-
var
|
|
55190
|
+
var isDirectExport = kind === 1 /* ExportsProperty */ && (ts.isPropertyAccessExpression(expression.left) || ts.isElementAccessExpression(expression.left)) && (ts.isModuleExportsAccessExpression(expression.left.expression) || (ts.isIdentifier(expression.left.expression) && ts.isExportsIdentifier(expression.left.expression)));
|
|
55191
|
+
var type = resolvedSymbol ? getTypeOfSymbol(resolvedSymbol)
|
|
55192
|
+
: isDirectExport ? getRegularTypeOfLiteralType(checkExpressionCached(expression.right))
|
|
55193
|
+
: getWidenedLiteralType(checkExpressionCached(expression.right));
|
|
55156
55194
|
if (type.flags & 524288 /* Object */ &&
|
|
55157
55195
|
kind === 2 /* ModuleExports */ &&
|
|
55158
55196
|
symbol.escapedName === "export=" /* ExportEquals */) {
|
|
@@ -55896,7 +55934,7 @@ var ts;
|
|
|
55896
55934
|
node = paramSymbol.valueDeclaration;
|
|
55897
55935
|
}
|
|
55898
55936
|
break;
|
|
55899
|
-
case 319 /*
|
|
55937
|
+
case 319 /* JSDoc */: {
|
|
55900
55938
|
var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes);
|
|
55901
55939
|
return node.tags
|
|
55902
55940
|
? appendTypeParameters(outerTypeParameters, ts.flatMap(node.tags, function (t) { return ts.isJSDocTemplateTag(t) ? t.typeParameters : undefined; }))
|
|
@@ -58157,10 +58195,10 @@ var ts;
|
|
|
58157
58195
|
else if (type !== firstType) {
|
|
58158
58196
|
checkFlags |= 64 /* HasNonUniformType */;
|
|
58159
58197
|
}
|
|
58160
|
-
if (isLiteralType(type) || isPatternLiteralType(type)) {
|
|
58198
|
+
if (isLiteralType(type) || isPatternLiteralType(type) || type === uniqueLiteralType) {
|
|
58161
58199
|
checkFlags |= 128 /* HasLiteralType */;
|
|
58162
58200
|
}
|
|
58163
|
-
if (type.flags & 131072 /* Never */) {
|
|
58201
|
+
if (type.flags & 131072 /* Never */ && type !== uniqueLiteralType) {
|
|
58164
58202
|
checkFlags |= 131072 /* HasNeverType */;
|
|
58165
58203
|
}
|
|
58166
58204
|
propTypes.push(type);
|
|
@@ -59345,7 +59383,7 @@ var ts;
|
|
|
59345
59383
|
function getConditionalFlowTypeOfType(type, node) {
|
|
59346
59384
|
var constraints;
|
|
59347
59385
|
var covariant = true;
|
|
59348
|
-
while (node && !ts.isStatement(node) && node.kind !== 319 /*
|
|
59386
|
+
while (node && !ts.isStatement(node) && node.kind !== 319 /* JSDoc */) {
|
|
59349
59387
|
var parent = node.parent;
|
|
59350
59388
|
// only consider variance flipped by parameter locations - `keyof` types would usually be considered variance inverting, but
|
|
59351
59389
|
// often get used in indexed accesses where they behave sortof invariantly, but our checking is lax
|
|
@@ -60012,6 +60050,10 @@ var ts;
|
|
|
60012
60050
|
return includes;
|
|
60013
60051
|
}
|
|
60014
60052
|
function removeSubtypes(types, hasObjectTypes) {
|
|
60053
|
+
// [] and [T] immediately reduce to [] and [T] respectively
|
|
60054
|
+
if (types.length < 2) {
|
|
60055
|
+
return types;
|
|
60056
|
+
}
|
|
60015
60057
|
var id = getTypeListId(types);
|
|
60016
60058
|
var match = subtypeReductionCache.get(id);
|
|
60017
60059
|
if (match) {
|
|
@@ -60697,10 +60739,24 @@ var ts;
|
|
|
60697
60739
|
return getUnionType(ts.concatenate(propertyTypes, indexKeyTypes), 1 /* Literal */,
|
|
60698
60740
|
/*aliasSymbol*/ undefined, /*aliasTypeArguments*/ undefined, origin);
|
|
60699
60741
|
}
|
|
60742
|
+
/**
|
|
60743
|
+
* A union type which is reducible upon instantiation (meaning some members are removed under certain instantiations)
|
|
60744
|
+
* must be kept generic, as that instantiation information needs to flow through the type system. By replacing all
|
|
60745
|
+
* type parameters in the union with a special never type that is treated as a literal in `getReducedType`, we can cause the `getReducedType` logic
|
|
60746
|
+
* to reduce the resulting type if possible (since only intersections with conflicting literal-typed properties are reducible).
|
|
60747
|
+
*/
|
|
60748
|
+
function isPossiblyReducibleByInstantiation(type) {
|
|
60749
|
+
return ts.some(type.types, function (t) {
|
|
60750
|
+
var uniqueFilled = getUniqueLiteralFilledInstantiation(t);
|
|
60751
|
+
return getReducedType(uniqueFilled) !== uniqueFilled;
|
|
60752
|
+
});
|
|
60753
|
+
}
|
|
60700
60754
|
function getIndexType(type, stringsOnly, noIndexSignatures) {
|
|
60701
60755
|
if (stringsOnly === void 0) { stringsOnly = keyofStringsOnly; }
|
|
60702
60756
|
type = getReducedType(type);
|
|
60703
|
-
return type.flags & 1048576 /* Union */ ?
|
|
60757
|
+
return type.flags & 1048576 /* Union */ ? isPossiblyReducibleByInstantiation(type)
|
|
60758
|
+
? getIndexTypeForGenericType(type, stringsOnly)
|
|
60759
|
+
: getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) :
|
|
60704
60760
|
type.flags & 2097152 /* Intersection */ ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) :
|
|
60705
60761
|
type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericTupleType(type) || isGenericMappedType(type) && !hasDistributiveNameType(type) ? getIndexTypeForGenericType(type, stringsOnly) :
|
|
60706
60762
|
ts.getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, stringsOnly, noIndexSignatures) :
|
|
@@ -61328,6 +61384,10 @@ var ts;
|
|
|
61328
61384
|
}
|
|
61329
61385
|
return type;
|
|
61330
61386
|
}
|
|
61387
|
+
function maybeCloneTypeParameter(p) {
|
|
61388
|
+
var constraint = getConstraintOfTypeParameter(p);
|
|
61389
|
+
return constraint && (isGenericObjectType(constraint) || isGenericIndexType(constraint)) ? cloneTypeParameter(p) : p;
|
|
61390
|
+
}
|
|
61331
61391
|
function isTypicalNondistributiveConditional(root) {
|
|
61332
61392
|
return !root.isDistributive && isSingletonTupleType(root.node.checkType) && isSingletonTupleType(root.node.extendsType);
|
|
61333
61393
|
}
|
|
@@ -61346,37 +61406,65 @@ var ts;
|
|
|
61346
61406
|
var result;
|
|
61347
61407
|
var extraTypes;
|
|
61348
61408
|
var tailCount = 0;
|
|
61349
|
-
|
|
61350
|
-
// types of the form 'A extends B ? X : C extends D ? Y : E extends F ? Z : ...' as a single construct for
|
|
61351
|
-
// purposes of resolution. We also loop here when resolution of a conditional type ends in resolution of
|
|
61352
|
-
// another (or, through recursion, possibly the same) conditional type. In the potentially tail-recursive
|
|
61353
|
-
// cases we increment the tail recursion counter and stop after 1000 iterations.
|
|
61354
|
-
while (true) {
|
|
61409
|
+
var _loop_18 = function () {
|
|
61355
61410
|
if (tailCount === 1000) {
|
|
61356
61411
|
error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite);
|
|
61357
61412
|
result = errorType;
|
|
61358
|
-
break;
|
|
61413
|
+
return "break";
|
|
61359
61414
|
}
|
|
61360
61415
|
var isUnwrapped = isTypicalNondistributiveConditional(root);
|
|
61361
61416
|
var checkType = instantiateType(unwrapNondistributiveConditionalTuple(root, getActualTypeVariable(root.checkType)), mapper);
|
|
61362
61417
|
var checkTypeInstantiable = isGenericType(checkType);
|
|
61363
61418
|
var extendsType = instantiateType(unwrapNondistributiveConditionalTuple(root, root.extendsType), mapper);
|
|
61364
61419
|
if (checkType === wildcardType || extendsType === wildcardType) {
|
|
61365
|
-
return wildcardType;
|
|
61420
|
+
return { value: wildcardType };
|
|
61366
61421
|
}
|
|
61367
61422
|
var combinedMapper = void 0;
|
|
61368
61423
|
if (root.inferTypeParameters) {
|
|
61369
|
-
|
|
61370
|
-
|
|
61424
|
+
// When we're looking at making an inference for an infer type, when we get its constraint, it'll automagically be
|
|
61425
|
+
// instantiated with the context, so it doesn't need the mapper for the inference contex - however the constraint
|
|
61426
|
+
// may refer to another _root_, _uncloned_ `infer` type parameter [1], or to something mapped by `mapper` [2].
|
|
61427
|
+
// [1] Eg, if we have `Foo<T, U extends T>` and `Foo<number, infer B>` - `B` is constrained to `T`, which, in turn, has been instantiated
|
|
61428
|
+
// as `number`
|
|
61429
|
+
// Conversely, if we have `Foo<infer A, infer B>`, `B` is still constrained to `T` and `T` is instantiated as `A`
|
|
61430
|
+
// [2] Eg, if we have `Foo<T, U extends T>` and `Foo<Q, infer B>` where `Q` is mapped by `mapper` into `number` - `B` is constrained to `T`
|
|
61431
|
+
// which is in turn instantiated as `Q`, which is in turn instantiated as `number`.
|
|
61432
|
+
// So we need to:
|
|
61433
|
+
// * Clone the type parameters so their constraints can be instantiated in the context of `mapper` (otherwise theyd only get inference context information)
|
|
61434
|
+
// * Set the clones to both map the conditional's enclosing `mapper` and the original params
|
|
61435
|
+
// * instantiate the extends type with the clones
|
|
61436
|
+
// * incorporate all of the component mappers into the combined mapper for the true and false members
|
|
61437
|
+
// This means we have three mappers that need applying:
|
|
61438
|
+
// * The original `mapper` used to create this conditional
|
|
61439
|
+
// * The mapper that maps the old root type parameter to the clone (`freshMapper`)
|
|
61440
|
+
// * The mapper that maps the clone to its inference result (`context.mapper`)
|
|
61441
|
+
var freshParams = ts.sameMap(root.inferTypeParameters, maybeCloneTypeParameter);
|
|
61442
|
+
var freshMapper = freshParams !== root.inferTypeParameters ? createTypeMapper(root.inferTypeParameters, freshParams) : undefined;
|
|
61443
|
+
var context = createInferenceContext(freshParams, /*signature*/ undefined, 0 /* None */);
|
|
61444
|
+
if (freshMapper) {
|
|
61445
|
+
var freshCombinedMapper = combineTypeMappers(mapper, freshMapper);
|
|
61446
|
+
for (var _i = 0, freshParams_1 = freshParams; _i < freshParams_1.length; _i++) {
|
|
61447
|
+
var p = freshParams_1[_i];
|
|
61448
|
+
if (root.inferTypeParameters.indexOf(p) === -1) {
|
|
61449
|
+
p.mapper = freshCombinedMapper;
|
|
61450
|
+
}
|
|
61451
|
+
}
|
|
61452
|
+
}
|
|
61453
|
+
// We skip inference of the possible `infer` types unles the `extendsType` _is_ an infer type
|
|
61454
|
+
// if it was, it's trivial to say that extendsType = checkType, however such a pattern is used to
|
|
61455
|
+
// "reset" the type being build up during constraint calculation and avoid making an apparently "infinite" constraint
|
|
61456
|
+
// so in those cases we refain from performing inference and retain the uninfered type parameter
|
|
61457
|
+
if (!checkTypeInstantiable || !ts.some(root.inferTypeParameters, function (t) { return t === extendsType; })) {
|
|
61371
61458
|
// We don't want inferences from constraints as they may cause us to eagerly resolve the
|
|
61372
61459
|
// conditional type instead of deferring resolution. Also, we always want strict function
|
|
61373
61460
|
// types rules (i.e. proper contravariance) for inferences.
|
|
61374
|
-
inferTypes(context.inferences, checkType, extendsType, 512 /* NoConstraints */ | 1024 /* AlwaysStrict */);
|
|
61461
|
+
inferTypes(context.inferences, checkType, instantiateType(extendsType, freshMapper), 512 /* NoConstraints */ | 1024 /* AlwaysStrict */);
|
|
61375
61462
|
}
|
|
61463
|
+
var innerMapper = combineTypeMappers(freshMapper, context.mapper);
|
|
61376
61464
|
// It's possible for 'infer T' type paramteters to be given uninstantiated constraints when the
|
|
61377
61465
|
// those type parameters are used in type references (see getInferredTypeParameterConstraint). For
|
|
61378
61466
|
// that reason we need context.mapper to be first in the combined mapper. See #42636 for examples.
|
|
61379
|
-
combinedMapper = mapper ? combineTypeMappers(
|
|
61467
|
+
combinedMapper = mapper ? combineTypeMappers(innerMapper, mapper) : innerMapper;
|
|
61380
61468
|
}
|
|
61381
61469
|
// Instantiate the extends type including inferences for 'infer T' type parameters
|
|
61382
61470
|
var inferredExtendsType = combinedMapper ? instantiateType(unwrapNondistributiveConditionalTuple(root, root.extendsType), combinedMapper) : extendsType;
|
|
@@ -61398,14 +61486,14 @@ var ts;
|
|
|
61398
61486
|
var newRoot = falseType_1.root;
|
|
61399
61487
|
if (newRoot.node.parent === root.node && (!newRoot.isDistributive || newRoot.checkType === root.checkType)) {
|
|
61400
61488
|
root = newRoot;
|
|
61401
|
-
continue;
|
|
61489
|
+
return "continue";
|
|
61402
61490
|
}
|
|
61403
61491
|
if (canTailRecurse(falseType_1, mapper)) {
|
|
61404
|
-
continue;
|
|
61492
|
+
return "continue";
|
|
61405
61493
|
}
|
|
61406
61494
|
}
|
|
61407
61495
|
result = instantiateType(falseType_1, mapper);
|
|
61408
|
-
break;
|
|
61496
|
+
return "break";
|
|
61409
61497
|
}
|
|
61410
61498
|
// Return trueType for a definitely true extends check. We check instantiations of the two
|
|
61411
61499
|
// types with type parameters mapped to their restrictive form, i.e. a form of the type parameter
|
|
@@ -61416,10 +61504,10 @@ var ts;
|
|
|
61416
61504
|
var trueType_1 = getTypeFromTypeNode(root.node.trueType);
|
|
61417
61505
|
var trueMapper = combinedMapper || mapper;
|
|
61418
61506
|
if (canTailRecurse(trueType_1, trueMapper)) {
|
|
61419
|
-
continue;
|
|
61507
|
+
return "continue";
|
|
61420
61508
|
}
|
|
61421
61509
|
result = instantiateType(trueType_1, trueMapper);
|
|
61422
|
-
break;
|
|
61510
|
+
return "break";
|
|
61423
61511
|
}
|
|
61424
61512
|
}
|
|
61425
61513
|
// Return a deferred type for a check that is neither definitely true nor definitely false
|
|
@@ -61431,7 +61519,19 @@ var ts;
|
|
|
61431
61519
|
result.combinedMapper = combinedMapper;
|
|
61432
61520
|
result.aliasSymbol = aliasSymbol || root.aliasSymbol;
|
|
61433
61521
|
result.aliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(root.aliasTypeArguments, mapper); // TODO: GH#18217
|
|
61434
|
-
break;
|
|
61522
|
+
return "break";
|
|
61523
|
+
};
|
|
61524
|
+
// We loop here for an immediately nested conditional type in the false position, effectively treating
|
|
61525
|
+
// types of the form 'A extends B ? X : C extends D ? Y : E extends F ? Z : ...' as a single construct for
|
|
61526
|
+
// purposes of resolution. We also loop here when resolution of a conditional type ends in resolution of
|
|
61527
|
+
// another (or, through recursion, possibly the same) conditional type. In the potentially tail-recursive
|
|
61528
|
+
// cases we increment the tail recursion counter and stop after 1000 iterations.
|
|
61529
|
+
while (true) {
|
|
61530
|
+
var state_5 = _loop_18();
|
|
61531
|
+
if (typeof state_5 === "object")
|
|
61532
|
+
return state_5.value;
|
|
61533
|
+
if (state_5 === "break")
|
|
61534
|
+
break;
|
|
61435
61535
|
}
|
|
61436
61536
|
return extraTypes ? getUnionType(ts.append(extraTypes, result)) : result;
|
|
61437
61537
|
// We tail-recurse for generic conditional types that (a) have not already been evaluated and cached, and
|
|
@@ -61853,9 +61953,11 @@ var ts;
|
|
|
61853
61953
|
}
|
|
61854
61954
|
function getESSymbolLikeTypeForNode(node) {
|
|
61855
61955
|
if (ts.isValidESSymbolDeclaration(node)) {
|
|
61856
|
-
var symbol = getSymbolOfNode(node);
|
|
61857
|
-
|
|
61858
|
-
|
|
61956
|
+
var symbol = ts.isCommonJsExportPropertyAssignment(node) ? getSymbolOfNode(node.left) : getSymbolOfNode(node);
|
|
61957
|
+
if (symbol) {
|
|
61958
|
+
var links = getSymbolLinks(symbol);
|
|
61959
|
+
return links.uniqueESSymbolType || (links.uniqueESSymbolType = createUniqueESSymbolType(symbol));
|
|
61960
|
+
}
|
|
61859
61961
|
}
|
|
61860
61962
|
return esSymbolType;
|
|
61861
61963
|
}
|
|
@@ -62499,6 +62601,10 @@ var ts;
|
|
|
62499
62601
|
}
|
|
62500
62602
|
return type; // Nested invocation of `inferTypeForHomomorphicMappedType` or the `source` instantiated into something unmappable
|
|
62501
62603
|
}
|
|
62604
|
+
function getUniqueLiteralFilledInstantiation(type) {
|
|
62605
|
+
return type.flags & (131068 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type :
|
|
62606
|
+
type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper));
|
|
62607
|
+
}
|
|
62502
62608
|
function getPermissiveInstantiation(type) {
|
|
62503
62609
|
return type.flags & (131068 /* Primitive */ | 3 /* AnyOrUnknown */ | 131072 /* Never */) ? type :
|
|
62504
62610
|
type.permissiveInstantiation || (type.permissiveInstantiation = instantiateType(type, permissiveMapper));
|
|
@@ -63958,7 +64064,7 @@ var ts;
|
|
|
63958
64064
|
reducedTarget = findMatchingDiscriminantType(source, target, isRelatedTo) || filterPrimitivesIfContainsNonPrimitive(target);
|
|
63959
64065
|
checkTypes = reducedTarget.flags & 1048576 /* Union */ ? reducedTarget.types : [reducedTarget];
|
|
63960
64066
|
}
|
|
63961
|
-
var
|
|
64067
|
+
var _loop_19 = function (prop) {
|
|
63962
64068
|
if (shouldCheckAsExcessProperty(prop, source.symbol) && !isIgnoredJsxProperty(source, prop)) {
|
|
63963
64069
|
if (!isKnownProperty(reducedTarget, prop.escapedName, isComparingJsxAttributes)) {
|
|
63964
64070
|
if (reportErrors) {
|
|
@@ -64021,9 +64127,9 @@ var ts;
|
|
|
64021
64127
|
};
|
|
64022
64128
|
for (var _i = 0, _b = getPropertiesOfType(source); _i < _b.length; _i++) {
|
|
64023
64129
|
var prop = _b[_i];
|
|
64024
|
-
var
|
|
64025
|
-
if (typeof
|
|
64026
|
-
return
|
|
64130
|
+
var state_6 = _loop_19(prop);
|
|
64131
|
+
if (typeof state_6 === "object")
|
|
64132
|
+
return state_6.value;
|
|
64027
64133
|
}
|
|
64028
64134
|
return false;
|
|
64029
64135
|
}
|
|
@@ -65013,11 +65119,11 @@ var ts;
|
|
|
65013
65119
|
// constituents of 'target'. If any combination does not have a match then 'source' is not relatable.
|
|
65014
65120
|
var discriminantCombinations = ts.cartesianProduct(sourceDiscriminantTypes);
|
|
65015
65121
|
var matchingTypes = [];
|
|
65016
|
-
var
|
|
65122
|
+
var _loop_20 = function (combination) {
|
|
65017
65123
|
var hasMatch = false;
|
|
65018
65124
|
outer: for (var _c = 0, _d = target.types; _c < _d.length; _c++) {
|
|
65019
65125
|
var type = _d[_c];
|
|
65020
|
-
var
|
|
65126
|
+
var _loop_21 = function (i) {
|
|
65021
65127
|
var sourceProperty = sourcePropertiesFiltered[i];
|
|
65022
65128
|
var targetProperty = getPropertyOfType(type, sourceProperty.escapedName);
|
|
65023
65129
|
if (!targetProperty)
|
|
@@ -65033,8 +65139,8 @@ var ts;
|
|
|
65033
65139
|
}
|
|
65034
65140
|
};
|
|
65035
65141
|
for (var i = 0; i < sourcePropertiesFiltered.length; i++) {
|
|
65036
|
-
var
|
|
65037
|
-
switch (
|
|
65142
|
+
var state_8 = _loop_21(i);
|
|
65143
|
+
switch (state_8) {
|
|
65038
65144
|
case "continue-outer": continue outer;
|
|
65039
65145
|
}
|
|
65040
65146
|
}
|
|
@@ -65047,9 +65153,9 @@ var ts;
|
|
|
65047
65153
|
};
|
|
65048
65154
|
for (var _a = 0, discriminantCombinations_1 = discriminantCombinations; _a < discriminantCombinations_1.length; _a++) {
|
|
65049
65155
|
var combination = discriminantCombinations_1[_a];
|
|
65050
|
-
var
|
|
65051
|
-
if (typeof
|
|
65052
|
-
return
|
|
65156
|
+
var state_7 = _loop_20(combination);
|
|
65157
|
+
if (typeof state_7 === "object")
|
|
65158
|
+
return state_7.value;
|
|
65053
65159
|
}
|
|
65054
65160
|
// Compare the remaining non-discriminant properties of each match.
|
|
65055
65161
|
var result = -1 /* True */;
|
|
@@ -65762,7 +65868,7 @@ var ts;
|
|
|
65762
65868
|
// The emptyArray singleton is used to signal a recursive invocation.
|
|
65763
65869
|
cache.variances = ts.emptyArray;
|
|
65764
65870
|
variances = [];
|
|
65765
|
-
var
|
|
65871
|
+
var _loop_22 = function (tp) {
|
|
65766
65872
|
var unmeasurable = false;
|
|
65767
65873
|
var unreliable = false;
|
|
65768
65874
|
var oldHandler = outofbandVarianceMarkerHandler;
|
|
@@ -65794,7 +65900,7 @@ var ts;
|
|
|
65794
65900
|
};
|
|
65795
65901
|
for (var _i = 0, typeParameters_1 = typeParameters; _i < typeParameters_1.length; _i++) {
|
|
65796
65902
|
var tp = typeParameters_1[_i];
|
|
65797
|
-
|
|
65903
|
+
_loop_22(tp);
|
|
65798
65904
|
}
|
|
65799
65905
|
cache.variances = variances;
|
|
65800
65906
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
@@ -68165,7 +68271,7 @@ var ts;
|
|
|
68165
68271
|
function mapTypesByKeyProperty(types, name) {
|
|
68166
68272
|
var map = new ts.Map();
|
|
68167
68273
|
var count = 0;
|
|
68168
|
-
var
|
|
68274
|
+
var _loop_23 = function (type) {
|
|
68169
68275
|
if (type.flags & (524288 /* Object */ | 2097152 /* Intersection */ | 58982400 /* InstantiableNonPrimitive */)) {
|
|
68170
68276
|
var discriminant = getTypeOfPropertyOfType(type, name);
|
|
68171
68277
|
if (discriminant) {
|
|
@@ -68191,9 +68297,9 @@ var ts;
|
|
|
68191
68297
|
};
|
|
68192
68298
|
for (var _i = 0, types_16 = types; _i < types_16.length; _i++) {
|
|
68193
68299
|
var type = types_16[_i];
|
|
68194
|
-
var
|
|
68195
|
-
if (typeof
|
|
68196
|
-
return
|
|
68300
|
+
var state_9 = _loop_23(type);
|
|
68301
|
+
if (typeof state_9 === "object")
|
|
68302
|
+
return state_9.value;
|
|
68197
68303
|
}
|
|
68198
68304
|
return count >= 10 && count * 2 >= types.length ? map : undefined;
|
|
68199
68305
|
}
|
|
@@ -70004,14 +70110,6 @@ var ts;
|
|
|
70004
70110
|
// the candidate type. If one or more constituents remain, return a union of those.
|
|
70005
70111
|
if (type.flags & 1048576 /* Union */) {
|
|
70006
70112
|
var assignableType = filterType(type, function (t) { return isRelated(t, candidate); });
|
|
70007
|
-
if (candidate.flags & 1048576 /* Union */) {
|
|
70008
|
-
var unionAssignableType = mapType(type, function (type) {
|
|
70009
|
-
return filterType(candidate, function (candidate) { return isRelated(candidate, type); });
|
|
70010
|
-
});
|
|
70011
|
-
if (!isTypeSubtypeOf(unionAssignableType, assignableType)) {
|
|
70012
|
-
assignableType = unionAssignableType;
|
|
70013
|
-
}
|
|
70014
|
-
}
|
|
70015
70113
|
if (!(assignableType.flags & 131072 /* Never */)) {
|
|
70016
70114
|
return assignableType;
|
|
70017
70115
|
}
|
|
@@ -74532,7 +74630,7 @@ var ts;
|
|
|
74532
74630
|
if (spreadIndex >= 0) {
|
|
74533
74631
|
// Create synthetic arguments from spreads of tuple types.
|
|
74534
74632
|
var effectiveArgs_1 = args.slice(0, spreadIndex);
|
|
74535
|
-
var
|
|
74633
|
+
var _loop_24 = function (i) {
|
|
74536
74634
|
var arg = args[i];
|
|
74537
74635
|
// We can call checkExpressionCached because spread expressions never have a contextual type.
|
|
74538
74636
|
var spreadType = arg.kind === 224 /* SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
|
|
@@ -74549,7 +74647,7 @@ var ts;
|
|
|
74549
74647
|
}
|
|
74550
74648
|
};
|
|
74551
74649
|
for (var i = spreadIndex; i < args.length; i++) {
|
|
74552
|
-
|
|
74650
|
+
_loop_24(i);
|
|
74553
74651
|
}
|
|
74554
74652
|
return effectiveArgs_1;
|
|
74555
74653
|
}
|
|
@@ -74862,7 +74960,7 @@ var ts;
|
|
|
74862
74960
|
var min_3 = Number.MAX_VALUE;
|
|
74863
74961
|
var minIndex = 0;
|
|
74864
74962
|
var i_1 = 0;
|
|
74865
|
-
var
|
|
74963
|
+
var _loop_25 = function (c) {
|
|
74866
74964
|
var chain_2 = function () { return ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Overload_0_of_1_2_gave_the_following_error, i_1 + 1, candidates.length, signatureToString(c)); };
|
|
74867
74965
|
var diags_2 = getSignatureApplicabilityError(node, args, c, assignableRelation, 0 /* Normal */, /*reportErrors*/ true, chain_2);
|
|
74868
74966
|
if (diags_2) {
|
|
@@ -74880,7 +74978,7 @@ var ts;
|
|
|
74880
74978
|
};
|
|
74881
74979
|
for (var _a = 0, candidatesForArgumentError_1 = candidatesForArgumentError; _a < candidatesForArgumentError_1.length; _a++) {
|
|
74882
74980
|
var c = candidatesForArgumentError_1[_a];
|
|
74883
|
-
|
|
74981
|
+
_loop_25(c);
|
|
74884
74982
|
}
|
|
74885
74983
|
var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics);
|
|
74886
74984
|
ts.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures");
|
|
@@ -75038,7 +75136,7 @@ var ts;
|
|
|
75038
75136
|
}
|
|
75039
75137
|
var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max;
|
|
75040
75138
|
var parameters = [];
|
|
75041
|
-
var
|
|
75139
|
+
var _loop_26 = function (i) {
|
|
75042
75140
|
var symbols = ts.mapDefined(candidates, function (s) { return signatureHasRestParameter(s) ?
|
|
75043
75141
|
i < s.parameters.length - 1 ? s.parameters[i] : ts.last(s.parameters) :
|
|
75044
75142
|
i < s.parameters.length ? s.parameters[i] : undefined; });
|
|
@@ -75046,7 +75144,7 @@ var ts;
|
|
|
75046
75144
|
parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); })));
|
|
75047
75145
|
};
|
|
75048
75146
|
for (var i = 0; i < maxNonRestParam; i++) {
|
|
75049
|
-
|
|
75147
|
+
_loop_26(i);
|
|
75050
75148
|
}
|
|
75051
75149
|
var restParameterSymbols = ts.mapDefined(candidates, function (c) { return signatureHasRestParameter(c) ? ts.last(c.parameters) : undefined; });
|
|
75052
75150
|
var flags = 0 /* None */;
|
|
@@ -75283,7 +75381,7 @@ var ts;
|
|
|
75283
75381
|
// then it cannot be instantiated.
|
|
75284
75382
|
// In the case of a merged class-module or class-interface declaration,
|
|
75285
75383
|
// only the class declaration node will have the Abstract flag set.
|
|
75286
|
-
if (constructSignatures
|
|
75384
|
+
if (someSignature(constructSignatures, function (signature) { return !!(signature.flags & 4 /* Abstract */); })) {
|
|
75287
75385
|
error(node, ts.Diagnostics.Cannot_create_an_instance_of_an_abstract_class);
|
|
75288
75386
|
return resolveErrorCall(node);
|
|
75289
75387
|
}
|
|
@@ -75314,6 +75412,12 @@ var ts;
|
|
|
75314
75412
|
invocationError(node.expression, expressionType, 1 /* Construct */);
|
|
75315
75413
|
return resolveErrorCall(node);
|
|
75316
75414
|
}
|
|
75415
|
+
function someSignature(signatures, f) {
|
|
75416
|
+
if (ts.isArray(signatures)) {
|
|
75417
|
+
return ts.some(signatures, function (signature) { return someSignature(signature, f); });
|
|
75418
|
+
}
|
|
75419
|
+
return signatures.compositeKind === 1048576 /* Union */ ? ts.some(signatures.compositeSignatures, f) : f(signatures);
|
|
75420
|
+
}
|
|
75317
75421
|
function typeHasProtectedAccessibleBase(target, type) {
|
|
75318
75422
|
var baseTypes = getBaseTypes(type);
|
|
75319
75423
|
if (!ts.length(baseTypes)) {
|
|
@@ -78267,7 +78371,7 @@ var ts;
|
|
|
78267
78371
|
}
|
|
78268
78372
|
function checkExpressionForMutableLocation(node, checkMode, contextualType, forceTuple) {
|
|
78269
78373
|
var type = checkExpression(node, checkMode, forceTuple);
|
|
78270
|
-
return isConstContext(node) ? getRegularTypeOfLiteralType(type) :
|
|
78374
|
+
return isConstContext(node) || ts.isCommonJsExportedExpression(node) ? getRegularTypeOfLiteralType(type) :
|
|
78271
78375
|
isTypeAssertion(node) ? type :
|
|
78272
78376
|
getWidenedLiteralLikeTypeForContextualType(type, instantiateContextualType(arguments.length === 2 ? getContextualType(node) : contextualType, node));
|
|
78273
78377
|
}
|
|
@@ -79036,7 +79140,7 @@ var ts;
|
|
|
79036
79140
|
var indexSymbol = getIndexSymbol(getSymbolOfNode(node));
|
|
79037
79141
|
if (indexSymbol === null || indexSymbol === void 0 ? void 0 : indexSymbol.declarations) {
|
|
79038
79142
|
var indexSignatureMap_1 = new ts.Map();
|
|
79039
|
-
var
|
|
79143
|
+
var _loop_27 = function (declaration) {
|
|
79040
79144
|
if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
|
|
79041
79145
|
forEachType(getTypeFromTypeNode(declaration.parameters[0].type), function (type) {
|
|
79042
79146
|
var entry = indexSignatureMap_1.get(getTypeId(type));
|
|
@@ -79051,7 +79155,7 @@ var ts;
|
|
|
79051
79155
|
};
|
|
79052
79156
|
for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
|
|
79053
79157
|
var declaration = _a[_i];
|
|
79054
|
-
|
|
79158
|
+
_loop_27(declaration);
|
|
79055
79159
|
}
|
|
79056
79160
|
indexSignatureMap_1.forEach(function (entry) {
|
|
79057
79161
|
if (entry.declarations.length > 1) {
|
|
@@ -82430,7 +82534,7 @@ var ts;
|
|
|
82430
82534
|
var interfaceDeclaration = ts.getObjectFlags(type) & 2 /* Interface */ ? ts.getDeclarationOfKind(type.symbol, 257 /* InterfaceDeclaration */) : undefined;
|
|
82431
82535
|
var localPropDeclaration = declaration && declaration.kind === 220 /* BinaryExpression */ ||
|
|
82432
82536
|
name && name.kind === 161 /* ComputedPropertyName */ || getParentOfSymbol(prop) === type.symbol ? declaration : undefined;
|
|
82433
|
-
var
|
|
82537
|
+
var _loop_28 = function (info) {
|
|
82434
82538
|
var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
|
|
82435
82539
|
// We check only when (a) the property is declared in the containing type, or (b) the applicable index signature is declared
|
|
82436
82540
|
// in the containing type, or (c) the containing type is an interface and no base interface contains both the property and
|
|
@@ -82443,7 +82547,7 @@ var ts;
|
|
|
82443
82547
|
};
|
|
82444
82548
|
for (var _i = 0, indexInfos_9 = indexInfos; _i < indexInfos_9.length; _i++) {
|
|
82445
82549
|
var info = indexInfos_9[_i];
|
|
82446
|
-
|
|
82550
|
+
_loop_28(info);
|
|
82447
82551
|
}
|
|
82448
82552
|
}
|
|
82449
82553
|
function checkIndexConstraintForIndexSignature(type, checkInfo) {
|
|
@@ -82451,7 +82555,7 @@ var ts;
|
|
|
82451
82555
|
var indexInfos = getApplicableIndexInfos(type, checkInfo.keyType);
|
|
82452
82556
|
var interfaceDeclaration = ts.getObjectFlags(type) & 2 /* Interface */ ? ts.getDeclarationOfKind(type.symbol, 257 /* InterfaceDeclaration */) : undefined;
|
|
82453
82557
|
var localCheckDeclaration = declaration && getParentOfSymbol(getSymbolOfNode(declaration)) === type.symbol ? declaration : undefined;
|
|
82454
|
-
var
|
|
82558
|
+
var _loop_29 = function (info) {
|
|
82455
82559
|
if (info === checkInfo)
|
|
82456
82560
|
return "continue";
|
|
82457
82561
|
var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
|
|
@@ -82466,7 +82570,7 @@ var ts;
|
|
|
82466
82570
|
};
|
|
82467
82571
|
for (var _i = 0, indexInfos_10 = indexInfos; _i < indexInfos_10.length; _i++) {
|
|
82468
82572
|
var info = indexInfos_10[_i];
|
|
82469
|
-
|
|
82573
|
+
_loop_29(info);
|
|
82470
82574
|
}
|
|
82471
82575
|
}
|
|
82472
82576
|
function checkTypeNameIsReserved(name, message) {
|
|
@@ -82777,7 +82881,7 @@ var ts;
|
|
|
82777
82881
|
var baseTypes = baseTypeNode && getBaseTypes(type);
|
|
82778
82882
|
var baseWithThis = (baseTypes === null || baseTypes === void 0 ? void 0 : baseTypes.length) ? getTypeWithThisArgument(ts.first(baseTypes), type.thisType) : undefined;
|
|
82779
82883
|
var baseStaticType = getBaseConstructorTypeOfClass(type);
|
|
82780
|
-
var
|
|
82884
|
+
var _loop_30 = function (member) {
|
|
82781
82885
|
if (ts.hasAmbientModifier(member)) {
|
|
82782
82886
|
return "continue";
|
|
82783
82887
|
}
|
|
@@ -82794,7 +82898,7 @@ var ts;
|
|
|
82794
82898
|
};
|
|
82795
82899
|
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
|
|
82796
82900
|
var member = _a[_i];
|
|
82797
|
-
|
|
82901
|
+
_loop_30(member);
|
|
82798
82902
|
}
|
|
82799
82903
|
}
|
|
82800
82904
|
/**
|
|
@@ -82882,7 +82986,7 @@ var ts;
|
|
|
82882
82986
|
function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) {
|
|
82883
82987
|
// iterate over all implemented properties and issue errors on each one which isn't compatible, rather than the class as a whole, if possible
|
|
82884
82988
|
var issuedMemberError = false;
|
|
82885
|
-
var
|
|
82989
|
+
var _loop_31 = function (member) {
|
|
82886
82990
|
if (ts.isStatic(member)) {
|
|
82887
82991
|
return "continue";
|
|
82888
82992
|
}
|
|
@@ -82901,7 +83005,7 @@ var ts;
|
|
|
82901
83005
|
};
|
|
82902
83006
|
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
|
|
82903
83007
|
var member = _a[_i];
|
|
82904
|
-
|
|
83008
|
+
_loop_31(member);
|
|
82905
83009
|
}
|
|
82906
83010
|
if (!issuedMemberError) {
|
|
82907
83011
|
// check again with diagnostics to generate a less-specific error
|
|
@@ -109866,7 +109970,7 @@ var ts;
|
|
|
109866
109970
|
return emitRestOrJSDocVariadicType(node);
|
|
109867
109971
|
case 318 /* JSDocNamepathType */:
|
|
109868
109972
|
return;
|
|
109869
|
-
case 319 /*
|
|
109973
|
+
case 319 /* JSDoc */:
|
|
109870
109974
|
return emitJSDoc(node);
|
|
109871
109975
|
case 321 /* JSDocTypeLiteral */:
|
|
109872
109976
|
return emitJSDocTypeLiteral(node);
|
|
@@ -120688,7 +120792,7 @@ var ts;
|
|
|
120688
120792
|
});
|
|
120689
120793
|
// Sort by paths closest to importing file Name directory
|
|
120690
120794
|
var sortedPaths = [];
|
|
120691
|
-
var
|
|
120795
|
+
var _loop_32 = function (directory) {
|
|
120692
120796
|
var directoryStart = ts.ensureTrailingDirectorySeparator(directory);
|
|
120693
120797
|
var pathsInDirectory;
|
|
120694
120798
|
allFileNames.forEach(function (_a, fileName) {
|
|
@@ -120712,9 +120816,9 @@ var ts;
|
|
|
120712
120816
|
};
|
|
120713
120817
|
var out_directory_1;
|
|
120714
120818
|
for (var directory = ts.getDirectoryPath(importingFileName); allFileNames.size !== 0;) {
|
|
120715
|
-
var
|
|
120819
|
+
var state_10 = _loop_32(directory);
|
|
120716
120820
|
directory = out_directory_1;
|
|
120717
|
-
if (
|
|
120821
|
+
if (state_10 === "break")
|
|
120718
120822
|
break;
|
|
120719
120823
|
}
|
|
120720
120824
|
if (allFileNames.size) {
|
|
@@ -126612,6 +126716,14 @@ var ts;
|
|
|
126612
126716
|
});
|
|
126613
126717
|
}
|
|
126614
126718
|
ts.signatureToDisplayParts = signatureToDisplayParts;
|
|
126719
|
+
function nodeToDisplayParts(node, enclosingDeclaration) {
|
|
126720
|
+
var file = enclosingDeclaration.getSourceFile();
|
|
126721
|
+
return mapToDisplayParts(function (writer) {
|
|
126722
|
+
var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true });
|
|
126723
|
+
printer.writeNode(4 /* Unspecified */, node, file, writer);
|
|
126724
|
+
});
|
|
126725
|
+
}
|
|
126726
|
+
ts.nodeToDisplayParts = nodeToDisplayParts;
|
|
126615
126727
|
function isImportOrExportSpecifierName(location) {
|
|
126616
126728
|
return !!location.parent && ts.isImportOrExportSpecifier(location.parent) && location.parent.propertyName === location;
|
|
126617
126729
|
}
|
|
@@ -129952,6 +130064,8 @@ var ts;
|
|
|
129952
130064
|
CompletionSource["ClassMemberSnippet"] = "ClassMemberSnippet/";
|
|
129953
130065
|
/** A type-only import that needs to be promoted in order to be used at the completion location */
|
|
129954
130066
|
CompletionSource["TypeOnlyAlias"] = "TypeOnlyAlias/";
|
|
130067
|
+
/** Auto-import that comes attached to an object literal method snippet */
|
|
130068
|
+
CompletionSource["ObjectLiteralMethodSnippet"] = "ObjectLiteralMethodSnippet/";
|
|
129955
130069
|
})(CompletionSource = Completions.CompletionSource || (Completions.CompletionSource = {}));
|
|
129956
130070
|
var SymbolOriginInfoKind;
|
|
129957
130071
|
(function (SymbolOriginInfoKind) {
|
|
@@ -129962,6 +130076,7 @@ var ts;
|
|
|
129962
130076
|
SymbolOriginInfoKind[SymbolOriginInfoKind["Nullable"] = 16] = "Nullable";
|
|
129963
130077
|
SymbolOriginInfoKind[SymbolOriginInfoKind["ResolvedExport"] = 32] = "ResolvedExport";
|
|
129964
130078
|
SymbolOriginInfoKind[SymbolOriginInfoKind["TypeOnlyAlias"] = 64] = "TypeOnlyAlias";
|
|
130079
|
+
SymbolOriginInfoKind[SymbolOriginInfoKind["ObjectLiteralMethod"] = 128] = "ObjectLiteralMethod";
|
|
129965
130080
|
SymbolOriginInfoKind[SymbolOriginInfoKind["SymbolMemberNoExport"] = 2] = "SymbolMemberNoExport";
|
|
129966
130081
|
SymbolOriginInfoKind[SymbolOriginInfoKind["SymbolMemberExport"] = 6] = "SymbolMemberExport";
|
|
129967
130082
|
})(SymbolOriginInfoKind || (SymbolOriginInfoKind = {}));
|
|
@@ -129992,6 +130107,9 @@ var ts;
|
|
|
129992
130107
|
function originIsTypeOnlyAlias(origin) {
|
|
129993
130108
|
return !!(origin && origin.kind & 64 /* TypeOnlyAlias */);
|
|
129994
130109
|
}
|
|
130110
|
+
function originIsObjectLiteralMethod(origin) {
|
|
130111
|
+
return !!(origin && origin.kind & 128 /* ObjectLiteralMethod */);
|
|
130112
|
+
}
|
|
129995
130113
|
var KeywordCompletionFilters;
|
|
129996
130114
|
(function (KeywordCompletionFilters) {
|
|
129997
130115
|
KeywordCompletionFilters[KeywordCompletionFilters["None"] = 0] = "None";
|
|
@@ -130417,6 +130535,20 @@ var ts;
|
|
|
130417
130535
|
source = CompletionSource.ClassMemberSnippet;
|
|
130418
130536
|
}
|
|
130419
130537
|
}
|
|
130538
|
+
if (origin && originIsObjectLiteralMethod(origin)) {
|
|
130539
|
+
var objectLiteral = ts.cast(tryGetObjectLikeCompletionContainer(contextToken), ts.isObjectLiteralExpression);
|
|
130540
|
+
var importAdder = void 0;
|
|
130541
|
+
var entry = getEntryForObjectLiteralMethodCompletion(symbol, name, objectLiteral, program, host, options, preferences, formatContext);
|
|
130542
|
+
if (!entry) {
|
|
130543
|
+
return undefined;
|
|
130544
|
+
}
|
|
130545
|
+
(insertText = entry.insertText, isSnippet = entry.isSnippet, importAdder = entry.importAdder, sourceDisplay = entry.sourceDisplay);
|
|
130546
|
+
source = CompletionSource.ObjectLiteralMethodSnippet;
|
|
130547
|
+
sortText = SortText.OptionalMember;
|
|
130548
|
+
if (importAdder.hasFixes()) {
|
|
130549
|
+
hasAction = true;
|
|
130550
|
+
}
|
|
130551
|
+
}
|
|
130420
130552
|
if (isJsxIdentifierExpected && !isRightOfOpenTag && preferences.includeCompletionsWithSnippetText && preferences.jsxAttributeCompletionStyle && preferences.jsxAttributeCompletionStyle !== "none") {
|
|
130421
130553
|
var useBraces_1 = preferences.jsxAttributeCompletionStyle === "braces";
|
|
130422
130554
|
var type = typeChecker.getTypeOfSymbolAtLocation(symbol, location);
|
|
@@ -130575,27 +130707,15 @@ var ts;
|
|
|
130575
130707
|
completionNodes.push(node);
|
|
130576
130708
|
}, body, 2 /* Property */, isAbstract);
|
|
130577
130709
|
if (completionNodes.length) {
|
|
130710
|
+
var format = 1 /* MultiLine */ | 131072 /* NoTrailingNewLine */;
|
|
130578
130711
|
replacementSpan = modifiersSpan;
|
|
130579
130712
|
// If we have access to formatting settings, we print the nodes using the emitter,
|
|
130580
130713
|
// and then format the printed text.
|
|
130581
130714
|
if (formatContext) {
|
|
130582
|
-
|
|
130583
|
-
text: printer.printSnippetList(1 /* MultiLine */ | 131072 /* NoTrailingNewLine */, ts.factory.createNodeArray(completionNodes), sourceFile),
|
|
130584
|
-
getLineAndCharacterOfPosition: function (pos) {
|
|
130585
|
-
return ts.getLineAndCharacterOfPosition(this, pos);
|
|
130586
|
-
},
|
|
130587
|
-
};
|
|
130588
|
-
var formatOptions_1 = ts.getFormatCodeSettingsForWriting(formatContext, sourceFile);
|
|
130589
|
-
var changes = ts.flatMap(completionNodes, function (node) {
|
|
130590
|
-
var nodeWithPos = ts.textChanges.assignPositionsToNode(node);
|
|
130591
|
-
return ts.formatting.formatNodeGivenIndentation(nodeWithPos, syntheticFile_1, sourceFile.languageVariant,
|
|
130592
|
-
/* indentation */ 0,
|
|
130593
|
-
/* delta */ 0, __assign(__assign({}, formatContext), { options: formatOptions_1 }));
|
|
130594
|
-
});
|
|
130595
|
-
insertText = ts.textChanges.applyChanges(syntheticFile_1.text, changes);
|
|
130715
|
+
insertText = printer.printAndFormatSnippetList(format, ts.factory.createNodeArray(completionNodes), sourceFile, formatContext);
|
|
130596
130716
|
}
|
|
130597
130717
|
else { // Otherwise, just use emitter to print the new nodes.
|
|
130598
|
-
insertText = printer.printSnippetList(
|
|
130718
|
+
insertText = printer.printSnippetList(format, ts.factory.createNodeArray(completionNodes), sourceFile);
|
|
130599
130719
|
}
|
|
130600
130720
|
}
|
|
130601
130721
|
return { insertText: insertText, isSnippet: isSnippet, importAdder: importAdder, replacementSpan: replacementSpan };
|
|
@@ -130645,12 +130765,92 @@ var ts;
|
|
|
130645
130765
|
}
|
|
130646
130766
|
return undefined;
|
|
130647
130767
|
}
|
|
130768
|
+
function getEntryForObjectLiteralMethodCompletion(symbol, name, enclosingDeclaration, program, host, options, preferences, formatContext) {
|
|
130769
|
+
var isSnippet;
|
|
130770
|
+
var insertText = name;
|
|
130771
|
+
var sourceFile = enclosingDeclaration.getSourceFile();
|
|
130772
|
+
var importAdder = ts.codefix.createImportAdder(sourceFile, program, preferences, host);
|
|
130773
|
+
var body;
|
|
130774
|
+
if (preferences.includeCompletionsWithSnippetText) {
|
|
130775
|
+
isSnippet = true;
|
|
130776
|
+
var emptyStmt = ts.factory.createEmptyStatement();
|
|
130777
|
+
body = ts.factory.createBlock([emptyStmt], /* multiline */ true);
|
|
130778
|
+
ts.setSnippetElement(emptyStmt, { kind: 0 /* TabStop */, order: 0 });
|
|
130779
|
+
}
|
|
130780
|
+
else {
|
|
130781
|
+
body = ts.factory.createBlock([], /* multiline */ true);
|
|
130782
|
+
}
|
|
130783
|
+
var method = createObjectLiteralMethod(symbol, enclosingDeclaration, sourceFile, program, host, preferences, importAdder, /*body*/ body);
|
|
130784
|
+
if (!method) {
|
|
130785
|
+
return undefined;
|
|
130786
|
+
}
|
|
130787
|
+
var printer = createSnippetPrinter({
|
|
130788
|
+
removeComments: true,
|
|
130789
|
+
module: options.module,
|
|
130790
|
+
target: options.target,
|
|
130791
|
+
omitTrailingSemicolon: false,
|
|
130792
|
+
newLine: ts.getNewLineKind(ts.getNewLineCharacter(options, ts.maybeBind(host, host.getNewLine))),
|
|
130793
|
+
});
|
|
130794
|
+
if (formatContext) {
|
|
130795
|
+
insertText = printer.printAndFormatSnippetList(16 /* CommaDelimited */ | 64 /* AllowTrailingComma */, ts.factory.createNodeArray([method], /*hasTrailingComma*/ true), sourceFile, formatContext);
|
|
130796
|
+
}
|
|
130797
|
+
else {
|
|
130798
|
+
insertText = printer.printSnippetList(16 /* CommaDelimited */ | 64 /* AllowTrailingComma */, ts.factory.createNodeArray([method], /*hasTrailingComma*/ true), sourceFile);
|
|
130799
|
+
}
|
|
130800
|
+
var methodSignature = ts.factory.createMethodSignature(method.modifiers, method.name, method.questionToken, method.typeParameters, method.parameters, method.type);
|
|
130801
|
+
var sourceDisplay = ts.nodeToDisplayParts(methodSignature, enclosingDeclaration);
|
|
130802
|
+
return { isSnippet: isSnippet, insertText: insertText, importAdder: importAdder, sourceDisplay: sourceDisplay };
|
|
130803
|
+
}
|
|
130804
|
+
;
|
|
130805
|
+
function createObjectLiteralMethod(symbol, enclosingDeclaration, sourceFile, program, host, preferences, importAdder, body) {
|
|
130806
|
+
var declarations = symbol.getDeclarations();
|
|
130807
|
+
if (!(declarations && declarations.length)) {
|
|
130808
|
+
return undefined;
|
|
130809
|
+
}
|
|
130810
|
+
var checker = program.getTypeChecker();
|
|
130811
|
+
var scriptTarget = ts.getEmitScriptTarget(program.getCompilerOptions());
|
|
130812
|
+
var declaration = declarations[0];
|
|
130813
|
+
var name = ts.getSynthesizedDeepClone(ts.getNameOfDeclaration(declaration), /*includeTrivia*/ false);
|
|
130814
|
+
var type = checker.getWidenedType(checker.getTypeOfSymbolAtLocation(symbol, enclosingDeclaration));
|
|
130815
|
+
var quotePreference = ts.getQuotePreference(sourceFile, preferences);
|
|
130816
|
+
var builderFlags = quotePreference === 0 /* Single */ ? 268435456 /* UseSingleQuotesForStringLiteralType */ : undefined;
|
|
130817
|
+
switch (declaration.kind) {
|
|
130818
|
+
case 165 /* PropertySignature */:
|
|
130819
|
+
case 166 /* PropertyDeclaration */:
|
|
130820
|
+
case 167 /* MethodSignature */:
|
|
130821
|
+
case 168 /* MethodDeclaration */: {
|
|
130822
|
+
var signatures = checker.getSignaturesOfType(type, 0 /* Call */);
|
|
130823
|
+
if (signatures.length > 1) {
|
|
130824
|
+
// We don't support overloads in object literals.
|
|
130825
|
+
return undefined;
|
|
130826
|
+
}
|
|
130827
|
+
var typeNode = checker.typeToTypeNode(type, enclosingDeclaration, builderFlags, ts.codefix.getNoopSymbolTrackerWithResolver({ program: program, host: host }));
|
|
130828
|
+
var importableReference = ts.codefix.tryGetAutoImportableReferenceFromTypeNode(typeNode, scriptTarget);
|
|
130829
|
+
if (importableReference) {
|
|
130830
|
+
typeNode = importableReference.typeNode;
|
|
130831
|
+
ts.codefix.importSymbols(importAdder, importableReference.symbols);
|
|
130832
|
+
}
|
|
130833
|
+
if (!typeNode) {
|
|
130834
|
+
return undefined;
|
|
130835
|
+
}
|
|
130836
|
+
ts.Debug.assertNode(typeNode, ts.isFunctionTypeNode);
|
|
130837
|
+
return ts.factory.createMethodDeclaration(
|
|
130838
|
+
/*decorators*/ undefined,
|
|
130839
|
+
/*modifiers*/ undefined,
|
|
130840
|
+
/*asteriskToken*/ undefined, name,
|
|
130841
|
+
/*questionToken*/ undefined, typeNode.typeParameters, typeNode.parameters, typeNode.type, body);
|
|
130842
|
+
}
|
|
130843
|
+
default:
|
|
130844
|
+
return undefined;
|
|
130845
|
+
}
|
|
130846
|
+
}
|
|
130648
130847
|
function createSnippetPrinter(printerOptions) {
|
|
130649
130848
|
var baseWriter = ts.textChanges.createWriter(ts.getNewLineCharacter(printerOptions));
|
|
130650
130849
|
var printer = ts.createPrinter(printerOptions, baseWriter);
|
|
130651
130850
|
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)); } });
|
|
130652
130851
|
return {
|
|
130653
130852
|
printSnippetList: printSnippetList,
|
|
130853
|
+
printAndFormatSnippetList: printAndFormatSnippetList,
|
|
130654
130854
|
};
|
|
130655
130855
|
/* Snippet-escaping version of `printer.printList`. */
|
|
130656
130856
|
function printSnippetList(format, list, sourceFile) {
|
|
@@ -130658,6 +130858,22 @@ var ts;
|
|
|
130658
130858
|
printer.writeList(format, list, sourceFile, writer);
|
|
130659
130859
|
return writer.getText();
|
|
130660
130860
|
}
|
|
130861
|
+
function printAndFormatSnippetList(format, list, sourceFile, formatContext) {
|
|
130862
|
+
var syntheticFile = {
|
|
130863
|
+
text: printSnippetList(format, list, sourceFile),
|
|
130864
|
+
getLineAndCharacterOfPosition: function (pos) {
|
|
130865
|
+
return ts.getLineAndCharacterOfPosition(this, pos);
|
|
130866
|
+
},
|
|
130867
|
+
};
|
|
130868
|
+
var formatOptions = ts.getFormatCodeSettingsForWriting(formatContext, sourceFile);
|
|
130869
|
+
var changes = ts.flatMap(list, function (node) {
|
|
130870
|
+
var nodeWithPos = ts.textChanges.assignPositionsToNode(node);
|
|
130871
|
+
return ts.formatting.formatNodeGivenIndentation(nodeWithPos, syntheticFile, sourceFile.languageVariant,
|
|
130872
|
+
/* indentation */ 0,
|
|
130873
|
+
/* delta */ 0, __assign(__assign({}, formatContext), { options: formatOptions }));
|
|
130874
|
+
});
|
|
130875
|
+
return ts.textChanges.applyChanges(syntheticFile.text, changes);
|
|
130876
|
+
}
|
|
130661
130877
|
}
|
|
130662
130878
|
function originToCompletionEntryData(origin) {
|
|
130663
130879
|
var ambientModuleName = origin.fileName ? undefined : ts.stripQuotes(origin.moduleSymbol.name);
|
|
@@ -130770,7 +130986,7 @@ var ts;
|
|
|
130770
130986
|
var symbol = symbols[i];
|
|
130771
130987
|
var origin = symbolToOriginInfoMap === null || symbolToOriginInfoMap === void 0 ? void 0 : symbolToOriginInfoMap[i];
|
|
130772
130988
|
var info = getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind, !!jsxIdentifierExpected);
|
|
130773
|
-
if (!info || uniques.get(info.name) || kind === 1 /* Global */ && symbolToSortTextIdMap && !shouldIncludeSymbol(symbol, symbolToSortTextIdMap)) {
|
|
130989
|
+
if (!info || (uniques.get(info.name) && (!origin || !originIsObjectLiteralMethod(origin))) || kind === 1 /* Global */ && symbolToSortTextIdMap && !shouldIncludeSymbol(symbol, symbolToSortTextIdMap)) {
|
|
130774
130990
|
continue;
|
|
130775
130991
|
}
|
|
130776
130992
|
var name = info.name, needsConvertPropertyAccess = info.needsConvertPropertyAccess;
|
|
@@ -130901,7 +131117,9 @@ var ts;
|
|
|
130901
131117
|
return ts.firstDefined(symbols, function (symbol, index) {
|
|
130902
131118
|
var origin = symbolToOriginInfoMap[index];
|
|
130903
131119
|
var info = getCompletionEntryDisplayNameForSymbol(symbol, ts.getEmitScriptTarget(compilerOptions), origin, completionKind, completionData.isJsxIdentifierExpected);
|
|
130904
|
-
return info && info.name === entryId.name && (entryId.source === CompletionSource.ClassMemberSnippet && symbol.flags & 106500 /* ClassMember */
|
|
131120
|
+
return info && info.name === entryId.name && (entryId.source === CompletionSource.ClassMemberSnippet && symbol.flags & 106500 /* ClassMember */
|
|
131121
|
+
|| entryId.source === CompletionSource.ObjectLiteralMethodSnippet && symbol.flags & (4 /* Property */ | 8192 /* Method */)
|
|
131122
|
+
|| getSourceFromOrigin(origin) === entryId.source)
|
|
130905
131123
|
? { type: "symbol", symbol: symbol, location: location, origin: origin, contextToken: contextToken, previousToken: previousToken, isJsxInitializer: isJsxInitializer, isTypeOnlyLocation: isTypeOnlyLocation }
|
|
130906
131124
|
: undefined;
|
|
130907
131125
|
}) || { type: "none" };
|
|
@@ -130983,6 +131201,20 @@ var ts;
|
|
|
130983
131201
|
};
|
|
130984
131202
|
}
|
|
130985
131203
|
}
|
|
131204
|
+
if (source === CompletionSource.ObjectLiteralMethodSnippet) {
|
|
131205
|
+
var enclosingDeclaration = tryGetObjectLikeCompletionContainer(contextToken);
|
|
131206
|
+
var importAdder = getEntryForObjectLiteralMethodCompletion(symbol, name, enclosingDeclaration, program, host, compilerOptions, preferences, formatContext).importAdder;
|
|
131207
|
+
if (importAdder.hasFixes()) {
|
|
131208
|
+
var changes = ts.textChanges.ChangeTracker.with({ host: host, formatContext: formatContext, preferences: preferences }, importAdder.writeFixes);
|
|
131209
|
+
return {
|
|
131210
|
+
sourceDisplay: undefined,
|
|
131211
|
+
codeActions: [{
|
|
131212
|
+
changes: changes,
|
|
131213
|
+
description: ts.diagnosticToString([ts.Diagnostics.Includes_imports_of_types_referenced_by_0, name]),
|
|
131214
|
+
}],
|
|
131215
|
+
};
|
|
131216
|
+
}
|
|
131217
|
+
}
|
|
130986
131218
|
if (originIsTypeOnlyAlias(origin)) {
|
|
130987
131219
|
var codeAction_1 = ts.codefix.getPromoteTypeOnlyCompletionAction(sourceFile, origin.declaration.name, program, host, formatContext, preferences);
|
|
130988
131220
|
ts.Debug.assertIsDefined(codeAction_1, "Expected to have a code action for promoting type-only alias");
|
|
@@ -131869,6 +132101,45 @@ var ts;
|
|
|
131869
132101
|
symbolToSortTextIdMap[symbolId] = importCompletionNode ? 11 /* LocationPriority */ : 16 /* AutoImportSuggestions */;
|
|
131870
132102
|
symbols.push(symbol);
|
|
131871
132103
|
}
|
|
132104
|
+
/* Mutates `symbols` and `symbolToOriginInfoMap`. */
|
|
132105
|
+
function collectObjectLiteralMethodSymbols(members) {
|
|
132106
|
+
// TODO: support JS files.
|
|
132107
|
+
if (ts.isInJSFile(location)) {
|
|
132108
|
+
return;
|
|
132109
|
+
}
|
|
132110
|
+
members = members.slice(); // Needed in case `symbol` and `members` are the same array.
|
|
132111
|
+
for (var _i = 0, members_1 = members; _i < members_1.length; _i++) {
|
|
132112
|
+
var member = members_1[_i];
|
|
132113
|
+
if (!isObjectLiteralMethodSymbol(member)) {
|
|
132114
|
+
continue;
|
|
132115
|
+
}
|
|
132116
|
+
var origin = { kind: 128 /* ObjectLiteralMethod */ };
|
|
132117
|
+
symbolToOriginInfoMap[symbols.length] = origin;
|
|
132118
|
+
symbols.push(member);
|
|
132119
|
+
}
|
|
132120
|
+
}
|
|
132121
|
+
function isObjectLiteralMethodSymbol(symbol) {
|
|
132122
|
+
/*
|
|
132123
|
+
For an object type
|
|
132124
|
+
`type Foo = {
|
|
132125
|
+
bar(x: number): void;
|
|
132126
|
+
foo: (x: string) => string;
|
|
132127
|
+
}`,
|
|
132128
|
+
`bar` will have symbol flag `Method`,
|
|
132129
|
+
`foo` will have symbol flag `Property`.
|
|
132130
|
+
*/
|
|
132131
|
+
if (!(symbol.flags & (4 /* Property */ | 8192 /* Method */))) {
|
|
132132
|
+
return false;
|
|
132133
|
+
}
|
|
132134
|
+
if (symbol.flags & 4 /* Property */) {
|
|
132135
|
+
var type = program.getTypeChecker().getTypeOfSymbol(symbol);
|
|
132136
|
+
// We ignore non-function properties.
|
|
132137
|
+
if (!type.getCallSignatures().length) {
|
|
132138
|
+
return false;
|
|
132139
|
+
}
|
|
132140
|
+
}
|
|
132141
|
+
return true;
|
|
132142
|
+
}
|
|
131872
132143
|
/**
|
|
131873
132144
|
* Finds the first node that "embraces" the position, so that one may
|
|
131874
132145
|
* accurately aggregate locals from the closest containing scope.
|
|
@@ -132066,7 +132337,11 @@ var ts;
|
|
|
132066
132337
|
}
|
|
132067
132338
|
if (typeMembers && typeMembers.length > 0) {
|
|
132068
132339
|
// Add filtered items to the completion list
|
|
132069
|
-
|
|
132340
|
+
var filteredMembers = filterObjectMembersList(typeMembers, ts.Debug.checkDefined(existingMembers));
|
|
132341
|
+
symbols = ts.concatenate(symbols, filteredMembers);
|
|
132342
|
+
if (objectLikeContainer.kind === 204 /* ObjectLiteralExpression */ && preferences.includeCompletionsWithInsertText) {
|
|
132343
|
+
collectObjectLiteralMethodSymbols(filteredMembers);
|
|
132344
|
+
}
|
|
132070
132345
|
}
|
|
132071
132346
|
setSortTextToOptionalMember();
|
|
132072
132347
|
return 1 /* Success */;
|
|
@@ -132198,29 +132473,6 @@ var ts;
|
|
|
132198
132473
|
}
|
|
132199
132474
|
return 1 /* Success */;
|
|
132200
132475
|
}
|
|
132201
|
-
/**
|
|
132202
|
-
* Returns the immediate owning object literal or binding pattern of a context token,
|
|
132203
|
-
* on the condition that one exists and that the context implies completion should be given.
|
|
132204
|
-
*/
|
|
132205
|
-
function tryGetObjectLikeCompletionContainer(contextToken) {
|
|
132206
|
-
if (contextToken) {
|
|
132207
|
-
var parent = contextToken.parent;
|
|
132208
|
-
switch (contextToken.kind) {
|
|
132209
|
-
case 18 /* OpenBraceToken */: // const x = { |
|
|
132210
|
-
case 27 /* CommaToken */: // const x = { a: 0, |
|
|
132211
|
-
if (ts.isObjectLiteralExpression(parent) || ts.isObjectBindingPattern(parent)) {
|
|
132212
|
-
return parent;
|
|
132213
|
-
}
|
|
132214
|
-
break;
|
|
132215
|
-
case 41 /* AsteriskToken */:
|
|
132216
|
-
return ts.isMethodDeclaration(parent) ? ts.tryCast(parent.parent, ts.isObjectLiteralExpression) : undefined;
|
|
132217
|
-
case 79 /* Identifier */:
|
|
132218
|
-
return contextToken.text === "async" && ts.isShorthandPropertyAssignment(contextToken.parent)
|
|
132219
|
-
? contextToken.parent.parent : undefined;
|
|
132220
|
-
}
|
|
132221
|
-
}
|
|
132222
|
-
return undefined;
|
|
132223
|
-
}
|
|
132224
132476
|
function isConstructorParameterCompletion(node) {
|
|
132225
132477
|
return !!node.parent && ts.isParameter(node.parent) && ts.isConstructorDeclaration(node.parent.parent)
|
|
132226
132478
|
&& (ts.isParameterPropertyModifier(node.kind) || ts.isDeclarationName(node));
|
|
@@ -132643,6 +132895,29 @@ var ts;
|
|
|
132643
132895
|
return node.getStart(sourceFile) <= position && position <= node.getEnd();
|
|
132644
132896
|
}
|
|
132645
132897
|
}
|
|
132898
|
+
/**
|
|
132899
|
+
* Returns the immediate owning object literal or binding pattern of a context token,
|
|
132900
|
+
* on the condition that one exists and that the context implies completion should be given.
|
|
132901
|
+
*/
|
|
132902
|
+
function tryGetObjectLikeCompletionContainer(contextToken) {
|
|
132903
|
+
if (contextToken) {
|
|
132904
|
+
var parent = contextToken.parent;
|
|
132905
|
+
switch (contextToken.kind) {
|
|
132906
|
+
case 18 /* OpenBraceToken */: // const x = { |
|
|
132907
|
+
case 27 /* CommaToken */: // const x = { a: 0, |
|
|
132908
|
+
if (ts.isObjectLiteralExpression(parent) || ts.isObjectBindingPattern(parent)) {
|
|
132909
|
+
return parent;
|
|
132910
|
+
}
|
|
132911
|
+
break;
|
|
132912
|
+
case 41 /* AsteriskToken */:
|
|
132913
|
+
return ts.isMethodDeclaration(parent) ? ts.tryCast(parent.parent, ts.isObjectLiteralExpression) : undefined;
|
|
132914
|
+
case 79 /* Identifier */:
|
|
132915
|
+
return contextToken.text === "async" && ts.isShorthandPropertyAssignment(contextToken.parent)
|
|
132916
|
+
? contextToken.parent.parent : undefined;
|
|
132917
|
+
}
|
|
132918
|
+
}
|
|
132919
|
+
return undefined;
|
|
132920
|
+
}
|
|
132646
132921
|
function getRelevantTokens(position, sourceFile) {
|
|
132647
132922
|
var previousToken = ts.findPrecedingToken(position, sourceFile);
|
|
132648
132923
|
if (previousToken && position <= previousToken.end && (ts.isMemberName(previousToken) || ts.isKeyword(previousToken.kind))) {
|
|
@@ -155040,6 +155315,7 @@ var ts;
|
|
|
155040
155315
|
if (!ts.some(signatures)) {
|
|
155041
155316
|
break;
|
|
155042
155317
|
}
|
|
155318
|
+
// >> TODO: call `try get auto importable reference from type node` on type nodes?
|
|
155043
155319
|
if (declarations.length === 1) {
|
|
155044
155320
|
ts.Debug.assert(signatures.length === 1, "One declaration implies one signature");
|
|
155045
155321
|
var signature = signatures[0];
|
|
@@ -155070,6 +155346,27 @@ var ts;
|
|
|
155070
155346
|
}
|
|
155071
155347
|
}
|
|
155072
155348
|
codefix.addNewNodeForMemberSymbol = addNewNodeForMemberSymbol;
|
|
155349
|
+
// export function addNewNodeObjectLiteralProperties(
|
|
155350
|
+
// // changes: textChanges.ChangeTracker,
|
|
155351
|
+
// // context: CodeFixContextBase,
|
|
155352
|
+
// sourceFile: SourceFile,
|
|
155353
|
+
// program: Program,
|
|
155354
|
+
// preferences: UserPreferences,
|
|
155355
|
+
// host: LanguageServiceHost,
|
|
155356
|
+
// // info: ObjectLiteralInfo,
|
|
155357
|
+
// properties: Symbol[],
|
|
155358
|
+
// addNodes: (nodes: PropertyAssignment[]) => void,
|
|
155359
|
+
// ): void {
|
|
155360
|
+
// const importAdder = createImportAdder(sourceFile, program, preferences, host);
|
|
155361
|
+
// const quotePreference = getQuotePreference(sourceFile, preferences);
|
|
155362
|
+
// const target = getEmitScriptTarget(program.getCompilerOptions());
|
|
155363
|
+
// const checker = program.getTypeChecker();
|
|
155364
|
+
// const props = map(properties, prop => {
|
|
155365
|
+
// const initializer = tryGetValueFromType(context, checker, importAdder, quotePreference, checker.getTypeOfSymbol(prop));
|
|
155366
|
+
// return factory.createPropertyAssignment(createPropertyNameNodeForIdentifierOrLiteral(prop.name, target, quotePreference === QuotePreference.Single), initializer);
|
|
155367
|
+
// });
|
|
155368
|
+
// addNodes(props);
|
|
155369
|
+
// }
|
|
155073
155370
|
function createSignatureDeclarationFromSignature(kind, context, quotePreference, signature, body, name, modifiers, optional, enclosingDeclaration, importAdder) {
|
|
155074
155371
|
var program = context.program;
|
|
155075
155372
|
var checker = program.getTypeChecker();
|
|
@@ -155239,6 +155536,7 @@ var ts;
|
|
|
155239
155536
|
return createStubbedMethod(modifiers, name, optional,
|
|
155240
155537
|
/*typeParameters*/ undefined, parameters, getReturnTypeFromSignatures(signatures, checker, context, enclosingDeclaration), quotePreference, body);
|
|
155241
155538
|
}
|
|
155539
|
+
codefix.createMethodImplementingSignatures = createMethodImplementingSignatures;
|
|
155242
155540
|
function getReturnTypeFromSignatures(signatures, checker, context, enclosingDeclaration) {
|
|
155243
155541
|
if (ts.length(signatures)) {
|
|
155244
155542
|
var type = checker.getUnionType(ts.map(signatures, checker.getReturnTypeOfSignature));
|
|
@@ -158466,8 +158764,8 @@ var ts;
|
|
|
158466
158764
|
ts.Debug.assert(members.length > 0, "Found no members"); // There must be at least one child, since we extracted from one.
|
|
158467
158765
|
var prevMember;
|
|
158468
158766
|
var allProperties = true;
|
|
158469
|
-
for (var _i = 0,
|
|
158470
|
-
var member =
|
|
158767
|
+
for (var _i = 0, members_2 = members; _i < members_2.length; _i++) {
|
|
158768
|
+
var member = members_2[_i];
|
|
158471
158769
|
if (member.pos > maxPos) {
|
|
158472
158770
|
return prevMember || members[0];
|
|
158473
158771
|
}
|
|
@@ -172427,47 +172725,18 @@ var ts;
|
|
|
172427
172725
|
}
|
|
172428
172726
|
return ts.deduplicate(outputs, ts.equateValues);
|
|
172429
172727
|
}
|
|
172430
|
-
|
|
172431
|
-
|
|
172432
|
-
|
|
172433
|
-
return ts.contains(result, output, areEqual);
|
|
172434
|
-
});
|
|
172435
|
-
}
|
|
172436
|
-
function addToCombineOutputResult(outputs, project, result) {
|
|
172437
|
-
if (result.length)
|
|
172438
|
-
outputs.push({ project: project, result: result });
|
|
172439
|
-
}
|
|
172440
|
-
function combineProjectOutputFromEveryProject(projectService, action, areEqual) {
|
|
172441
|
-
var outputs = [];
|
|
172442
|
-
projectService.loadAncestorProjectTree();
|
|
172443
|
-
projectService.forEachEnabledProject(function (project) {
|
|
172444
|
-
var theseOutputs = action(project);
|
|
172445
|
-
addToCombineOutputResult(outputs, project, ts.filter(theseOutputs, function (output) { return !combineOutputResultContains(outputs, output, areEqual); }));
|
|
172446
|
-
});
|
|
172447
|
-
return outputs;
|
|
172448
|
-
}
|
|
172449
|
-
function flattenCombineOutputResult(outputs) {
|
|
172450
|
-
return ts.flatMap(outputs, function (_a) {
|
|
172451
|
-
var result = _a.result;
|
|
172452
|
-
return result;
|
|
172453
|
-
});
|
|
172454
|
-
}
|
|
172455
|
-
function combineProjectOutputWhileOpeningReferencedProjects(projects, defaultProject, action, getLocation, resultsEqual) {
|
|
172456
|
-
var outputs = [];
|
|
172457
|
-
combineProjectOutputWorker(projects, defaultProject,
|
|
172458
|
-
/*initialLocation*/ undefined, function (project, _, tryAddToTodo) {
|
|
172459
|
-
var theseOutputs = action(project);
|
|
172460
|
-
addToCombineOutputResult(outputs, project, ts.filter(theseOutputs, function (output) { return !combineOutputResultContains(outputs, output, resultsEqual) && !tryAddToTodo(project, getLocation(output)); }));
|
|
172461
|
-
});
|
|
172462
|
-
return outputs;
|
|
172463
|
-
}
|
|
172464
|
-
function combineProjectOutputForRenameLocations(projects, defaultProject, initialLocation, findInStrings, findInComments, hostPreferences) {
|
|
172728
|
+
;
|
|
172729
|
+
function combineProjectOutputForRenameLocations(projects, defaultProject, initialLocation, findInStrings, findInComments, _a) {
|
|
172730
|
+
var providePrefixAndSuffixTextForRename = _a.providePrefixAndSuffixTextForRename;
|
|
172465
172731
|
var outputs = [];
|
|
172466
172732
|
combineProjectOutputWorker(projects, defaultProject, initialLocation, function (project, location, tryAddToTodo) {
|
|
172467
|
-
|
|
172468
|
-
|
|
172469
|
-
|
|
172470
|
-
|
|
172733
|
+
var projectOutputs = project.getLanguageService().findRenameLocations(location.fileName, location.pos, findInStrings, findInComments, providePrefixAndSuffixTextForRename);
|
|
172734
|
+
if (projectOutputs) {
|
|
172735
|
+
for (var _i = 0, projectOutputs_1 = projectOutputs; _i < projectOutputs_1.length; _i++) {
|
|
172736
|
+
var output = projectOutputs_1[_i];
|
|
172737
|
+
if (!ts.contains(outputs, output, ts.documentSpansEqual) && !tryAddToTodo(project, documentSpanLocation(output))) {
|
|
172738
|
+
outputs.push(output);
|
|
172739
|
+
}
|
|
172471
172740
|
}
|
|
172472
172741
|
}
|
|
172473
172742
|
});
|
|
@@ -172482,43 +172751,33 @@ var ts;
|
|
|
172482
172751
|
var outputs = [];
|
|
172483
172752
|
combineProjectOutputWorker(projects, defaultProject, initialLocation, function (project, location, getMappedLocation) {
|
|
172484
172753
|
logger.info("Finding references to " + location.fileName + " position " + location.pos + " in project " + project.getProjectName());
|
|
172485
|
-
var
|
|
172486
|
-
|
|
172487
|
-
var
|
|
172488
|
-
|
|
172489
|
-
|
|
172490
|
-
|
|
172491
|
-
symbolToAddTo = {
|
|
172492
|
-
|
|
172493
|
-
|
|
172494
|
-
|
|
172495
|
-
|
|
172496
|
-
|
|
172497
|
-
|
|
172498
|
-
|
|
172754
|
+
var projectOutputs = project.getLanguageService().findReferences(location.fileName, location.pos);
|
|
172755
|
+
if (projectOutputs) {
|
|
172756
|
+
var _loop_8 = function (referencedSymbol) {
|
|
172757
|
+
var mappedDefinitionFile = getMappedLocation(project, documentSpanLocation(referencedSymbol.definition));
|
|
172758
|
+
var definition = mappedDefinitionFile === undefined ?
|
|
172759
|
+
referencedSymbol.definition : __assign(__assign({}, referencedSymbol.definition), { textSpan: ts.createTextSpan(mappedDefinitionFile.pos, referencedSymbol.definition.textSpan.length), fileName: mappedDefinitionFile.fileName, contextSpan: getMappedContextSpan(referencedSymbol.definition, project) });
|
|
172760
|
+
var symbolToAddTo = ts.find(outputs, function (o) { return ts.documentSpansEqual(o.definition, definition); });
|
|
172761
|
+
if (!symbolToAddTo) {
|
|
172762
|
+
symbolToAddTo = { definition: definition, references: [] };
|
|
172763
|
+
outputs.push(symbolToAddTo);
|
|
172764
|
+
}
|
|
172765
|
+
for (var _a = 0, _b = referencedSymbol.references; _a < _b.length; _a++) {
|
|
172766
|
+
var ref = _b[_a];
|
|
172767
|
+
// If it's in a mapped file, that is added to the todo list by `getMappedLocation`.
|
|
172768
|
+
if (!ts.contains(symbolToAddTo.references, ref, ts.documentSpansEqual) && !getMappedLocation(project, documentSpanLocation(ref))) {
|
|
172769
|
+
symbolToAddTo.references.push(ref);
|
|
172770
|
+
}
|
|
172499
172771
|
}
|
|
172772
|
+
};
|
|
172773
|
+
for (var _i = 0, projectOutputs_2 = projectOutputs; _i < projectOutputs_2.length; _i++) {
|
|
172774
|
+
var referencedSymbol = projectOutputs_2[_i];
|
|
172775
|
+
_loop_8(referencedSymbol);
|
|
172500
172776
|
}
|
|
172501
|
-
};
|
|
172502
|
-
for (var _i = 0, _a = project.getLanguageService().findReferences(location.fileName, location.pos) || server.emptyArray; _i < _a.length; _i++) {
|
|
172503
|
-
var outputReferencedSymbol = _a[_i];
|
|
172504
|
-
_loop_8(outputReferencedSymbol);
|
|
172505
172777
|
}
|
|
172506
172778
|
});
|
|
172507
172779
|
return outputs.filter(function (o) { return o.references.length !== 0; });
|
|
172508
172780
|
}
|
|
172509
|
-
function combineProjectOutputForFileReferences(projects, defaultProject, fileName) {
|
|
172510
|
-
var outputs = [];
|
|
172511
|
-
combineProjectOutputWorker(projects, defaultProject,
|
|
172512
|
-
/*initialLocation*/ undefined, function (project) {
|
|
172513
|
-
for (var _i = 0, _a = project.getLanguageService().getFileReferences(fileName) || server.emptyArray; _i < _a.length; _i++) {
|
|
172514
|
-
var referenceEntry = _a[_i];
|
|
172515
|
-
if (!ts.contains(outputs, referenceEntry, ts.documentSpansEqual)) {
|
|
172516
|
-
outputs.push(referenceEntry);
|
|
172517
|
-
}
|
|
172518
|
-
}
|
|
172519
|
-
});
|
|
172520
|
-
return outputs;
|
|
172521
|
-
}
|
|
172522
172781
|
function forEachProjectInProjects(projects, path, cb) {
|
|
172523
172782
|
for (var _i = 0, _a = ts.isArray(projects) ? projects : projects.projects; _i < _a.length; _i++) {
|
|
172524
172783
|
var project = _a[_i];
|
|
@@ -173857,7 +174116,21 @@ var ts;
|
|
|
173857
174116
|
Session.prototype.getFileReferences = function (args, simplifiedResult) {
|
|
173858
174117
|
var _this = this;
|
|
173859
174118
|
var projects = this.getProjects(args);
|
|
173860
|
-
var
|
|
174119
|
+
var fileName = args.file;
|
|
174120
|
+
var references = [];
|
|
174121
|
+
forEachProjectInProjects(projects, /*path*/ undefined, function (project) {
|
|
174122
|
+
if (project.getCancellationToken().isCancellationRequested())
|
|
174123
|
+
return;
|
|
174124
|
+
var projectOutputs = project.getLanguageService().getFileReferences(fileName);
|
|
174125
|
+
if (projectOutputs) {
|
|
174126
|
+
for (var _i = 0, projectOutputs_3 = projectOutputs; _i < projectOutputs_3.length; _i++) {
|
|
174127
|
+
var referenceEntry = projectOutputs_3[_i];
|
|
174128
|
+
if (!ts.contains(references, referenceEntry, ts.documentSpansEqual)) {
|
|
174129
|
+
references.push(referenceEntry);
|
|
174130
|
+
}
|
|
174131
|
+
}
|
|
174132
|
+
}
|
|
174133
|
+
});
|
|
173861
174134
|
if (!simplifiedResult)
|
|
173862
174135
|
return references;
|
|
173863
174136
|
var refs = references.map(function (entry) { return referenceEntryToReferencesResponseItem(_this.projectService, entry); });
|
|
@@ -174256,10 +174529,13 @@ var ts;
|
|
|
174256
174529
|
Session.prototype.getNavigateToItems = function (args, simplifiedResult) {
|
|
174257
174530
|
var full = this.getFullNavigateToItems(args);
|
|
174258
174531
|
return !simplifiedResult ?
|
|
174259
|
-
flattenCombineOutputResult(full) :
|
|
174260
174532
|
ts.flatMap(full, function (_a) {
|
|
174261
|
-
var
|
|
174262
|
-
return
|
|
174533
|
+
var navigateToItems = _a.navigateToItems;
|
|
174534
|
+
return navigateToItems;
|
|
174535
|
+
}) :
|
|
174536
|
+
ts.flatMap(full, function (_a) {
|
|
174537
|
+
var project = _a.project, navigateToItems = _a.navigateToItems;
|
|
174538
|
+
return navigateToItems.map(function (navItem) {
|
|
174263
174539
|
var scriptInfo = project.getScriptInfo(navItem.fileName);
|
|
174264
174540
|
var bakedItem = {
|
|
174265
174541
|
name: navItem.name,
|
|
@@ -174289,13 +174565,57 @@ var ts;
|
|
|
174289
174565
|
if (currentFileOnly) {
|
|
174290
174566
|
ts.Debug.assertIsDefined(args.file);
|
|
174291
174567
|
var _a = this.getFileAndProject(args), file = _a.file, project = _a.project;
|
|
174292
|
-
return [{ project: project,
|
|
174568
|
+
return [{ project: project, navigateToItems: project.getLanguageService().getNavigateToItems(searchValue, maxResultCount, file) }];
|
|
174569
|
+
}
|
|
174570
|
+
var outputs = [];
|
|
174571
|
+
// This is effectively a hashset with `name` as the custom hash and `navigateToItemIsEqualTo` as the custom equals.
|
|
174572
|
+
// `name` is a very cheap hash function, but we could incorporate other properties to reduce collisions.
|
|
174573
|
+
var seenItems = new ts.Map(); // name to items with that name
|
|
174574
|
+
if (!args.file && !projectFileName) {
|
|
174575
|
+
// VS Code's `Go to symbol in workspaces` sends request like this
|
|
174576
|
+
// TODO (https://github.com/microsoft/TypeScript/issues/47839)
|
|
174577
|
+
// This appears to have been intended to search all projects but, in practice, it seems to only search
|
|
174578
|
+
// those that are downstream from already-loaded projects.
|
|
174579
|
+
// Filtering by !isSourceOfProjectReferenceRedirect is new, but seems appropriate and consistent with
|
|
174580
|
+
// the case below.
|
|
174581
|
+
this.projectService.loadAncestorProjectTree();
|
|
174582
|
+
this.projectService.forEachEnabledProject(function (project) { return addItemsForProject(project); });
|
|
174293
174583
|
}
|
|
174294
|
-
else
|
|
174295
|
-
|
|
174584
|
+
else {
|
|
174585
|
+
// VS's `Go to symbol` sends requests with just a project and doesn't want cascading since it will
|
|
174586
|
+
// send a separate request for each project of interest
|
|
174587
|
+
// TODO (https://github.com/microsoft/TypeScript/issues/47839)
|
|
174588
|
+
// This doesn't really make sense unless it's a single project matching `projectFileName`
|
|
174589
|
+
var projects = this.getProjects(args);
|
|
174590
|
+
forEachProjectInProjects(projects, /*path*/ undefined, function (project) { return addItemsForProject(project); });
|
|
174591
|
+
}
|
|
174592
|
+
return outputs;
|
|
174593
|
+
// Mutates `outputs`
|
|
174594
|
+
function addItemsForProject(project) {
|
|
174595
|
+
var projectItems = project.getLanguageService().getNavigateToItems(searchValue, maxResultCount, /*filename*/ undefined, /*excludeDts*/ project.isNonTsProject());
|
|
174596
|
+
var unseenItems = ts.filter(projectItems, function (item) { return tryAddSeenItem(item) && !getMappedLocation(documentSpanLocation(item), project); });
|
|
174597
|
+
if (unseenItems.length) {
|
|
174598
|
+
outputs.push({ project: project, navigateToItems: unseenItems });
|
|
174599
|
+
}
|
|
174600
|
+
}
|
|
174601
|
+
// Returns true if the item had not been seen before
|
|
174602
|
+
// Mutates `seenItems`
|
|
174603
|
+
function tryAddSeenItem(item) {
|
|
174604
|
+
var name = item.name;
|
|
174605
|
+
if (!seenItems.has(name)) {
|
|
174606
|
+
seenItems.set(name, [item]);
|
|
174607
|
+
return true;
|
|
174608
|
+
}
|
|
174609
|
+
var seen = seenItems.get(name);
|
|
174610
|
+
for (var _i = 0, seen_1 = seen; _i < seen_1.length; _i++) {
|
|
174611
|
+
var seenItem = seen_1[_i];
|
|
174612
|
+
if (navigateToItemIsEqualTo(seenItem, item)) {
|
|
174613
|
+
return false;
|
|
174614
|
+
}
|
|
174615
|
+
}
|
|
174616
|
+
seen.push(item);
|
|
174617
|
+
return true;
|
|
174296
174618
|
}
|
|
174297
|
-
var fileArgs = args;
|
|
174298
|
-
return combineProjectOutputWhileOpeningReferencedProjects(this.getProjects(fileArgs), this.getDefaultProject(fileArgs), function (project) { return project.getLanguageService().getNavigateToItems(searchValue, maxResultCount, /*fileName*/ undefined, /*excludeDts*/ project.isNonTsProject()); }, documentSpanLocation, navigateToItemIsEqualTo);
|
|
174299
174619
|
function navigateToItemIsEqualTo(a, b) {
|
|
174300
174620
|
if (a === b) {
|
|
174301
174621
|
return true;
|
|
@@ -174387,8 +174707,28 @@ var ts;
|
|
|
174387
174707
|
var newPath = server.toNormalizedPath(args.newFilePath);
|
|
174388
174708
|
var formatOptions = this.getHostFormatOptions();
|
|
174389
174709
|
var preferences = this.getHostPreferences();
|
|
174390
|
-
var
|
|
174391
|
-
|
|
174710
|
+
var seenFiles = new ts.Set();
|
|
174711
|
+
var textChanges = [];
|
|
174712
|
+
// TODO (https://github.com/microsoft/TypeScript/issues/47839)
|
|
174713
|
+
// This appears to have been intended to search all projects but, in practice, it seems to only search
|
|
174714
|
+
// those that are downstream from already-loaded projects.
|
|
174715
|
+
this.projectService.loadAncestorProjectTree();
|
|
174716
|
+
this.projectService.forEachEnabledProject(function (project) {
|
|
174717
|
+
var projectTextChanges = project.getLanguageService().getEditsForFileRename(oldPath, newPath, formatOptions, preferences);
|
|
174718
|
+
var projectFiles = [];
|
|
174719
|
+
for (var _i = 0, projectTextChanges_1 = projectTextChanges; _i < projectTextChanges_1.length; _i++) {
|
|
174720
|
+
var textChange = projectTextChanges_1[_i];
|
|
174721
|
+
if (!seenFiles.has(textChange.fileName)) {
|
|
174722
|
+
textChanges.push(textChange);
|
|
174723
|
+
projectFiles.push(textChange.fileName);
|
|
174724
|
+
}
|
|
174725
|
+
}
|
|
174726
|
+
for (var _a = 0, projectFiles_1 = projectFiles; _a < projectFiles_1.length; _a++) {
|
|
174727
|
+
var file = projectFiles_1[_a];
|
|
174728
|
+
seenFiles.add(file);
|
|
174729
|
+
}
|
|
174730
|
+
});
|
|
174731
|
+
return simplifiedResult ? textChanges.map(function (c) { return _this.mapTextChangeToCodeEdit(c); }) : textChanges;
|
|
174392
174732
|
};
|
|
174393
174733
|
Session.prototype.getCodeFixes = function (args, simplifiedResult) {
|
|
174394
174734
|
var _this = this;
|