Skip to content

Commit 58854a6

Browse files
authored
Revert old lkg and re lkg (microsoft#33769)
* Revert "Update LKG (microsoft#33710)" This reverts commit 29becf0. * Re-accept LKG with API with breaking typeArguments change removed
1 parent a8bea77 commit 58854a6

11 files changed

+154
-57
lines changed

lib/pt-br/diagnosticMessages.generated.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@
441441
"Function_implementation_is_missing_or_not_immediately_following_the_declaration_2391": "A implementação da função está ausente ou não está imediatamente depois da declaração.",
442442
"Function_implementation_name_must_be_0_2389": "O nome da implementação de função deve ser '{0}'.",
443443
"Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_ref_7024": "A função tem o tipo de retorno 'any', de forma implícita, porque ela não tem uma anotação de tipo de retorno e é referenciada direta ou indiretamente em uma das suas expressões de retorno.",
444-
"Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366": "A função não tem a instrução de retorno final e o tipo de retorno não inclui 'undefined'.",
444+
"Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined_2366": "A função não tem a instrução return final e o tipo de retorno não inclui 'undefined'.",
445445
"Function_overload_must_be_static_2387": "A sobrecarga de função deve ser estática.",
446446
"Function_overload_must_not_be_static_2388": "A sobrecarga de função não deve ser estática.",
447447
"Generate_get_and_set_accessors_95046": "Gerar acessadores 'get' e 'set'",

lib/tsc.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -3752,8 +3752,7 @@ var ts;
37523752
Did_you_mean_to_mark_this_function_as_async: diag(1356, ts.DiagnosticCategory.Error, "Did_you_mean_to_mark_this_function_as_async_1356", "Did you mean to mark this function as 'async'?"),
37533753
An_enum_member_name_must_be_followed_by_a_or: diag(1357, ts.DiagnosticCategory.Error, "An_enum_member_name_must_be_followed_by_a_or_1357", "An enum member name must be followed by a ',', '=', or '}'."),
37543754
Tagged_template_expressions_are_not_permitted_in_an_optional_chain: diag(1358, ts.DiagnosticCategory.Error, "Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358", "Tagged template expressions are not permitted in an optional chain."),
3755-
Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead: diag(1359, ts.DiagnosticCategory.Error, "Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_1359", "Module '{0}' has no default export. Did you mean to use 'import { {1} } from {0}' instead?"),
3756-
Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead: diag(1360, ts.DiagnosticCategory.Error, "Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_1360", "Module '{0}' has no exported member '{1}'. Did you mean to use 'import {1} from {0}' instead?"),
3755+
Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here: diag(1359, ts.DiagnosticCategory.Error, "Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here_1359", "Identifier expected. '{0}' is a reserved word that cannot be used here."),
37573756
The_types_of_0_are_incompatible_between_these_types: diag(2200, ts.DiagnosticCategory.Error, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
37583757
The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, ts.DiagnosticCategory.Error, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
37593758
Call_signature_return_types_0_and_1_are_incompatible: diag(2202, ts.DiagnosticCategory.Error, "Call_signature_return_types_0_and_1_are_incompatible_2202", "Call signature return types '{0}' and '{1}' are incompatible.", undefined, true),
@@ -4054,6 +4053,8 @@ var ts;
40544053
Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_property: diag(2610, ts.DiagnosticCategory.Error, "Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_proper_2610", "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member property."),
40554054
Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_accessor: diag(2611, ts.DiagnosticCategory.Error, "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_access_2611", "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member accessor."),
40564055
Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration: diag(2612, ts.DiagnosticCategory.Error, "Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_2612", "Property '{0}' will overwrite the base property in '{1}'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration."),
4056+
Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead: diag(2613, ts.DiagnosticCategory.Error, "Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613", "Module '{0}' has no default export. Did you mean to use 'import { {1} } from {0}' instead?"),
4057+
Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead: diag(2614, ts.DiagnosticCategory.Error, "Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614", "Module '{0}' has no exported member '{1}'. Did you mean to use 'import {1} from {0}' instead?"),
40574058
Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity: diag(2649, ts.DiagnosticCategory.Error, "Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649", "Cannot augment module '{0}' with value exports because it resolves to a non-module entity."),
40584059
A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums: diag(2651, ts.DiagnosticCategory.Error, "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651", "A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums."),
40594060
Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead: diag(2652, ts.DiagnosticCategory.Error, "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652", "Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead."),
@@ -8385,7 +8386,7 @@ var ts;
83858386
ts.idText(expr.expression.expression) === "Object" &&
83868387
ts.idText(expr.expression.name) === "defineProperty" &&
83878388
isStringOrNumericLiteralLike(expr.arguments[1]) &&
8388-
isBindableStaticNameExpression(expr.arguments[0]);
8389+
isBindableStaticNameExpression(expr.arguments[0], true);
83898390
}
83908391
ts.isBindableObjectDefinePropertyCall = isBindableObjectDefinePropertyCall;
83918392
function isBindableStaticElementAccessExpression(node, excludeThisKeyword) {
@@ -15116,7 +15117,12 @@ var ts;
1511615117
return finishNode(node);
1511715118
}
1511815119
var reportAtCurrentPosition = token() === 1;
15119-
return createMissingNode(75, reportAtCurrentPosition, diagnosticMessage || ts.Diagnostics.Identifier_expected);
15120+
var isReservedWord = scanner.isReservedWord();
15121+
var msgArg = scanner.getTokenText();
15122+
var defaultMessage = isReservedWord ?
15123+
ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here :
15124+
ts.Diagnostics.Identifier_expected;
15125+
return createMissingNode(75, reportAtCurrentPosition, diagnosticMessage || defaultMessage, msgArg);
1512015126
}
1512115127
function parseIdentifier(diagnosticMessage) {
1512215128
return createIdentifier(isIdentifier(), diagnosticMessage);

lib/tsserver.js

+23-4
Original file line numberDiff line numberDiff line change
@@ -5910,8 +5910,7 @@ var ts;
59105910
Did_you_mean_to_mark_this_function_as_async: diag(1356, ts.DiagnosticCategory.Error, "Did_you_mean_to_mark_this_function_as_async_1356", "Did you mean to mark this function as 'async'?"),
59115911
An_enum_member_name_must_be_followed_by_a_or: diag(1357, ts.DiagnosticCategory.Error, "An_enum_member_name_must_be_followed_by_a_or_1357", "An enum member name must be followed by a ',', '=', or '}'."),
59125912
Tagged_template_expressions_are_not_permitted_in_an_optional_chain: diag(1358, ts.DiagnosticCategory.Error, "Tagged_template_expressions_are_not_permitted_in_an_optional_chain_1358", "Tagged template expressions are not permitted in an optional chain."),
5913-
Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead: diag(1359, ts.DiagnosticCategory.Error, "Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_1359", "Module '{0}' has no default export. Did you mean to use 'import { {1} } from {0}' instead?"),
5914-
Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead: diag(1360, ts.DiagnosticCategory.Error, "Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_1360", "Module '{0}' has no exported member '{1}'. Did you mean to use 'import {1} from {0}' instead?"),
5913+
Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here: diag(1359, ts.DiagnosticCategory.Error, "Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here_1359", "Identifier expected. '{0}' is a reserved word that cannot be used here."),
59155914
The_types_of_0_are_incompatible_between_these_types: diag(2200, ts.DiagnosticCategory.Error, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
59165915
The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, ts.DiagnosticCategory.Error, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
59175916
Call_signature_return_types_0_and_1_are_incompatible: diag(2202, ts.DiagnosticCategory.Error, "Call_signature_return_types_0_and_1_are_incompatible_2202", "Call signature return types '{0}' and '{1}' are incompatible.", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ true),
@@ -6212,6 +6211,8 @@ var ts;
62126211
Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_property: diag(2610, ts.DiagnosticCategory.Error, "Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_proper_2610", "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member property."),
62136212
Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_accessor: diag(2611, ts.DiagnosticCategory.Error, "Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_access_2611", "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member accessor."),
62146213
Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration: diag(2612, ts.DiagnosticCategory.Error, "Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_2612", "Property '{0}' will overwrite the base property in '{1}'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration."),
6214+
Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead: diag(2613, ts.DiagnosticCategory.Error, "Module_0_has_no_default_export_Did_you_mean_to_use_import_1_from_0_instead_2613", "Module '{0}' has no default export. Did you mean to use 'import { {1} } from {0}' instead?"),
6215+
Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead: diag(2614, ts.DiagnosticCategory.Error, "Module_0_has_no_exported_member_1_Did_you_mean_to_use_import_1_from_0_instead_2614", "Module '{0}' has no exported member '{1}'. Did you mean to use 'import {1} from {0}' instead?"),
62156216
Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity: diag(2649, ts.DiagnosticCategory.Error, "Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649", "Cannot augment module '{0}' with value exports because it resolves to a non-module entity."),
62166217
A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums: diag(2651, ts.DiagnosticCategory.Error, "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651", "A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums."),
62176218
Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead: diag(2652, ts.DiagnosticCategory.Error, "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652", "Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead."),
@@ -10969,7 +10970,7 @@ var ts;
1096910970
ts.idText(expr.expression.expression) === "Object" &&
1097010971
ts.idText(expr.expression.name) === "defineProperty" &&
1097110972
isStringOrNumericLiteralLike(expr.arguments[1]) &&
10972-
isBindableStaticNameExpression(expr.arguments[0]);
10973+
isBindableStaticNameExpression(expr.arguments[0], /*excludeThisKeyword*/ true);
1097310974
}
1097410975
ts.isBindableObjectDefinePropertyCall = isBindableObjectDefinePropertyCall;
1097510976
function isBindableStaticElementAccessExpression(node, excludeThisKeyword) {
@@ -18745,7 +18746,12 @@ var ts;
1874518746
}
1874618747
// Only for end of file because the error gets reported incorrectly on embedded script tags.
1874718748
var reportAtCurrentPosition = token() === 1 /* EndOfFileToken */;
18748-
return createMissingNode(75 /* Identifier */, reportAtCurrentPosition, diagnosticMessage || ts.Diagnostics.Identifier_expected);
18749+
var isReservedWord = scanner.isReservedWord();
18750+
var msgArg = scanner.getTokenText();
18751+
var defaultMessage = isReservedWord ?
18752+
ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here :
18753+
ts.Diagnostics.Identifier_expected;
18754+
return createMissingNode(75 /* Identifier */, reportAtCurrentPosition, diagnosticMessage || defaultMessage, msgArg);
1874918755
}
1875018756
function parseIdentifier(diagnosticMessage) {
1875118757
return createIdentifier(isIdentifier(), diagnosticMessage);
@@ -129633,6 +129639,19 @@ var ts;
129633129639
TypeObject.prototype.isClass = function () {
129634129640
return !!(ts.getObjectFlags(this) & 1 /* Class */);
129635129641
};
129642+
Object.defineProperty(TypeObject.prototype, "typeArguments", {
129643+
/**
129644+
* This polyfills `referenceType.typeArguments` for API consumers
129645+
*/
129646+
get: function () {
129647+
if (ts.getObjectFlags(this) & 4 /* Reference */) {
129648+
return this.checker.getTypeArguments(this);
129649+
}
129650+
return undefined;
129651+
},
129652+
enumerable: true,
129653+
configurable: true
129654+
});
129636129655
return TypeObject;
129637129656
}());
129638129657
var SignatureObject = /** @class */ (function () {

lib/tsserverlibrary.d.ts

+3
Original file line numberDiff line numberDiff line change
@@ -4902,6 +4902,9 @@ declare namespace ts {
49024902
isClassOrInterface(): this is InterfaceType;
49034903
isClass(): this is InterfaceType;
49044904
}
4905+
interface TypeReference {
4906+
typeArguments?: readonly Type[];
4907+
}
49054908
interface Signature {
49064909
getDeclaration(): SignatureDeclaration;
49074910
getTypeParameters(): TypeParameter[] | undefined;

0 commit comments

Comments
 (0)