Skip to content

Commit

Permalink
Merge branch 'main' into only-suggest-param-codefixes-in-ts
Browse files Browse the repository at this point in the history
  • Loading branch information
sandersn committed Feb 18, 2022
2 parents 4056b38 + b0b8cda commit 4fb10f1
Show file tree
Hide file tree
Showing 52 changed files with 554 additions and 208 deletions.
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25081,7 +25081,7 @@ namespace ts {
const substituteConstraints = !(checkMode && checkMode & CheckMode.Inferential) &&
someType(type, isGenericTypeWithUnionConstraint) &&
(isConstraintPosition(type, reference) || hasContextualTypeWithNoGenericTypes(reference, checkMode));
return substituteConstraints ? mapType(type, t => t.flags & TypeFlags.Instantiable && !isMappedTypeGenericIndexedAccess(t) ? getBaseConstraintOrType(t) : t) : type;
return substituteConstraints ? mapType(type, t => t.flags & TypeFlags.Instantiable ? getBaseConstraintOrType(t) : t) : type;
}

function isExportOrExportExpression(location: Node) {
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/commandLineParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2498,7 +2498,7 @@ namespace ts {
const result: string[] = [];
result.push(`{`);
result.push(`${tab}"compilerOptions": {`);
result.push(`${tab}${tab}/* ${getLocaleSpecificMessage(Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_json_to_read_more_about_this_file)} */`);
result.push(`${tab}${tab}/* ${getLocaleSpecificMessage(Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file)} */`);
result.push("");
// Print out each row, aligning all the descriptions on the same column.
for (const entry of entries) {
Expand Down
3 changes: 1 addition & 2 deletions src/compiler/diagnosticMessages.json
Original file line number Diff line number Diff line change
Expand Up @@ -5852,7 +5852,6 @@
"code": 6930
},


"Variable '{0}' implicitly has an '{1}' type.": {
"category": "Error",
"code": 7005
Expand Down Expand Up @@ -6911,7 +6910,7 @@
"category": "Message",
"code": 95109
},
"Visit https://aka.ms/tsconfig.json to read more about this file": {
"Visit https://aka.ms/tsconfig to read more about this file": {
"category": "Message",
"code": 95110
},
Expand Down
6 changes: 3 additions & 3 deletions src/executeCommandLine/executeCommandLine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ namespace ts {
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"))
...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/tsc"))
];

for (const line of output) {
Expand All @@ -414,7 +414,7 @@ namespace ts {

function printAllHelp(sys: System, compilerOptions: readonly CommandLineOption[], buildOptions: readonly CommandLineOption[], watchOptions: readonly CommandLineOption[]) {
let output: string[] = [...getHeader(sys,`${getDiagnosticText(Diagnostics.tsc_Colon_The_TypeScript_Compiler)} - ${getDiagnosticText(Diagnostics.Version_0, version)}`)];
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.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/tsc"))];
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) {
Expand Down Expand Up @@ -1061,7 +1061,7 @@ namespace ts {
sys.writeFile(file, generateTSConfig(options, fileNames, sys.newLine));
const output: string[] = [sys.newLine, ...getHeader(sys,"Created a new tsconfig.json with:")];
output.push(getCompilerOptionsDiffValue(options, sys.newLine) + sys.newLine + sys.newLine);
output.push(`You can learn more at https://aka.ms/tsconfig.json` + sys.newLine);
output.push(`You can learn more at https://aka.ms/tsconfig` + sys.newLine);
for (const line of output) {
sys.write(line);
}
Expand Down
6 changes: 3 additions & 3 deletions src/lib/es2015.core.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ interface ObjectConstructor {
* @param target The target object to copy to.
* @param source The source object from which to copy properties.
*/
assign<T, U>(target: T, source: U): T & U;
assign<T extends {}, U>(target: T, source: U): T & U;

/**
* Copy the values of all of the enumerable own properties from one or more source objects to a
Expand All @@ -272,7 +272,7 @@ interface ObjectConstructor {
* @param source1 The first source object from which to copy properties.
* @param source2 The second source object from which to copy properties.
*/
assign<T, U, V>(target: T, source1: U, source2: V): T & U & V;
assign<T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;

/**
* Copy the values of all of the enumerable own properties from one or more source objects to a
Expand All @@ -282,7 +282,7 @@ interface ObjectConstructor {
* @param source2 The second source object from which to copy properties.
* @param source3 The third source object from which to copy properties.
*/
assign<T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
assign<T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;

/**
* Copy the values of all of the enumerable own properties from one or more source objects to a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -546,15 +546,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list_1384" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A 'new' expression with type arguments must always be followed by a parenthesized argument list.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[具有类型参数的 "new" 表达式的后面必须始终是带括号的参数列表。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_non_dry_build_would_build_project_0_6357" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A non-dry build would build project '{0}']]></Val>
Expand Down Expand Up @@ -13806,6 +13797,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' has no signatures for which the type argument list is applicable.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[类型“{0}”没有类型参数列表适用的签名。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is missing the following properties from type '{1}': {2}]]></Val>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,15 +555,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list_1384" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A 'new' expression with type arguments must always be followed by a parenthesized argument list.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Za výrazem new s argumenty typů musí vždy následovat seznam argumentů v závorkách.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_non_dry_build_would_build_project_0_6357" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A non-dry build would build project '{0}']]></Val>
Expand Down Expand Up @@ -4569,6 +4560,24 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Decorator_function_return_type_0_is_not_assignable_to_type_1_1270" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Decorator function return type '{0}' is not assignable to type '{1}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Návratový typ funkce dekoratéru {0} se nedá přiřadit k typu {1}.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Decorator function return type is '{0}' but is expected to be 'void' or 'any'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Návratový typ funkce dekoratéru je {0}, ale očekává se, že bude void nebo any.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Decorators_are_not_valid_here_1206" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Decorators are not valid here.]]></Val>
Expand Down Expand Up @@ -11034,6 +11043,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Resolution_modes_are_only_supported_when_moduleResolution_is_node12_or_nodenext_1452" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Resolution modes are only supported when `moduleResolution` is `node12` or `nodenext`.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Režimy řešení se podporují pouze v případě, že moduleResolution je node12 nebo nodenext.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols_6195" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Resolve 'keyof' to string valued property names only (no numbers or symbols).]]></Val>
Expand Down Expand Up @@ -13788,6 +13806,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' has no signatures for which the type argument list is applicable.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[U typu {0} nejsou žádné podpisy, pro které platí seznam argumentů obecného typu.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is missing the following properties from type '{1}': {2}]]></Val>
Expand Down Expand Up @@ -16335,6 +16362,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";resolution_mode_should_be_either_require_or_import_1453" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[`resolution-mode` should be either `require` or `import`.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[resolution-mode by měl být buď require, nebo import.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA['rootDirs' option is set, using it to resolve relative module name '{0}'.]]></Val>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,15 +555,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list_1384" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A 'new' expression with type arguments must always be followed by a parenthesized argument list.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Una expresión "new" con argumentos de tipo siempre debe ir seguida de una lista de argumentos entre paréntesis.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_non_dry_build_would_build_project_0_6357" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A non-dry build would build project '{0}']]></Val>
Expand Down Expand Up @@ -4572,6 +4563,24 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Decorator_function_return_type_0_is_not_assignable_to_type_1_1270" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Decorator function return type '{0}' is not assignable to type '{1}'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[El tipo de valor devuelto de la función Decorator "{0}" no se puede asignar al tipo "{1}".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Decorator function return type is '{0}' but is expected to be 'void' or 'any'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[El tipo de valor devuelto de la función Decorator es "{0}" pero se espera que sea "void" o "any".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Decorators_are_not_valid_here_1206" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Decorators are not valid here.]]></Val>
Expand Down Expand Up @@ -11037,6 +11046,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Resolution_modes_are_only_supported_when_moduleResolution_is_node12_or_nodenext_1452" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Resolution modes are only supported when `moduleResolution` is `node12` or `nodenext`.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Los modos de resolución solo se admiten cuando "moduleResolution" es "node12" o "nodenext".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols_6195" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Resolve 'keyof' to string valued property names only (no numbers or symbols).]]></Val>
Expand Down Expand Up @@ -13791,6 +13809,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' has no signatures for which the type argument list is applicable.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[El tipo "{0}" no tiene firmas para las que sea aplicable la lista de argumentos de tipo.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is missing the following properties from type '{1}': {2}]]></Val>
Expand Down Expand Up @@ -16338,6 +16365,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";resolution_mode_should_be_either_require_or_import_1453" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[`resolution-mode` should be either `require` or `import`.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA["modo de resolución" debe ser "requerir" o "importar".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA['rootDirs' option is set, using it to resolve relative module name '{0}'.]]></Val>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,15 +555,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list_1384" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A 'new' expression with type arguments must always be followed by a parenthesized argument list.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Une expression 'new' avec des arguments de type doit toujours être suivie d'une liste d'arguments entre parenthèses.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_non_dry_build_would_build_project_0_6357" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A non-dry build would build project '{0}']]></Val>
Expand Down Expand Up @@ -13818,6 +13809,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' has no signatures for which the type argument list is applicable.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Le type '{0}' n’a aucune signature pour laquelle la liste d’arguments de type est applicable.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Type '{0}' is missing the following properties from type '{1}': {2}]]></Val>
Expand Down
Loading

0 comments on commit 4fb10f1

Please sign in to comment.