@typescript-deploys/pr-build 5.5.0-pr-57686-4 → 5.5.0-pr-57749-11

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/tsc.js CHANGED
@@ -6096,6 +6096,8 @@ var Diagnostics = {
6096
6096
  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."),
6097
6097
  _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."),
6098
6098
  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."),
6099
+ 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."),
6100
+ Invalid_syntax_in_decorator: diag(1498, 1 /* Error */, "Invalid_syntax_in_decorator_1498", "Invalid syntax in decorator."),
6099
6101
  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."),
6100
6102
  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."),
6101
6103
  Call_signature_return_types_0_and_1_are_incompatible: diag(
@@ -7743,6 +7745,8 @@ var Diagnostics = {
7743
7745
  Add_optional_parameter_to_0: diag(95191, 3 /* Message */, "Add_optional_parameter_to_0_95191", "Add optional parameter to '{0}'"),
7744
7746
  Add_optional_parameters_to_0: diag(95192, 3 /* Message */, "Add_optional_parameters_to_0_95192", "Add optional parameters to '{0}'"),
7745
7747
  Add_all_optional_parameters: diag(95193, 3 /* Message */, "Add_all_optional_parameters_95193", "Add all optional parameters"),
7748
+ Wrap_in_parentheses: diag(95194, 3 /* Message */, "Wrap_in_parentheses_95194", "Wrap in parentheses"),
7749
+ 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"),
7746
7750
  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."),
7747
7751
  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'."),
7748
7752
  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?"),
@@ -17647,21 +17651,6 @@ function replaceFirstStar(s, replacement) {
17647
17651
  function getNameFromImportAttribute(node) {
17648
17652
  return isIdentifier(node.name) ? node.name.escapedText : escapeLeadingUnderscores(node.name.text);
17649
17653
  }
17650
- function isSyntacticallyString(expr) {
17651
- switch (expr.kind) {
17652
- case 226 /* BinaryExpression */:
17653
- const left = expr.left;
17654
- const right = expr.right;
17655
- return expr.operatorToken.kind === 40 /* PlusToken */ && (isSyntacticallyString(left) || isSyntacticallyString(right));
17656
- case 217 /* ParenthesizedExpression */:
17657
- return isSyntacticallyString(expr.expression);
17658
- case 228 /* TemplateExpression */:
17659
- case 11 /* StringLiteral */:
17660
- case 15 /* NoSubstitutionTemplateLiteral */:
17661
- return true;
17662
- }
17663
- return false;
17664
- }
17665
17654
 
17666
17655
  // src/compiler/factory/baseNodeFactory.ts
17667
17656
  function createBaseNodeFactory() {
@@ -77357,7 +77346,56 @@ function createTypeChecker(host) {
77357
77346
  }
77358
77347
  }
77359
77348
  }
77349
+ function checkGrammarDecorator(decorator) {
77350
+ const sourceFile = getSourceFileOfNode(decorator);
77351
+ if (!hasParseDiagnostics(sourceFile)) {
77352
+ let node = decorator.expression;
77353
+ if (isParenthesizedExpression(node)) {
77354
+ return false;
77355
+ }
77356
+ let canHaveCallExpression = true;
77357
+ let errorNode;
77358
+ while (true) {
77359
+ if (isExpressionWithTypeArguments(node) || isNonNullExpression(node)) {
77360
+ node = node.expression;
77361
+ continue;
77362
+ }
77363
+ if (isCallExpression(node)) {
77364
+ if (!canHaveCallExpression) {
77365
+ errorNode = node;
77366
+ }
77367
+ if (node.questionDotToken) {
77368
+ errorNode = node.questionDotToken;
77369
+ }
77370
+ node = node.expression;
77371
+ canHaveCallExpression = false;
77372
+ continue;
77373
+ }
77374
+ if (isPropertyAccessExpression(node)) {
77375
+ if (node.questionDotToken) {
77376
+ errorNode = node.questionDotToken;
77377
+ }
77378
+ node = node.expression;
77379
+ canHaveCallExpression = false;
77380
+ continue;
77381
+ }
77382
+ if (!isIdentifier(node)) {
77383
+ errorNode = node;
77384
+ }
77385
+ break;
77386
+ }
77387
+ if (errorNode) {
77388
+ addRelatedInfo(
77389
+ error(decorator.expression, Diagnostics.Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator),
77390
+ createDiagnosticForNode(errorNode, Diagnostics.Invalid_syntax_in_decorator)
77391
+ );
77392
+ return true;
77393
+ }
77394
+ }
77395
+ return false;
77396
+ }
77360
77397
  function checkDecorator(node) {
77398
+ checkGrammarDecorator(node);
77361
77399
  const signature = getResolvedSignature(node);
77362
77400
  checkDeprecatedSignature(signature, node);
77363
77401
  const returnType = getReturnTypeOfSignature(signature);
@@ -89347,7 +89385,7 @@ function transformTypeScript(context) {
89347
89385
  ),
89348
89386
  valueExpression
89349
89387
  );
89350
- const outerAssignment = isSyntacticallyString(valueExpression) ? innerAssignment : factory2.createAssignment(
89388
+ const outerAssignment = valueExpression.kind === 11 /* StringLiteral */ ? innerAssignment : factory2.createAssignment(
89351
89389
  factory2.createElementAccessExpression(
89352
89390
  currentNamespaceContainerName,
89353
89391
  innerAssignment
package/lib/tsserver.js CHANGED
@@ -1760,7 +1760,6 @@ __export(server_exports, {
1760
1760
  isSuperProperty: () => isSuperProperty,
1761
1761
  isSupportedSourceFileName: () => isSupportedSourceFileName,
1762
1762
  isSwitchStatement: () => isSwitchStatement,
1763
- isSyntacticallyString: () => isSyntacticallyString,
1764
1763
  isSyntaxList: () => isSyntaxList,
1765
1764
  isSyntheticExpression: () => isSyntheticExpression,
1766
1765
  isSyntheticReference: () => isSyntheticReference,
@@ -9676,6 +9675,8 @@ var Diagnostics = {
9676
9675
  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."),
9677
9676
  _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."),
9678
9677
  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."),
9678
+ 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."),
9679
+ Invalid_syntax_in_decorator: diag(1498, 1 /* Error */, "Invalid_syntax_in_decorator_1498", "Invalid syntax in decorator."),
9679
9680
  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."),
9680
9681
  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."),
9681
9682
  Call_signature_return_types_0_and_1_are_incompatible: diag(
@@ -11323,6 +11324,8 @@ var Diagnostics = {
11323
11324
  Add_optional_parameter_to_0: diag(95191, 3 /* Message */, "Add_optional_parameter_to_0_95191", "Add optional parameter to '{0}'"),
11324
11325
  Add_optional_parameters_to_0: diag(95192, 3 /* Message */, "Add_optional_parameters_to_0_95192", "Add optional parameters to '{0}'"),
11325
11326
  Add_all_optional_parameters: diag(95193, 3 /* Message */, "Add_all_optional_parameters_95193", "Add all optional parameters"),
11327
+ Wrap_in_parentheses: diag(95194, 3 /* Message */, "Wrap_in_parentheses_95194", "Wrap in parentheses"),
11328
+ 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"),
11326
11329
  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."),
11327
11330
  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'."),
11328
11331
  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?"),
@@ -21908,21 +21911,6 @@ function replaceFirstStar(s, replacement) {
21908
21911
  function getNameFromImportAttribute(node) {
21909
21912
  return isIdentifier(node.name) ? node.name.escapedText : escapeLeadingUnderscores(node.name.text);
21910
21913
  }
21911
- function isSyntacticallyString(expr) {
21912
- switch (expr.kind) {
21913
- case 226 /* BinaryExpression */:
21914
- const left = expr.left;
21915
- const right = expr.right;
21916
- return expr.operatorToken.kind === 40 /* PlusToken */ && (isSyntacticallyString(left) || isSyntacticallyString(right));
21917
- case 217 /* ParenthesizedExpression */:
21918
- return isSyntacticallyString(expr.expression);
21919
- case 228 /* TemplateExpression */:
21920
- case 11 /* StringLiteral */:
21921
- case 15 /* NoSubstitutionTemplateLiteral */:
21922
- return true;
21923
- }
21924
- return false;
21925
- }
21926
21914
 
21927
21915
  // src/compiler/factory/baseNodeFactory.ts
21928
21916
  function createBaseNodeFactory() {
@@ -82110,7 +82098,56 @@ function createTypeChecker(host) {
82110
82098
  }
82111
82099
  }
82112
82100
  }
82101
+ function checkGrammarDecorator(decorator) {
82102
+ const sourceFile = getSourceFileOfNode(decorator);
82103
+ if (!hasParseDiagnostics(sourceFile)) {
82104
+ let node = decorator.expression;
82105
+ if (isParenthesizedExpression(node)) {
82106
+ return false;
82107
+ }
82108
+ let canHaveCallExpression = true;
82109
+ let errorNode;
82110
+ while (true) {
82111
+ if (isExpressionWithTypeArguments(node) || isNonNullExpression(node)) {
82112
+ node = node.expression;
82113
+ continue;
82114
+ }
82115
+ if (isCallExpression(node)) {
82116
+ if (!canHaveCallExpression) {
82117
+ errorNode = node;
82118
+ }
82119
+ if (node.questionDotToken) {
82120
+ errorNode = node.questionDotToken;
82121
+ }
82122
+ node = node.expression;
82123
+ canHaveCallExpression = false;
82124
+ continue;
82125
+ }
82126
+ if (isPropertyAccessExpression(node)) {
82127
+ if (node.questionDotToken) {
82128
+ errorNode = node.questionDotToken;
82129
+ }
82130
+ node = node.expression;
82131
+ canHaveCallExpression = false;
82132
+ continue;
82133
+ }
82134
+ if (!isIdentifier(node)) {
82135
+ errorNode = node;
82136
+ }
82137
+ break;
82138
+ }
82139
+ if (errorNode) {
82140
+ addRelatedInfo(
82141
+ error2(decorator.expression, Diagnostics.Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator),
82142
+ createDiagnosticForNode(errorNode, Diagnostics.Invalid_syntax_in_decorator)
82143
+ );
82144
+ return true;
82145
+ }
82146
+ }
82147
+ return false;
82148
+ }
82113
82149
  function checkDecorator(node) {
82150
+ checkGrammarDecorator(node);
82114
82151
  const signature = getResolvedSignature(node);
82115
82152
  checkDeprecatedSignature(signature, node);
82116
82153
  const returnType = getReturnTypeOfSignature(signature);
@@ -94287,7 +94324,7 @@ function transformTypeScript(context) {
94287
94324
  ),
94288
94325
  valueExpression
94289
94326
  );
94290
- const outerAssignment = isSyntacticallyString(valueExpression) ? innerAssignment : factory2.createAssignment(
94327
+ const outerAssignment = valueExpression.kind === 11 /* StringLiteral */ ? innerAssignment : factory2.createAssignment(
94291
94328
  factory2.createElementAccessExpression(
94292
94329
  currentNamespaceContainerName,
94293
94330
  innerAssignment
@@ -145648,22 +145685,22 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
145648
145685
  }
145649
145686
  return [];
145650
145687
  }
145651
- function getCodeFixesAtPosition(fileName, start2, end, errorCodes65, formatOptions, preferences = emptyOptions) {
145688
+ function getCodeFixesAtPosition(fileName, start2, end, errorCodes66, formatOptions, preferences = emptyOptions) {
145652
145689
  synchronizeHostData();
145653
145690
  const sourceFile = getValidSourceFile(fileName);
145654
145691
  const span = createTextSpanFromBounds(start2, end);
145655
145692
  const formatContext = ts_formatting_exports.getFormatContext(formatOptions, host);
145656
- return flatMap(deduplicate(errorCodes65, equateValues, compareValues), (errorCode) => {
145693
+ return flatMap(deduplicate(errorCodes66, equateValues, compareValues), (errorCode) => {
145657
145694
  cancellationToken.throwIfCancellationRequested();
145658
145695
  return ts_codefix_exports.getFixes({ errorCode, sourceFile, span, program, host, cancellationToken, formatContext, preferences });
145659
145696
  });
145660
145697
  }
145661
- function getCombinedCodeFix(scope, fixId52, formatOptions, preferences = emptyOptions) {
145698
+ function getCombinedCodeFix(scope, fixId53, formatOptions, preferences = emptyOptions) {
145662
145699
  synchronizeHostData();
145663
145700
  Debug.assert(scope.type === "file");
145664
145701
  const sourceFile = getValidSourceFile(scope.fileName);
145665
145702
  const formatContext = ts_formatting_exports.getFormatContext(formatOptions, host);
145666
- return ts_codefix_exports.getAllFixes({ fixId: fixId52, sourceFile, program, host, cancellationToken, formatContext, preferences });
145703
+ return ts_codefix_exports.getAllFixes({ fixId: fixId53, sourceFile, program, host, cancellationToken, formatContext, preferences });
145667
145704
  }
145668
145705
  function organizeImports2(args, formatOptions, preferences = emptyOptions) {
145669
145706
  synchronizeHostData();
@@ -147342,14 +147379,14 @@ function createCodeFixActionWithoutFixAll(fixName8, changes, description3) {
147342
147379
  void 0
147343
147380
  );
147344
147381
  }
147345
- function createCodeFixAction(fixName8, changes, description3, fixId52, fixAllDescription, command) {
147346
- return createCodeFixActionWorker(fixName8, diagnosticToString(description3), changes, fixId52, diagnosticToString(fixAllDescription), command);
147382
+ function createCodeFixAction(fixName8, changes, description3, fixId53, fixAllDescription, command) {
147383
+ return createCodeFixActionWorker(fixName8, diagnosticToString(description3), changes, fixId53, diagnosticToString(fixAllDescription), command);
147347
147384
  }
147348
- function createCodeFixActionMaybeFixAll(fixName8, changes, description3, fixId52, fixAllDescription, command) {
147349
- return createCodeFixActionWorker(fixName8, diagnosticToString(description3), changes, fixId52, fixAllDescription && diagnosticToString(fixAllDescription), command);
147385
+ function createCodeFixActionMaybeFixAll(fixName8, changes, description3, fixId53, fixAllDescription, command) {
147386
+ return createCodeFixActionWorker(fixName8, diagnosticToString(description3), changes, fixId53, fixAllDescription && diagnosticToString(fixAllDescription), command);
147350
147387
  }
147351
- function createCodeFixActionWorker(fixName8, description3, changes, fixId52, fixAllDescription, command) {
147352
- return { fixName: fixName8, description: description3, changes, fixId: fixId52, fixAllDescription, commands: command ? [command] : void 0 };
147388
+ function createCodeFixActionWorker(fixName8, description3, changes, fixId53, fixAllDescription, command) {
147389
+ return { fixName: fixName8, description: description3, changes, fixId: fixId53, fixAllDescription, commands: command ? [command] : void 0 };
147353
147390
  }
147354
147391
  function registerCodeFix(reg) {
147355
147392
  for (const error2 of reg.errorCodes) {
@@ -147357,9 +147394,9 @@ function registerCodeFix(reg) {
147357
147394
  errorCodeToFixes.add(String(error2), reg);
147358
147395
  }
147359
147396
  if (reg.fixIds) {
147360
- for (const fixId52 of reg.fixIds) {
147361
- Debug.assert(!fixIdToRegistration.has(fixId52));
147362
- fixIdToRegistration.set(fixId52, reg);
147397
+ for (const fixId53 of reg.fixIds) {
147398
+ Debug.assert(!fixIdToRegistration.has(fixId53));
147399
+ fixIdToRegistration.set(fixId53, reg);
147363
147400
  }
147364
147401
  }
147365
147402
  }
@@ -147368,17 +147405,17 @@ function getSupportedErrorCodes() {
147368
147405
  return errorCodeToFixesArray ?? (errorCodeToFixesArray = arrayFrom(errorCodeToFixes.keys()));
147369
147406
  }
147370
147407
  function removeFixIdIfFixAllUnavailable(registration, diagnostics) {
147371
- const { errorCodes: errorCodes65 } = registration;
147408
+ const { errorCodes: errorCodes66 } = registration;
147372
147409
  let maybeFixableDiagnostics = 0;
147373
147410
  for (const diag2 of diagnostics) {
147374
- if (contains(errorCodes65, diag2.code))
147411
+ if (contains(errorCodes66, diag2.code))
147375
147412
  maybeFixableDiagnostics++;
147376
147413
  if (maybeFixableDiagnostics > 1)
147377
147414
  break;
147378
147415
  }
147379
147416
  const fixAllUnavailable = maybeFixableDiagnostics < 2;
147380
- return ({ fixId: fixId52, fixAllDescription, ...action }) => {
147381
- return fixAllUnavailable ? action : { ...action, fixId: fixId52, fixAllDescription };
147417
+ return ({ fixId: fixId53, fixAllDescription, ...action }) => {
147418
+ return fixAllUnavailable ? action : { ...action, fixId: fixId53, fixAllDescription };
147382
147419
  };
147383
147420
  }
147384
147421
  function getFixes(context) {
@@ -147395,14 +147432,14 @@ function createCombinedCodeActions(changes, commands) {
147395
147432
  function createFileTextChanges(fileName, textChanges2) {
147396
147433
  return { fileName, textChanges: textChanges2 };
147397
147434
  }
147398
- function codeFixAll(context, errorCodes65, use) {
147435
+ function codeFixAll(context, errorCodes66, use) {
147399
147436
  const commands = [];
147400
- const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => eachDiagnostic(context, errorCodes65, (diag2) => use(t, diag2, commands)));
147437
+ const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => eachDiagnostic(context, errorCodes66, (diag2) => use(t, diag2, commands)));
147401
147438
  return createCombinedCodeActions(changes, commands.length === 0 ? void 0 : commands);
147402
147439
  }
147403
- function eachDiagnostic(context, errorCodes65, cb) {
147440
+ function eachDiagnostic(context, errorCodes66, cb) {
147404
147441
  for (const diag2 of getDiagnostics(context)) {
147405
- if (contains(errorCodes65, diag2.code)) {
147442
+ if (contains(errorCodes66, diag2.code)) {
147406
147443
  cb(diag2);
147407
147444
  }
147408
147445
  }
@@ -151813,10 +151850,10 @@ registerCodeFix({
151813
151850
  const info = errorCodeFixIdMap[errorCode];
151814
151851
  if (!info)
151815
151852
  return emptyArray;
151816
- const { descriptions, fixId: fixId52, fixAllDescriptions } = info;
151853
+ const { descriptions, fixId: fixId53, fixAllDescriptions } = info;
151817
151854
  const changes = ts_textChanges_exports.ChangeTracker.with(context, (changes2) => dispatchChanges(changes2, context, errorCode, span.start));
151818
151855
  return [
151819
- createCodeFixActionMaybeFixAll(fixName, changes, descriptions, fixId52, fixAllDescriptions)
151856
+ createCodeFixActionMaybeFixAll(fixName, changes, descriptions, fixId53, fixAllDescriptions)
151820
151857
  ];
151821
151858
  },
151822
151859
  fixIds: [fixName, fixAddOverrideId, fixRemoveOverrideId],
@@ -152621,7 +152658,7 @@ registerCodeFix({
152621
152658
  },
152622
152659
  fixIds: [fixMissingMember, fixMissingFunctionDeclaration, fixMissingProperties, fixMissingAttributes],
152623
152660
  getAllCodeActions: (context) => {
152624
- const { program, fixId: fixId52 } = context;
152661
+ const { program, fixId: fixId53 } = context;
152625
152662
  const checker = program.getTypeChecker();
152626
152663
  const seen = /* @__PURE__ */ new Map();
152627
152664
  const typeDeclToMembers = /* @__PURE__ */ new Map();
@@ -152631,11 +152668,11 @@ registerCodeFix({
152631
152668
  if (!info || !addToSeen(seen, getNodeId(info.parentDeclaration) + "#" + (info.kind === 3 /* ObjectLiteral */ ? info.identifier : info.token.text))) {
152632
152669
  return;
152633
152670
  }
152634
- if (fixId52 === fixMissingFunctionDeclaration && (info.kind === 2 /* Function */ || info.kind === 5 /* Signature */)) {
152671
+ if (fixId53 === fixMissingFunctionDeclaration && (info.kind === 2 /* Function */ || info.kind === 5 /* Signature */)) {
152635
152672
  addFunctionDeclaration(changes, context, info);
152636
- } else if (fixId52 === fixMissingProperties && info.kind === 3 /* ObjectLiteral */) {
152673
+ } else if (fixId53 === fixMissingProperties && info.kind === 3 /* ObjectLiteral */) {
152637
152674
  addObjectLiteralProperties(changes, context, info);
152638
- } else if (fixId52 === fixMissingAttributes && info.kind === 4 /* JsxAttributes */) {
152675
+ } else if (fixId53 === fixMissingAttributes && info.kind === 4 /* JsxAttributes */) {
152639
152676
  addJsxAttributes(changes, context, info);
152640
152677
  } else {
152641
152678
  if (info.kind === 1 /* Enum */) {
@@ -154529,21 +154566,21 @@ registerCodeFix({
154529
154566
  actions2.push(fix(type, fixIdNullable, Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types));
154530
154567
  }
154531
154568
  return actions2;
154532
- function fix(type2, fixId52, fixAllDescription) {
154569
+ function fix(type2, fixId53, fixAllDescription) {
154533
154570
  const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange29(t, sourceFile, typeNode, type2, checker));
154534
- return createCodeFixAction("jdocTypes", changes, [Diagnostics.Change_0_to_1, original, checker.typeToString(type2)], fixId52, fixAllDescription);
154571
+ return createCodeFixAction("jdocTypes", changes, [Diagnostics.Change_0_to_1, original, checker.typeToString(type2)], fixId53, fixAllDescription);
154535
154572
  }
154536
154573
  },
154537
154574
  fixIds: [fixIdPlain, fixIdNullable],
154538
154575
  getAllCodeActions(context) {
154539
- const { fixId: fixId52, program, sourceFile } = context;
154576
+ const { fixId: fixId53, program, sourceFile } = context;
154540
154577
  const checker = program.getTypeChecker();
154541
154578
  return codeFixAll(context, errorCodes45, (changes, err) => {
154542
154579
  const info = getInfo15(err.file, err.start, checker);
154543
154580
  if (!info)
154544
154581
  return;
154545
154582
  const { typeNode, type } = info;
154546
- const fixedType = typeNode.kind === 314 /* JSDocNullableType */ && fixId52 === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type;
154583
+ const fixedType = typeNode.kind === 314 /* JSDocNullableType */ && fixId53 === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type;
154547
154584
  doChange29(changes, sourceFile, typeNode, fixedType, checker);
154548
154585
  });
154549
154586
  }
@@ -157251,11 +157288,31 @@ function flattenInvalidBinaryExpr(node) {
157251
157288
  }
157252
157289
  }
157253
157290
 
157254
- // src/services/codefixes/convertToMappedObjectType.ts
157255
- var fixId45 = "fixConvertToMappedObjectType";
157256
- var errorCodes58 = [Diagnostics.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead.code];
157291
+ // src/services/codefixes/wrapDecoratorInParentheses.ts
157292
+ var fixId45 = "wrapDecoratorInParentheses";
157293
+ var errorCodes58 = [Diagnostics.Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator.code];
157257
157294
  registerCodeFix({
157258
157295
  errorCodes: errorCodes58,
157296
+ getCodeActions: function getCodeActionsToWrapDecoratorExpressionInParentheses(context) {
157297
+ const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange10(t, context.sourceFile, context.span.start));
157298
+ return [createCodeFixAction(fixId45, changes, Diagnostics.Wrap_in_parentheses, fixId45, Diagnostics.Wrap_all_invalid_decorator_expressions_in_parentheses)];
157299
+ },
157300
+ fixIds: [fixId45],
157301
+ getAllCodeActions: (context) => codeFixAll(context, errorCodes58, (changes, diag2) => makeChange10(changes, diag2.file, diag2.start))
157302
+ });
157303
+ function makeChange10(changeTracker, sourceFile, pos) {
157304
+ const token = getTokenAtPosition(sourceFile, pos);
157305
+ const decorator = findAncestor(token, isDecorator);
157306
+ Debug.assert(!!decorator, "Expected position to be owned by a decorator.");
157307
+ const replacement = factory.createParenthesizedExpression(decorator.expression);
157308
+ changeTracker.replaceNode(sourceFile, decorator.expression, replacement);
157309
+ }
157310
+
157311
+ // src/services/codefixes/convertToMappedObjectType.ts
157312
+ var fixId46 = "fixConvertToMappedObjectType";
157313
+ var errorCodes59 = [Diagnostics.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead.code];
157314
+ registerCodeFix({
157315
+ errorCodes: errorCodes59,
157259
157316
  getCodeActions: function getCodeActionsToConvertToMappedTypeObject(context) {
157260
157317
  const { sourceFile, span } = context;
157261
157318
  const info = getInfo20(sourceFile, span.start);
@@ -157263,10 +157320,10 @@ registerCodeFix({
157263
157320
  return void 0;
157264
157321
  const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange39(t, sourceFile, info));
157265
157322
  const name = idText(info.container.name);
157266
- return [createCodeFixAction(fixId45, changes, [Diagnostics.Convert_0_to_mapped_object_type, name], fixId45, [Diagnostics.Convert_0_to_mapped_object_type, name])];
157323
+ return [createCodeFixAction(fixId46, changes, [Diagnostics.Convert_0_to_mapped_object_type, name], fixId46, [Diagnostics.Convert_0_to_mapped_object_type, name])];
157267
157324
  },
157268
- fixIds: [fixId45],
157269
- getAllCodeActions: (context) => codeFixAll(context, errorCodes58, (changes, diag2) => {
157325
+ fixIds: [fixId46],
157326
+ getAllCodeActions: (context) => codeFixAll(context, errorCodes59, (changes, diag2) => {
157270
157327
  const info = getInfo20(diag2.file, diag2.start);
157271
157328
  if (info)
157272
157329
  doChange39(changes, diag2.file, info);
@@ -157314,12 +157371,12 @@ function doChange39(changes, sourceFile, { indexSignature, container }) {
157314
157371
  }
157315
157372
 
157316
157373
  // src/services/codefixes/removeAccidentalCallParentheses.ts
157317
- var fixId46 = "removeAccidentalCallParentheses";
157318
- var errorCodes59 = [
157374
+ var fixId47 = "removeAccidentalCallParentheses";
157375
+ var errorCodes60 = [
157319
157376
  Diagnostics.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without.code
157320
157377
  ];
157321
157378
  registerCodeFix({
157322
- errorCodes: errorCodes59,
157379
+ errorCodes: errorCodes60,
157323
157380
  getCodeActions(context) {
157324
157381
  const callExpression = findAncestor(getTokenAtPosition(context.sourceFile, context.span.start), isCallExpression);
157325
157382
  if (!callExpression) {
@@ -157328,30 +157385,30 @@ registerCodeFix({
157328
157385
  const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => {
157329
157386
  t.deleteRange(context.sourceFile, { pos: callExpression.expression.end, end: callExpression.end });
157330
157387
  });
157331
- return [createCodeFixActionWithoutFixAll(fixId46, changes, Diagnostics.Remove_parentheses)];
157388
+ return [createCodeFixActionWithoutFixAll(fixId47, changes, Diagnostics.Remove_parentheses)];
157332
157389
  },
157333
- fixIds: [fixId46]
157390
+ fixIds: [fixId47]
157334
157391
  });
157335
157392
 
157336
157393
  // src/services/codefixes/removeUnnecessaryAwait.ts
157337
- var fixId47 = "removeUnnecessaryAwait";
157338
- var errorCodes60 = [
157394
+ var fixId48 = "removeUnnecessaryAwait";
157395
+ var errorCodes61 = [
157339
157396
  Diagnostics.await_has_no_effect_on_the_type_of_this_expression.code
157340
157397
  ];
157341
157398
  registerCodeFix({
157342
- errorCodes: errorCodes60,
157399
+ errorCodes: errorCodes61,
157343
157400
  getCodeActions: function getCodeActionsToRemoveUnnecessaryAwait(context) {
157344
- const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange10(t, context.sourceFile, context.span));
157401
+ const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange11(t, context.sourceFile, context.span));
157345
157402
  if (changes.length > 0) {
157346
- return [createCodeFixAction(fixId47, changes, Diagnostics.Remove_unnecessary_await, fixId47, Diagnostics.Remove_all_unnecessary_uses_of_await)];
157403
+ return [createCodeFixAction(fixId48, changes, Diagnostics.Remove_unnecessary_await, fixId48, Diagnostics.Remove_all_unnecessary_uses_of_await)];
157347
157404
  }
157348
157405
  },
157349
- fixIds: [fixId47],
157406
+ fixIds: [fixId48],
157350
157407
  getAllCodeActions: (context) => {
157351
- return codeFixAll(context, errorCodes60, (changes, diag2) => makeChange10(changes, diag2.file, diag2));
157408
+ return codeFixAll(context, errorCodes61, (changes, diag2) => makeChange11(changes, diag2.file, diag2));
157352
157409
  }
157353
157410
  });
157354
- function makeChange10(changeTracker, sourceFile, span) {
157411
+ function makeChange11(changeTracker, sourceFile, span) {
157355
157412
  const awaitKeyword = tryCast(getTokenAtPosition(sourceFile, span.start), (node) => node.kind === 135 /* AwaitKeyword */);
157356
157413
  const awaitExpression = awaitKeyword && tryCast(awaitKeyword.parent, isAwaitExpression);
157357
157414
  if (!awaitExpression) {
@@ -157376,20 +157433,20 @@ function makeChange10(changeTracker, sourceFile, span) {
157376
157433
  }
157377
157434
 
157378
157435
  // src/services/codefixes/splitTypeOnlyImport.ts
157379
- var errorCodes61 = [Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both.code];
157380
- var fixId48 = "splitTypeOnlyImport";
157436
+ var errorCodes62 = [Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both.code];
157437
+ var fixId49 = "splitTypeOnlyImport";
157381
157438
  registerCodeFix({
157382
- errorCodes: errorCodes61,
157383
- fixIds: [fixId48],
157439
+ errorCodes: errorCodes62,
157440
+ fixIds: [fixId49],
157384
157441
  getCodeActions: function getCodeActionsToSplitTypeOnlyImport(context) {
157385
157442
  const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => {
157386
157443
  return splitTypeOnlyImport(t, getImportDeclaration2(context.sourceFile, context.span), context);
157387
157444
  });
157388
157445
  if (changes.length) {
157389
- return [createCodeFixAction(fixId48, changes, Diagnostics.Split_into_two_separate_import_declarations, fixId48, Diagnostics.Split_all_invalid_type_only_imports)];
157446
+ return [createCodeFixAction(fixId49, changes, Diagnostics.Split_into_two_separate_import_declarations, fixId49, Diagnostics.Split_all_invalid_type_only_imports)];
157390
157447
  }
157391
157448
  },
157392
- getAllCodeActions: (context) => codeFixAll(context, errorCodes61, (changes, error2) => {
157449
+ getAllCodeActions: (context) => codeFixAll(context, errorCodes62, (changes, error2) => {
157393
157450
  splitTypeOnlyImport(changes, getImportDeclaration2(context.sourceFile, error2), context);
157394
157451
  })
157395
157452
  });
@@ -157438,23 +157495,23 @@ function splitTypeOnlyImport(changes, importDeclaration, context) {
157438
157495
  }
157439
157496
 
157440
157497
  // src/services/codefixes/convertConstToLet.ts
157441
- var fixId49 = "fixConvertConstToLet";
157442
- var errorCodes62 = [Diagnostics.Cannot_assign_to_0_because_it_is_a_constant.code];
157498
+ var fixId50 = "fixConvertConstToLet";
157499
+ var errorCodes63 = [Diagnostics.Cannot_assign_to_0_because_it_is_a_constant.code];
157443
157500
  registerCodeFix({
157444
- errorCodes: errorCodes62,
157501
+ errorCodes: errorCodes63,
157445
157502
  getCodeActions: function getCodeActionsToConvertConstToLet(context) {
157446
157503
  const { sourceFile, span, program } = context;
157447
157504
  const info = getInfo21(sourceFile, span.start, program);
157448
157505
  if (info === void 0)
157449
157506
  return;
157450
157507
  const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange40(t, sourceFile, info.token));
157451
- return [createCodeFixActionMaybeFixAll(fixId49, changes, Diagnostics.Convert_const_to_let, fixId49, Diagnostics.Convert_all_const_to_let)];
157508
+ return [createCodeFixActionMaybeFixAll(fixId50, changes, Diagnostics.Convert_const_to_let, fixId50, Diagnostics.Convert_all_const_to_let)];
157452
157509
  },
157453
157510
  getAllCodeActions: (context) => {
157454
157511
  const { program } = context;
157455
157512
  const seen = /* @__PURE__ */ new Map();
157456
157513
  return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, (changes) => {
157457
- eachDiagnostic(context, errorCodes62, (diag2) => {
157514
+ eachDiagnostic(context, errorCodes63, (diag2) => {
157458
157515
  const info = getInfo21(diag2.file, diag2.start, program);
157459
157516
  if (info) {
157460
157517
  if (addToSeen(seen, getSymbolId(info.symbol))) {
@@ -157465,7 +157522,7 @@ registerCodeFix({
157465
157522
  });
157466
157523
  }));
157467
157524
  },
157468
- fixIds: [fixId49]
157525
+ fixIds: [fixId50]
157469
157526
  });
157470
157527
  function getInfo21(sourceFile, pos, program) {
157471
157528
  var _a;
@@ -157486,11 +157543,11 @@ function doChange40(changes, sourceFile, token) {
157486
157543
  }
157487
157544
 
157488
157545
  // src/services/codefixes/fixExpectedComma.ts
157489
- var fixId50 = "fixExpectedComma";
157546
+ var fixId51 = "fixExpectedComma";
157490
157547
  var expectedErrorCode = Diagnostics._0_expected.code;
157491
- var errorCodes63 = [expectedErrorCode];
157548
+ var errorCodes64 = [expectedErrorCode];
157492
157549
  registerCodeFix({
157493
- errorCodes: errorCodes63,
157550
+ errorCodes: errorCodes64,
157494
157551
  getCodeActions(context) {
157495
157552
  const { sourceFile } = context;
157496
157553
  const info = getInfo22(sourceFile, context.span.start, context.errorCode);
@@ -157498,15 +157555,15 @@ registerCodeFix({
157498
157555
  return void 0;
157499
157556
  const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange41(t, sourceFile, info));
157500
157557
  return [createCodeFixAction(
157501
- fixId50,
157558
+ fixId51,
157502
157559
  changes,
157503
157560
  [Diagnostics.Change_0_to_1, ";", ","],
157504
- fixId50,
157561
+ fixId51,
157505
157562
  [Diagnostics.Change_0_to_1, ";", ","]
157506
157563
  )];
157507
157564
  },
157508
- fixIds: [fixId50],
157509
- getAllCodeActions: (context) => codeFixAll(context, errorCodes63, (changes, diag2) => {
157565
+ fixIds: [fixId51],
157566
+ getAllCodeActions: (context) => codeFixAll(context, errorCodes64, (changes, diag2) => {
157510
157567
  const info = getInfo22(diag2.file, diag2.start, diag2.code);
157511
157568
  if (info)
157512
157569
  doChange41(changes, context.sourceFile, info);
@@ -157523,25 +157580,25 @@ function doChange41(changes, sourceFile, { node }) {
157523
157580
 
157524
157581
  // src/services/codefixes/fixAddVoidToPromise.ts
157525
157582
  var fixName7 = "addVoidToPromise";
157526
- var fixId51 = "addVoidToPromise";
157527
- var errorCodes64 = [
157583
+ var fixId52 = "addVoidToPromise";
157584
+ var errorCodes65 = [
157528
157585
  Diagnostics.Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments.code,
157529
157586
  Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise.code
157530
157587
  ];
157531
157588
  registerCodeFix({
157532
- errorCodes: errorCodes64,
157533
- fixIds: [fixId51],
157589
+ errorCodes: errorCodes65,
157590
+ fixIds: [fixId52],
157534
157591
  getCodeActions(context) {
157535
- const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange11(t, context.sourceFile, context.span, context.program));
157592
+ const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange12(t, context.sourceFile, context.span, context.program));
157536
157593
  if (changes.length > 0) {
157537
- return [createCodeFixAction(fixName7, changes, Diagnostics.Add_void_to_Promise_resolved_without_a_value, fixId51, Diagnostics.Add_void_to_all_Promises_resolved_without_a_value)];
157594
+ return [createCodeFixAction(fixName7, changes, Diagnostics.Add_void_to_Promise_resolved_without_a_value, fixId52, Diagnostics.Add_void_to_all_Promises_resolved_without_a_value)];
157538
157595
  }
157539
157596
  },
157540
157597
  getAllCodeActions(context) {
157541
- return codeFixAll(context, errorCodes64, (changes, diag2) => makeChange11(changes, diag2.file, diag2, context.program, /* @__PURE__ */ new Set()));
157598
+ return codeFixAll(context, errorCodes65, (changes, diag2) => makeChange12(changes, diag2.file, diag2, context.program, /* @__PURE__ */ new Set()));
157542
157599
  }
157543
157600
  });
157544
- function makeChange11(changes, sourceFile, span, program, seen) {
157601
+ function makeChange12(changes, sourceFile, span, program, seen) {
157545
157602
  const node = getTokenAtPosition(sourceFile, span.start);
157546
157603
  if (!isIdentifier(node) || !isCallExpression(node.parent) || node.parent.expression !== node || node.parent.arguments.length !== 0)
157547
157604
  return;
@@ -175026,7 +175083,6 @@ __export(ts_exports2, {
175026
175083
  isSuperProperty: () => isSuperProperty,
175027
175084
  isSupportedSourceFileName: () => isSupportedSourceFileName,
175028
175085
  isSwitchStatement: () => isSwitchStatement,
175029
- isSyntacticallyString: () => isSyntacticallyString,
175030
175086
  isSyntaxList: () => isSyntaxList,
175031
175087
  isSyntheticExpression: () => isSyntheticExpression,
175032
175088
  isSyntheticReference: () => isSyntheticReference,
@@ -186030,10 +186086,10 @@ ${e.message}`;
186030
186086
  }
186031
186087
  return simplifiedResult ? codeActions.map((codeAction) => this.mapCodeFixAction(codeAction)) : codeActions;
186032
186088
  }
186033
- getCombinedCodeFix({ scope, fixId: fixId52 }, simplifiedResult) {
186089
+ getCombinedCodeFix({ scope, fixId: fixId53 }, simplifiedResult) {
186034
186090
  Debug.assert(scope.type === "file");
186035
186091
  const { file, project } = this.getFileAndProject(scope.args);
186036
- const res = project.getLanguageService().getCombinedCodeFix({ type: "file", fileName: file }, fixId52, this.getFormatOptions(file), this.getPreferences(file));
186092
+ const res = project.getLanguageService().getCombinedCodeFix({ type: "file", fileName: file }, fixId53, this.getFormatOptions(file), this.getPreferences(file));
186037
186093
  if (simplifiedResult) {
186038
186094
  return { changes: this.mapTextChangesToCodeEdits(res.changes), commands: res.commands };
186039
186095
  } else {
@@ -186072,8 +186128,8 @@ ${e.message}`;
186072
186128
  mapCodeAction({ description: description3, changes, commands }) {
186073
186129
  return { description: description3, changes: this.mapTextChangesToCodeEdits(changes), commands };
186074
186130
  }
186075
- mapCodeFixAction({ fixName: fixName8, description: description3, changes, commands, fixId: fixId52, fixAllDescription }) {
186076
- return { fixName: fixName8, description: description3, changes: this.mapTextChangesToCodeEdits(changes), commands, fixId: fixId52, fixAllDescription };
186131
+ mapCodeFixAction({ fixName: fixName8, description: description3, changes, commands, fixId: fixId53, fixAllDescription }) {
186132
+ return { fixName: fixName8, description: description3, changes: this.mapTextChangesToCodeEdits(changes), commands, fixId: fixId53, fixAllDescription };
186077
186133
  }
186078
186134
  mapTextChangesToCodeEdits(textChanges2) {
186079
186135
  return textChanges2.map((change) => this.mapTextChangeToCodeEdit(change));
@@ -189803,7 +189859,6 @@ start(initializeNodeSystem(), require("os").platform());
189803
189859
  isSuperProperty,
189804
189860
  isSupportedSourceFileName,
189805
189861
  isSwitchStatement,
189806
- isSyntacticallyString,
189807
189862
  isSyntaxList,
189808
189863
  isSyntheticExpression,
189809
189864
  isSyntheticReference,
package/lib/typescript.js CHANGED
@@ -1760,7 +1760,6 @@ __export(typescript_exports, {
1760
1760
  isSuperProperty: () => isSuperProperty,
1761
1761
  isSupportedSourceFileName: () => isSupportedSourceFileName,
1762
1762
  isSwitchStatement: () => isSwitchStatement,
1763
- isSyntacticallyString: () => isSyntacticallyString,
1764
1763
  isSyntaxList: () => isSyntaxList,
1765
1764
  isSyntheticExpression: () => isSyntheticExpression,
1766
1765
  isSyntheticReference: () => isSyntheticReference,
@@ -9676,6 +9675,8 @@ var Diagnostics = {
9676
9675
  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."),
9677
9676
  _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."),
9678
9677
  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."),
9678
+ 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."),
9679
+ Invalid_syntax_in_decorator: diag(1498, 1 /* Error */, "Invalid_syntax_in_decorator_1498", "Invalid syntax in decorator."),
9679
9680
  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."),
9680
9681
  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."),
9681
9682
  Call_signature_return_types_0_and_1_are_incompatible: diag(
@@ -11323,6 +11324,8 @@ var Diagnostics = {
11323
11324
  Add_optional_parameter_to_0: diag(95191, 3 /* Message */, "Add_optional_parameter_to_0_95191", "Add optional parameter to '{0}'"),
11324
11325
  Add_optional_parameters_to_0: diag(95192, 3 /* Message */, "Add_optional_parameters_to_0_95192", "Add optional parameters to '{0}'"),
11325
11326
  Add_all_optional_parameters: diag(95193, 3 /* Message */, "Add_all_optional_parameters_95193", "Add all optional parameters"),
11327
+ Wrap_in_parentheses: diag(95194, 3 /* Message */, "Wrap_in_parentheses_95194", "Wrap in parentheses"),
11328
+ 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"),
11326
11329
  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."),
11327
11330
  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'."),
11328
11331
  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?"),
@@ -21908,21 +21911,6 @@ function replaceFirstStar(s, replacement) {
21908
21911
  function getNameFromImportAttribute(node) {
21909
21912
  return isIdentifier(node.name) ? node.name.escapedText : escapeLeadingUnderscores(node.name.text);
21910
21913
  }
21911
- function isSyntacticallyString(expr) {
21912
- switch (expr.kind) {
21913
- case 226 /* BinaryExpression */:
21914
- const left = expr.left;
21915
- const right = expr.right;
21916
- return expr.operatorToken.kind === 40 /* PlusToken */ && (isSyntacticallyString(left) || isSyntacticallyString(right));
21917
- case 217 /* ParenthesizedExpression */:
21918
- return isSyntacticallyString(expr.expression);
21919
- case 228 /* TemplateExpression */:
21920
- case 11 /* StringLiteral */:
21921
- case 15 /* NoSubstitutionTemplateLiteral */:
21922
- return true;
21923
- }
21924
- return false;
21925
- }
21926
21914
 
21927
21915
  // src/compiler/factory/baseNodeFactory.ts
21928
21916
  function createBaseNodeFactory() {
@@ -82110,7 +82098,56 @@ function createTypeChecker(host) {
82110
82098
  }
82111
82099
  }
82112
82100
  }
82101
+ function checkGrammarDecorator(decorator) {
82102
+ const sourceFile = getSourceFileOfNode(decorator);
82103
+ if (!hasParseDiagnostics(sourceFile)) {
82104
+ let node = decorator.expression;
82105
+ if (isParenthesizedExpression(node)) {
82106
+ return false;
82107
+ }
82108
+ let canHaveCallExpression = true;
82109
+ let errorNode;
82110
+ while (true) {
82111
+ if (isExpressionWithTypeArguments(node) || isNonNullExpression(node)) {
82112
+ node = node.expression;
82113
+ continue;
82114
+ }
82115
+ if (isCallExpression(node)) {
82116
+ if (!canHaveCallExpression) {
82117
+ errorNode = node;
82118
+ }
82119
+ if (node.questionDotToken) {
82120
+ errorNode = node.questionDotToken;
82121
+ }
82122
+ node = node.expression;
82123
+ canHaveCallExpression = false;
82124
+ continue;
82125
+ }
82126
+ if (isPropertyAccessExpression(node)) {
82127
+ if (node.questionDotToken) {
82128
+ errorNode = node.questionDotToken;
82129
+ }
82130
+ node = node.expression;
82131
+ canHaveCallExpression = false;
82132
+ continue;
82133
+ }
82134
+ if (!isIdentifier(node)) {
82135
+ errorNode = node;
82136
+ }
82137
+ break;
82138
+ }
82139
+ if (errorNode) {
82140
+ addRelatedInfo(
82141
+ error2(decorator.expression, Diagnostics.Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator),
82142
+ createDiagnosticForNode(errorNode, Diagnostics.Invalid_syntax_in_decorator)
82143
+ );
82144
+ return true;
82145
+ }
82146
+ }
82147
+ return false;
82148
+ }
82113
82149
  function checkDecorator(node) {
82150
+ checkGrammarDecorator(node);
82114
82151
  const signature = getResolvedSignature(node);
82115
82152
  checkDeprecatedSignature(signature, node);
82116
82153
  const returnType = getReturnTypeOfSignature(signature);
@@ -94287,7 +94324,7 @@ function transformTypeScript(context) {
94287
94324
  ),
94288
94325
  valueExpression
94289
94326
  );
94290
- const outerAssignment = isSyntacticallyString(valueExpression) ? innerAssignment : factory2.createAssignment(
94327
+ const outerAssignment = valueExpression.kind === 11 /* StringLiteral */ ? innerAssignment : factory2.createAssignment(
94291
94328
  factory2.createElementAccessExpression(
94292
94329
  currentNamespaceContainerName,
94293
94330
  innerAssignment
@@ -145648,22 +145685,22 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
145648
145685
  }
145649
145686
  return [];
145650
145687
  }
145651
- function getCodeFixesAtPosition(fileName, start, end, errorCodes65, formatOptions, preferences = emptyOptions) {
145688
+ function getCodeFixesAtPosition(fileName, start, end, errorCodes66, formatOptions, preferences = emptyOptions) {
145652
145689
  synchronizeHostData();
145653
145690
  const sourceFile = getValidSourceFile(fileName);
145654
145691
  const span = createTextSpanFromBounds(start, end);
145655
145692
  const formatContext = ts_formatting_exports.getFormatContext(formatOptions, host);
145656
- return flatMap(deduplicate(errorCodes65, equateValues, compareValues), (errorCode) => {
145693
+ return flatMap(deduplicate(errorCodes66, equateValues, compareValues), (errorCode) => {
145657
145694
  cancellationToken.throwIfCancellationRequested();
145658
145695
  return ts_codefix_exports.getFixes({ errorCode, sourceFile, span, program, host, cancellationToken, formatContext, preferences });
145659
145696
  });
145660
145697
  }
145661
- function getCombinedCodeFix(scope, fixId52, formatOptions, preferences = emptyOptions) {
145698
+ function getCombinedCodeFix(scope, fixId53, formatOptions, preferences = emptyOptions) {
145662
145699
  synchronizeHostData();
145663
145700
  Debug.assert(scope.type === "file");
145664
145701
  const sourceFile = getValidSourceFile(scope.fileName);
145665
145702
  const formatContext = ts_formatting_exports.getFormatContext(formatOptions, host);
145666
- return ts_codefix_exports.getAllFixes({ fixId: fixId52, sourceFile, program, host, cancellationToken, formatContext, preferences });
145703
+ return ts_codefix_exports.getAllFixes({ fixId: fixId53, sourceFile, program, host, cancellationToken, formatContext, preferences });
145667
145704
  }
145668
145705
  function organizeImports2(args, formatOptions, preferences = emptyOptions) {
145669
145706
  synchronizeHostData();
@@ -147342,14 +147379,14 @@ function createCodeFixActionWithoutFixAll(fixName8, changes, description3) {
147342
147379
  void 0
147343
147380
  );
147344
147381
  }
147345
- function createCodeFixAction(fixName8, changes, description3, fixId52, fixAllDescription, command) {
147346
- return createCodeFixActionWorker(fixName8, diagnosticToString(description3), changes, fixId52, diagnosticToString(fixAllDescription), command);
147382
+ function createCodeFixAction(fixName8, changes, description3, fixId53, fixAllDescription, command) {
147383
+ return createCodeFixActionWorker(fixName8, diagnosticToString(description3), changes, fixId53, diagnosticToString(fixAllDescription), command);
147347
147384
  }
147348
- function createCodeFixActionMaybeFixAll(fixName8, changes, description3, fixId52, fixAllDescription, command) {
147349
- return createCodeFixActionWorker(fixName8, diagnosticToString(description3), changes, fixId52, fixAllDescription && diagnosticToString(fixAllDescription), command);
147385
+ function createCodeFixActionMaybeFixAll(fixName8, changes, description3, fixId53, fixAllDescription, command) {
147386
+ return createCodeFixActionWorker(fixName8, diagnosticToString(description3), changes, fixId53, fixAllDescription && diagnosticToString(fixAllDescription), command);
147350
147387
  }
147351
- function createCodeFixActionWorker(fixName8, description3, changes, fixId52, fixAllDescription, command) {
147352
- return { fixName: fixName8, description: description3, changes, fixId: fixId52, fixAllDescription, commands: command ? [command] : void 0 };
147388
+ function createCodeFixActionWorker(fixName8, description3, changes, fixId53, fixAllDescription, command) {
147389
+ return { fixName: fixName8, description: description3, changes, fixId: fixId53, fixAllDescription, commands: command ? [command] : void 0 };
147353
147390
  }
147354
147391
  function registerCodeFix(reg) {
147355
147392
  for (const error2 of reg.errorCodes) {
@@ -147357,9 +147394,9 @@ function registerCodeFix(reg) {
147357
147394
  errorCodeToFixes.add(String(error2), reg);
147358
147395
  }
147359
147396
  if (reg.fixIds) {
147360
- for (const fixId52 of reg.fixIds) {
147361
- Debug.assert(!fixIdToRegistration.has(fixId52));
147362
- fixIdToRegistration.set(fixId52, reg);
147397
+ for (const fixId53 of reg.fixIds) {
147398
+ Debug.assert(!fixIdToRegistration.has(fixId53));
147399
+ fixIdToRegistration.set(fixId53, reg);
147363
147400
  }
147364
147401
  }
147365
147402
  }
@@ -147368,17 +147405,17 @@ function getSupportedErrorCodes() {
147368
147405
  return errorCodeToFixesArray ?? (errorCodeToFixesArray = arrayFrom(errorCodeToFixes.keys()));
147369
147406
  }
147370
147407
  function removeFixIdIfFixAllUnavailable(registration, diagnostics) {
147371
- const { errorCodes: errorCodes65 } = registration;
147408
+ const { errorCodes: errorCodes66 } = registration;
147372
147409
  let maybeFixableDiagnostics = 0;
147373
147410
  for (const diag2 of diagnostics) {
147374
- if (contains(errorCodes65, diag2.code))
147411
+ if (contains(errorCodes66, diag2.code))
147375
147412
  maybeFixableDiagnostics++;
147376
147413
  if (maybeFixableDiagnostics > 1)
147377
147414
  break;
147378
147415
  }
147379
147416
  const fixAllUnavailable = maybeFixableDiagnostics < 2;
147380
- return ({ fixId: fixId52, fixAllDescription, ...action }) => {
147381
- return fixAllUnavailable ? action : { ...action, fixId: fixId52, fixAllDescription };
147417
+ return ({ fixId: fixId53, fixAllDescription, ...action }) => {
147418
+ return fixAllUnavailable ? action : { ...action, fixId: fixId53, fixAllDescription };
147382
147419
  };
147383
147420
  }
147384
147421
  function getFixes(context) {
@@ -147395,14 +147432,14 @@ function createCombinedCodeActions(changes, commands) {
147395
147432
  function createFileTextChanges(fileName, textChanges2) {
147396
147433
  return { fileName, textChanges: textChanges2 };
147397
147434
  }
147398
- function codeFixAll(context, errorCodes65, use) {
147435
+ function codeFixAll(context, errorCodes66, use) {
147399
147436
  const commands = [];
147400
- const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => eachDiagnostic(context, errorCodes65, (diag2) => use(t, diag2, commands)));
147437
+ const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => eachDiagnostic(context, errorCodes66, (diag2) => use(t, diag2, commands)));
147401
147438
  return createCombinedCodeActions(changes, commands.length === 0 ? void 0 : commands);
147402
147439
  }
147403
- function eachDiagnostic(context, errorCodes65, cb) {
147440
+ function eachDiagnostic(context, errorCodes66, cb) {
147404
147441
  for (const diag2 of getDiagnostics(context)) {
147405
- if (contains(errorCodes65, diag2.code)) {
147442
+ if (contains(errorCodes66, diag2.code)) {
147406
147443
  cb(diag2);
147407
147444
  }
147408
147445
  }
@@ -151813,10 +151850,10 @@ registerCodeFix({
151813
151850
  const info = errorCodeFixIdMap[errorCode];
151814
151851
  if (!info)
151815
151852
  return emptyArray;
151816
- const { descriptions, fixId: fixId52, fixAllDescriptions } = info;
151853
+ const { descriptions, fixId: fixId53, fixAllDescriptions } = info;
151817
151854
  const changes = ts_textChanges_exports.ChangeTracker.with(context, (changes2) => dispatchChanges(changes2, context, errorCode, span.start));
151818
151855
  return [
151819
- createCodeFixActionMaybeFixAll(fixName, changes, descriptions, fixId52, fixAllDescriptions)
151856
+ createCodeFixActionMaybeFixAll(fixName, changes, descriptions, fixId53, fixAllDescriptions)
151820
151857
  ];
151821
151858
  },
151822
151859
  fixIds: [fixName, fixAddOverrideId, fixRemoveOverrideId],
@@ -152621,7 +152658,7 @@ registerCodeFix({
152621
152658
  },
152622
152659
  fixIds: [fixMissingMember, fixMissingFunctionDeclaration, fixMissingProperties, fixMissingAttributes],
152623
152660
  getAllCodeActions: (context) => {
152624
- const { program, fixId: fixId52 } = context;
152661
+ const { program, fixId: fixId53 } = context;
152625
152662
  const checker = program.getTypeChecker();
152626
152663
  const seen = /* @__PURE__ */ new Map();
152627
152664
  const typeDeclToMembers = /* @__PURE__ */ new Map();
@@ -152631,11 +152668,11 @@ registerCodeFix({
152631
152668
  if (!info || !addToSeen(seen, getNodeId(info.parentDeclaration) + "#" + (info.kind === 3 /* ObjectLiteral */ ? info.identifier : info.token.text))) {
152632
152669
  return;
152633
152670
  }
152634
- if (fixId52 === fixMissingFunctionDeclaration && (info.kind === 2 /* Function */ || info.kind === 5 /* Signature */)) {
152671
+ if (fixId53 === fixMissingFunctionDeclaration && (info.kind === 2 /* Function */ || info.kind === 5 /* Signature */)) {
152635
152672
  addFunctionDeclaration(changes, context, info);
152636
- } else if (fixId52 === fixMissingProperties && info.kind === 3 /* ObjectLiteral */) {
152673
+ } else if (fixId53 === fixMissingProperties && info.kind === 3 /* ObjectLiteral */) {
152637
152674
  addObjectLiteralProperties(changes, context, info);
152638
- } else if (fixId52 === fixMissingAttributes && info.kind === 4 /* JsxAttributes */) {
152675
+ } else if (fixId53 === fixMissingAttributes && info.kind === 4 /* JsxAttributes */) {
152639
152676
  addJsxAttributes(changes, context, info);
152640
152677
  } else {
152641
152678
  if (info.kind === 1 /* Enum */) {
@@ -154529,21 +154566,21 @@ registerCodeFix({
154529
154566
  actions2.push(fix(type, fixIdNullable, Diagnostics.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types));
154530
154567
  }
154531
154568
  return actions2;
154532
- function fix(type2, fixId52, fixAllDescription) {
154569
+ function fix(type2, fixId53, fixAllDescription) {
154533
154570
  const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange29(t, sourceFile, typeNode, type2, checker));
154534
- return createCodeFixAction("jdocTypes", changes, [Diagnostics.Change_0_to_1, original, checker.typeToString(type2)], fixId52, fixAllDescription);
154571
+ return createCodeFixAction("jdocTypes", changes, [Diagnostics.Change_0_to_1, original, checker.typeToString(type2)], fixId53, fixAllDescription);
154535
154572
  }
154536
154573
  },
154537
154574
  fixIds: [fixIdPlain, fixIdNullable],
154538
154575
  getAllCodeActions(context) {
154539
- const { fixId: fixId52, program, sourceFile } = context;
154576
+ const { fixId: fixId53, program, sourceFile } = context;
154540
154577
  const checker = program.getTypeChecker();
154541
154578
  return codeFixAll(context, errorCodes45, (changes, err) => {
154542
154579
  const info = getInfo15(err.file, err.start, checker);
154543
154580
  if (!info)
154544
154581
  return;
154545
154582
  const { typeNode, type } = info;
154546
- const fixedType = typeNode.kind === 314 /* JSDocNullableType */ && fixId52 === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type;
154583
+ const fixedType = typeNode.kind === 314 /* JSDocNullableType */ && fixId53 === fixIdNullable ? checker.getNullableType(type, 32768 /* Undefined */) : type;
154547
154584
  doChange29(changes, sourceFile, typeNode, fixedType, checker);
154548
154585
  });
154549
154586
  }
@@ -157251,11 +157288,31 @@ function flattenInvalidBinaryExpr(node) {
157251
157288
  }
157252
157289
  }
157253
157290
 
157254
- // src/services/codefixes/convertToMappedObjectType.ts
157255
- var fixId45 = "fixConvertToMappedObjectType";
157256
- var errorCodes58 = [Diagnostics.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead.code];
157291
+ // src/services/codefixes/wrapDecoratorInParentheses.ts
157292
+ var fixId45 = "wrapDecoratorInParentheses";
157293
+ var errorCodes58 = [Diagnostics.Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator.code];
157257
157294
  registerCodeFix({
157258
157295
  errorCodes: errorCodes58,
157296
+ getCodeActions: function getCodeActionsToWrapDecoratorExpressionInParentheses(context) {
157297
+ const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange10(t, context.sourceFile, context.span.start));
157298
+ return [createCodeFixAction(fixId45, changes, Diagnostics.Wrap_in_parentheses, fixId45, Diagnostics.Wrap_all_invalid_decorator_expressions_in_parentheses)];
157299
+ },
157300
+ fixIds: [fixId45],
157301
+ getAllCodeActions: (context) => codeFixAll(context, errorCodes58, (changes, diag2) => makeChange10(changes, diag2.file, diag2.start))
157302
+ });
157303
+ function makeChange10(changeTracker, sourceFile, pos) {
157304
+ const token = getTokenAtPosition(sourceFile, pos);
157305
+ const decorator = findAncestor(token, isDecorator);
157306
+ Debug.assert(!!decorator, "Expected position to be owned by a decorator.");
157307
+ const replacement = factory.createParenthesizedExpression(decorator.expression);
157308
+ changeTracker.replaceNode(sourceFile, decorator.expression, replacement);
157309
+ }
157310
+
157311
+ // src/services/codefixes/convertToMappedObjectType.ts
157312
+ var fixId46 = "fixConvertToMappedObjectType";
157313
+ var errorCodes59 = [Diagnostics.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead.code];
157314
+ registerCodeFix({
157315
+ errorCodes: errorCodes59,
157259
157316
  getCodeActions: function getCodeActionsToConvertToMappedTypeObject(context) {
157260
157317
  const { sourceFile, span } = context;
157261
157318
  const info = getInfo20(sourceFile, span.start);
@@ -157263,10 +157320,10 @@ registerCodeFix({
157263
157320
  return void 0;
157264
157321
  const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange39(t, sourceFile, info));
157265
157322
  const name = idText(info.container.name);
157266
- return [createCodeFixAction(fixId45, changes, [Diagnostics.Convert_0_to_mapped_object_type, name], fixId45, [Diagnostics.Convert_0_to_mapped_object_type, name])];
157323
+ return [createCodeFixAction(fixId46, changes, [Diagnostics.Convert_0_to_mapped_object_type, name], fixId46, [Diagnostics.Convert_0_to_mapped_object_type, name])];
157267
157324
  },
157268
- fixIds: [fixId45],
157269
- getAllCodeActions: (context) => codeFixAll(context, errorCodes58, (changes, diag2) => {
157325
+ fixIds: [fixId46],
157326
+ getAllCodeActions: (context) => codeFixAll(context, errorCodes59, (changes, diag2) => {
157270
157327
  const info = getInfo20(diag2.file, diag2.start);
157271
157328
  if (info)
157272
157329
  doChange39(changes, diag2.file, info);
@@ -157314,12 +157371,12 @@ function doChange39(changes, sourceFile, { indexSignature, container }) {
157314
157371
  }
157315
157372
 
157316
157373
  // src/services/codefixes/removeAccidentalCallParentheses.ts
157317
- var fixId46 = "removeAccidentalCallParentheses";
157318
- var errorCodes59 = [
157374
+ var fixId47 = "removeAccidentalCallParentheses";
157375
+ var errorCodes60 = [
157319
157376
  Diagnostics.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without.code
157320
157377
  ];
157321
157378
  registerCodeFix({
157322
- errorCodes: errorCodes59,
157379
+ errorCodes: errorCodes60,
157323
157380
  getCodeActions(context) {
157324
157381
  const callExpression = findAncestor(getTokenAtPosition(context.sourceFile, context.span.start), isCallExpression);
157325
157382
  if (!callExpression) {
@@ -157328,30 +157385,30 @@ registerCodeFix({
157328
157385
  const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => {
157329
157386
  t.deleteRange(context.sourceFile, { pos: callExpression.expression.end, end: callExpression.end });
157330
157387
  });
157331
- return [createCodeFixActionWithoutFixAll(fixId46, changes, Diagnostics.Remove_parentheses)];
157388
+ return [createCodeFixActionWithoutFixAll(fixId47, changes, Diagnostics.Remove_parentheses)];
157332
157389
  },
157333
- fixIds: [fixId46]
157390
+ fixIds: [fixId47]
157334
157391
  });
157335
157392
 
157336
157393
  // src/services/codefixes/removeUnnecessaryAwait.ts
157337
- var fixId47 = "removeUnnecessaryAwait";
157338
- var errorCodes60 = [
157394
+ var fixId48 = "removeUnnecessaryAwait";
157395
+ var errorCodes61 = [
157339
157396
  Diagnostics.await_has_no_effect_on_the_type_of_this_expression.code
157340
157397
  ];
157341
157398
  registerCodeFix({
157342
- errorCodes: errorCodes60,
157399
+ errorCodes: errorCodes61,
157343
157400
  getCodeActions: function getCodeActionsToRemoveUnnecessaryAwait(context) {
157344
- const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange10(t, context.sourceFile, context.span));
157401
+ const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange11(t, context.sourceFile, context.span));
157345
157402
  if (changes.length > 0) {
157346
- return [createCodeFixAction(fixId47, changes, Diagnostics.Remove_unnecessary_await, fixId47, Diagnostics.Remove_all_unnecessary_uses_of_await)];
157403
+ return [createCodeFixAction(fixId48, changes, Diagnostics.Remove_unnecessary_await, fixId48, Diagnostics.Remove_all_unnecessary_uses_of_await)];
157347
157404
  }
157348
157405
  },
157349
- fixIds: [fixId47],
157406
+ fixIds: [fixId48],
157350
157407
  getAllCodeActions: (context) => {
157351
- return codeFixAll(context, errorCodes60, (changes, diag2) => makeChange10(changes, diag2.file, diag2));
157408
+ return codeFixAll(context, errorCodes61, (changes, diag2) => makeChange11(changes, diag2.file, diag2));
157352
157409
  }
157353
157410
  });
157354
- function makeChange10(changeTracker, sourceFile, span) {
157411
+ function makeChange11(changeTracker, sourceFile, span) {
157355
157412
  const awaitKeyword = tryCast(getTokenAtPosition(sourceFile, span.start), (node) => node.kind === 135 /* AwaitKeyword */);
157356
157413
  const awaitExpression = awaitKeyword && tryCast(awaitKeyword.parent, isAwaitExpression);
157357
157414
  if (!awaitExpression) {
@@ -157376,20 +157433,20 @@ function makeChange10(changeTracker, sourceFile, span) {
157376
157433
  }
157377
157434
 
157378
157435
  // src/services/codefixes/splitTypeOnlyImport.ts
157379
- var errorCodes61 = [Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both.code];
157380
- var fixId48 = "splitTypeOnlyImport";
157436
+ var errorCodes62 = [Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both.code];
157437
+ var fixId49 = "splitTypeOnlyImport";
157381
157438
  registerCodeFix({
157382
- errorCodes: errorCodes61,
157383
- fixIds: [fixId48],
157439
+ errorCodes: errorCodes62,
157440
+ fixIds: [fixId49],
157384
157441
  getCodeActions: function getCodeActionsToSplitTypeOnlyImport(context) {
157385
157442
  const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => {
157386
157443
  return splitTypeOnlyImport(t, getImportDeclaration2(context.sourceFile, context.span), context);
157387
157444
  });
157388
157445
  if (changes.length) {
157389
- return [createCodeFixAction(fixId48, changes, Diagnostics.Split_into_two_separate_import_declarations, fixId48, Diagnostics.Split_all_invalid_type_only_imports)];
157446
+ return [createCodeFixAction(fixId49, changes, Diagnostics.Split_into_two_separate_import_declarations, fixId49, Diagnostics.Split_all_invalid_type_only_imports)];
157390
157447
  }
157391
157448
  },
157392
- getAllCodeActions: (context) => codeFixAll(context, errorCodes61, (changes, error2) => {
157449
+ getAllCodeActions: (context) => codeFixAll(context, errorCodes62, (changes, error2) => {
157393
157450
  splitTypeOnlyImport(changes, getImportDeclaration2(context.sourceFile, error2), context);
157394
157451
  })
157395
157452
  });
@@ -157438,23 +157495,23 @@ function splitTypeOnlyImport(changes, importDeclaration, context) {
157438
157495
  }
157439
157496
 
157440
157497
  // src/services/codefixes/convertConstToLet.ts
157441
- var fixId49 = "fixConvertConstToLet";
157442
- var errorCodes62 = [Diagnostics.Cannot_assign_to_0_because_it_is_a_constant.code];
157498
+ var fixId50 = "fixConvertConstToLet";
157499
+ var errorCodes63 = [Diagnostics.Cannot_assign_to_0_because_it_is_a_constant.code];
157443
157500
  registerCodeFix({
157444
- errorCodes: errorCodes62,
157501
+ errorCodes: errorCodes63,
157445
157502
  getCodeActions: function getCodeActionsToConvertConstToLet(context) {
157446
157503
  const { sourceFile, span, program } = context;
157447
157504
  const info = getInfo21(sourceFile, span.start, program);
157448
157505
  if (info === void 0)
157449
157506
  return;
157450
157507
  const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange40(t, sourceFile, info.token));
157451
- return [createCodeFixActionMaybeFixAll(fixId49, changes, Diagnostics.Convert_const_to_let, fixId49, Diagnostics.Convert_all_const_to_let)];
157508
+ return [createCodeFixActionMaybeFixAll(fixId50, changes, Diagnostics.Convert_const_to_let, fixId50, Diagnostics.Convert_all_const_to_let)];
157452
157509
  },
157453
157510
  getAllCodeActions: (context) => {
157454
157511
  const { program } = context;
157455
157512
  const seen = /* @__PURE__ */ new Map();
157456
157513
  return createCombinedCodeActions(ts_textChanges_exports.ChangeTracker.with(context, (changes) => {
157457
- eachDiagnostic(context, errorCodes62, (diag2) => {
157514
+ eachDiagnostic(context, errorCodes63, (diag2) => {
157458
157515
  const info = getInfo21(diag2.file, diag2.start, program);
157459
157516
  if (info) {
157460
157517
  if (addToSeen(seen, getSymbolId(info.symbol))) {
@@ -157465,7 +157522,7 @@ registerCodeFix({
157465
157522
  });
157466
157523
  }));
157467
157524
  },
157468
- fixIds: [fixId49]
157525
+ fixIds: [fixId50]
157469
157526
  });
157470
157527
  function getInfo21(sourceFile, pos, program) {
157471
157528
  var _a;
@@ -157486,11 +157543,11 @@ function doChange40(changes, sourceFile, token) {
157486
157543
  }
157487
157544
 
157488
157545
  // src/services/codefixes/fixExpectedComma.ts
157489
- var fixId50 = "fixExpectedComma";
157546
+ var fixId51 = "fixExpectedComma";
157490
157547
  var expectedErrorCode = Diagnostics._0_expected.code;
157491
- var errorCodes63 = [expectedErrorCode];
157548
+ var errorCodes64 = [expectedErrorCode];
157492
157549
  registerCodeFix({
157493
- errorCodes: errorCodes63,
157550
+ errorCodes: errorCodes64,
157494
157551
  getCodeActions(context) {
157495
157552
  const { sourceFile } = context;
157496
157553
  const info = getInfo22(sourceFile, context.span.start, context.errorCode);
@@ -157498,15 +157555,15 @@ registerCodeFix({
157498
157555
  return void 0;
157499
157556
  const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange41(t, sourceFile, info));
157500
157557
  return [createCodeFixAction(
157501
- fixId50,
157558
+ fixId51,
157502
157559
  changes,
157503
157560
  [Diagnostics.Change_0_to_1, ";", ","],
157504
- fixId50,
157561
+ fixId51,
157505
157562
  [Diagnostics.Change_0_to_1, ";", ","]
157506
157563
  )];
157507
157564
  },
157508
- fixIds: [fixId50],
157509
- getAllCodeActions: (context) => codeFixAll(context, errorCodes63, (changes, diag2) => {
157565
+ fixIds: [fixId51],
157566
+ getAllCodeActions: (context) => codeFixAll(context, errorCodes64, (changes, diag2) => {
157510
157567
  const info = getInfo22(diag2.file, diag2.start, diag2.code);
157511
157568
  if (info)
157512
157569
  doChange41(changes, context.sourceFile, info);
@@ -157523,25 +157580,25 @@ function doChange41(changes, sourceFile, { node }) {
157523
157580
 
157524
157581
  // src/services/codefixes/fixAddVoidToPromise.ts
157525
157582
  var fixName7 = "addVoidToPromise";
157526
- var fixId51 = "addVoidToPromise";
157527
- var errorCodes64 = [
157583
+ var fixId52 = "addVoidToPromise";
157584
+ var errorCodes65 = [
157528
157585
  Diagnostics.Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments.code,
157529
157586
  Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise.code
157530
157587
  ];
157531
157588
  registerCodeFix({
157532
- errorCodes: errorCodes64,
157533
- fixIds: [fixId51],
157589
+ errorCodes: errorCodes65,
157590
+ fixIds: [fixId52],
157534
157591
  getCodeActions(context) {
157535
- const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange11(t, context.sourceFile, context.span, context.program));
157592
+ const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => makeChange12(t, context.sourceFile, context.span, context.program));
157536
157593
  if (changes.length > 0) {
157537
- return [createCodeFixAction(fixName7, changes, Diagnostics.Add_void_to_Promise_resolved_without_a_value, fixId51, Diagnostics.Add_void_to_all_Promises_resolved_without_a_value)];
157594
+ return [createCodeFixAction(fixName7, changes, Diagnostics.Add_void_to_Promise_resolved_without_a_value, fixId52, Diagnostics.Add_void_to_all_Promises_resolved_without_a_value)];
157538
157595
  }
157539
157596
  },
157540
157597
  getAllCodeActions(context) {
157541
- return codeFixAll(context, errorCodes64, (changes, diag2) => makeChange11(changes, diag2.file, diag2, context.program, /* @__PURE__ */ new Set()));
157598
+ return codeFixAll(context, errorCodes65, (changes, diag2) => makeChange12(changes, diag2.file, diag2, context.program, /* @__PURE__ */ new Set()));
157542
157599
  }
157543
157600
  });
157544
- function makeChange11(changes, sourceFile, span, program, seen) {
157601
+ function makeChange12(changes, sourceFile, span, program, seen) {
157545
157602
  const node = getTokenAtPosition(sourceFile, span.start);
157546
157603
  if (!isIdentifier(node) || !isCallExpression(node.parent) || node.parent.expression !== node || node.parent.arguments.length !== 0)
157547
157604
  return;
@@ -175026,7 +175083,6 @@ __export(ts_exports2, {
175026
175083
  isSuperProperty: () => isSuperProperty,
175027
175084
  isSupportedSourceFileName: () => isSupportedSourceFileName,
175028
175085
  isSwitchStatement: () => isSwitchStatement,
175029
- isSyntacticallyString: () => isSyntacticallyString,
175030
175086
  isSyntaxList: () => isSyntaxList,
175031
175087
  isSyntheticExpression: () => isSyntheticExpression,
175032
175088
  isSyntheticReference: () => isSyntheticReference,
@@ -186030,10 +186086,10 @@ ${e.message}`;
186030
186086
  }
186031
186087
  return simplifiedResult ? codeActions.map((codeAction) => this.mapCodeFixAction(codeAction)) : codeActions;
186032
186088
  }
186033
- getCombinedCodeFix({ scope, fixId: fixId52 }, simplifiedResult) {
186089
+ getCombinedCodeFix({ scope, fixId: fixId53 }, simplifiedResult) {
186034
186090
  Debug.assert(scope.type === "file");
186035
186091
  const { file, project } = this.getFileAndProject(scope.args);
186036
- const res = project.getLanguageService().getCombinedCodeFix({ type: "file", fileName: file }, fixId52, this.getFormatOptions(file), this.getPreferences(file));
186092
+ const res = project.getLanguageService().getCombinedCodeFix({ type: "file", fileName: file }, fixId53, this.getFormatOptions(file), this.getPreferences(file));
186037
186093
  if (simplifiedResult) {
186038
186094
  return { changes: this.mapTextChangesToCodeEdits(res.changes), commands: res.commands };
186039
186095
  } else {
@@ -186072,8 +186128,8 @@ ${e.message}`;
186072
186128
  mapCodeAction({ description: description3, changes, commands }) {
186073
186129
  return { description: description3, changes: this.mapTextChangesToCodeEdits(changes), commands };
186074
186130
  }
186075
- mapCodeFixAction({ fixName: fixName8, description: description3, changes, commands, fixId: fixId52, fixAllDescription }) {
186076
- return { fixName: fixName8, description: description3, changes: this.mapTextChangesToCodeEdits(changes), commands, fixId: fixId52, fixAllDescription };
186131
+ mapCodeFixAction({ fixName: fixName8, description: description3, changes, commands, fixId: fixId53, fixAllDescription }) {
186132
+ return { fixName: fixName8, description: description3, changes: this.mapTextChangesToCodeEdits(changes), commands, fixId: fixId53, fixAllDescription };
186077
186133
  }
186078
186134
  mapTextChangesToCodeEdits(textChanges2) {
186079
186135
  return textChanges2.map((change) => this.mapTextChangeToCodeEdit(change));
@@ -189228,7 +189284,6 @@ if (typeof console !== "undefined") {
189228
189284
  isSuperProperty,
189229
189285
  isSupportedSourceFileName,
189230
189286
  isSwitchStatement,
189231
- isSyntacticallyString,
189232
189287
  isSyntaxList,
189233
189288
  isSyntheticExpression,
189234
189289
  isSyntheticReference,
@@ -5481,6 +5481,8 @@ var Diagnostics = {
5481
5481
  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."),
5482
5482
  _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."),
5483
5483
  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."),
5484
+ 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."),
5485
+ Invalid_syntax_in_decorator: diag(1498, 1 /* Error */, "Invalid_syntax_in_decorator_1498", "Invalid syntax in decorator."),
5484
5486
  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."),
5485
5487
  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."),
5486
5488
  Call_signature_return_types_0_and_1_are_incompatible: diag(
@@ -7128,6 +7130,8 @@ var Diagnostics = {
7128
7130
  Add_optional_parameter_to_0: diag(95191, 3 /* Message */, "Add_optional_parameter_to_0_95191", "Add optional parameter to '{0}'"),
7129
7131
  Add_optional_parameters_to_0: diag(95192, 3 /* Message */, "Add_optional_parameters_to_0_95192", "Add optional parameters to '{0}'"),
7130
7132
  Add_all_optional_parameters: diag(95193, 3 /* Message */, "Add_all_optional_parameters_95193", "Add all optional parameters"),
7133
+ Wrap_in_parentheses: diag(95194, 3 /* Message */, "Wrap_in_parentheses_95194", "Wrap in parentheses"),
7134
+ 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"),
7131
7135
  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."),
7132
7136
  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'."),
7133
7137
  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?"),
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@typescript-deploys/pr-build",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.5.0-pr-57686-4",
5
+ "version": "5.5.0-pr-57749-11",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -113,5 +113,5 @@
113
113
  "node": "20.1.0",
114
114
  "npm": "8.19.4"
115
115
  },
116
- "gitHead": "1553ea578452313298576241b0e1c059813925f0"
116
+ "gitHead": "965ee32ce9a02965a4ab1a33e2757175e67d911c"
117
117
  }