typescript 5.5.0-dev.20240312 → 5.5.0-dev.20240314

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tsserver.js CHANGED
@@ -1760,6 +1760,7 @@ __export(server_exports, {
1760
1760
  isSuperProperty: () => isSuperProperty,
1761
1761
  isSupportedSourceFileName: () => isSupportedSourceFileName,
1762
1762
  isSwitchStatement: () => isSwitchStatement,
1763
+ isSyntacticallyString: () => isSyntacticallyString,
1763
1764
  isSyntaxList: () => isSyntaxList,
1764
1765
  isSyntheticExpression: () => isSyntheticExpression,
1765
1766
  isSyntheticReference: () => isSyntheticReference,
@@ -2326,7 +2327,7 @@ module.exports = __toCommonJS(server_exports);
2326
2327
 
2327
2328
  // src/compiler/corePublic.ts
2328
2329
  var versionMajorMinor = "5.5";
2329
- var version = `${versionMajorMinor}.0-dev.20240312`;
2330
+ var version = `${versionMajorMinor}.0-dev.20240314`;
2330
2331
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2331
2332
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2332
2333
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -3633,7 +3634,7 @@ var createUIStringComparer = /* @__PURE__ */ (() => {
3633
3634
  return value < 0 ? -1 /* LessThan */ : value > 0 ? 1 /* GreaterThan */ : 0 /* EqualTo */;
3634
3635
  }
3635
3636
  function createIntlCollatorStringComparer(locale) {
3636
- const comparer = new Intl.Collator(locale, { usage: "sort", sensitivity: "variant" }).compare;
3637
+ const comparer = new Intl.Collator(locale, { usage: "sort", sensitivity: "variant", numeric: true }).compare;
3637
3638
  return (a, b) => compareWithCallback(a, b, comparer);
3638
3639
  }
3639
3640
  })();
@@ -9675,6 +9676,8 @@ var Diagnostics = {
9675
9676
  The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration: diag(1494, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration_1494", "The left-hand side of a 'for...in' statement cannot be an 'await using' declaration."),
9676
9677
  _0_modifier_cannot_appear_on_an_await_using_declaration: diag(1495, 1 /* Error */, "_0_modifier_cannot_appear_on_an_await_using_declaration_1495", "'{0}' modifier cannot appear on an 'await using' declaration."),
9677
9678
  Identifier_string_literal_or_number_literal_expected: diag(1496, 1 /* Error */, "Identifier_string_literal_or_number_literal_expected_1496", "Identifier, string literal, or number literal expected."),
9679
+ Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator: diag(1497, 1 /* Error */, "Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator_1497", "Expression must be enclosed in parentheses to be used as a decorator."),
9680
+ Invalid_syntax_in_decorator: diag(1498, 1 /* Error */, "Invalid_syntax_in_decorator_1498", "Invalid syntax in decorator."),
9678
9681
  The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
9679
9682
  The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
9680
9683
  Call_signature_return_types_0_and_1_are_incompatible: diag(
@@ -9921,7 +9924,7 @@ var Diagnostics = {
9921
9924
  Overload_signatures_must_all_be_abstract_or_non_abstract: diag(2512, 1 /* Error */, "Overload_signatures_must_all_be_abstract_or_non_abstract_2512", "Overload signatures must all be abstract or non-abstract."),
9922
9925
  Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression: diag(2513, 1 /* Error */, "Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513", "Abstract method '{0}' in class '{1}' cannot be accessed via super expression."),
9923
9926
  A_tuple_type_cannot_be_indexed_with_a_negative_value: diag(2514, 1 /* Error */, "A_tuple_type_cannot_be_indexed_with_a_negative_value_2514", "A tuple type cannot be indexed with a negative value."),
9924
- Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2: diag(2515, 1 /* Error */, "Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515", "Non-abstract class '{0}' does not implement inherited abstract member '{1}' from class '{2}'."),
9927
+ Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2: diag(2515, 1 /* Error */, "Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515", "Non-abstract class '{0}' does not implement inherited abstract member {1} from class '{2}'."),
9925
9928
  All_declarations_of_an_abstract_method_must_be_consecutive: diag(2516, 1 /* Error */, "All_declarations_of_an_abstract_method_must_be_consecutive_2516", "All declarations of an abstract method must be consecutive."),
9926
9929
  Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type: diag(2517, 1 /* Error */, "Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517", "Cannot assign an abstract constructor type to a non-abstract constructor type."),
9927
9930
  A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard: diag(2518, 1 /* Error */, "A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518", "A 'this'-based type guard is not compatible with a parameter-based type guard."),
@@ -10031,9 +10034,13 @@ var Diagnostics = {
10031
10034
  Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operator: diag(2638, 1 /* Error */, "Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operato_2638", "Type '{0}' may represent a primitive value, which is not permitted as the right operand of the 'in' operator."),
10032
10035
  React_components_cannot_include_JSX_namespace_names: diag(2639, 1 /* Error */, "React_components_cannot_include_JSX_namespace_names_2639", "React components cannot include JSX namespace names"),
10033
10036
  Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity: diag(2649, 1 /* 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."),
10037
+ Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_and_2_more: diag(2650, 1 /* Error */, "Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_and__2650", "Non-abstract class expression is missing implementations for the following members of '{0}': {1} and {2} more."),
10034
10038
  A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums: diag(2651, 1 /* 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."),
10035
10039
  Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead: diag(2652, 1 /* 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."),
10036
10040
  Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1: diag(2653, 1 /* Error */, "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653", "Non-abstract class expression does not implement inherited abstract member '{0}' from class '{1}'."),
10041
+ Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2: diag(2654, 1 /* Error */, "Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_2654", "Non-abstract class '{0}' is missing implementations for the following members of '{1}': {2}."),
10042
+ Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_and_3_more: diag(2655, 1 /* Error */, "Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_and_3_more_2655", "Non-abstract class '{0}' is missing implementations for the following members of '{1}': {2} and {3} more."),
10043
+ Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1: diag(2656, 1 /* Error */, "Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_2656", "Non-abstract class expression is missing implementations for the following members of '{0}': {1}."),
10037
10044
  JSX_expressions_must_have_one_parent_element: diag(2657, 1 /* Error */, "JSX_expressions_must_have_one_parent_element_2657", "JSX expressions must have one parent element."),
10038
10045
  Type_0_provides_no_match_for_the_signature_1: diag(2658, 1 /* Error */, "Type_0_provides_no_match_for_the_signature_1_2658", "Type '{0}' provides no match for the signature '{1}'."),
10039
10046
  super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher: diag(2659, 1 /* Error */, "super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659", "'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher."),
@@ -11322,6 +11329,8 @@ var Diagnostics = {
11322
11329
  Add_optional_parameter_to_0: diag(95191, 3 /* Message */, "Add_optional_parameter_to_0_95191", "Add optional parameter to '{0}'"),
11323
11330
  Add_optional_parameters_to_0: diag(95192, 3 /* Message */, "Add_optional_parameters_to_0_95192", "Add optional parameters to '{0}'"),
11324
11331
  Add_all_optional_parameters: diag(95193, 3 /* Message */, "Add_all_optional_parameters_95193", "Add all optional parameters"),
11332
+ Wrap_in_parentheses: diag(95194, 3 /* Message */, "Wrap_in_parentheses_95194", "Wrap in parentheses"),
11333
+ Wrap_all_invalid_decorator_expressions_in_parentheses: diag(95195, 3 /* Message */, "Wrap_all_invalid_decorator_expressions_in_parentheses_95195", "Wrap all invalid decorator expressions in parentheses"),
11325
11334
  No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, 1 /* Error */, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),
11326
11335
  Classes_may_not_have_a_field_named_constructor: diag(18006, 1 /* Error */, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."),
11327
11336
  JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, 1 /* Error */, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"),
@@ -11362,7 +11371,6 @@ var Diagnostics = {
11362
11371
  _0_is_possibly_null_or_undefined: diag(18049, 1 /* Error */, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."),
11363
11372
  The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."),
11364
11373
  Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string."),
11365
- Non_abstract_class_0_does_not_implement_all_abstract_members_of_1: diag(18052, 1 /* Error */, "Non_abstract_class_0_does_not_implement_all_abstract_members_of_1_18052", "Non-abstract class '{0}' does not implement all abstract members of '{1}'"),
11366
11374
  Its_type_0_is_not_a_valid_JSX_element_type: diag(18053, 1 /* Error */, "Its_type_0_is_not_a_valid_JSX_element_type_18053", "Its type '{0}' is not a valid JSX element type."),
11367
11375
  await_using_statements_cannot_be_used_inside_a_class_static_block: diag(18054, 1 /* Error */, "await_using_statements_cannot_be_used_inside_a_class_static_block_18054", "'await using' statements cannot be used inside a class static block.")
11368
11376
  };
@@ -21830,7 +21838,7 @@ function hasTabstop(node) {
21830
21838
  }
21831
21839
  function isJSDocOptionalParameter(node) {
21832
21840
  return isInJSFile(node) && // node.type should only be a JSDocOptionalType when node is a parameter of a JSDocFunctionType
21833
- (node.type && node.type.kind === 316 /* JSDocOptionalType */ || getJSDocParameterTags(node).some(({ isBracketed, typeExpression }) => isBracketed || !!typeExpression && typeExpression.type.kind === 316 /* JSDocOptionalType */));
21841
+ (node.type && node.type.kind === 316 /* JSDocOptionalType */ || getJSDocParameterTags(node).some(isOptionalJSDocPropertyLikeTag));
21834
21842
  }
21835
21843
  function isOptionalDeclaration(declaration) {
21836
21844
  switch (declaration.kind) {
@@ -21907,6 +21915,20 @@ function replaceFirstStar(s, replacement) {
21907
21915
  function getNameFromImportAttribute(node) {
21908
21916
  return isIdentifier(node.name) ? node.name.escapedText : escapeLeadingUnderscores(node.name.text);
21909
21917
  }
21918
+ function isSyntacticallyString(expr) {
21919
+ expr = skipOuterExpressions(expr);
21920
+ switch (expr.kind) {
21921
+ case 226 /* BinaryExpression */:
21922
+ const left = expr.left;
21923
+ const right = expr.right;
21924
+ return expr.operatorToken.kind === 40 /* PlusToken */ && (isSyntacticallyString(left) || isSyntacticallyString(right));
21925
+ case 228 /* TemplateExpression */:
21926
+ case 11 /* StringLiteral */:
21927
+ case 15 /* NoSubstitutionTemplateLiteral */:
21928
+ return true;
21929
+ }
21930
+ return false;
21931
+ }
21910
21932
 
21911
21933
  // src/compiler/factory/baseNodeFactory.ts
21912
21934
  function createBaseNodeFactory() {
@@ -60108,10 +60130,16 @@ function createTypeChecker(host) {
60108
60130
  const symbol = getSymbol2(globals, '"' + moduleName + '"', 512 /* ValueModule */);
60109
60131
  return symbol && withAugmentations ? getMergedSymbol(symbol) : symbol;
60110
60132
  }
60133
+ function hasEffectiveQuestionToken(node) {
60134
+ return hasQuestionToken(node) || isOptionalJSDocPropertyLikeTag(node) || isParameter(node) && isJSDocOptionalParameter(node);
60135
+ }
60111
60136
  function isOptionalParameter(node) {
60112
- if (hasQuestionToken(node) || isOptionalJSDocPropertyLikeTag(node) || isJSDocOptionalParameter(node)) {
60137
+ if (hasEffectiveQuestionToken(node)) {
60113
60138
  return true;
60114
60139
  }
60140
+ if (!isParameter(node)) {
60141
+ return false;
60142
+ }
60115
60143
  if (node.initializer) {
60116
60144
  const signature = getSignatureFromDeclaration(node.parent);
60117
60145
  const parameterIndex = node.parent.parameters.indexOf(node);
@@ -60211,7 +60239,7 @@ function createTypeChecker(host) {
60211
60239
  if (type && type.kind === 201 /* LiteralType */) {
60212
60240
  flags |= 2 /* HasLiteralTypes */;
60213
60241
  }
60214
- const isOptionalParameter2 = isOptionalJSDocPropertyLikeTag(param) || param.initializer || param.questionToken || isRestParameter(param) || iife && parameters.length > iife.arguments.length && !type || isJSDocOptionalParameter(param);
60242
+ const isOptionalParameter2 = hasEffectiveQuestionToken(param) || isParameter(param) && param.initializer || isRestParameter(param) || iife && parameters.length > iife.arguments.length && !type;
60215
60243
  if (!isOptionalParameter2) {
60216
60244
  minArgumentCount = parameters.length;
60217
60245
  }
@@ -62334,7 +62362,7 @@ function createTypeChecker(host) {
62334
62362
  const typeVarIndex = typeSet[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
62335
62363
  const typeVariable = typeSet[typeVarIndex];
62336
62364
  const primitiveType = typeSet[1 - typeVarIndex];
62337
- if (typeVariable.flags & 8650752 /* TypeVariable */ && (primitiveType.flags & (402784252 /* Primitive */ | 67108864 /* NonPrimitive */) || includes & 16777216 /* IncludesEmptyObject */)) {
62365
+ if (typeVariable.flags & 8650752 /* TypeVariable */ && (primitiveType.flags & (402784252 /* Primitive */ | 67108864 /* NonPrimitive */) && !isGenericStringLikeType(primitiveType) || includes & 16777216 /* IncludesEmptyObject */)) {
62338
62366
  const constraint = getBaseConstraintOfType(typeVariable);
62339
62367
  if (constraint && everyType(constraint, (t) => !!(t.flags & (402784252 /* Primitive */ | 67108864 /* NonPrimitive */)) || isEmptyAnonymousObjectType(t))) {
62340
62368
  if (isTypeStrictSubtypeOf(constraint, primitiveType)) {
@@ -62939,6 +62967,9 @@ function createTypeChecker(host) {
62939
62967
  function isPatternLiteralType(type) {
62940
62968
  return !!(type.flags & 134217728 /* TemplateLiteral */) && every(type.types, isPatternLiteralPlaceholderType) || !!(type.flags & 268435456 /* StringMapping */) && isPatternLiteralPlaceholderType(type.type);
62941
62969
  }
62970
+ function isGenericStringLikeType(type) {
62971
+ return !!(type.flags & (134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */)) && !isPatternLiteralType(type);
62972
+ }
62942
62973
  function isGenericType(type) {
62943
62974
  return !!getGenericObjectFlags(type);
62944
62975
  }
@@ -62961,7 +62992,7 @@ function createTypeChecker(host) {
62961
62992
  }
62962
62993
  return type.objectFlags & 12582912 /* IsGenericType */;
62963
62994
  }
62964
- return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 8388608 /* IsGenericIndexType */ : 0);
62995
+ return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ? 4194304 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */) || isGenericStringLikeType(type) ? 8388608 /* IsGenericIndexType */ : 0);
62965
62996
  }
62966
62997
  function getSimplifiedType(type, writing) {
62967
62998
  return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type;
@@ -76899,7 +76930,7 @@ function createTypeChecker(host) {
76899
76930
  }
76900
76931
  return resolveErrorCall(node);
76901
76932
  }
76902
- if (checkMode & 8 /* SkipGenericFunctions */ && !node.typeArguments && callSignatures.some(isGenericFunctionReturningFunctionOrConstructor)) {
76933
+ if (checkMode & 8 /* SkipGenericFunctions */ && !node.typeArguments && callSignatures.some(isGenericFunctionReturningFunction)) {
76903
76934
  skippedGenericFunction(node, checkMode);
76904
76935
  return resolvingSignature;
76905
76936
  }
@@ -76909,12 +76940,8 @@ function createTypeChecker(host) {
76909
76940
  }
76910
76941
  return resolveCall(node, callSignatures, candidatesOutArray, checkMode, callChainFlags);
76911
76942
  }
76912
- function isGenericFunctionReturningFunctionOrConstructor(signature) {
76913
- if (!signature.typeParameters) {
76914
- return false;
76915
- }
76916
- const returnType = getReturnTypeOfSignature(signature);
76917
- return isFunctionType(returnType) || isConstructorType(returnType);
76943
+ function isGenericFunctionReturningFunction(signature) {
76944
+ return !!(signature.typeParameters && isFunctionType(getReturnTypeOfSignature(signature)));
76918
76945
  }
76919
76946
  function isUntypedFunctionCall(funcType, apparentFuncType, numCallSignatures, numConstructSignatures) {
76920
76947
  return isTypeAny(funcType) || isTypeAny(apparentFuncType) && !!(funcType.flags & 262144 /* TypeParameter */) || !numCallSignatures && !numConstructSignatures && !(apparentFuncType.flags & 1048576 /* Union */) && !(getReducedType(apparentFuncType).flags & 131072 /* Never */) && isTypeAssignableTo(funcType, globalFunctionType);
@@ -82092,7 +82119,56 @@ function createTypeChecker(host) {
82092
82119
  }
82093
82120
  }
82094
82121
  }
82122
+ function checkGrammarDecorator(decorator) {
82123
+ const sourceFile = getSourceFileOfNode(decorator);
82124
+ if (!hasParseDiagnostics(sourceFile)) {
82125
+ let node = decorator.expression;
82126
+ if (isParenthesizedExpression(node)) {
82127
+ return false;
82128
+ }
82129
+ let canHaveCallExpression = true;
82130
+ let errorNode;
82131
+ while (true) {
82132
+ if (isExpressionWithTypeArguments(node) || isNonNullExpression(node)) {
82133
+ node = node.expression;
82134
+ continue;
82135
+ }
82136
+ if (isCallExpression(node)) {
82137
+ if (!canHaveCallExpression) {
82138
+ errorNode = node;
82139
+ }
82140
+ if (node.questionDotToken) {
82141
+ errorNode = node.questionDotToken;
82142
+ }
82143
+ node = node.expression;
82144
+ canHaveCallExpression = false;
82145
+ continue;
82146
+ }
82147
+ if (isPropertyAccessExpression(node)) {
82148
+ if (node.questionDotToken) {
82149
+ errorNode = node.questionDotToken;
82150
+ }
82151
+ node = node.expression;
82152
+ canHaveCallExpression = false;
82153
+ continue;
82154
+ }
82155
+ if (!isIdentifier(node)) {
82156
+ errorNode = node;
82157
+ }
82158
+ break;
82159
+ }
82160
+ if (errorNode) {
82161
+ addRelatedInfo(
82162
+ error2(decorator.expression, Diagnostics.Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator),
82163
+ createDiagnosticForNode(errorNode, Diagnostics.Invalid_syntax_in_decorator)
82164
+ );
82165
+ return true;
82166
+ }
82167
+ }
82168
+ return false;
82169
+ }
82095
82170
  function checkDecorator(node) {
82171
+ checkGrammarDecorator(node);
82096
82172
  const signature = getResolvedSignature(node);
82097
82173
  checkDeprecatedSignature(signature, node);
82098
82174
  const returnType = getReturnTypeOfSignature(signature);
@@ -84788,9 +84864,9 @@ function createTypeChecker(host) {
84788
84864
  return filter(symbol.declarations, (d) => d.kind === 263 /* ClassDeclaration */ || d.kind === 264 /* InterfaceDeclaration */);
84789
84865
  }
84790
84866
  function checkKindsOfPropertyMemberOverrides(type, baseType) {
84791
- var _a, _b, _c, _d;
84867
+ var _a, _b, _c, _d, _e;
84792
84868
  const baseProperties = getPropertiesOfType(baseType);
84793
- let inheritedAbstractMemberNotImplementedError;
84869
+ const notImplementedInfo = /* @__PURE__ */ new Map();
84794
84870
  basePropertyCheck:
84795
84871
  for (const baseProperty of baseProperties) {
84796
84872
  const base = getTargetSymbol(baseProperty);
@@ -84816,36 +84892,11 @@ function createTypeChecker(host) {
84816
84892
  continue basePropertyCheck;
84817
84893
  }
84818
84894
  }
84819
- if (!inheritedAbstractMemberNotImplementedError) {
84820
- inheritedAbstractMemberNotImplementedError = error2(
84821
- derivedClassDecl,
84822
- Diagnostics.Non_abstract_class_0_does_not_implement_all_abstract_members_of_1,
84823
- typeToString(type),
84824
- typeToString(baseType)
84825
- );
84826
- }
84827
- if (derivedClassDecl.kind === 231 /* ClassExpression */) {
84828
- addRelatedInfo(
84829
- inheritedAbstractMemberNotImplementedError,
84830
- createDiagnosticForNode(
84831
- baseProperty.valueDeclaration ?? (baseProperty.declarations && first(baseProperty.declarations)) ?? derivedClassDecl,
84832
- Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1,
84833
- symbolToString(baseProperty),
84834
- typeToString(baseType)
84835
- )
84836
- );
84837
- } else {
84838
- addRelatedInfo(
84839
- inheritedAbstractMemberNotImplementedError,
84840
- createDiagnosticForNode(
84841
- baseProperty.valueDeclaration ?? (baseProperty.declarations && first(baseProperty.declarations)) ?? derivedClassDecl,
84842
- Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2,
84843
- typeToString(type),
84844
- symbolToString(baseProperty),
84845
- typeToString(baseType)
84846
- )
84847
- );
84848
- }
84895
+ const baseTypeName = typeToString(baseType);
84896
+ const typeName = typeToString(type);
84897
+ const basePropertyName = symbolToString(baseProperty);
84898
+ const missedProperties = append((_a = notImplementedInfo.get(derivedClassDecl)) == null ? void 0 : _a.missedProperties, basePropertyName);
84899
+ notImplementedInfo.set(derivedClassDecl, { baseTypeName, typeName, missedProperties });
84849
84900
  }
84850
84901
  } else {
84851
84902
  const derivedDeclarationFlags = getDeclarationModifierFlagsFromSymbol(derived);
@@ -84856,7 +84907,7 @@ function createTypeChecker(host) {
84856
84907
  const basePropertyFlags = base.flags & 98308 /* PropertyOrAccessor */;
84857
84908
  const derivedPropertyFlags = derived.flags & 98308 /* PropertyOrAccessor */;
84858
84909
  if (basePropertyFlags && derivedPropertyFlags) {
84859
- if ((getCheckFlags(base) & 6 /* Synthetic */ ? (_a = base.declarations) == null ? void 0 : _a.some((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags)) : (_b = base.declarations) == null ? void 0 : _b.every((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags))) || getCheckFlags(base) & 262144 /* Mapped */ || derived.valueDeclaration && isBinaryExpression(derived.valueDeclaration)) {
84910
+ if ((getCheckFlags(base) & 6 /* Synthetic */ ? (_b = base.declarations) == null ? void 0 : _b.some((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags)) : (_c = base.declarations) == null ? void 0 : _c.every((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags))) || getCheckFlags(base) & 262144 /* Mapped */ || derived.valueDeclaration && isBinaryExpression(derived.valueDeclaration)) {
84860
84911
  continue;
84861
84912
  }
84862
84913
  const overriddenInstanceProperty = basePropertyFlags !== 4 /* Property */ && derivedPropertyFlags === 4 /* Property */;
@@ -84865,8 +84916,8 @@ function createTypeChecker(host) {
84865
84916
  const errorMessage2 = overriddenInstanceProperty ? Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property : Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor;
84866
84917
  error2(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString(base), typeToString(baseType), typeToString(type));
84867
84918
  } else if (useDefineForClassFields) {
84868
- const uninitialized = (_c = derived.declarations) == null ? void 0 : _c.find((d) => d.kind === 172 /* PropertyDeclaration */ && !d.initializer);
84869
- if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 64 /* Abstract */) && !(derivedDeclarationFlags & 64 /* Abstract */) && !((_d = derived.declarations) == null ? void 0 : _d.some((d) => !!(d.flags & 33554432 /* Ambient */)))) {
84919
+ const uninitialized = (_d = derived.declarations) == null ? void 0 : _d.find((d) => d.kind === 172 /* PropertyDeclaration */ && !d.initializer);
84920
+ if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 64 /* Abstract */) && !(derivedDeclarationFlags & 64 /* Abstract */) && !((_e = derived.declarations) == null ? void 0 : _e.some((d) => !!(d.flags & 33554432 /* Ambient */)))) {
84870
84921
  const constructor = findConstructorDeclaration(getClassLikeDeclarationOfSymbol(type.symbol));
84871
84922
  const propName = uninitialized.name;
84872
84923
  if (uninitialized.exclamationToken || !constructor || !isIdentifier(propName) || !strictNullChecks || !isPropertyInitializedInConstructor(propName, type, constructor)) {
@@ -84891,6 +84942,30 @@ function createTypeChecker(host) {
84891
84942
  error2(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type));
84892
84943
  }
84893
84944
  }
84945
+ for (const [errorNode, memberInfo] of notImplementedInfo) {
84946
+ if (length(memberInfo.missedProperties) === 1) {
84947
+ if (isClassExpression(errorNode)) {
84948
+ error2(errorNode, Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, first(memberInfo.missedProperties), memberInfo.baseTypeName);
84949
+ } else {
84950
+ error2(errorNode, Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2, memberInfo.typeName, first(memberInfo.missedProperties), memberInfo.baseTypeName);
84951
+ }
84952
+ } else if (length(memberInfo.missedProperties) > 5) {
84953
+ const missedProperties = map(memberInfo.missedProperties.slice(0, 4), (prop) => `'${prop}'`).join(", ");
84954
+ const remainingMissedProperties = length(memberInfo.missedProperties) - 4;
84955
+ if (isClassExpression(errorNode)) {
84956
+ error2(errorNode, Diagnostics.Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_and_2_more, memberInfo.baseTypeName, missedProperties, remainingMissedProperties);
84957
+ } else {
84958
+ error2(errorNode, Diagnostics.Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_and_3_more, memberInfo.typeName, memberInfo.baseTypeName, missedProperties, remainingMissedProperties);
84959
+ }
84960
+ } else {
84961
+ const missedProperties = map(memberInfo.missedProperties, (prop) => `'${prop}'`).join(", ");
84962
+ if (isClassExpression(errorNode)) {
84963
+ error2(errorNode, Diagnostics.Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1, memberInfo.baseTypeName, missedProperties);
84964
+ } else {
84965
+ error2(errorNode, Diagnostics.Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2, memberInfo.typeName, memberInfo.baseTypeName, missedProperties);
84966
+ }
84967
+ }
84968
+ }
84894
84969
  }
84895
84970
  function isPropertyAbstractOrInterface(declaration, baseDeclarationFlags) {
84896
84971
  return baseDeclarationFlags & 64 /* Abstract */ && (!isPropertyDeclaration(declaration) || !declaration.initializer) || isInterfaceDeclaration(declaration.parent);
@@ -88615,7 +88690,7 @@ function createTypeChecker(host) {
88615
88690
  if (parameter.initializer) {
88616
88691
  return grammarErrorOnNode(parameter.name, Diagnostics.A_rest_parameter_cannot_have_an_initializer);
88617
88692
  }
88618
- } else if (isOptionalParameter(parameter)) {
88693
+ } else if (hasEffectiveQuestionToken(parameter)) {
88619
88694
  seenOptionalParameter = true;
88620
88695
  if (parameter.questionToken && parameter.initializer) {
88621
88696
  return grammarErrorOnNode(parameter.name, Diagnostics.Parameter_cannot_have_question_mark_and_initializer);
@@ -94269,7 +94344,7 @@ function transformTypeScript(context) {
94269
94344
  ),
94270
94345
  valueExpression
94271
94346
  );
94272
- const outerAssignment = valueExpression.kind === 11 /* StringLiteral */ ? innerAssignment : factory2.createAssignment(
94347
+ const outerAssignment = isSyntacticallyString(valueExpression) ? innerAssignment : factory2.createAssignment(
94273
94348
  factory2.createElementAccessExpression(
94274
94349
  currentNamespaceContainerName,
94275
94350
  innerAssignment
@@ -145630,22 +145705,22 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
145630
145705
  }
145631
145706
  return [];
145632
145707
  }
145633
- function getCodeFixesAtPosition(fileName, start2, end, errorCodes65, formatOptions, preferences = emptyOptions) {
145708
+ function getCodeFixesAtPosition(fileName, start2, end, errorCodes66, formatOptions, preferences = emptyOptions) {
145634
145709
  synchronizeHostData();
145635
145710
  const sourceFile = getValidSourceFile(fileName);
145636
145711
  const span = createTextSpanFromBounds(start2, end);
145637
145712
  const formatContext = ts_formatting_exports.getFormatContext(formatOptions, host);
145638
- return flatMap(deduplicate(errorCodes65, equateValues, compareValues), (errorCode) => {
145713
+ return flatMap(deduplicate(errorCodes66, equateValues, compareValues), (errorCode) => {
145639
145714
  cancellationToken.throwIfCancellationRequested();
145640
145715
  return ts_codefix_exports.getFixes({ errorCode, sourceFile, span, program, host, cancellationToken, formatContext, preferences });
145641
145716
  });
145642
145717
  }
145643
- function getCombinedCodeFix(scope, fixId52, formatOptions, preferences = emptyOptions) {
145718
+ function getCombinedCodeFix(scope, fixId53, formatOptions, preferences = emptyOptions) {
145644
145719
  synchronizeHostData();
145645
145720
  Debug.assert(scope.type === "file");
145646
145721
  const sourceFile = getValidSourceFile(scope.fileName);
145647
145722
  const formatContext = ts_formatting_exports.getFormatContext(formatOptions, host);
145648
- return ts_codefix_exports.getAllFixes({ fixId: fixId52, sourceFile, program, host, cancellationToken, formatContext, preferences });
145723
+ return ts_codefix_exports.getAllFixes({ fixId: fixId53, sourceFile, program, host, cancellationToken, formatContext, preferences });
145649
145724
  }
145650
145725
  function organizeImports2(args, formatOptions, preferences = emptyOptions) {
145651
145726
  synchronizeHostData();
@@ -147324,14 +147399,14 @@ function createCodeFixActionWithoutFixAll(fixName8, changes, description3) {
147324
147399
  void 0
147325
147400
  );
147326
147401
  }
147327
- function createCodeFixAction(fixName8, changes, description3, fixId52, fixAllDescription, command) {
147328
- return createCodeFixActionWorker(fixName8, diagnosticToString(description3), changes, fixId52, diagnosticToString(fixAllDescription), command);
147402
+ function createCodeFixAction(fixName8, changes, description3, fixId53, fixAllDescription, command) {
147403
+ return createCodeFixActionWorker(fixName8, diagnosticToString(description3), changes, fixId53, diagnosticToString(fixAllDescription), command);
147329
147404
  }
147330
- function createCodeFixActionMaybeFixAll(fixName8, changes, description3, fixId52, fixAllDescription, command) {
147331
- return createCodeFixActionWorker(fixName8, diagnosticToString(description3), changes, fixId52, fixAllDescription && diagnosticToString(fixAllDescription), command);
147405
+ function createCodeFixActionMaybeFixAll(fixName8, changes, description3, fixId53, fixAllDescription, command) {
147406
+ return createCodeFixActionWorker(fixName8, diagnosticToString(description3), changes, fixId53, fixAllDescription && diagnosticToString(fixAllDescription), command);
147332
147407
  }
147333
- function createCodeFixActionWorker(fixName8, description3, changes, fixId52, fixAllDescription, command) {
147334
- return { fixName: fixName8, description: description3, changes, fixId: fixId52, fixAllDescription, commands: command ? [command] : void 0 };
147408
+ function createCodeFixActionWorker(fixName8, description3, changes, fixId53, fixAllDescription, command) {
147409
+ return { fixName: fixName8, description: description3, changes, fixId: fixId53, fixAllDescription, commands: command ? [command] : void 0 };
147335
147410
  }
147336
147411
  function registerCodeFix(reg) {
147337
147412
  for (const error2 of reg.errorCodes) {
@@ -147339,9 +147414,9 @@ function registerCodeFix(reg) {
147339
147414
  errorCodeToFixes.add(String(error2), reg);
147340
147415
  }
147341
147416
  if (reg.fixIds) {
147342
- for (const fixId52 of reg.fixIds) {
147343
- Debug.assert(!fixIdToRegistration.has(fixId52));
147344
- fixIdToRegistration.set(fixId52, reg);
147417
+ for (const fixId53 of reg.fixIds) {
147418
+ Debug.assert(!fixIdToRegistration.has(fixId53));
147419
+ fixIdToRegistration.set(fixId53, reg);
147345
147420
  }
147346
147421
  }
147347
147422
  }
@@ -147350,17 +147425,17 @@ function getSupportedErrorCodes() {
147350
147425
  return errorCodeToFixesArray ?? (errorCodeToFixesArray = arrayFrom(errorCodeToFixes.keys()));
147351
147426
  }
147352
147427
  function removeFixIdIfFixAllUnavailable(registration, diagnostics) {
147353
- const { errorCodes: errorCodes65 } = registration;
147428
+ const { errorCodes: errorCodes66 } = registration;
147354
147429
  let maybeFixableDiagnostics = 0;
147355
147430
  for (const diag2 of diagnostics) {
147356
- if (contains(errorCodes65, diag2.code))
147431
+ if (contains(errorCodes66, diag2.code))
147357
147432
  maybeFixableDiagnostics++;
147358
147433
  if (maybeFixableDiagnostics > 1)
147359
147434
  break;
147360
147435
  }
147361
147436
  const fixAllUnavailable = maybeFixableDiagnostics < 2;
147362
- return ({ fixId: fixId52, fixAllDescription, ...action }) => {
147363
- return fixAllUnavailable ? action : { ...action, fixId: fixId52, fixAllDescription };
147437
+ return ({ fixId: fixId53, fixAllDescription, ...action }) => {
147438
+ return fixAllUnavailable ? action : { ...action, fixId: fixId53, fixAllDescription };
147364
147439
  };
147365
147440
  }
147366
147441
  function getFixes(context) {
@@ -147377,14 +147452,14 @@ function createCombinedCodeActions(changes, commands) {
147377
147452
  function createFileTextChanges(fileName, textChanges2) {
147378
147453
  return { fileName, textChanges: textChanges2 };
147379
147454
  }
147380
- function codeFixAll(context, errorCodes65, use) {
147455
+ function codeFixAll(context, errorCodes66, use) {
147381
147456
  const commands = [];
147382
- const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => eachDiagnostic(context, errorCodes65, (diag2) => use(t, diag2, commands)));
147457
+ const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => eachDiagnostic(context, errorCodes66, (diag2) => use(t, diag2, commands)));
147383
147458
  return createCombinedCodeActions(changes, commands.length === 0 ? void 0 : commands);
147384
147459
  }
147385
- function eachDiagnostic(context, errorCodes65, cb) {
147460
+ function eachDiagnostic(context, errorCodes66, cb) {
147386
147461
  for (const diag2 of getDiagnostics(context)) {
147387
- if (contains(errorCodes65, diag2.code)) {
147462
+ if (contains(errorCodes66, diag2.code)) {
147388
147463
  cb(diag2);
147389
147464
  }
147390
147465
  }
@@ -151795,10 +151870,10 @@ registerCodeFix({
151795
151870
  const info = errorCodeFixIdMap[errorCode];
151796
151871
  if (!info)
151797
151872
  return emptyArray;
151798
- const { descriptions, fixId: fixId52, fixAllDescriptions } = info;
151873
+ const { descriptions, fixId: fixId53, fixAllDescriptions } = info;
151799
151874
  const changes = ts_textChanges_exports.ChangeTracker.with(context, (changes2) => dispatchChanges(changes2, context, errorCode, span.start));
151800
151875
  return [
151801
- createCodeFixActionMaybeFixAll(fixName, changes, descriptions, fixId52, fixAllDescriptions)
151876
+ createCodeFixActionMaybeFixAll(fixName, changes, descriptions, fixId53, fixAllDescriptions)
151802
151877
  ];
151803
151878
  },
151804
151879
  fixIds: [fixName, fixAddOverrideId, fixRemoveOverrideId],
@@ -152603,7 +152678,7 @@ registerCodeFix({
152603
152678
  },
152604
152679
  fixIds: [fixMissingMember, fixMissingFunctionDeclaration, fixMissingProperties, fixMissingAttributes],
152605
152680
  getAllCodeActions: (context) => {
152606
- const { program, fixId: fixId52 } = context;
152681
+ const { program, fixId: fixId53 } = context;
152607
152682
  const checker = program.getTypeChecker();
152608
152683
  const seen = /* @__PURE__ */ new Map();
152609
152684
  const typeDeclToMembers = /* @__PURE__ */ new Map();
@@ -152613,11 +152688,11 @@ registerCodeFix({
152613
152688
  if (!info || !addToSeen(seen, getNodeId(info.parentDeclaration) + "#" + (info.kind === 3 /* ObjectLiteral */ ? info.identifier : info.token.text))) {
152614
152689
  return;
152615
152690
  }
152616
- if (fixId52 === fixMissingFunctionDeclaration && (info.kind === 2 /* Function */ || info.kind === 5 /* Signature */)) {
152691
+ if (fixId53 === fixMissingFunctionDeclaration && (info.kind === 2 /* Function */ || info.kind === 5 /* Signature */)) {
152617
152692
  addFunctionDeclaration(changes, context, info);
152618
- } else if (fixId52 === fixMissingProperties && info.kind === 3 /* ObjectLiteral */) {
152693
+ } else if (fixId53 === fixMissingProperties && info.kind === 3 /* ObjectLiteral */) {
152619
152694
  addObjectLiteralProperties(changes, context, info);
152620
- } else if (fixId52 === fixMissingAttributes && info.kind === 4 /* JsxAttributes */) {
152695
+ } else if (fixId53 === fixMissingAttributes && info.kind === 4 /* JsxAttributes */) {
152621
152696
  addJsxAttributes(changes, context, info);
152622
152697
  } else {
152623
152698
  if (info.kind === 1 /* Enum */) {
@@ -153524,7 +153599,12 @@ function getTypesPackageNameToInstall(packageName, host, diagCode) {
153524
153599
 
153525
153600
  // src/services/codefixes/fixClassDoesntImplementInheritedAbstractMember.ts
153526
153601
  var errorCodes31 = [
153527
- Diagnostics.Non_abstract_class_0_does_not_implement_all_abstract_members_of_1.code
153602
+ Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2.code,
153603
+ Diagnostics.Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2.code,
153604
+ Diagnostics.Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_and_3_more.code,
153605
+ Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code,
153606
+ Diagnostics.Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1.code,
153607
+ Diagnostics.Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_and_2_more.code
153528
153608
  ];
153529
153609
  var fixId25 = "fixClassDoesntImplementInheritedAbstractMember";
153530
153610
  registerCodeFix({
@@ -154511,21 +154591,21 @@ registerCodeFix({
154511
154591
  actions2.push(fix(type, fixIdNullable, Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types));
154512
154592
  }
154513
154593
  return actions2;
154514
- function fix(type2, fixId52, fixAllDescription) {
154594
+ function fix(type2, fixId53, fixAllDescription) {
154515
154595
  const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange29(t, sourceFile, typeNode, type2, checker));
154516
- return createCodeFixAction("jdocTypes", changes, [Diagnostics.Change_0_to_1, original, checker.typeToString(type2)], fixId52, fixAllDescription);
154596
+ return createCodeFixAction("jdocTypes", changes, [Diagnostics.Change_0_to_1, original, checker.typeToString(type2)], fixId53, fixAllDescription);
154517
154597
  }
154518
154598
  },
154519
154599
  fixIds: [fixIdPlain, fixIdNullable],
154520
154600
  getAllCodeActions(context) {
154521
- const { fixId: fixId52, program, sourceFile } = context;
154601
+ const { fixId: fixId53, program, sourceFile } = context;
154522
154602
  const checker = program.getTypeChecker();
154523
154603
  return codeFixAll(context, errorCodes45, (changes, err) => {
154524
154604
  const info = getInfo15(err.file, err.start, checker);
154525
154605
  if (!info)
154526
154606
  return;
154527
154607
  const { typeNode, type } = info;
154528
- const fixedType = typeNode.kind === 314 /* JSDocNullableType */ && fixId52 === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type;
154608
+ const fixedType = typeNode.kind === 314 /* JSDocNullableType */ && fixId53 === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type;
154529
154609
  doChange29(changes, sourceFile, typeNode, fixedType, checker);
154530
154610
  });
154531
154611
  }
@@ -157233,11 +157313,31 @@ function flattenInvalidBinaryExpr(node) {
157233
157313
  }
157234
157314
  }
157235
157315
 
157236
- // src/services/codefixes/convertToMappedObjectType.ts
157237
- var fixId45 = "fixConvertToMappedObjectType";
157238
- var errorCodes58 = [Diagnostics.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead.code];
157316
+ // src/services/codefixes/wrapDecoratorInParentheses.ts
157317
+ var fixId45 = "wrapDecoratorInParentheses";
157318
+ var errorCodes58 = [Diagnostics.Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator.code];
157239
157319
  registerCodeFix({
157240
157320
  errorCodes: errorCodes58,
157321
+ getCodeActions: function getCodeActionsToWrapDecoratorExpressionInParentheses(context) {
157322
+ const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange10(t, context.sourceFile, context.span.start));
157323
+ return [createCodeFixAction(fixId45, changes, Diagnostics.Wrap_in_parentheses, fixId45, Diagnostics.Wrap_all_invalid_decorator_expressions_in_parentheses)];
157324
+ },
157325
+ fixIds: [fixId45],
157326
+ getAllCodeActions: (context) => codeFixAll(context, errorCodes58, (changes, diag2) => makeChange10(changes, diag2.file, diag2.start))
157327
+ });
157328
+ function makeChange10(changeTracker, sourceFile, pos) {
157329
+ const token = getTokenAtPosition(sourceFile, pos);
157330
+ const decorator = findAncestor(token, isDecorator);
157331
+ Debug.assert(!!decorator, "Expected position to be owned by a decorator.");
157332
+ const replacement = factory.createParenthesizedExpression(decorator.expression);
157333
+ changeTracker.replaceNode(sourceFile, decorator.expression, replacement);
157334
+ }
157335
+
157336
+ // src/services/codefixes/convertToMappedObjectType.ts
157337
+ var fixId46 = "fixConvertToMappedObjectType";
157338
+ var errorCodes59 = [Diagnostics.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead.code];
157339
+ registerCodeFix({
157340
+ errorCodes: errorCodes59,
157241
157341
  getCodeActions: function getCodeActionsToConvertToMappedTypeObject(context) {
157242
157342
  const { sourceFile, span } = context;
157243
157343
  const info = getInfo20(sourceFile, span.start);
@@ -157245,10 +157345,10 @@ registerCodeFix({
157245
157345
  return void 0;
157246
157346
  const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange39(t, sourceFile, info));
157247
157347
  const name = idText(info.container.name);
157248
- return [createCodeFixAction(fixId45, changes, [Diagnostics.Convert_0_to_mapped_object_type, name], fixId45, [Diagnostics.Convert_0_to_mapped_object_type, name])];
157348
+ return [createCodeFixAction(fixId46, changes, [Diagnostics.Convert_0_to_mapped_object_type, name], fixId46, [Diagnostics.Convert_0_to_mapped_object_type, name])];
157249
157349
  },
157250
- fixIds: [fixId45],
157251
- getAllCodeActions: (context) => codeFixAll(context, errorCodes58, (changes, diag2) => {
157350
+ fixIds: [fixId46],
157351
+ getAllCodeActions: (context) => codeFixAll(context, errorCodes59, (changes, diag2) => {
157252
157352
  const info = getInfo20(diag2.file, diag2.start);
157253
157353
  if (info)
157254
157354
  doChange39(changes, diag2.file, info);
@@ -157296,12 +157396,12 @@ function doChange39(changes, sourceFile, { indexSignature, container }) {
157296
157396
  }
157297
157397
 
157298
157398
  // src/services/codefixes/removeAccidentalCallParentheses.ts
157299
- var fixId46 = "removeAccidentalCallParentheses";
157300
- var errorCodes59 = [
157399
+ var fixId47 = "removeAccidentalCallParentheses";
157400
+ var errorCodes60 = [
157301
157401
  Diagnostics.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without.code
157302
157402
  ];
157303
157403
  registerCodeFix({
157304
- errorCodes: errorCodes59,
157404
+ errorCodes: errorCodes60,
157305
157405
  getCodeActions(context) {
157306
157406
  const callExpression = findAncestor(getTokenAtPosition(context.sourceFile, context.span.start), isCallExpression);
157307
157407
  if (!callExpression) {
@@ -157310,30 +157410,30 @@ registerCodeFix({
157310
157410
  const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => {
157311
157411
  t.deleteRange(context.sourceFile, { pos: callExpression.expression.end, end: callExpression.end });
157312
157412
  });
157313
- return [createCodeFixActionWithoutFixAll(fixId46, changes, Diagnostics.Remove_parentheses)];
157413
+ return [createCodeFixActionWithoutFixAll(fixId47, changes, Diagnostics.Remove_parentheses)];
157314
157414
  },
157315
- fixIds: [fixId46]
157415
+ fixIds: [fixId47]
157316
157416
  });
157317
157417
 
157318
157418
  // src/services/codefixes/removeUnnecessaryAwait.ts
157319
- var fixId47 = "removeUnnecessaryAwait";
157320
- var errorCodes60 = [
157419
+ var fixId48 = "removeUnnecessaryAwait";
157420
+ var errorCodes61 = [
157321
157421
  Diagnostics.await_has_no_effect_on_the_type_of_this_expression.code
157322
157422
  ];
157323
157423
  registerCodeFix({
157324
- errorCodes: errorCodes60,
157424
+ errorCodes: errorCodes61,
157325
157425
  getCodeActions: function getCodeActionsToRemoveUnnecessaryAwait(context) {
157326
- const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange10(t, context.sourceFile, context.span));
157426
+ const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange11(t, context.sourceFile, context.span));
157327
157427
  if (changes.length > 0) {
157328
- return [createCodeFixAction(fixId47, changes, Diagnostics.Remove_unnecessary_await, fixId47, Diagnostics.Remove_all_unnecessary_uses_of_await)];
157428
+ return [createCodeFixAction(fixId48, changes, Diagnostics.Remove_unnecessary_await, fixId48, Diagnostics.Remove_all_unnecessary_uses_of_await)];
157329
157429
  }
157330
157430
  },
157331
- fixIds: [fixId47],
157431
+ fixIds: [fixId48],
157332
157432
  getAllCodeActions: (context) => {
157333
- return codeFixAll(context, errorCodes60, (changes, diag2) => makeChange10(changes, diag2.file, diag2));
157433
+ return codeFixAll(context, errorCodes61, (changes, diag2) => makeChange11(changes, diag2.file, diag2));
157334
157434
  }
157335
157435
  });
157336
- function makeChange10(changeTracker, sourceFile, span) {
157436
+ function makeChange11(changeTracker, sourceFile, span) {
157337
157437
  const awaitKeyword = tryCast(getTokenAtPosition(sourceFile, span.start), (node) => node.kind === 135 /* AwaitKeyword */);
157338
157438
  const awaitExpression = awaitKeyword && tryCast(awaitKeyword.parent, isAwaitExpression);
157339
157439
  if (!awaitExpression) {
@@ -157358,20 +157458,20 @@ function makeChange10(changeTracker, sourceFile, span) {
157358
157458
  }
157359
157459
 
157360
157460
  // src/services/codefixes/splitTypeOnlyImport.ts
157361
- var errorCodes61 = [Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both.code];
157362
- var fixId48 = "splitTypeOnlyImport";
157461
+ var errorCodes62 = [Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both.code];
157462
+ var fixId49 = "splitTypeOnlyImport";
157363
157463
  registerCodeFix({
157364
- errorCodes: errorCodes61,
157365
- fixIds: [fixId48],
157464
+ errorCodes: errorCodes62,
157465
+ fixIds: [fixId49],
157366
157466
  getCodeActions: function getCodeActionsToSplitTypeOnlyImport(context) {
157367
157467
  const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => {
157368
157468
  return splitTypeOnlyImport(t, getImportDeclaration2(context.sourceFile, context.span), context);
157369
157469
  });
157370
157470
  if (changes.length) {
157371
- return [createCodeFixAction(fixId48, changes, Diagnostics.Split_into_two_separate_import_declarations, fixId48, Diagnostics.Split_all_invalid_type_only_imports)];
157471
+ return [createCodeFixAction(fixId49, changes, Diagnostics.Split_into_two_separate_import_declarations, fixId49, Diagnostics.Split_all_invalid_type_only_imports)];
157372
157472
  }
157373
157473
  },
157374
- getAllCodeActions: (context) => codeFixAll(context, errorCodes61, (changes, error2) => {
157474
+ getAllCodeActions: (context) => codeFixAll(context, errorCodes62, (changes, error2) => {
157375
157475
  splitTypeOnlyImport(changes, getImportDeclaration2(context.sourceFile, error2), context);
157376
157476
  })
157377
157477
  });
@@ -157420,23 +157520,23 @@ function splitTypeOnlyImport(changes, importDeclaration, context) {
157420
157520
  }
157421
157521
 
157422
157522
  // src/services/codefixes/convertConstToLet.ts
157423
- var fixId49 = "fixConvertConstToLet";
157424
- var errorCodes62 = [Diagnostics.Cannot_assign_to_0_because_it_is_a_constant.code];
157523
+ var fixId50 = "fixConvertConstToLet";
157524
+ var errorCodes63 = [Diagnostics.Cannot_assign_to_0_because_it_is_a_constant.code];
157425
157525
  registerCodeFix({
157426
- errorCodes: errorCodes62,
157526
+ errorCodes: errorCodes63,
157427
157527
  getCodeActions: function getCodeActionsToConvertConstToLet(context) {
157428
157528
  const { sourceFile, span, program } = context;
157429
157529
  const info = getInfo21(sourceFile, span.start, program);
157430
157530
  if (info === void 0)
157431
157531
  return;
157432
157532
  const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange40(t, sourceFile, info.token));
157433
- return [createCodeFixActionMaybeFixAll(fixId49, changes, Diagnostics.Convert_const_to_let, fixId49, Diagnostics.Convert_all_const_to_let)];
157533
+ return [createCodeFixActionMaybeFixAll(fixId50, changes, Diagnostics.Convert_const_to_let, fixId50, Diagnostics.Convert_all_const_to_let)];
157434
157534
  },
157435
157535
  getAllCodeActions: (context) => {
157436
157536
  const { program } = context;
157437
157537
  const seen = /* @__PURE__ */ new Map();
157438
157538
  return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, (changes) => {
157439
- eachDiagnostic(context, errorCodes62, (diag2) => {
157539
+ eachDiagnostic(context, errorCodes63, (diag2) => {
157440
157540
  const info = getInfo21(diag2.file, diag2.start, program);
157441
157541
  if (info) {
157442
157542
  if (addToSeen(seen, getSymbolId(info.symbol))) {
@@ -157447,7 +157547,7 @@ registerCodeFix({
157447
157547
  });
157448
157548
  }));
157449
157549
  },
157450
- fixIds: [fixId49]
157550
+ fixIds: [fixId50]
157451
157551
  });
157452
157552
  function getInfo21(sourceFile, pos, program) {
157453
157553
  var _a;
@@ -157468,11 +157568,11 @@ function doChange40(changes, sourceFile, token) {
157468
157568
  }
157469
157569
 
157470
157570
  // src/services/codefixes/fixExpectedComma.ts
157471
- var fixId50 = "fixExpectedComma";
157571
+ var fixId51 = "fixExpectedComma";
157472
157572
  var expectedErrorCode = Diagnostics._0_expected.code;
157473
- var errorCodes63 = [expectedErrorCode];
157573
+ var errorCodes64 = [expectedErrorCode];
157474
157574
  registerCodeFix({
157475
- errorCodes: errorCodes63,
157575
+ errorCodes: errorCodes64,
157476
157576
  getCodeActions(context) {
157477
157577
  const { sourceFile } = context;
157478
157578
  const info = getInfo22(sourceFile, context.span.start, context.errorCode);
@@ -157480,15 +157580,15 @@ registerCodeFix({
157480
157580
  return void 0;
157481
157581
  const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange41(t, sourceFile, info));
157482
157582
  return [createCodeFixAction(
157483
- fixId50,
157583
+ fixId51,
157484
157584
  changes,
157485
157585
  [Diagnostics.Change_0_to_1, ";", ","],
157486
- fixId50,
157586
+ fixId51,
157487
157587
  [Diagnostics.Change_0_to_1, ";", ","]
157488
157588
  )];
157489
157589
  },
157490
- fixIds: [fixId50],
157491
- getAllCodeActions: (context) => codeFixAll(context, errorCodes63, (changes, diag2) => {
157590
+ fixIds: [fixId51],
157591
+ getAllCodeActions: (context) => codeFixAll(context, errorCodes64, (changes, diag2) => {
157492
157592
  const info = getInfo22(diag2.file, diag2.start, diag2.code);
157493
157593
  if (info)
157494
157594
  doChange41(changes, context.sourceFile, info);
@@ -157505,25 +157605,25 @@ function doChange41(changes, sourceFile, { node }) {
157505
157605
 
157506
157606
  // src/services/codefixes/fixAddVoidToPromise.ts
157507
157607
  var fixName7 = "addVoidToPromise";
157508
- var fixId51 = "addVoidToPromise";
157509
- var errorCodes64 = [
157608
+ var fixId52 = "addVoidToPromise";
157609
+ var errorCodes65 = [
157510
157610
  Diagnostics.Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments.code,
157511
157611
  Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise.code
157512
157612
  ];
157513
157613
  registerCodeFix({
157514
- errorCodes: errorCodes64,
157515
- fixIds: [fixId51],
157614
+ errorCodes: errorCodes65,
157615
+ fixIds: [fixId52],
157516
157616
  getCodeActions(context) {
157517
- const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange11(t, context.sourceFile, context.span, context.program));
157617
+ const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange12(t, context.sourceFile, context.span, context.program));
157518
157618
  if (changes.length > 0) {
157519
- return [createCodeFixAction(fixName7, changes, Diagnostics.Add_void_to_Promise_resolved_without_a_value, fixId51, Diagnostics.Add_void_to_all_Promises_resolved_without_a_value)];
157619
+ return [createCodeFixAction(fixName7, changes, Diagnostics.Add_void_to_Promise_resolved_without_a_value, fixId52, Diagnostics.Add_void_to_all_Promises_resolved_without_a_value)];
157520
157620
  }
157521
157621
  },
157522
157622
  getAllCodeActions(context) {
157523
- return codeFixAll(context, errorCodes64, (changes, diag2) => makeChange11(changes, diag2.file, diag2, context.program, /* @__PURE__ */ new Set()));
157623
+ return codeFixAll(context, errorCodes65, (changes, diag2) => makeChange12(changes, diag2.file, diag2, context.program, /* @__PURE__ */ new Set()));
157524
157624
  }
157525
157625
  });
157526
- function makeChange11(changes, sourceFile, span, program, seen) {
157626
+ function makeChange12(changes, sourceFile, span, program, seen) {
157527
157627
  const node = getTokenAtPosition(sourceFile, span.start);
157528
157628
  if (!isIdentifier(node) || !isCallExpression(node.parent) || node.parent.expression !== node || node.parent.arguments.length !== 0)
157529
157629
  return;
@@ -165553,7 +165653,7 @@ function provideInlayHints(context) {
165553
165653
  return type.symbol && type.symbol.flags & 1536 /* Module */;
165554
165654
  }
165555
165655
  function visitVariableLikeDeclaration(decl) {
165556
- if (!decl.initializer || isBindingPattern(decl.name) || isVariableDeclaration(decl) && !isHintableDeclaration(decl)) {
165656
+ if (decl.initializer === void 0 && !(isPropertyDeclaration(decl) && !(checker.getTypeAtLocation(decl).flags & 1 /* Any */)) || isBindingPattern(decl.name) || isVariableDeclaration(decl) && !isHintableDeclaration(decl)) {
165557
165657
  return;
165558
165658
  }
165559
165659
  const effectiveTypeAnnotation = getEffectiveTypeAnnotationNode(decl);
@@ -175008,6 +175108,7 @@ __export(ts_exports2, {
175008
175108
  isSuperProperty: () => isSuperProperty,
175009
175109
  isSupportedSourceFileName: () => isSupportedSourceFileName,
175010
175110
  isSwitchStatement: () => isSwitchStatement,
175111
+ isSyntacticallyString: () => isSyntacticallyString,
175011
175112
  isSyntaxList: () => isSyntaxList,
175012
175113
  isSyntheticExpression: () => isSyntheticExpression,
175013
175114
  isSyntheticReference: () => isSyntheticReference,
@@ -186011,10 +186112,10 @@ ${e.message}`;
186011
186112
  }
186012
186113
  return simplifiedResult ? codeActions.map((codeAction) => this.mapCodeFixAction(codeAction)) : codeActions;
186013
186114
  }
186014
- getCombinedCodeFix({ scope, fixId: fixId52 }, simplifiedResult) {
186115
+ getCombinedCodeFix({ scope, fixId: fixId53 }, simplifiedResult) {
186015
186116
  Debug.assert(scope.type === "file");
186016
186117
  const { file, project } = this.getFileAndProject(scope.args);
186017
- const res = project.getLanguageService().getCombinedCodeFix({ type: "file", fileName: file }, fixId52, this.getFormatOptions(file), this.getPreferences(file));
186118
+ const res = project.getLanguageService().getCombinedCodeFix({ type: "file", fileName: file }, fixId53, this.getFormatOptions(file), this.getPreferences(file));
186018
186119
  if (simplifiedResult) {
186019
186120
  return { changes: this.mapTextChangesToCodeEdits(res.changes), commands: res.commands };
186020
186121
  } else {
@@ -186053,8 +186154,8 @@ ${e.message}`;
186053
186154
  mapCodeAction({ description: description3, changes, commands }) {
186054
186155
  return { description: description3, changes: this.mapTextChangesToCodeEdits(changes), commands };
186055
186156
  }
186056
- mapCodeFixAction({ fixName: fixName8, description: description3, changes, commands, fixId: fixId52, fixAllDescription }) {
186057
- return { fixName: fixName8, description: description3, changes: this.mapTextChangesToCodeEdits(changes), commands, fixId: fixId52, fixAllDescription };
186157
+ mapCodeFixAction({ fixName: fixName8, description: description3, changes, commands, fixId: fixId53, fixAllDescription }) {
186158
+ return { fixName: fixName8, description: description3, changes: this.mapTextChangesToCodeEdits(changes), commands, fixId: fixId53, fixAllDescription };
186058
186159
  }
186059
186160
  mapTextChangesToCodeEdits(textChanges2) {
186060
186161
  return textChanges2.map((change) => this.mapTextChangeToCodeEdit(change));
@@ -189784,6 +189885,7 @@ start(initializeNodeSystem(), require("os").platform());
189784
189885
  isSuperProperty,
189785
189886
  isSupportedSourceFileName,
189786
189887
  isSwitchStatement,
189888
+ isSyntacticallyString,
189787
189889
  isSyntaxList,
189788
189890
  isSyntheticExpression,
189789
189891
  isSyntheticReference,