diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 67971280a84ab..e9ac5fa8011f7 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -196,12 +196,14 @@ namespace ts { showInSimplifiedHelpView: false, category: Diagnostics.Output_Formatting, description: Diagnostics.Disable_wiping_the_console_in_watch_mode, + defaultValueDescription: "n/a" }, { name: "listFiles", type: "boolean", category: Diagnostics.Compiler_Diagnostics, - description: Diagnostics.Print_all_of_the_files_read_during_the_compilation + description: Diagnostics.Print_all_of_the_files_read_during_the_compilation, + defaultValueDescription: "false" }, { name: "explainFiles", @@ -213,32 +215,37 @@ namespace ts { name: "listEmittedFiles", type: "boolean", category: Diagnostics.Compiler_Diagnostics, - description: Diagnostics.Print_the_names_of_emitted_files_after_a_compilation + description: Diagnostics.Print_the_names_of_emitted_files_after_a_compilation, + defaultValueDescription: "false" }, { name: "pretty", type: "boolean", showInSimplifiedHelpView: true, category: Diagnostics.Output_Formatting, - description: Diagnostics.Enable_color_and_formatting_in_output_to_make_compiler_errors_easier_to_read + description: Diagnostics.Enable_color_and_formatting_in_output_to_make_compiler_errors_easier_to_read, + defaultValueDescription: "true" }, { name: "traceResolution", type: "boolean", category: Diagnostics.Compiler_Diagnostics, - description: Diagnostics.Log_paths_used_during_the_moduleResolution_process + description: Diagnostics.Log_paths_used_during_the_moduleResolution_process, + defaultValueDescription: "false" }, { name: "diagnostics", type: "boolean", category: Diagnostics.Compiler_Diagnostics, - description: Diagnostics.Output_compiler_performance_information_after_building + description: Diagnostics.Output_compiler_performance_information_after_building, + defaultValueDescription: "false" }, { name: "extendedDiagnostics", type: "boolean", category: Diagnostics.Compiler_Diagnostics, - description: Diagnostics.Output_more_detailed_compiler_performance_information_after_building + description: Diagnostics.Output_more_detailed_compiler_performance_information_after_building, + defaultValueDescription: "false" }, { name: "generateCpuProfile", @@ -246,7 +253,8 @@ namespace ts { isFilePath: true, paramType: Diagnostics.FILE_OR_DIRECTORY, category: Diagnostics.Compiler_Diagnostics, - description: Diagnostics.Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging + description: Diagnostics.Emit_a_v8_CPU_profile_of_the_compiler_run_for_debugging, + defaultValueDescription: "profile.cpuprofile" }, { name: "generateTrace", @@ -263,7 +271,8 @@ namespace ts { type: "boolean", category: Diagnostics.Projects, description: Diagnostics.Enable_incremental_compilation, - transpileOptionValue: undefined + transpileOptionValue: undefined, + defaultValueDescription: Diagnostics.false_unless_composite_is_set }, { name: "assumeChangesOnlyAffectDirectDependencies", @@ -278,7 +287,8 @@ namespace ts { type: "string", category: Diagnostics.Command_line_Options, isCommandLineOnly: true, - description: Diagnostics.Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit + description: Diagnostics.Set_the_language_of_the_messaging_from_TypeScript_This_does_not_affect_emit, + defaultValueDescription: Diagnostics.Platform_specific }, ]; @@ -306,6 +316,7 @@ namespace ts { showInSimplifiedHelpView: true, category: Diagnostics.Language_and_Environment, description: Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations, + defaultValueDescription: "ES3" }; const commandOptionsWithoutBuild: CommandLineOption[] = [ @@ -353,6 +364,7 @@ namespace ts { { name: "showConfig", type: "boolean", + showInSimplifiedHelpView: true, category: Diagnostics.Command_line_Options, isCommandLineOnly: true, description: Diagnostics.Print_the_final_configuration_instead_of_building @@ -409,13 +421,16 @@ namespace ts { affectsModuleResolution: true, showInSimplifiedHelpView: true, category: Diagnostics.JavaScript_Support, - description: Diagnostics.Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files + description: Diagnostics.Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files, + defaultValueDescription: "false" }, { name: "checkJs", type: "boolean", + showInSimplifiedHelpView: true, category: Diagnostics.JavaScript_Support, - description: Diagnostics.Enable_error_reporting_in_type_checked_JavaScript_files + description: Diagnostics.Enable_error_reporting_in_type_checked_JavaScript_files, + defaultValueDescription: "false" }, { name: "jsx", @@ -427,6 +442,7 @@ namespace ts { showInSimplifiedHelpView: true, category: Diagnostics.Language_and_Environment, description: Diagnostics.Specify_what_JSX_code_is_generated, + defaultValueDescription: "undefined" }, { name: "declaration", @@ -435,8 +451,9 @@ namespace ts { affectsEmit: true, showInSimplifiedHelpView: true, category: Diagnostics.Emit, + transpileOptionValue: undefined, description: Diagnostics.Generate_d_ts_files_from_TypeScript_and_JavaScript_files_in_your_project, - transpileOptionValue: undefined + defaultValueDescription: Diagnostics.false_unless_composite_is_set, }, { name: "declarationMap", @@ -444,16 +461,20 @@ namespace ts { affectsEmit: true, showInSimplifiedHelpView: true, category: Diagnostics.Emit, - description: Diagnostics.Create_sourcemaps_for_d_ts_files, - transpileOptionValue: undefined + transpileOptionValue: undefined, + defaultValueDescription: "false", + description: Diagnostics.Create_sourcemaps_for_d_ts_files }, { name: "emitDeclarationOnly", type: "boolean", affectsEmit: true, + showInSimplifiedHelpView: true, + category: Diagnostics.Emit, description: Diagnostics.Only_output_d_ts_files_and_not_JavaScript_files, - transpileOptionValue: undefined + transpileOptionValue: undefined, + defaultValueDescription: "false", }, { name: "sourceMap", @@ -461,6 +482,7 @@ namespace ts { affectsEmit: true, showInSimplifiedHelpView: true, category: Diagnostics.Emit, + defaultValueDescription: "false", description: Diagnostics.Create_source_map_files_for_emitted_JavaScript_files, }, { @@ -472,7 +494,8 @@ namespace ts { showInSimplifiedHelpView: true, category: Diagnostics.Emit, description: Diagnostics.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, - transpileOptionValue: undefined + transpileOptionValue: undefined, + defaultValueDescription: "n/a" }, { name: "outDir", @@ -483,6 +506,7 @@ namespace ts { showInSimplifiedHelpView: true, category: Diagnostics.Emit, description: Diagnostics.Specify_an_output_folder_for_all_emitted_files, + defaultValueDescription: "n/a" }, { name: "rootDir", @@ -492,6 +516,7 @@ namespace ts { paramType: Diagnostics.LOCATION, category: Diagnostics.Modules, description: Diagnostics.Specify_the_root_folder_within_your_source_files, + defaultValueDescription: Diagnostics.Computed_from_the_list_of_input_files }, { name: "composite", @@ -499,8 +524,9 @@ namespace ts { affectsEmit: true, isTSConfigOnly: true, category: Diagnostics.Projects, + transpileOptionValue: undefined, + defaultValueDescription: "false", description: Diagnostics.Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references, - transpileOptionValue: undefined }, { name: "tsBuildInfoFile", @@ -509,8 +535,9 @@ namespace ts { isFilePath: true, paramType: Diagnostics.FILE, category: Diagnostics.Projects, + transpileOptionValue: undefined, + defaultValueDescription: ".tsbuildinfo", description: Diagnostics.Specify_the_folder_for_tsbuildinfo_incremental_compilation_files, - transpileOptionValue: undefined }, { name: "removeComments", @@ -518,6 +545,7 @@ namespace ts { affectsEmit: true, showInSimplifiedHelpView: true, category: Diagnostics.Emit, + defaultValueDescription: "false", description: Diagnostics.Disable_emitting_comments, }, { @@ -526,14 +554,16 @@ namespace ts { showInSimplifiedHelpView: true, category: Diagnostics.Emit, description: Diagnostics.Disable_emitting_file_from_a_compilation, - transpileOptionValue: undefined + transpileOptionValue: undefined, + defaultValueDescription: "false" }, { name: "importHelpers", type: "boolean", affectsEmit: true, category: Diagnostics.Emit, - description: Diagnostics.Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file + description: Diagnostics.Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file, + defaultValueDescription: "false" }, { name: "importsNotUsedAsValues", @@ -552,14 +582,16 @@ namespace ts { type: "boolean", affectsEmit: true, category: Diagnostics.Emit, - description: Diagnostics.Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration + description: Diagnostics.Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration, + defaultValueDescription: "false" }, { name: "isolatedModules", type: "boolean", category: Diagnostics.Interop_Constraints, description: Diagnostics.Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports, - transpileOptionValue: true + transpileOptionValue: true, + defaultValueDescription: "false" }, // Strict Type Checks @@ -570,58 +602,57 @@ namespace ts { // The value of each strictFlag depends on own strictFlag value or this and never accessed directly. showInSimplifiedHelpView: true, category: Diagnostics.Type_Checking, - description: Diagnostics.Enable_all_strict_type_checking_options + description: Diagnostics.Enable_all_strict_type_checking_options, + defaultValueDescription: "false" }, { name: "noImplicitAny", type: "boolean", affectsSemanticDiagnostics: true, strictFlag: true, - showInSimplifiedHelpView: true, category: Diagnostics.Type_Checking, - description: Diagnostics.Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type + description: Diagnostics.Enable_error_reporting_for_expressions_and_declarations_with_an_implied_any_type, + defaultValueDescription: Diagnostics.false_unless_strict_is_set }, { name: "strictNullChecks", type: "boolean", affectsSemanticDiagnostics: true, strictFlag: true, - showInSimplifiedHelpView: true, category: Diagnostics.Type_Checking, - description: Diagnostics.When_type_checking_take_into_account_null_and_undefined + description: Diagnostics.When_type_checking_take_into_account_null_and_undefined, + defaultValueDescription: Diagnostics.false_unless_strict_is_set }, { name: "strictFunctionTypes", type: "boolean", - affectsSemanticDiagnostics: true, strictFlag: true, - showInSimplifiedHelpView: true, category: Diagnostics.Type_Checking, - description: Diagnostics.When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible + description: Diagnostics.When_assigning_functions_check_to_ensure_parameters_and_the_return_values_are_subtype_compatible, + defaultValueDescription: Diagnostics.false_unless_strict_is_set }, { name: "strictBindCallApply", type: "boolean", strictFlag: true, - showInSimplifiedHelpView: true, category: Diagnostics.Type_Checking, - description: Diagnostics.Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function + description: Diagnostics.Check_that_the_arguments_for_bind_call_and_apply_methods_match_the_original_function, + defaultValueDescription: Diagnostics.false_unless_strict_is_set }, { name: "strictPropertyInitialization", type: "boolean", affectsSemanticDiagnostics: true, strictFlag: true, - showInSimplifiedHelpView: true, category: Diagnostics.Type_Checking, - description: Diagnostics.Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor + description: Diagnostics.Check_for_class_properties_that_are_declared_but_not_set_in_the_constructor, + defaultValueDescription: Diagnostics.false_unless_strict_is_set }, { name: "strictOptionalProperties", type: "boolean", affectsSemanticDiagnostics: true, strictFlag: true, - showInSimplifiedHelpView: true, category: Diagnostics.Type_Checking, description: Diagnostics.Enable_strict_checking_of_optional_properties }, @@ -630,16 +661,15 @@ namespace ts { type: "boolean", affectsSemanticDiagnostics: true, strictFlag: true, - showInSimplifiedHelpView: true, category: Diagnostics.Type_Checking, description: Diagnostics.Enable_error_reporting_when_this_is_given_the_type_any, + defaultValueDescription: Diagnostics.false_unless_strict_is_set }, { name: "useUnknownInCatchVariables", type: "boolean", affectsSemanticDiagnostics: true, strictFlag: true, - showInSimplifiedHelpView: true, category: Diagnostics.Type_Checking, description: Diagnostics.Type_catch_clause_variables_as_unknown_instead_of_any, }, @@ -648,9 +678,9 @@ namespace ts { type: "boolean", affectsSourceFile: true, strictFlag: true, - showInSimplifiedHelpView: true, category: Diagnostics.Type_Checking, - description: Diagnostics.Ensure_use_strict_is_always_emitted + description: Diagnostics.Ensure_use_strict_is_always_emitted, + defaultValueDescription: Diagnostics.false_unless_strict_is_set }, // Additional Checks @@ -658,32 +688,31 @@ namespace ts { name: "noUnusedLocals", type: "boolean", affectsSemanticDiagnostics: true, - showInSimplifiedHelpView: true, category: Diagnostics.Type_Checking, description: Diagnostics.Enable_error_reporting_when_a_local_variables_aren_t_read, + defaultValueDescription: "false" }, { name: "noUnusedParameters", type: "boolean", affectsSemanticDiagnostics: true, - showInSimplifiedHelpView: true, category: Diagnostics.Type_Checking, description: Diagnostics.Raise_an_error_when_a_function_parameter_isn_t_read, + defaultValueDescription: "false" }, { name: "noImplicitReturns", type: "boolean", affectsSemanticDiagnostics: true, - showInSimplifiedHelpView: true, category: Diagnostics.Type_Checking, - description: Diagnostics.Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function + description: Diagnostics.Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function, + defaultValueDescription: "false" }, { name: "noFallthroughCasesInSwitch", type: "boolean", affectsBindDiagnostics: true, affectsSemanticDiagnostics: true, - showInSimplifiedHelpView: true, category: Diagnostics.Type_Checking, description: Diagnostics.Enable_error_reporting_for_fallthrough_cases_in_switch_statements }, @@ -691,7 +720,6 @@ namespace ts { name: "noUncheckedIndexedAccess", type: "boolean", affectsSemanticDiagnostics: true, - showInSimplifiedHelpView: false, category: Diagnostics.Type_Checking, description: Diagnostics.Include_undefined_in_index_signature_results }, @@ -699,7 +727,6 @@ namespace ts { name: "noImplicitOverride", type: "boolean", affectsSemanticDiagnostics: true, - showInSimplifiedHelpView: false, category: Diagnostics.Type_Checking, description: Diagnostics.Add_undefined_to_a_type_when_accessed_using_an_index }, @@ -708,7 +735,8 @@ namespace ts { type: "boolean", showInSimplifiedHelpView: false, category: Diagnostics.Type_Checking, - description: Diagnostics.Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type + description: Diagnostics.Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type, + defaultValueDescription: "false" }, // Module Resolution @@ -722,6 +750,7 @@ namespace ts { paramType: Diagnostics.STRATEGY, category: Diagnostics.Modules, description: Diagnostics.Specify_how_TypeScript_looks_up_a_file_from_a_given_module_specifier, + defaultValueDescription: Diagnostics.module_AMD_or_UMD_or_System_or_ES6_then_Classic_Otherwise_Node }, { name: "baseUrl", @@ -756,7 +785,8 @@ namespace ts { affectsModuleResolution: true, category: Diagnostics.Modules, description: Diagnostics.Allow_multiple_folders_to_be_treated_as_one_when_resolving_modules, - transpileOptionValue: undefined + transpileOptionValue: undefined, + defaultValueDescription: Diagnostics.Computed_from_the_list_of_input_files }, { name: "typeRoots", @@ -788,7 +818,8 @@ namespace ts { type: "boolean", affectsSemanticDiagnostics: true, category: Diagnostics.Interop_Constraints, - description: Diagnostics.Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export + description: Diagnostics.Allow_import_x_from_y_when_a_module_doesn_t_have_a_default_export, + defaultValueDescription: Diagnostics.module_system_or_esModuleInterop }, { name: "esModuleInterop", @@ -797,13 +828,15 @@ namespace ts { affectsEmit: true, showInSimplifiedHelpView: true, category: Diagnostics.Interop_Constraints, - description: Diagnostics.Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility + description: Diagnostics.Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility, + defaultValueDescription: "false" }, { name: "preserveSymlinks", type: "boolean", category: Diagnostics.Interop_Constraints, description: Diagnostics.Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node, + defaultValueDescription: "n/a" }, { name: "allowUmdGlobalAccess", @@ -811,6 +844,7 @@ namespace ts { affectsSemanticDiagnostics: true, category: Diagnostics.Modules, description: Diagnostics.Allow_accessing_UMD_globals_from_modules, + defaultValueDescription: "false" }, // Source Maps @@ -835,14 +869,16 @@ namespace ts { type: "boolean", affectsEmit: true, category: Diagnostics.Emit, - description: Diagnostics.Include_sourcemap_files_inside_the_emitted_JavaScript + description: Diagnostics.Include_sourcemap_files_inside_the_emitted_JavaScript, + defaultValueDescription: "false" }, { name: "inlineSources", type: "boolean", affectsEmit: true, category: Diagnostics.Emit, - description: Diagnostics.Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript + description: Diagnostics.Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript, + defaultValueDescription: "false" }, // Experimental @@ -867,7 +903,8 @@ namespace ts { name: "jsxFactory", type: "string", category: Diagnostics.Language_and_Environment, - description: Diagnostics.Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h + description: Diagnostics.Specify_the_JSX_factory_function_used_when_targeting_React_JSX_emit_e_g_React_createElement_or_h, + defaultValueDescription: "`React.createElement`" }, { name: "jsxFragmentFactory", @@ -882,14 +919,16 @@ namespace ts { affectsEmit: true, affectsModuleResolution: true, category: Diagnostics.Language_and_Environment, - description: Diagnostics.Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk + description: Diagnostics.Specify_module_specifier_used_to_import_the_JSX_factory_functions_when_using_jsx_Colon_react_jsx_Asterisk, + defaultValueDescription: "react" }, { name: "resolveJsonModule", type: "boolean", affectsModuleResolution: true, category: Diagnostics.Modules, - description: Diagnostics.Enable_importing_json_files + description: Diagnostics.Enable_importing_json_files, + defaultValueDescription: "false" }, { @@ -900,34 +939,39 @@ namespace ts { // for correct behaviour, please use outFile category: Diagnostics.Backwards_Compatibility, paramType: Diagnostics.FILE, + transpileOptionValue: undefined, + defaultValueDescription: "n/a", description: Diagnostics.Deprecated_setting_Use_outFile_instead, - transpileOptionValue: undefined }, { name: "reactNamespace", type: "string", affectsEmit: true, category: Diagnostics.Language_and_Environment, - description: Diagnostics.Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit + description: Diagnostics.Specify_the_object_invoked_for_createElement_This_only_applies_when_targeting_react_JSX_emit, + defaultValueDescription: "`React`", }, { name: "skipDefaultLibCheck", type: "boolean", category: Diagnostics.Completeness, - description: Diagnostics.Skip_type_checking_d_ts_files_that_are_included_with_TypeScript + description: Diagnostics.Skip_type_checking_d_ts_files_that_are_included_with_TypeScript, + defaultValueDescription: "false", }, { name: "charset", type: "string", category: Diagnostics.Backwards_Compatibility, - description: Diagnostics.No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files + description: Diagnostics.No_longer_supported_In_early_versions_manually_set_the_text_encoding_for_reading_files, + defaultValueDescription: "utf8" }, { name: "emitBOM", type: "boolean", affectsEmit: true, category: Diagnostics.Emit, - description: Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files + description: Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files, + defaultValueDescription: "false" }, { name: "newLine", @@ -939,13 +983,15 @@ namespace ts { paramType: Diagnostics.NEWLINE, category: Diagnostics.Emit, description: Diagnostics.Set_the_newline_character_for_emitting_files, + defaultValueDescription: Diagnostics.Platform_specific }, { name: "noErrorTruncation", type: "boolean", affectsSemanticDiagnostics: true, category: Diagnostics.Output_Formatting, - description: Diagnostics.Disable_truncating_types_in_error_messages + description: Diagnostics.Disable_truncating_types_in_error_messages, + defaultValueDescription: "false" }, { name: "noLib", @@ -955,7 +1001,8 @@ namespace ts { description: Diagnostics.Disable_including_any_library_files_including_the_default_lib_d_ts, // We are not returning a sourceFile for lib file when asked by the program, // so pass --noLib to avoid reporting a file not found error. - transpileOptionValue: true + transpileOptionValue: true, + defaultValueDescription: "false" }, { name: "noResolve", @@ -965,7 +1012,8 @@ namespace ts { description: Diagnostics.Disallow_import_s_require_s_or_reference_s_from_expanding_the_number_of_files_TypeScript_should_add_to_a_project, // We are not doing a full typecheck, we are not resolving the whole context, // so pass --noResolve to avoid reporting missing file errors. - transpileOptionValue: true + transpileOptionValue: true, + defaultValueDescription: "false" }, { name: "stripInternal", @@ -979,7 +1027,8 @@ namespace ts { type: "boolean", affectsProgramStructure: true, category: Diagnostics.Editor_Support, - description: Diagnostics.Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server + description: Diagnostics.Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server, + defaultValueDescription: "false" }, { name: "disableSourceOfProjectReferenceRedirect", @@ -1007,29 +1056,33 @@ namespace ts { type: "boolean", affectsSemanticDiagnostics: true, category: Diagnostics.Backwards_Compatibility, - description: Diagnostics.Disable_adding_use_strict_directives_in_emitted_JavaScript_files + description: Diagnostics.Disable_adding_use_strict_directives_in_emitted_JavaScript_files, + defaultValueDescription: "false" }, { name: "noEmitHelpers", type: "boolean", affectsEmit: true, category: Diagnostics.Emit, - description: Diagnostics.Disable_generating_custom_helper_functions_like_extends_in_compiled_output + description: Diagnostics.Disable_generating_custom_helper_functions_like_extends_in_compiled_output, + defaultValueDescription: "false" }, { name: "noEmitOnError", type: "boolean", affectsEmit: true, category: Diagnostics.Emit, + transpileOptionValue: undefined, description: Diagnostics.Disable_emitting_files_if_any_type_checking_errors_are_reported, - transpileOptionValue: undefined + defaultValueDescription: "false" }, { name: "preserveConstEnums", type: "boolean", affectsEmit: true, category: Diagnostics.Emit, - description: Diagnostics.Disable_erasing_const_enum_declarations_in_generated_code + description: Diagnostics.Disable_erasing_const_enum_declarations_in_generated_code, + defaultValueDescription: "n/a" }, { name: "declarationDir", @@ -1038,14 +1091,16 @@ namespace ts { isFilePath: true, paramType: Diagnostics.DIRECTORY, category: Diagnostics.Emit, + transpileOptionValue: undefined, description: Diagnostics.Specify_the_output_directory_for_generated_declaration_files, - transpileOptionValue: undefined + defaultValueDescription: "n/a" }, { name: "skipLibCheck", type: "boolean", category: Diagnostics.Completeness, description: Diagnostics.Skip_type_checking_all_d_ts_files, + defaultValueDescription: "false" }, { name: "allowUnusedLabels", @@ -1053,7 +1108,8 @@ namespace ts { affectsBindDiagnostics: true, affectsSemanticDiagnostics: true, category: Diagnostics.Type_Checking, - description: Diagnostics.Disable_error_reporting_for_unused_labels + description: Diagnostics.Disable_error_reporting_for_unused_labels, + defaultValueDescription: "undefined" }, { name: "allowUnreachableCode", @@ -1061,7 +1117,8 @@ namespace ts { affectsBindDiagnostics: true, affectsSemanticDiagnostics: true, category: Diagnostics.Type_Checking, - description: Diagnostics.Disable_error_reporting_for_unreachable_code + description: Diagnostics.Disable_error_reporting_for_unreachable_code, + defaultValueDescription: "undefined" }, { name: "suppressExcessPropertyErrors", @@ -1069,6 +1126,7 @@ namespace ts { affectsSemanticDiagnostics: true, category: Diagnostics.Backwards_Compatibility, description: Diagnostics.Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals, + defaultValueDescription: "false" }, { name: "suppressImplicitAnyIndexErrors", @@ -1076,20 +1134,23 @@ namespace ts { affectsSemanticDiagnostics: true, category: Diagnostics.Backwards_Compatibility, description: Diagnostics.Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures, + defaultValueDescription: "false" }, { name: "forceConsistentCasingInFileNames", type: "boolean", affectsModuleResolution: true, category: Diagnostics.Interop_Constraints, - description: Diagnostics.Ensure_that_casing_is_correct_in_imports + description: Diagnostics.Ensure_that_casing_is_correct_in_imports, + defaultValueDescription: "false" }, { name: "maxNodeModuleJsDepth", type: "number", affectsModuleResolution: true, category: Diagnostics.JavaScript_Support, - description: Diagnostics.Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs + description: Diagnostics.Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs, + defaultValueDescription: "0" }, { name: "noStrictGenericChecks", @@ -1097,6 +1158,7 @@ namespace ts { affectsSemanticDiagnostics: true, category: Diagnostics.Backwards_Compatibility, description: Diagnostics.Disable_strict_checking_of_generic_signatures_in_function_types, + defaultValueDescription: "false" }, { name: "useDefineForClassFields", @@ -1105,13 +1167,14 @@ namespace ts { affectsEmit: true, category: Diagnostics.Language_and_Environment, description: Diagnostics.Emit_ECMAScript_standard_compliant_class_fields, + defaultValueDescription: "false" }, - { name: "keyofStringsOnly", type: "boolean", category: Diagnostics.Backwards_Compatibility, description: Diagnostics.Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option, + defaultValueDescription: "false" }, { // A list of plugins to load in the language service @@ -1158,7 +1221,9 @@ namespace ts { export const transpileOptionValueCompilerOptions: readonly CommandLineOption[] = optionDeclarations.filter(option => hasProperty(option, "transpileOptionValue")); - const commandOptionsOnlyBuild: CommandLineOption[] = [ + // Build related options + /* @internal */ + export const optionsForBuild: CommandLineOption[] = [ { name: "verbose", shortName: "v", @@ -1191,7 +1256,7 @@ namespace ts { /* @internal */ export const buildOpts: CommandLineOption[] = [ ...commonOptionsWithBuild, - ...commandOptionsOnlyBuild, + ...optionsForBuild ]; /* @internal */ @@ -1794,6 +1859,7 @@ namespace ts { type: "string" }, category: Diagnostics.File_Management, + defaultValueDescription: Diagnostics.if_files_is_specified_otherwise_Asterisk_Asterisk_Slash_Asterisk }, { name: "exclude", @@ -1803,6 +1869,7 @@ namespace ts { type: "string" }, category: Diagnostics.File_Management, + defaultValueDescription: Diagnostics.node_modules_bower_components_jspm_packages_plus_the_value_of_outDir_if_one_is_specified }, compileOnSaveCommandLineOption ]) diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 90b875f1d8afb..c7dd23fb11e57 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -4031,11 +4031,11 @@ "category": "Message", "code": 6014 }, - "Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'.": { + "Specify ECMAScript target version.": { "category": "Message", "code": 6015 }, - "Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'.": { + "Specify module code generation.": { "category": "Message", "code": 6016 }, @@ -4243,7 +4243,7 @@ "category": "Message", "code": 6079 }, - "Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'.": { + "Specify JSX code generation.": { "category": "Message", "code": 6080 }, @@ -5638,6 +5638,127 @@ "code": 6803 }, + "one of:": { + "category": "Message", + "code": 6900 + }, + "one or more:": { + "category": "Message", + "code": 6901 + }, + "type:": { + "category": "Message", + "code": 6902 + }, + "default:": { + "category": "Message", + "code": 6903 + }, + "module === \"system\" or esModuleInterop": { + "category": "Message", + "code": 6904 + }, + "`false`, unless `strict` is set": { + "category": "Message", + "code": 6905 + }, + "`false`, unless `composite` is set": { + "category": "Message", + "code": 6906 + }, + "`[\"node_modules\", \"bower_components\", \"jspm_packages\"]`, plus the value of `outDir` if one is specified.": { + "category": "Message", + "code": 6907 + }, + "`[]` if `files` is specified, otherwise `[\"**/*\"]`": { + "category": "Message", + "code": 6908 + }, + "`true` if `composite`, `false` otherwise": { + "category": "Message", + "code": 6909 + }, + "module === `AMD` or `UMD` or `System` or `ES6`, then `Classic`, Otherwise `Node`": { + "category": "Message", + "code": 69010 + }, + "Computed from the list of input files": { + "category": "Message", + "code": 6911 + }, + "Platform specific": { + "category": "Message", + "code": 6912 + }, + "You can learn about all of the compiler options at {0}": { + "category": "Message", + "code": 6913 + }, + "Including --watch, -w will start watching the current project for the file changes. Once set, you can config watch mode with:": { + "category": "Message", + "code": 6914 + }, + "Using --build, -b will make tsc behave more like a build orchestrator than a compiler. This is used to trigger building composite projects which you can learn more about at {0}": { + "category": "Message", + "code": 6915 + }, + "COMMON COMMANDS": { + "category": "Message", + "code": 6916 + }, + "ALL COMPILER OPTIONS": { + "category": "Message", + "code": 6917 + }, + "WATCH OPTIONS": { + "category": "Message", + "code": 6918 + }, + "BUILD OPTIONS": { + "category": "Message", + "code": 6919 + }, + "COMMON COMPILER OPTIONS": { + "category": "Message", + "code": 6920 + }, + "COMMAND LINE FLAGS": { + "category": "Message", + "code": 6921 + }, + "tsc: The TypeScript Compiler": { + "category": "Message", + "code": 6922 + }, + "Compiles the current project (tsconfig.json in the working directory.)": { + "category": "Message", + "code": 6923 + }, + "Ignoring tsconfig.json, compiles the specified files with default compiler options": { + "category": "Message", + "code": 6924 + }, + "Build a composite project in the working directory.": { + "category": "Message", + "code": 6925 + }, + "Creates a tsconfig.json with the recommended settings in the working directory.": { + "category": "Message", + "code": 6926 + }, + "Compiles the TypeScript project located at the specified path": { + "category": "Message", + "code": 6927 + }, + "An expanded version of this information, showing all possible compiler options": { + "category": "Message", + "code": 6928 + }, + "Compiles the current project, with additional settings": { + "category": "Message", + "code": 6929 + }, + "Variable '{0}' implicitly has an '{1}' type.": { "category": "Error", "code": 7005 diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts index 3366c444559b2..86029e971ccad 100644 --- a/src/compiler/sys.ts +++ b/src/compiler/sys.ts @@ -1162,6 +1162,7 @@ namespace ts { useCaseSensitiveFileNames: boolean; write(s: string): void; writeOutputIsTTY?(): boolean; + getWidthOfTerminal?(): number; readFile(path: string, encoding?: string): string | undefined; getFileSize?(path: string): number; writeFile(path: string, data: string, writeByteOrderMark?: boolean): void; @@ -1308,6 +1309,9 @@ namespace ts { write(s: string): void { process.stdout.write(s); }, + getWidthOfTerminal(){ + return process.stdout.columns; + }, writeOutputIsTTY() { return process.stdout.isTTY; }, diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 65996b86a5ef0..6379c8a558b99 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -6224,7 +6224,8 @@ namespace ts { type: "string" | "number" | "boolean" | "object" | "list" | ESMap; // a value of a primitive type, or an object literal mapping named values to actual values isFilePath?: boolean; // True if option value is a path or fileName shortName?: string; // A short mnemonic for convenience - for instance, 'h' can be used in place of 'help' - description?: DiagnosticMessage; // The message describing what the command line switch does + description?: DiagnosticMessage; // The message describing what the command line switch does. + defaultValueDescription?: string | DiagnosticMessage; // The message describing what the dafault value is. string type is prepared for fixed chosen like "false" which do not need I18n. paramType?: DiagnosticMessage; // The name to be used for a non-boolean option's parameter isTSConfigOnly?: boolean; // True if option can only be specified via tsconfig.json file isCommandLineOnly?: boolean; diff --git a/src/executeCommandLine/executeCommandLine.ts b/src/executeCommandLine/executeCommandLine.ts index 1861e3e103247..888172b87325e 100644 --- a/src/executeCommandLine/executeCommandLine.ts +++ b/src/executeCommandLine/executeCommandLine.ts @@ -24,7 +24,7 @@ namespace ts { } function getCountsMap() { - const counts = createMap(); + const counts = new Map(); counts.set("Library", 0); counts.set("Definitions", 0); counts.set("TypeScript", 0); @@ -89,111 +89,331 @@ namespace ts { sys.write(getDiagnosticText(Diagnostics.Version_0, version) + sys.newLine); } - function printHelp(sys: System, optionsList: readonly CommandLineOption[], syntaxPrefix = "") { - const output: string[] = []; - - // We want to align our "syntax" and "examples" commands to a certain margin. - const syntaxLength = getDiagnosticText(Diagnostics.Syntax_Colon_0, "").length; - const examplesLength = getDiagnosticText(Diagnostics.Examples_Colon_0, "").length; - let marginLength = Math.max(syntaxLength, examplesLength); + function createColors(sys: System) { + const showColors = defaultIsPretty(sys); + if (!showColors) { + return { + bold: (str: string) => str, + blue: (str: string) => str, + blueBackground: (str: string) => str, + white: (str: string) => str + }; + } - // Build up the syntactic skeleton. - let syntax = makePadding(marginLength - syntaxLength); - syntax += `tsc ${syntaxPrefix}[${getDiagnosticText(Diagnostics.options)}] [${getDiagnosticText(Diagnostics.file)}...]`; + function bold(str: string) { + return `\x1b[1m${str}\x1b[22m`; + } + function blue(str: string) { + return `\x1b[34m${str}\x1b[39m`; + } + function blueBackground(str: string) { + return `\x1b[44m${str}\x1b[49m`; + } + function white(str: string) { + return `\x1b[37m${str}\x1b[39m`; + } + return { + bold, + blue, + white, + blueBackground + }; + } - output.push(getDiagnosticText(Diagnostics.Syntax_Colon_0, syntax)); - output.push(sys.newLine + sys.newLine); + function getDisplayNameTextOfOption(option: CommandLineOption) { + return `--${option.name}${option.shortName ? `, -${option.shortName}` : ""}`; + } - // Build up the list of examples. - const padding = makePadding(marginLength); - output.push(getDiagnosticText(Diagnostics.Examples_Colon_0, makePadding(marginLength - examplesLength) + "tsc hello.ts") + sys.newLine); - output.push(padding + "tsc --outFile file.js file.ts" + sys.newLine); - output.push(padding + "tsc @args.txt" + sys.newLine); - output.push(padding + "tsc --build tsconfig.json" + sys.newLine); - output.push(sys.newLine); + function generateOptionOutput(sys: System, option: CommandLineOption, rightAlignOfLeft: number, leftAlignOfRight: number) { + interface ValueCandidate { + // "one or more" or "any of" + valueType: string; + possibleValues: string; + } - output.push(getDiagnosticText(Diagnostics.Options_Colon) + sys.newLine); + const text: string[] = []; + const colors = createColors(sys); - // We want our descriptions to align at the same column in our output, - // so we keep track of the longest option usage string. - marginLength = 0; - const usageColumn: string[] = []; // Things like "-d, --declaration" go in here. - const descriptionColumn: string[] = []; + // name and description + const name = getDisplayNameTextOfOption(option); - const optionsDescriptionMap = new Map(); // Map between option.description and list of option.type if it is a kind + // value type and possible value + const valueCandidates = getValueCandidate(option); + const defaultValueDescription = typeof option.defaultValueDescription === "object" ? getDiagnosticText(option.defaultValueDescription) : option.defaultValueDescription; + const terminalWidth = sys.getWidthOfTerminal?.() ?? 0; - for (const option of optionsList) { - // If an option lacks a description, - // it is not officially supported. - if (!option.description) { - continue; + // Note: child_process might return `terminalWidth` as undefined. + if (terminalWidth >= 60) { + let description = ""; + if (option.description) { + description = getDiagnosticText(option.description); } - - let usageText = " "; - if (option.shortName) { - usageText += "-" + option.shortName; - usageText += getParamType(option); - usageText += ", "; + text.push(...getPrettyOutput(name, description, rightAlignOfLeft, leftAlignOfRight, terminalWidth, /*colorLeft*/ true), sys.newLine); + if (showAdditionalInfoOutput(valueCandidates, option)) { + if (valueCandidates) { + text.push(...getPrettyOutput(valueCandidates.valueType, valueCandidates.possibleValues, rightAlignOfLeft, leftAlignOfRight, terminalWidth, /*colorLeft*/ false), sys.newLine); + } + if (defaultValueDescription) { + text.push(...getPrettyOutput(getDiagnosticText(Diagnostics.default_Colon), defaultValueDescription, rightAlignOfLeft, leftAlignOfRight, terminalWidth, /*colorLeft*/ false), sys.newLine); + } } + text.push(sys.newLine); + } + else { + text.push(colors.blue(name), sys.newLine); + if (option.description) { + const description = getDiagnosticText(option.description); + text.push(description); + } + text.push(sys.newLine); + if (showAdditionalInfoOutput(valueCandidates, option)) { + if (valueCandidates) { + text.push(`${valueCandidates.valueType} ${valueCandidates.possibleValues}`); + } + if (defaultValueDescription) { + if (valueCandidates) text.push(sys.newLine); + const diagType = getDiagnosticText(Diagnostics.default_Colon); + text.push(`${diagType} ${defaultValueDescription}`); + } - usageText += "--" + option.name; - usageText += getParamType(option); + text.push(sys.newLine); + } + text.push(sys.newLine); + } + return text; - usageColumn.push(usageText); - let description: string; + function showAdditionalInfoOutput(valueCandidates: ValueCandidate | undefined, option: CommandLineOption): boolean { + const ignoreValues = ["string"]; + const ignoredDescriptions = [undefined, "false", "n/a"]; + const defaultValueDescription = option.defaultValueDescription; + if (option.category === Diagnostics.Command_line_Options) return false; - if (option.name === "lib") { - description = getDiagnosticText(option.description); - const element = (option as CommandLineOptionOfListType).element; - const typeMap = element.type as ESMap; - optionsDescriptionMap.set(description, arrayFrom(typeMap.keys()).map(key => `'${key}'`)); + if (contains(ignoreValues, valueCandidates?.possibleValues) && contains(ignoredDescriptions, defaultValueDescription)) { + return false; } - else { - description = getDiagnosticText(option.description); + return true; + } + + function getPrettyOutput(left: string, right: string, rightAlignOfLeft: number, leftAlignOfRight: number, terminalWidth: number, colorLeft: boolean) { + const res = []; + let isFirstLine = true; + let remainRight = right; + const rightCharacterNumber = terminalWidth - leftAlignOfRight; + while (remainRight.length > 0) { + let curLeft = ""; + if (isFirstLine) { + curLeft = padLeft(left, rightAlignOfLeft); + curLeft = padRight(curLeft, leftAlignOfRight); + curLeft = colorLeft ? colors.blue(curLeft) : curLeft; + } + else { + curLeft = padLeft("", leftAlignOfRight); + } + + const curRight = remainRight.substr(0, rightCharacterNumber); + remainRight = remainRight.slice(rightCharacterNumber); + res.push(`${curLeft}${curRight}`); + isFirstLine = false; + } + return res; + } + + function getValueCandidate(option: CommandLineOption): ValueCandidate | undefined { + // option.type might be "string" | "number" | "boolean" | "object" | "list" | ESMap + // string -- any of: string + // number -- any of: number + // boolean -- any of: boolean + // object -- null + // list -- one or more: , content depends on `option.element.type`, the same as others + // ESMap -- any of: key1, key2, .... + if (option.type === "object") { + return undefined; + } + + return { + valueType: getValueType(option), + possibleValues: getPossibleValues(option) + }; + + function getValueType(option: CommandLineOption) { + switch (option.type) { + case "string": + case "number": + case "boolean": + return getDiagnosticText(Diagnostics.type_Colon); + case "list": + return getDiagnosticText(Diagnostics.one_or_more_Colon); + default: + return getDiagnosticText(Diagnostics.one_of_Colon); + } } - descriptionColumn.push(description); + function getPossibleValues(option: CommandLineOption) { + let possibleValues: string; + switch (option.type) { + case "string": + case "number": + case "boolean": + possibleValues = option.type; + break; + case "list": + // TODO: check infinite loop + possibleValues = getPossibleValues(option.element); + break; + case "object": + possibleValues = ""; + break; + default: + // ESMap + const keys = arrayFrom(option.type.keys()); + possibleValues = keys.join(", "); + } + return possibleValues; + } + } + } - // Set the new margin for the description column if necessary. - marginLength = Math.max(usageText.length, marginLength); + function generateGroupOptionOutput(sys: System, optionsList: readonly CommandLineOption[]) { + let maxLength = 0; + for (const option of optionsList) { + const curLength = getDisplayNameTextOfOption(option).length; + maxLength = maxLength > curLength ? maxLength : curLength; } - // Special case that can't fit in the loop. - const usageText = " @<" + getDiagnosticText(Diagnostics.file) + ">"; - usageColumn.push(usageText); - descriptionColumn.push(getDiagnosticText(Diagnostics.Insert_command_line_options_and_files_from_a_file)); - marginLength = Math.max(usageText.length, marginLength); + // left part should be right align, right part should be left align - // Print out each row, aligning all the descriptions on the same column. - for (let i = 0; i < usageColumn.length; i++) { - const usage = usageColumn[i]; - const description = descriptionColumn[i]; - const kindsList = optionsDescriptionMap.get(description); - output.push(usage + makePadding(marginLength - usage.length + 2) + description + sys.newLine); + // assume 2 space between left margin and left part. + const rightAlignOfLeftPart = maxLength + 2; + // assume 2 space between left and right part + const leftAlignOfRightPart = rightAlignOfLeftPart + 2; + let lines: string[] = []; + for (const option of optionsList) { + const tmp = generateOptionOutput(sys, option, rightAlignOfLeftPart, leftAlignOfRightPart); + lines = [...lines, ...tmp]; + } + // make sure always a blank line in the end. + if (lines[lines.length - 2] !== sys.newLine) { + lines.push(sys.newLine); + } + return lines; + } - if (kindsList) { - output.push(makePadding(marginLength + 4)); - for (const kind of kindsList) { - output.push(kind + " "); - } - output.push(sys.newLine); + function generateSectionOptionsOutput(sys: System, sectionName: string, options: readonly CommandLineOption[], subCategory: boolean, beforeOptionsDescription?: string, afterOptionsDescription?: string) { + let res: string[] = []; + res.push(createColors(sys).bold(sectionName) + sys.newLine + sys.newLine); + if (beforeOptionsDescription) { + res.push(beforeOptionsDescription + sys.newLine + sys.newLine); + } + if (!subCategory) { + res = [...res, ...generateGroupOptionOutput(sys, options)]; + if (afterOptionsDescription) { + res.push(afterOptionsDescription + sys.newLine + sys.newLine); + } + return res; + } + const categoryMap = new Map(); + for (const option of options) { + if (!option.category) { + continue; } + const curCategory = getDiagnosticText(option.category); + const optionsOfCurCategory = categoryMap.get(curCategory) ?? []; + optionsOfCurCategory.push(option); + categoryMap.set(curCategory, optionsOfCurCategory); } + categoryMap.forEach((value, key) => { + res.push(`### ${key}${sys.newLine}${sys.newLine}`); + res = [...res, ...generateGroupOptionOutput(sys, value)]; + }); + if (afterOptionsDescription) { + res.push(afterOptionsDescription + sys.newLine + sys.newLine); + } + return res; + } + + function printEasyHelp(sys: System, simpleOptions: readonly CommandLineOption[]) { + const colors = createColors(sys); + let output: string[] = [...getHelpHeader(sys)]; + output.push(colors.bold(getDiagnosticText(Diagnostics.COMMON_COMMANDS)) + sys.newLine + sys.newLine); + + example("tsc", Diagnostics.Compiles_the_current_project_tsconfig_json_in_the_working_directory); + example("tsc app.ts util.ts", Diagnostics.Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options); + example("tsc -b", Diagnostics.Build_a_composite_project_in_the_working_directory); + example("tsc --init", Diagnostics.Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory); + example("tsc -p .path/to/tsconfig.json", Diagnostics.Compiles_the_TypeScript_project_located_at_the_specified_path); + example("tsc --help --all", Diagnostics.An_expanded_version_of_this_information_showing_all_possible_compiler_options); + example(["tsc --noEmit", "tsc --target esnext"], Diagnostics.Compiles_the_current_project_with_additional_settings); + + const cliCommands = simpleOptions.filter(opt => opt.isCommandLineOnly || opt.category === Diagnostics.Command_line_Options); + const configOpts = simpleOptions.filter(opt => !contains(cliCommands, opt)); + + output = [ + ...output, + ...generateSectionOptionsOutput(sys, getDiagnosticText(Diagnostics.COMMAND_LINE_FLAGS), cliCommands, /*subCategory*/ false, /* beforeOptionsDescription */ undefined, /* afterOptionsDescription*/ undefined), + ...generateSectionOptionsOutput(sys, getDiagnosticText(Diagnostics.COMMON_COMPILER_OPTIONS), configOpts, /*subCategory*/ false, /* beforeOptionsDescription */ undefined, formatMessage(/*_dummy*/ undefined, Diagnostics.You_can_learn_about_all_of_the_compiler_options_at_0, "https://aka.ms/tsconfig-reference")) + ]; for (const line of output) { sys.write(line); } - return; - function getParamType(option: CommandLineOption) { - if (option.paramType !== undefined) { - return " " + getDiagnosticText(option.paramType); + function example(ex: string | string[], desc: DiagnosticMessage) { + const examples = typeof ex === "string" ? [ex] : ex; + for (const example of examples) { + output.push(" " + colors.blue(example) + sys.newLine); } - return ""; + output.push(" " + getDiagnosticText(desc) + sys.newLine + sys.newLine); + } + } + + function printAllHelp(sys: System, compilerOptions: readonly CommandLineOption[], buildOptions: readonly CommandLineOption[], watchOptions: readonly CommandLineOption[]) { + let output: string[] = [...getHelpHeader(sys)]; + output = [...output, ...generateSectionOptionsOutput(sys, getDiagnosticText(Diagnostics.ALL_COMPILER_OPTIONS), compilerOptions, /*subCategory*/ true, /* beforeOptionsDescription */ undefined, formatMessage(/*_dummy*/ undefined, Diagnostics.You_can_learn_about_all_of_the_compiler_options_at_0, "https://aka.ms/tsconfig-reference"))]; + output = [...output, ...generateSectionOptionsOutput(sys, getDiagnosticText(Diagnostics.WATCH_OPTIONS), watchOptions, /*subCategory*/ false, getDiagnosticText(Diagnostics.Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon))]; + output = [...output, ...generateSectionOptionsOutput(sys, getDiagnosticText(Diagnostics.BUILD_OPTIONS), buildOptions, /*subCategory*/ false, formatMessage(/*_dummy*/ undefined, Diagnostics.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0, "https://aka.ms/tsc-composite-builds"))]; + for (const line of output) { + sys.write(line); + } + } + + function printBuildHelp(sys: System, buildOptions: readonly CommandLineOption[]) { + let output: string[] = [...getHelpHeader(sys)]; + output = [...output, ...generateSectionOptionsOutput(sys, getDiagnosticText(Diagnostics.BUILD_OPTIONS), buildOptions, /*subCategory*/ false, formatMessage(/*_dummy*/ undefined, Diagnostics.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0, "https://aka.ms/tsc-composite-builds"))]; + for (const line of output) { + sys.write(line); } + } - function makePadding(paddingLength: number): string { - return Array(paddingLength + 1).join(" "); + function getHelpHeader(sys: System) { + const colors = createColors(sys); + const header: string[] = []; + const tscExplanation = `${getDiagnosticText(Diagnostics.tsc_Colon_The_TypeScript_Compiler)} - ${getDiagnosticText(Diagnostics.Version_0, version)}`; + const terminalWidth = sys.getWidthOfTerminal?.() ?? 0;; + const tsIconLength = 5; + + const tsIconFirstLine = colors.blueBackground(padLeft("", tsIconLength)); + const tsIconSecondLine = colors.blueBackground(colors.white(padLeft("TS ", tsIconLength))); + // If we have enough space, print TS icon. + if (terminalWidth >= tscExplanation.length + tsIconLength) { + // right align of the icon is 120 at most. + const rightAlign = terminalWidth > 120 ? 120 : terminalWidth; + const leftAlign = rightAlign - tsIconLength; + header.push(padRight(tscExplanation, leftAlign) + tsIconFirstLine + sys.newLine); + header.push(padLeft("", leftAlign) + tsIconSecondLine + sys.newLine); + } + else { + header.push(tscExplanation + sys.newLine); + header.push(sys.newLine); + } + return header; + } + + function printHelp(sys: System, commandLine: ParsedCommandLine) { + if (!commandLine.options.all) { + printEasyHelp(sys, getOptionsForHelp(commandLine)); + } + else { + printAllHelp(sys, getOptionsForHelp(commandLine), optionsForBuild, optionsForWatch); } } @@ -232,8 +452,7 @@ namespace ts { } if (commandLine.options.help || commandLine.options.all) { - printVersion(sys); - printHelp(sys, getOptionsForHelp(commandLine)); + printHelp(sys, commandLine); return sys.exit(ExitStatus.Success); } @@ -275,7 +494,7 @@ namespace ts { } else { printVersion(sys); - printHelp(sys, getOptionsForHelp(commandLine)); + printHelp(sys, commandLine); } return sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped); } @@ -463,13 +682,13 @@ namespace ts { if (buildOptions.help) { printVersion(sys); - printHelp(sys, buildOpts, "--build "); + printBuildHelp(sys, buildOpts); return sys.exit(ExitStatus.Success); } if (projects.length === 0) { printVersion(sys); - printHelp(sys, buildOpts, "--build "); + printBuildHelp(sys, buildOpts); return sys.exit(ExitStatus.Success); } @@ -671,7 +890,7 @@ namespace ts { if (canTrace(system, compilerOptions)) { startTracing(isBuildMode ? "build" : "project", - compilerOptions.generateTrace!, compilerOptions.configFilePath); + compilerOptions.generateTrace!, compilerOptions.configFilePath); } } diff --git a/src/harness/fakesHosts.ts b/src/harness/fakesHosts.ts index 8d7db1d333cb3..58b29a4c7ef98 100644 --- a/src/harness/fakesHosts.ts +++ b/src/harness/fakesHosts.ts @@ -32,6 +32,9 @@ namespace fakes { this._env = env; } + private testTerminalWidth = Number.parseInt(this.getEnvironmentVariable("TS_TEST_TERMINAL_WIDTH")); + getWidthOfTerminal = Number.isNaN(this.testTerminalWidth) ? undefined : () => this.testTerminalWidth; + // Pretty output writeOutputIsTTY() { return true; diff --git a/src/testRunner/unittests/tsc/helpers.ts b/src/testRunner/unittests/tsc/helpers.ts index 11cae1cfbd8c1..14c4bc0df5127 100644 --- a/src/testRunner/unittests/tsc/helpers.ts +++ b/src/testRunner/unittests/tsc/helpers.ts @@ -10,7 +10,7 @@ namespace ts { IncrementalDtsChange = "incremental-declaration-changes", IncrementalDtsUnchanged = "incremental-declaration-doesnt-change", IncrementalHeadersChange = "incremental-headers-change-without-dts-changes", - NoChangeRun ="no-change-run" + NoChangeRun = "no-change-run" } export const noChangeRun: TscIncremental = { @@ -32,6 +32,7 @@ namespace ts { baselinePrograms?: boolean; baselineDependencies?: boolean; disableUseFileVersionAsSignature?: boolean; + environmentVariables?: Record; } export type CommandLineProgram = [Program, EmitAndSemanticDiagnosticsBuilderProgram?]; @@ -77,14 +78,15 @@ namespace ts { const { scenario, subScenario, buildKind, commandLineArgs, modifyFs, - baselineSourceMap, baselineReadFileCalls, baselinePrograms, baselineDependencies + baselineSourceMap, baselineReadFileCalls, baselinePrograms, baselineDependencies, + environmentVariables } = input; if (modifyFs) modifyFs(inputFs); inputFs.makeReadonly(); const fs = inputFs.shadow(); // Create system - const sys = new fakes.System(fs, { executingFilePath: "/lib/tsc" }) as TscCompileSystem; + const sys = new fakes.System(fs, { executingFilePath: "/lib/tsc", env: environmentVariables }) as TscCompileSystem; if (input.disableUseFileVersionAsSignature) sys.disableUseFileVersionAsSignature = true; fakes.patchHostForBuildInfoReadWrite(sys); const writtenFiles = sys.writtenFiles = new Set(); diff --git a/src/testRunner/unittests/tsc/runWithoutArgs.ts b/src/testRunner/unittests/tsc/runWithoutArgs.ts index ed53a16229490..d09ffec78f93c 100644 --- a/src/testRunner/unittests/tsc/runWithoutArgs.ts +++ b/src/testRunner/unittests/tsc/runWithoutArgs.ts @@ -4,7 +4,15 @@ namespace ts { scenario: "runWithoutArgs", subScenario: "show help with ExitStatus.DiagnosticsPresent_OutputsSkipped", fs: () => loadProjectFromFiles({}), - commandLineArgs: [] + commandLineArgs: [], + environmentVariables: { TS_TEST_TERMINAL_WIDTH: "120" } + }); + + verifyTsc({ + scenario: "runWithoutArgs", + subScenario: "show help with ExitStatus.DiagnosticsPresent_OutputsSkipped when host can't provide terminal width", + fs: () => loadProjectFromFiles({}), + commandLineArgs: [], }); }); } diff --git a/src/webServer/webServer.ts b/src/webServer/webServer.ts index 684bd3181dcf4..fe3d6aa44a45d 100644 --- a/src/webServer/webServer.ts +++ b/src/webServer/webServer.ts @@ -122,7 +122,6 @@ namespace ts.server { const webPath = getWebPath(path); return webPath && host.readFile(webPath); }, - write: host.writeMessage.bind(host), watchFile: returnNoopFileWatcher, watchDirectory: returnNoopFileWatcher, diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index f4efe2ea1a4b2..4289acd54ebc1 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -3981,6 +3981,7 @@ declare namespace ts { useCaseSensitiveFileNames: boolean; write(s: string): void; writeOutputIsTTY?(): boolean; + getWidthOfTerminal?(): number; readFile(path: string, encoding?: string): string | undefined; getFileSize?(path: string): number; writeFile(path: string, data: string, writeByteOrderMark?: boolean): void; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 95b91d2887cde..d3afe0978cf70 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -3981,6 +3981,7 @@ declare namespace ts { useCaseSensitiveFileNames: boolean; write(s: string): void; writeOutputIsTTY?(): boolean; + getWidthOfTerminal?(): number; readFile(path: string, encoding?: string): string | undefined; getFileSize?(path: string): number; writeFile(path: string, data: string, writeByteOrderMark?: boolean): void; diff --git a/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js b/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js new file mode 100644 index 0000000000000..d58956b4597bb --- /dev/null +++ b/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped-when-host-can't-provide-terminal-width.js @@ -0,0 +1,150 @@ +Input:: +//// [/lib/lib.d.ts] + + + + +Output:: +/lib/tsc +Version FakeTSVersion +tsc: The TypeScript Compiler - Version FakeTSVersion + +COMMON COMMANDS + + tsc + Compiles the current project (tsconfig.json in the working directory.) + + tsc app.ts util.ts + Ignoring tsconfig.json, compiles the specified files with default compiler options + + tsc -b + Build a composite project in the working directory. + + tsc --init + Creates a tsconfig.json with the recommended settings in the working directory. + + tsc -p .path/to/tsconfig.json + Compiles the TypeScript project located at the specified path + + tsc --help --all + An expanded version of this information, showing all possible compiler options + + tsc --noEmit + tsc --target esnext + Compiles the current project, with additional settings + +COMMAND LINE FLAGS + +--help, -h +Print this message. + +--watch, -w +Watch input files. + +--all +Show all compiler options. + +--version, -v +Print the compiler's version. + +--init +Initializes a TypeScript project and creates a tsconfig.json file. + +--project, -p +Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'. + +--build, -b +Build one or more projects and their dependencies, if out of date + +--showConfig +Print the final configuration instead of building. + +COMMON COMPILER OPTIONS + +--pretty +Enable color and formatting in output to make compiler errors easier to read +type: boolean +default: true + +--target, -t +Set the JavaScript language version for emitted JavaScript and include compatible library declarations. +one of: es3, es5, es6, es2015, es2016, es2017, es2018, es2019, es2020, es2021, esnext +default: ES3 + +--module, -m +Specify what module code is generated. +one of: none, commonjs, amd, system, umd, es6, es2015, es2020, esnext + +--lib +Specify a set of bundled library declaration files that describe the target runtime environment. +one or more: es5, es6, es2015, es7, es2016, es2017, es2018, es2019, es2020, es2021, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol, es2020.bigint, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2021.promise, es2021.string, es2021.weakref, esnext.array, esnext.symbol, esnext.asynciterable, esnext.intl, esnext.bigint, esnext.string, esnext.promise, esnext.weakref + +--allowJs +Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. +type: boolean +default: false + +--checkJs +Enable error reporting in type-checked JavaScript files. +type: boolean +default: false + +--jsx +Specify what JSX code is generated. +one of: preserve, react-native, react, react-jsx, react-jsxdev +default: undefined + +--declaration, -d +Generate .d.ts files from TypeScript and JavaScript files in your project. +type: boolean +default: `false`, unless `composite` is set + +--declarationMap +Create sourcemaps for d.ts files. +type: boolean +default: false + +--emitDeclarationOnly +Only output d.ts files and not JavaScript files. +type: boolean +default: false + +--sourceMap +Create source map files for emitted JavaScript files. +type: boolean +default: false + +--outFile +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. + +--outDir +Specify an output folder for all emitted files. + +--removeComments +Disable emitting comments. +type: boolean +default: false + +--noEmit +Disable emitting file from a compilation. +type: boolean +default: false + +--strict +Enable all strict type-checking options. +type: boolean +default: false + +--types +Specify type package names to be included without being referenced in a source file. + +--esModuleInterop +Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. +type: boolean +default: false + +You can learn about all of the compiler options at https://aka.ms/tsconfig-reference + +exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped + + diff --git a/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js b/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js index 4e92fe526bd65..d58956b4597bb 100644 --- a/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js +++ b/tests/baselines/reference/tsc/runWithoutArgs/initial-build/show-help-with-ExitStatus.DiagnosticsPresent_OutputsSkipped.js @@ -7,52 +7,144 @@ Input:: Output:: /lib/tsc Version FakeTSVersion -Syntax: tsc [options] [file...] - -Examples: tsc hello.ts - tsc --outFile file.js file.ts - tsc @args.txt - tsc --build tsconfig.json - -Options: - -h, --help Print this message. - -w, --watch Watch input files. - --pretty Enable color and formatting in output to make compiler errors easier to read - --all Show all compiler options. - -v, --version Print the compiler's version. - --init Initializes a TypeScript project and creates a tsconfig.json file. - -p FILE OR DIRECTORY, --project FILE OR DIRECTORY Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'. - -b, --build Build one or more projects and their dependencies, if out of date - -t VERSION, --target VERSION Set the JavaScript language version for emitted JavaScript and include compatible library declarations. - -m KIND, --module KIND Specify what module code is generated. - --lib Specify a set of bundled library declaration files that describe the target runtime environment. - 'es5' 'es6' 'es2015' 'es7' 'es2016' 'es2017' 'es2018' 'es2019' 'es2020' 'es2021' 'esnext' 'dom' 'dom.iterable' 'webworker' 'webworker.importscripts' 'webworker.iterable' 'scripthost' 'es2015.core' 'es2015.collection' 'es2015.generator' 'es2015.iterable' 'es2015.promise' 'es2015.proxy' 'es2015.reflect' 'es2015.symbol' 'es2015.symbol.wellknown' 'es2016.array.include' 'es2017.object' 'es2017.sharedmemory' 'es2017.string' 'es2017.intl' 'es2017.typedarrays' 'es2018.asyncgenerator' 'es2018.asynciterable' 'es2018.intl' 'es2018.promise' 'es2018.regexp' 'es2019.array' 'es2019.object' 'es2019.string' 'es2019.symbol' 'es2020.bigint' 'es2020.promise' 'es2020.sharedmemory' 'es2020.string' 'es2020.symbol.wellknown' 'es2020.intl' 'es2021.promise' 'es2021.string' 'es2021.weakref' 'esnext.array' 'esnext.symbol' 'esnext.asynciterable' 'esnext.intl' 'esnext.bigint' 'esnext.string' 'esnext.promise' 'esnext.weakref' - --allowJs Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. - --jsx KIND Specify what JSX code is generated. - -d, --declaration Generate .d.ts files from TypeScript and JavaScript files in your project. - --declarationMap Create sourcemaps for d.ts files. - --sourceMap Create source map files for emitted JavaScript files. - --outFile FILE 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. - --outDir DIRECTORY Specify an output folder for all emitted files. - --removeComments Disable emitting comments. - --noEmit Disable emitting file from a compilation. - --strict Enable all strict type-checking options. - --noImplicitAny Enable error reporting for expressions and declarations with an implied `any` type.. - --strictNullChecks When type checking, take into account `null` and `undefined`. - --strictFunctionTypes When assigning functions, check to ensure parameters and the return values are subtype-compatible. - --strictBindCallApply Check that the arguments for `bind`, `call`, and `apply` methods match the original function. - --strictPropertyInitialization Check for class properties that are declared but not set in the constructor. - --strictOptionalProperties Enable strict checking of optional properties. - --noImplicitThis Enable error reporting when `this` is given the type `any`. - --useUnknownInCatchVariables Type catch clause variables as 'unknown' instead of 'any'. - --alwaysStrict Ensure 'use strict' is always emitted. - --noUnusedLocals Enable error reporting when a local variables aren't read. - --noUnusedParameters Raise an error when a function parameter isn't read - --noImplicitReturns Enable error reporting for codepaths that do not explicitly return in a function. - --noFallthroughCasesInSwitch Enable error reporting for fallthrough cases in switch statements. - --types Specify type package names to be included without being referenced in a source file. - --esModuleInterop Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. - @ Insert command line options and files from a file. +tsc: The TypeScript Compiler - Version FakeTSVersion + +COMMON COMMANDS + + tsc + Compiles the current project (tsconfig.json in the working directory.) + + tsc app.ts util.ts + Ignoring tsconfig.json, compiles the specified files with default compiler options + + tsc -b + Build a composite project in the working directory. + + tsc --init + Creates a tsconfig.json with the recommended settings in the working directory. + + tsc -p .path/to/tsconfig.json + Compiles the TypeScript project located at the specified path + + tsc --help --all + An expanded version of this information, showing all possible compiler options + + tsc --noEmit + tsc --target esnext + Compiles the current project, with additional settings + +COMMAND LINE FLAGS + +--help, -h +Print this message. + +--watch, -w +Watch input files. + +--all +Show all compiler options. + +--version, -v +Print the compiler's version. + +--init +Initializes a TypeScript project and creates a tsconfig.json file. + +--project, -p +Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'. + +--build, -b +Build one or more projects and their dependencies, if out of date + +--showConfig +Print the final configuration instead of building. + +COMMON COMPILER OPTIONS + +--pretty +Enable color and formatting in output to make compiler errors easier to read +type: boolean +default: true + +--target, -t +Set the JavaScript language version for emitted JavaScript and include compatible library declarations. +one of: es3, es5, es6, es2015, es2016, es2017, es2018, es2019, es2020, es2021, esnext +default: ES3 + +--module, -m +Specify what module code is generated. +one of: none, commonjs, amd, system, umd, es6, es2015, es2020, esnext + +--lib +Specify a set of bundled library declaration files that describe the target runtime environment. +one or more: es5, es6, es2015, es7, es2016, es2017, es2018, es2019, es2020, es2021, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol, es2020.bigint, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2021.promise, es2021.string, es2021.weakref, esnext.array, esnext.symbol, esnext.asynciterable, esnext.intl, esnext.bigint, esnext.string, esnext.promise, esnext.weakref + +--allowJs +Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. +type: boolean +default: false + +--checkJs +Enable error reporting in type-checked JavaScript files. +type: boolean +default: false + +--jsx +Specify what JSX code is generated. +one of: preserve, react-native, react, react-jsx, react-jsxdev +default: undefined + +--declaration, -d +Generate .d.ts files from TypeScript and JavaScript files in your project. +type: boolean +default: `false`, unless `composite` is set + +--declarationMap +Create sourcemaps for d.ts files. +type: boolean +default: false + +--emitDeclarationOnly +Only output d.ts files and not JavaScript files. +type: boolean +default: false + +--sourceMap +Create source map files for emitted JavaScript files. +type: boolean +default: false + +--outFile +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. + +--outDir +Specify an output folder for all emitted files. + +--removeComments +Disable emitting comments. +type: boolean +default: false + +--noEmit +Disable emitting file from a compilation. +type: boolean +default: false + +--strict +Enable all strict type-checking options. +type: boolean +default: false + +--types +Specify type package names to be included without being referenced in a source file. + +--esModuleInterop +Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. +type: boolean +default: false + +You can learn about all of the compiler options at https://aka.ms/tsconfig-reference + exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped