@typescript-deploys/pr-build 5.2.0-pr-54377-7 → 5.2.0-pr-54052-23

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
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.2";
21
- var version = `${versionMajorMinor}.0-insiders.20230524`;
21
+ var version = `${versionMajorMinor}.0-insiders.20230526`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -42656,6 +42656,7 @@ var CheckMode = /* @__PURE__ */ ((CheckMode3) => {
42656
42656
  CheckMode3[CheckMode3["IsForSignatureHelp"] = 16] = "IsForSignatureHelp";
42657
42657
  CheckMode3[CheckMode3["IsForStringLiteralArgumentCompletions"] = 32] = "IsForStringLiteralArgumentCompletions";
42658
42658
  CheckMode3[CheckMode3["RestBindingElement"] = 64] = "RestBindingElement";
42659
+ CheckMode3[CheckMode3["TypeOnly"] = 128] = "TypeOnly";
42659
42660
  return CheckMode3;
42660
42661
  })(CheckMode || {});
42661
42662
  var SignatureCheckMode = /* @__PURE__ */ ((SignatureCheckMode3) => {
@@ -58527,6 +58528,10 @@ function createTypeChecker(host) {
58527
58528
  return true;
58528
58529
  }
58529
58530
  switch (node.kind) {
58531
+ case 233 /* AsExpression */:
58532
+ if (!isConstAssertion(node)) {
58533
+ break;
58534
+ }
58530
58535
  case 293 /* JsxExpression */:
58531
58536
  case 216 /* ParenthesizedExpression */:
58532
58537
  return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer);
@@ -61774,7 +61779,7 @@ function createTypeChecker(host) {
61774
61779
  }
61775
61780
  }
61776
61781
  }
61777
- const filtered = contains(include, 0 /* False */) ? getUnionType(types.filter((_, i) => include[i])) : target;
61782
+ const filtered = contains(include, 0 /* False */) ? getUnionType(types.filter((_, i) => include[i]), 0 /* None */) : target;
61778
61783
  return filtered.flags & 131072 /* Never */ ? target : filtered;
61779
61784
  }
61780
61785
  function isWeakType(type) {
@@ -62753,8 +62758,6 @@ function createTypeChecker(host) {
62753
62758
  return context && context.mapper;
62754
62759
  }
62755
62760
  function couldContainTypeVariables(type) {
62756
- if (type.flags & 67359327 /* Intrinsic */)
62757
- return false;
62758
62761
  const objectFlags = getObjectFlags(type);
62759
62762
  if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
62760
62763
  return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
@@ -64807,7 +64810,7 @@ function createTypeChecker(host) {
64807
64810
  target.antecedents = saveAntecedents;
64808
64811
  } else if (flags & 2 /* Start */) {
64809
64812
  const container = flow.node;
64810
- if (container && container !== flowContainer && reference.kind !== 210 /* PropertyAccessExpression */ && reference.kind !== 211 /* ElementAccessExpression */ && reference.kind !== 110 /* ThisKeyword */) {
64813
+ if (container && container !== flowContainer && reference.kind !== 210 /* PropertyAccessExpression */ && reference.kind !== 211 /* ElementAccessExpression */ && !(reference.kind === 110 /* ThisKeyword */ && container.kind !== 218 /* ArrowFunction */)) {
64811
64814
  flow = container.flowNode;
64812
64815
  continue;
64813
64816
  }
@@ -73294,7 +73297,7 @@ function createTypeChecker(host) {
73294
73297
  Debug.assertIsDefined(leftType);
73295
73298
  const rightType = getLastResult(state);
73296
73299
  Debug.assertIsDefined(rightType);
73297
- result = checkBinaryLikeExpressionWorker(node.left, node.operatorToken, node.right, leftType, rightType, node);
73300
+ result = checkBinaryLikeExpressionWorker(node.left, node.operatorToken, node.right, leftType, rightType, state.checkMode, node);
73298
73301
  }
73299
73302
  state.skip = false;
73300
73303
  setLeftType(
@@ -73356,9 +73359,9 @@ function createTypeChecker(host) {
73356
73359
  leftType = checkExpression(left, checkMode);
73357
73360
  }
73358
73361
  const rightType = checkExpression(right, checkMode);
73359
- return checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, errorNode);
73362
+ return checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, checkMode, errorNode);
73360
73363
  }
73361
- function checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, errorNode) {
73364
+ function checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, checkMode, errorNode) {
73362
73365
  const operator = operatorToken.kind;
73363
73366
  switch (operator) {
73364
73367
  case 42 /* AsteriskToken */:
@@ -73515,12 +73518,14 @@ function createTypeChecker(host) {
73515
73518
  case 36 /* ExclamationEqualsToken */:
73516
73519
  case 37 /* EqualsEqualsEqualsToken */:
73517
73520
  case 38 /* ExclamationEqualsEqualsToken */:
73518
- if (isLiteralExpressionOfObject(left) || isLiteralExpressionOfObject(right)) {
73519
- const eqType = operator === 35 /* EqualsEqualsToken */ || operator === 37 /* EqualsEqualsEqualsToken */;
73520
- error(errorNode, Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value, eqType ? "false" : "true");
73521
+ if (!(checkMode && checkMode & 128 /* TypeOnly */)) {
73522
+ if (isLiteralExpressionOfObject(left) || isLiteralExpressionOfObject(right)) {
73523
+ const eqType = operator === 35 /* EqualsEqualsToken */ || operator === 37 /* EqualsEqualsEqualsToken */;
73524
+ error(errorNode, Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value, eqType ? "false" : "true");
73525
+ }
73526
+ checkNaNEquality(errorNode, operator, left, right);
73527
+ reportOperatorErrorUnless((left2, right2) => isTypeEqualityComparableTo(left2, right2) || isTypeEqualityComparableTo(right2, left2));
73521
73528
  }
73522
- checkNaNEquality(errorNode, operator, left, right);
73523
- reportOperatorErrorUnless((left2, right2) => isTypeEqualityComparableTo(left2, right2) || isTypeEqualityComparableTo(right2, left2));
73524
73529
  return booleanType;
73525
73530
  case 104 /* InstanceOfKeyword */:
73526
73531
  return checkInstanceOfExpression(left, right, leftType, rightType);
@@ -73831,7 +73836,7 @@ function createTypeChecker(host) {
73831
73836
  }
73832
73837
  }
73833
73838
  function checkConditionalExpression(node, checkMode) {
73834
- const type = checkTruthinessExpression(node.condition);
73839
+ const type = checkTruthinessExpression(node.condition, checkMode);
73835
73840
  checkTestingKnownTruthyCallableOrAwaitableType(node.condition, type, node.whenTrue);
73836
73841
  const type1 = checkExpression(node.whenTrue, checkMode);
73837
73842
  const type2 = checkExpression(node.whenFalse, checkMode);
@@ -74172,7 +74177,7 @@ function createTypeChecker(host) {
74172
74177
  }
74173
74178
  }
74174
74179
  const startInvocationCount = flowInvocationCount;
74175
- const type = checkExpression(node);
74180
+ const type = checkExpression(node, 128 /* TypeOnly */);
74176
74181
  if (flowInvocationCount !== startInvocationCount) {
74177
74182
  const cache = flowTypeCache || (flowTypeCache = []);
74178
74183
  cache[getNodeId(node)] = type;
package/lib/tsserver.js CHANGED
@@ -2304,7 +2304,7 @@ module.exports = __toCommonJS(server_exports);
2304
2304
 
2305
2305
  // src/compiler/corePublic.ts
2306
2306
  var versionMajorMinor = "5.2";
2307
- var version = `${versionMajorMinor}.0-insiders.20230524`;
2307
+ var version = `${versionMajorMinor}.0-insiders.20230526`;
2308
2308
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2309
2309
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2310
2310
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -47307,6 +47307,7 @@ var CheckMode = /* @__PURE__ */ ((CheckMode3) => {
47307
47307
  CheckMode3[CheckMode3["IsForSignatureHelp"] = 16] = "IsForSignatureHelp";
47308
47308
  CheckMode3[CheckMode3["IsForStringLiteralArgumentCompletions"] = 32] = "IsForStringLiteralArgumentCompletions";
47309
47309
  CheckMode3[CheckMode3["RestBindingElement"] = 64] = "RestBindingElement";
47310
+ CheckMode3[CheckMode3["TypeOnly"] = 128] = "TypeOnly";
47310
47311
  return CheckMode3;
47311
47312
  })(CheckMode || {});
47312
47313
  var SignatureCheckMode = /* @__PURE__ */ ((SignatureCheckMode3) => {
@@ -63178,6 +63179,10 @@ function createTypeChecker(host) {
63178
63179
  return true;
63179
63180
  }
63180
63181
  switch (node.kind) {
63182
+ case 233 /* AsExpression */:
63183
+ if (!isConstAssertion(node)) {
63184
+ break;
63185
+ }
63181
63186
  case 293 /* JsxExpression */:
63182
63187
  case 216 /* ParenthesizedExpression */:
63183
63188
  return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer);
@@ -66425,7 +66430,7 @@ function createTypeChecker(host) {
66425
66430
  }
66426
66431
  }
66427
66432
  }
66428
- const filtered = contains(include, 0 /* False */) ? getUnionType(types.filter((_, i) => include[i])) : target;
66433
+ const filtered = contains(include, 0 /* False */) ? getUnionType(types.filter((_, i) => include[i]), 0 /* None */) : target;
66429
66434
  return filtered.flags & 131072 /* Never */ ? target : filtered;
66430
66435
  }
66431
66436
  function isWeakType(type) {
@@ -67404,8 +67409,6 @@ function createTypeChecker(host) {
67404
67409
  return context && context.mapper;
67405
67410
  }
67406
67411
  function couldContainTypeVariables(type) {
67407
- if (type.flags & 67359327 /* Intrinsic */)
67408
- return false;
67409
67412
  const objectFlags = getObjectFlags(type);
67410
67413
  if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
67411
67414
  return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
@@ -69458,7 +69461,7 @@ function createTypeChecker(host) {
69458
69461
  target.antecedents = saveAntecedents;
69459
69462
  } else if (flags & 2 /* Start */) {
69460
69463
  const container = flow.node;
69461
- if (container && container !== flowContainer && reference.kind !== 210 /* PropertyAccessExpression */ && reference.kind !== 211 /* ElementAccessExpression */ && reference.kind !== 110 /* ThisKeyword */) {
69464
+ if (container && container !== flowContainer && reference.kind !== 210 /* PropertyAccessExpression */ && reference.kind !== 211 /* ElementAccessExpression */ && !(reference.kind === 110 /* ThisKeyword */ && container.kind !== 218 /* ArrowFunction */)) {
69462
69465
  flow = container.flowNode;
69463
69466
  continue;
69464
69467
  }
@@ -77945,7 +77948,7 @@ function createTypeChecker(host) {
77945
77948
  Debug.assertIsDefined(leftType);
77946
77949
  const rightType = getLastResult(state);
77947
77950
  Debug.assertIsDefined(rightType);
77948
- result = checkBinaryLikeExpressionWorker(node.left, node.operatorToken, node.right, leftType, rightType, node);
77951
+ result = checkBinaryLikeExpressionWorker(node.left, node.operatorToken, node.right, leftType, rightType, state.checkMode, node);
77949
77952
  }
77950
77953
  state.skip = false;
77951
77954
  setLeftType(
@@ -78007,9 +78010,9 @@ function createTypeChecker(host) {
78007
78010
  leftType = checkExpression(left, checkMode);
78008
78011
  }
78009
78012
  const rightType = checkExpression(right, checkMode);
78010
- return checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, errorNode);
78013
+ return checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, checkMode, errorNode);
78011
78014
  }
78012
- function checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, errorNode) {
78015
+ function checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, checkMode, errorNode) {
78013
78016
  const operator = operatorToken.kind;
78014
78017
  switch (operator) {
78015
78018
  case 42 /* AsteriskToken */:
@@ -78166,12 +78169,14 @@ function createTypeChecker(host) {
78166
78169
  case 36 /* ExclamationEqualsToken */:
78167
78170
  case 37 /* EqualsEqualsEqualsToken */:
78168
78171
  case 38 /* ExclamationEqualsEqualsToken */:
78169
- if (isLiteralExpressionOfObject(left) || isLiteralExpressionOfObject(right)) {
78170
- const eqType = operator === 35 /* EqualsEqualsToken */ || operator === 37 /* EqualsEqualsEqualsToken */;
78171
- error(errorNode, Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value, eqType ? "false" : "true");
78172
+ if (!(checkMode && checkMode & 128 /* TypeOnly */)) {
78173
+ if (isLiteralExpressionOfObject(left) || isLiteralExpressionOfObject(right)) {
78174
+ const eqType = operator === 35 /* EqualsEqualsToken */ || operator === 37 /* EqualsEqualsEqualsToken */;
78175
+ error(errorNode, Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value, eqType ? "false" : "true");
78176
+ }
78177
+ checkNaNEquality(errorNode, operator, left, right);
78178
+ reportOperatorErrorUnless((left2, right2) => isTypeEqualityComparableTo(left2, right2) || isTypeEqualityComparableTo(right2, left2));
78172
78179
  }
78173
- checkNaNEquality(errorNode, operator, left, right);
78174
- reportOperatorErrorUnless((left2, right2) => isTypeEqualityComparableTo(left2, right2) || isTypeEqualityComparableTo(right2, left2));
78175
78180
  return booleanType;
78176
78181
  case 104 /* InstanceOfKeyword */:
78177
78182
  return checkInstanceOfExpression(left, right, leftType, rightType);
@@ -78482,7 +78487,7 @@ function createTypeChecker(host) {
78482
78487
  }
78483
78488
  }
78484
78489
  function checkConditionalExpression(node, checkMode) {
78485
- const type = checkTruthinessExpression(node.condition);
78490
+ const type = checkTruthinessExpression(node.condition, checkMode);
78486
78491
  checkTestingKnownTruthyCallableOrAwaitableType(node.condition, type, node.whenTrue);
78487
78492
  const type1 = checkExpression(node.whenTrue, checkMode);
78488
78493
  const type2 = checkExpression(node.whenFalse, checkMode);
@@ -78823,7 +78828,7 @@ function createTypeChecker(host) {
78823
78828
  }
78824
78829
  }
78825
78830
  const startInvocationCount = flowInvocationCount;
78826
- const type = checkExpression(node);
78831
+ const type = checkExpression(node, 128 /* TypeOnly */);
78827
78832
  if (flowInvocationCount !== startInvocationCount) {
78828
78833
  const cache = flowTypeCache || (flowTypeCache = []);
78829
78834
  cache[getNodeId(node)] = type;
@@ -135601,12 +135606,12 @@ function getEditsForRefactor(context, refactorName13, actionName2, interactiveRe
135601
135606
  var refactorName = "Convert export";
135602
135607
  var defaultToNamedAction = {
135603
135608
  name: "Convert default export to named export",
135604
- description: Diagnostics.Convert_default_export_to_named_export.message,
135609
+ description: getLocaleSpecificMessage(Diagnostics.Convert_default_export_to_named_export),
135605
135610
  kind: "refactor.rewrite.export.named"
135606
135611
  };
135607
135612
  var namedToDefaultAction = {
135608
135613
  name: "Convert named export to default export",
135609
- description: Diagnostics.Convert_named_export_to_default_export.message,
135614
+ description: getLocaleSpecificMessage(Diagnostics.Convert_named_export_to_default_export),
135610
135615
  kind: "refactor.rewrite.export.default"
135611
135616
  };
135612
135617
  registerRefactor(refactorName, {
@@ -135624,7 +135629,7 @@ registerRefactor(refactorName, {
135624
135629
  }
135625
135630
  if (context.preferences.provideRefactorNotApplicableReason) {
135626
135631
  return [
135627
- { name: refactorName, description: Diagnostics.Convert_default_export_to_named_export.message, actions: [
135632
+ { name: refactorName, description: getLocaleSpecificMessage(Diagnostics.Convert_default_export_to_named_export), actions: [
135628
135633
  { ...defaultToNamedAction, notApplicableReason: info.error },
135629
135634
  { ...namedToDefaultAction, notApplicableReason: info.error }
135630
135635
  ] }
@@ -135847,17 +135852,17 @@ var refactorName2 = "Convert import";
135847
135852
  var actions = {
135848
135853
  [0 /* Named */]: {
135849
135854
  name: "Convert namespace import to named imports",
135850
- description: Diagnostics.Convert_namespace_import_to_named_imports.message,
135855
+ description: getLocaleSpecificMessage(Diagnostics.Convert_namespace_import_to_named_imports),
135851
135856
  kind: "refactor.rewrite.import.named"
135852
135857
  },
135853
135858
  [2 /* Namespace */]: {
135854
135859
  name: "Convert named imports to namespace import",
135855
- description: Diagnostics.Convert_named_imports_to_namespace_import.message,
135860
+ description: getLocaleSpecificMessage(Diagnostics.Convert_named_imports_to_namespace_import),
135856
135861
  kind: "refactor.rewrite.import.namespace"
135857
135862
  },
135858
135863
  [1 /* Default */]: {
135859
135864
  name: "Convert named imports to default import",
135860
- description: Diagnostics.Convert_named_imports_to_default_import.message,
135865
+ description: getLocaleSpecificMessage(Diagnostics.Convert_named_imports_to_default_import),
135861
135866
  kind: "refactor.rewrite.import.default"
135862
135867
  }
135863
135868
  };
@@ -137146,6 +137151,10 @@ function getRangeToMove(context) {
137146
137151
  if (isNamedDeclaration(startStatement) && startStatement.name && rangeContainsRange(startStatement.name, range)) {
137147
137152
  return { toMove: [statements[startNodeIndex]], afterLast: statements[startNodeIndex + 1] };
137148
137153
  }
137154
+ const overloadRangeToMove = getOverloadRangeToMove(file, startStatement);
137155
+ if (overloadRangeToMove) {
137156
+ return overloadRangeToMove;
137157
+ }
137149
137158
  if (range.pos > startStatement.getStart(file))
137150
137159
  return void 0;
137151
137160
  const afterEndNodeIndex = findIndex(statements, (s) => s.end > range.end, startNodeIndex);
@@ -137341,13 +137350,26 @@ function isNonVariableTopLevelDeclaration(node) {
137341
137350
  return false;
137342
137351
  }
137343
137352
  }
137353
+ function getOverloadRangeToMove(sourceFile, statement) {
137354
+ if (isFunctionLikeDeclaration(statement)) {
137355
+ const declarations = statement.symbol.declarations;
137356
+ if (declarations === void 0 || length(declarations) <= 1 || !contains(declarations, statement)) {
137357
+ return void 0;
137358
+ }
137359
+ const lastDecl = declarations[length(declarations) - 1];
137360
+ const statementsToMove = mapDefined(declarations, (d) => getSourceFileOfNode(d) === sourceFile && isStatement(d) ? d : void 0);
137361
+ const end = findLastIndex(sourceFile.statements, (s) => s.end > lastDecl.end);
137362
+ return { toMove: statementsToMove, afterLast: end >= 0 ? sourceFile.statements[end] : void 0 };
137363
+ }
137364
+ return void 0;
137365
+ }
137344
137366
 
137345
137367
  // src/services/_namespaces/ts.refactor.addOrRemoveBracesToArrowFunction.ts
137346
137368
  var ts_refactor_addOrRemoveBracesToArrowFunction_exports = {};
137347
137369
 
137348
137370
  // src/services/refactors/convertOverloadListToSingleSignature.ts
137349
137371
  var refactorName5 = "Convert overload list to single signature";
137350
- var refactorDescription = Diagnostics.Convert_overload_list_to_single_signature.message;
137372
+ var refactorDescription = getLocaleSpecificMessage(Diagnostics.Convert_overload_list_to_single_signature);
137351
137373
  var functionOverloadAction = {
137352
137374
  name: refactorName5,
137353
137375
  description: refactorDescription,
@@ -137559,15 +137581,15 @@ function getConvertableOverloadListAtPosition(file, startPosition, program) {
137559
137581
 
137560
137582
  // src/services/refactors/addOrRemoveBracesToArrowFunction.ts
137561
137583
  var refactorName6 = "Add or remove braces in an arrow function";
137562
- var refactorDescription2 = Diagnostics.Add_or_remove_braces_in_an_arrow_function.message;
137584
+ var refactorDescription2 = getLocaleSpecificMessage(Diagnostics.Add_or_remove_braces_in_an_arrow_function);
137563
137585
  var addBracesAction = {
137564
137586
  name: "Add braces to arrow function",
137565
- description: Diagnostics.Add_braces_to_arrow_function.message,
137587
+ description: getLocaleSpecificMessage(Diagnostics.Add_braces_to_arrow_function),
137566
137588
  kind: "refactor.rewrite.arrow.braces.add"
137567
137589
  };
137568
137590
  var removeBracesAction = {
137569
137591
  name: "Remove braces from arrow function",
137570
- description: Diagnostics.Remove_braces_from_arrow_function.message,
137592
+ description: getLocaleSpecificMessage(Diagnostics.Remove_braces_from_arrow_function),
137571
137593
  kind: "refactor.rewrite.arrow.braces.remove"
137572
137594
  };
137573
137595
  registerRefactor(refactorName6, {
@@ -138521,7 +138543,7 @@ function getEditsForToTemplateLiteral(context, node) {
138521
138543
  }
138522
138544
  }
138523
138545
  function isNotEqualsOperator(node) {
138524
- return node.operatorToken.kind !== 64 /* EqualsToken */;
138546
+ return !(node.operatorToken.kind === 64 /* EqualsToken */ || node.operatorToken.kind === 65 /* PlusEqualsToken */);
138525
138547
  }
138526
138548
  function getParentBinaryExpression(expr) {
138527
138549
  const container = findAncestor(expr.parent, (n) => {
@@ -140497,7 +140519,7 @@ var ts_refactor_generateGetAccessorAndSetAccessor_exports = {};
140497
140519
 
140498
140520
  // src/services/refactors/generateGetAccessorAndSetAccessor.ts
140499
140521
  var actionName = "Generate 'get' and 'set' accessors";
140500
- var actionDescription = Diagnostics.Generate_get_and_set_accessors.message;
140522
+ var actionDescription = getLocaleSpecificMessage(Diagnostics.Generate_get_and_set_accessors);
140501
140523
  var generateGetSetAction = {
140502
140524
  name: actionName,
140503
140525
  description: actionDescription,
@@ -140554,7 +140576,7 @@ var ts_refactor_inferFunctionReturnType_exports = {};
140554
140576
 
140555
140577
  // src/services/refactors/inferFunctionReturnType.ts
140556
140578
  var refactorName12 = "Infer function return type";
140557
- var refactorDescription6 = Diagnostics.Infer_function_return_type.message;
140579
+ var refactorDescription6 = getLocaleSpecificMessage(Diagnostics.Infer_function_return_type);
140558
140580
  var inferReturnTypeAction = {
140559
140581
  name: refactorName12,
140560
140582
  description: refactorDescription6,
@@ -141897,7 +141919,11 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
141897
141919
  onUnRecoverableConfigFileDiagnostic: noop
141898
141920
  };
141899
141921
  const documentRegistryBucketKey = documentRegistry.getKeyForCompilationSettings(newSettings);
141922
+ let releasedScriptKinds = /* @__PURE__ */ new Set();
141900
141923
  if (isProgramUptoDate(program, rootFileNames, newSettings, (_path, fileName) => host.getScriptVersion(fileName), (fileName) => compilerHost.fileExists(fileName), hasInvalidatedResolutions, hasInvalidatedLibResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
141924
+ compilerHost = void 0;
141925
+ parsedCommandLines = void 0;
141926
+ releasedScriptKinds = void 0;
141901
141927
  return;
141902
141928
  }
141903
141929
  const options = {
@@ -141910,6 +141936,7 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
141910
141936
  program = createProgram(options);
141911
141937
  compilerHost = void 0;
141912
141938
  parsedCommandLines = void 0;
141939
+ releasedScriptKinds = void 0;
141913
141940
  sourceMapper.clearCache();
141914
141941
  program.getTypeChecker();
141915
141942
  return;
@@ -141964,10 +141991,11 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
141964
141991
  if (!shouldCreateNewSourceFile) {
141965
141992
  const oldSourceFile = program && program.getSourceFileByPath(path);
141966
141993
  if (oldSourceFile) {
141967
- if (scriptKind === oldSourceFile.scriptKind) {
141994
+ if (scriptKind === oldSourceFile.scriptKind || releasedScriptKinds.has(oldSourceFile.resolvedPath)) {
141968
141995
  return documentRegistry.updateDocumentWithKey(fileName, path, host, documentRegistryBucketKey, scriptSnapshot, scriptVersion, scriptKind, languageVersionOrOptions);
141969
141996
  } else {
141970
141997
  documentRegistry.releaseDocumentWithKey(oldSourceFile.resolvedPath, documentRegistry.getKeyForCompilationSettings(program.getCompilerOptions()), oldSourceFile.scriptKind, oldSourceFile.impliedNodeFormat);
141998
+ releasedScriptKinds.add(oldSourceFile.resolvedPath);
141971
141999
  }
141972
142000
  }
141973
142001
  }
@@ -150447,9 +150475,6 @@ function getActionsForMissingMethodDeclaration(context, info) {
150447
150475
  if (call === void 0) {
150448
150476
  return void 0;
150449
150477
  }
150450
- if (isPrivateIdentifier(token)) {
150451
- return void 0;
150452
- }
150453
150478
  const methodName = token.text;
150454
150479
  const addMethodDeclarationChanges = (modifierFlags2) => ts_textChanges_exports.ChangeTracker.with(context, (t) => addMethodDeclaration(context, t, call, token, modifierFlags2, parentDeclaration, declSourceFile));
150455
150480
  const actions2 = [createCodeFixAction(fixMissingMember, addMethodDeclarationChanges(modifierFlags & 32 /* Static */), [modifierFlags & 32 /* Static */ ? Diagnostics.Declare_static_method_0 : Diagnostics.Declare_method_0, methodName], fixMissingMember, Diagnostics.Add_all_missing_members)];
@@ -153499,6 +153524,7 @@ function createSignatureDeclarationFromCallExpression(kind, context, importAdder
153499
153524
  type === void 0 ? factory.createKeywordTypeNode(159 /* UnknownKeyword */) : type
153500
153525
  );
153501
153526
  case 261 /* FunctionDeclaration */:
153527
+ Debug.assert(typeof name === "string" || isIdentifier(name), "Unexpected name");
153502
153528
  return factory.createFunctionDeclaration(
153503
153529
  modifiers,
153504
153530
  asteriskToken,
@@ -161520,9 +161546,9 @@ var Core;
161520
161546
  if (refNode.parent.kind === 303 /* ShorthandPropertyAssignment */) {
161521
161547
  getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference2);
161522
161548
  }
161523
- const containingClass = getContainingClassIfInHeritageClause(refNode);
161524
- if (containingClass) {
161525
- addReference2(containingClass);
161549
+ const containingNode = getContainingNodeIfInHeritageClause(refNode);
161550
+ if (containingNode) {
161551
+ addReference2(containingNode);
161526
161552
  return;
161527
161553
  }
161528
161554
  const typeNode = findAncestor(refNode, (a) => !isQualifiedName(a.parent) && !isTypeNode(a.parent) && !isTypeElement(a.parent));
@@ -161549,8 +161575,8 @@ var Core;
161549
161575
  addReference2(e);
161550
161576
  }
161551
161577
  }
161552
- function getContainingClassIfInHeritageClause(node) {
161553
- return isIdentifier(node) || isPropertyAccessExpression(node) ? getContainingClassIfInHeritageClause(node.parent) : isExpressionWithTypeArguments(node) ? tryCast(node.parent.parent, isClassLike) : void 0;
161578
+ function getContainingNodeIfInHeritageClause(node) {
161579
+ return isIdentifier(node) || isPropertyAccessExpression(node) ? getContainingNodeIfInHeritageClause(node.parent) : isExpressionWithTypeArguments(node) ? tryCast(node.parent.parent, or(isClassLike, isInterfaceDeclaration)) : void 0;
161554
161580
  }
161555
161581
  function isImplementationExpression(node) {
161556
161582
  switch (node.kind) {
@@ -163101,7 +163127,7 @@ function getDocCommentTemplateAtPosition(newLine, sourceFile, position, options)
163101
163127
  const tags = (parameters ? parameterDocComments(parameters || [], isJavaScriptFile, indentationStr, newLine) : "") + (hasReturn2 ? returnsDocComment(indentationStr, newLine) : "");
163102
163128
  const openComment = "/**";
163103
163129
  const closeComment = " */";
163104
- const hasTag = (commentOwnerJsDoc || []).some((jsDoc) => !!jsDoc.tags);
163130
+ const hasTag = length(getJSDocTags(commentOwner)) > 0;
163105
163131
  if (tags && !hasTag) {
163106
163132
  const preamble = openComment + newLine + indentationStr + " * ";
163107
163133
  const endLine = tokenStart === position ? newLine + indentationStr : "";
@@ -168452,7 +168478,8 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt
168452
168478
  }
168453
168479
  processNode(enclosingNode, enclosingNode, startLine, undecoratedStartLine, initialIndentation, delta);
168454
168480
  }
168455
- if (!formattingScanner.isOnToken()) {
168481
+ const remainingTrivia = formattingScanner.getCurrentLeadingTrivia();
168482
+ if (remainingTrivia) {
168456
168483
  const indentation = SmartIndenter.nodeWillIndentChild(
168457
168484
  options,
168458
168485
  enclosingNode,
@@ -168462,25 +168489,30 @@ function formatSpanWorker(originalRange, enclosingNode, initialIndentation, delt
168462
168489
  /*indentByDefault*/
168463
168490
  false
168464
168491
  ) ? initialIndentation + options.indentSize : initialIndentation;
168465
- const leadingTrivia = formattingScanner.getCurrentLeadingTrivia();
168466
- if (leadingTrivia) {
168467
- indentTriviaItems(
168468
- leadingTrivia,
168469
- indentation,
168470
- /*indentNextTokenOrTrivia*/
168471
- false,
168472
- (item) => processRange(
168492
+ indentTriviaItems(
168493
+ remainingTrivia,
168494
+ indentation,
168495
+ /*indentNextTokenOrTrivia*/
168496
+ true,
168497
+ (item) => {
168498
+ processRange(
168473
168499
  item,
168474
168500
  sourceFile.getLineAndCharacterOfPosition(item.pos),
168475
168501
  enclosingNode,
168476
168502
  enclosingNode,
168477
168503
  /*dynamicIndentation*/
168478
168504
  void 0
168479
- )
168480
- );
168481
- if (options.trimTrailingWhitespace !== false) {
168482
- trimTrailingWhitespacesForRemainingRange(leadingTrivia);
168505
+ );
168506
+ insertIndentation(
168507
+ item.pos,
168508
+ indentation,
168509
+ /*lineAdded*/
168510
+ false
168511
+ );
168483
168512
  }
168513
+ );
168514
+ if (options.trimTrailingWhitespace !== false) {
168515
+ trimTrailingWhitespacesForRemainingRange(remainingTrivia);
168484
168516
  }
168485
168517
  }
168486
168518
  if (previousRange && formattingScanner.getTokenFullStart() >= originalRange.end) {
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.2";
38
- version = `${versionMajorMinor}.0-insiders.20230524`;
38
+ version = `${versionMajorMinor}.0-insiders.20230526`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -60969,6 +60969,10 @@ ${lanes.join("\n")}
60969
60969
  return true;
60970
60970
  }
60971
60971
  switch (node.kind) {
60972
+ case 233 /* AsExpression */:
60973
+ if (!isConstAssertion(node)) {
60974
+ break;
60975
+ }
60972
60976
  case 293 /* JsxExpression */:
60973
60977
  case 216 /* ParenthesizedExpression */:
60974
60978
  return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer);
@@ -64216,7 +64220,7 @@ ${lanes.join("\n")}
64216
64220
  }
64217
64221
  }
64218
64222
  }
64219
- const filtered = contains(include, 0 /* False */) ? getUnionType(types.filter((_, i) => include[i])) : target;
64223
+ const filtered = contains(include, 0 /* False */) ? getUnionType(types.filter((_, i) => include[i]), 0 /* None */) : target;
64220
64224
  return filtered.flags & 131072 /* Never */ ? target : filtered;
64221
64225
  }
64222
64226
  function isWeakType(type) {
@@ -65195,8 +65199,6 @@ ${lanes.join("\n")}
65195
65199
  return context && context.mapper;
65196
65200
  }
65197
65201
  function couldContainTypeVariables(type) {
65198
- if (type.flags & 67359327 /* Intrinsic */)
65199
- return false;
65200
65202
  const objectFlags = getObjectFlags(type);
65201
65203
  if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
65202
65204
  return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
@@ -67249,7 +67251,7 @@ ${lanes.join("\n")}
67249
67251
  target.antecedents = saveAntecedents;
67250
67252
  } else if (flags & 2 /* Start */) {
67251
67253
  const container = flow.node;
67252
- if (container && container !== flowContainer && reference.kind !== 210 /* PropertyAccessExpression */ && reference.kind !== 211 /* ElementAccessExpression */ && reference.kind !== 110 /* ThisKeyword */) {
67254
+ if (container && container !== flowContainer && reference.kind !== 210 /* PropertyAccessExpression */ && reference.kind !== 211 /* ElementAccessExpression */ && !(reference.kind === 110 /* ThisKeyword */ && container.kind !== 218 /* ArrowFunction */)) {
67253
67255
  flow = container.flowNode;
67254
67256
  continue;
67255
67257
  }
@@ -75736,7 +75738,7 @@ ${lanes.join("\n")}
75736
75738
  Debug.assertIsDefined(leftType);
75737
75739
  const rightType = getLastResult(state);
75738
75740
  Debug.assertIsDefined(rightType);
75739
- result = checkBinaryLikeExpressionWorker(node.left, node.operatorToken, node.right, leftType, rightType, node);
75741
+ result = checkBinaryLikeExpressionWorker(node.left, node.operatorToken, node.right, leftType, rightType, state.checkMode, node);
75740
75742
  }
75741
75743
  state.skip = false;
75742
75744
  setLeftType(
@@ -75798,9 +75800,9 @@ ${lanes.join("\n")}
75798
75800
  leftType = checkExpression(left, checkMode);
75799
75801
  }
75800
75802
  const rightType = checkExpression(right, checkMode);
75801
- return checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, errorNode);
75803
+ return checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, checkMode, errorNode);
75802
75804
  }
75803
- function checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, errorNode) {
75805
+ function checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, checkMode, errorNode) {
75804
75806
  const operator = operatorToken.kind;
75805
75807
  switch (operator) {
75806
75808
  case 42 /* AsteriskToken */:
@@ -75957,12 +75959,14 @@ ${lanes.join("\n")}
75957
75959
  case 36 /* ExclamationEqualsToken */:
75958
75960
  case 37 /* EqualsEqualsEqualsToken */:
75959
75961
  case 38 /* ExclamationEqualsEqualsToken */:
75960
- if (isLiteralExpressionOfObject(left) || isLiteralExpressionOfObject(right)) {
75961
- const eqType = operator === 35 /* EqualsEqualsToken */ || operator === 37 /* EqualsEqualsEqualsToken */;
75962
- error(errorNode, Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value, eqType ? "false" : "true");
75962
+ if (!(checkMode && checkMode & 128 /* TypeOnly */)) {
75963
+ if (isLiteralExpressionOfObject(left) || isLiteralExpressionOfObject(right)) {
75964
+ const eqType = operator === 35 /* EqualsEqualsToken */ || operator === 37 /* EqualsEqualsEqualsToken */;
75965
+ error(errorNode, Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value, eqType ? "false" : "true");
75966
+ }
75967
+ checkNaNEquality(errorNode, operator, left, right);
75968
+ reportOperatorErrorUnless((left2, right2) => isTypeEqualityComparableTo(left2, right2) || isTypeEqualityComparableTo(right2, left2));
75963
75969
  }
75964
- checkNaNEquality(errorNode, operator, left, right);
75965
- reportOperatorErrorUnless((left2, right2) => isTypeEqualityComparableTo(left2, right2) || isTypeEqualityComparableTo(right2, left2));
75966
75970
  return booleanType;
75967
75971
  case 104 /* InstanceOfKeyword */:
75968
75972
  return checkInstanceOfExpression(left, right, leftType, rightType);
@@ -76273,7 +76277,7 @@ ${lanes.join("\n")}
76273
76277
  }
76274
76278
  }
76275
76279
  function checkConditionalExpression(node, checkMode) {
76276
- const type = checkTruthinessExpression(node.condition);
76280
+ const type = checkTruthinessExpression(node.condition, checkMode);
76277
76281
  checkTestingKnownTruthyCallableOrAwaitableType(node.condition, type, node.whenTrue);
76278
76282
  const type1 = checkExpression(node.whenTrue, checkMode);
76279
76283
  const type2 = checkExpression(node.whenFalse, checkMode);
@@ -76614,7 +76618,7 @@ ${lanes.join("\n")}
76614
76618
  }
76615
76619
  }
76616
76620
  const startInvocationCount = flowInvocationCount;
76617
- const type = checkExpression(node);
76621
+ const type = checkExpression(node, 128 /* TypeOnly */);
76618
76622
  if (flowInvocationCount !== startInvocationCount) {
76619
76623
  const cache = flowTypeCache || (flowTypeCache = []);
76620
76624
  cache[getNodeId(node)] = type;
@@ -85824,6 +85828,7 @@ ${lanes.join("\n")}
85824
85828
  CheckMode3[CheckMode3["IsForSignatureHelp"] = 16] = "IsForSignatureHelp";
85825
85829
  CheckMode3[CheckMode3["IsForStringLiteralArgumentCompletions"] = 32] = "IsForStringLiteralArgumentCompletions";
85826
85830
  CheckMode3[CheckMode3["RestBindingElement"] = 64] = "RestBindingElement";
85831
+ CheckMode3[CheckMode3["TypeOnly"] = 128] = "TypeOnly";
85827
85832
  return CheckMode3;
85828
85833
  })(CheckMode || {});
85829
85834
  SignatureCheckMode = /* @__PURE__ */ ((SignatureCheckMode3) => {
@@ -134188,12 +134193,12 @@ ${lanes.join("\n")}
134188
134193
  refactorName = "Convert export";
134189
134194
  defaultToNamedAction = {
134190
134195
  name: "Convert default export to named export",
134191
- description: Diagnostics.Convert_default_export_to_named_export.message,
134196
+ description: getLocaleSpecificMessage(Diagnostics.Convert_default_export_to_named_export),
134192
134197
  kind: "refactor.rewrite.export.named"
134193
134198
  };
134194
134199
  namedToDefaultAction = {
134195
134200
  name: "Convert named export to default export",
134196
- description: Diagnostics.Convert_named_export_to_default_export.message,
134201
+ description: getLocaleSpecificMessage(Diagnostics.Convert_named_export_to_default_export),
134197
134202
  kind: "refactor.rewrite.export.default"
134198
134203
  };
134199
134204
  registerRefactor(refactorName, {
@@ -134211,7 +134216,7 @@ ${lanes.join("\n")}
134211
134216
  }
134212
134217
  if (context.preferences.provideRefactorNotApplicableReason) {
134213
134218
  return [
134214
- { name: refactorName, description: Diagnostics.Convert_default_export_to_named_export.message, actions: [
134219
+ { name: refactorName, description: getLocaleSpecificMessage(Diagnostics.Convert_default_export_to_named_export), actions: [
134215
134220
  { ...defaultToNamedAction, notApplicableReason: info.error },
134216
134221
  { ...namedToDefaultAction, notApplicableReason: info.error }
134217
134222
  ] }
@@ -134413,17 +134418,17 @@ ${lanes.join("\n")}
134413
134418
  actions = {
134414
134419
  [0 /* Named */]: {
134415
134420
  name: "Convert namespace import to named imports",
134416
- description: Diagnostics.Convert_namespace_import_to_named_imports.message,
134421
+ description: getLocaleSpecificMessage(Diagnostics.Convert_namespace_import_to_named_imports),
134417
134422
  kind: "refactor.rewrite.import.named"
134418
134423
  },
134419
134424
  [2 /* Namespace */]: {
134420
134425
  name: "Convert named imports to namespace import",
134421
- description: Diagnostics.Convert_named_imports_to_namespace_import.message,
134426
+ description: getLocaleSpecificMessage(Diagnostics.Convert_named_imports_to_namespace_import),
134422
134427
  kind: "refactor.rewrite.import.namespace"
134423
134428
  },
134424
134429
  [1 /* Default */]: {
134425
134430
  name: "Convert named imports to default import",
134426
- description: Diagnostics.Convert_named_imports_to_default_import.message,
134431
+ description: getLocaleSpecificMessage(Diagnostics.Convert_named_imports_to_default_import),
134427
134432
  kind: "refactor.rewrite.import.default"
134428
134433
  }
134429
134434
  };
@@ -135525,6 +135530,10 @@ ${lanes.join("\n")}
135525
135530
  if (isNamedDeclaration(startStatement) && startStatement.name && rangeContainsRange(startStatement.name, range)) {
135526
135531
  return { toMove: [statements[startNodeIndex]], afterLast: statements[startNodeIndex + 1] };
135527
135532
  }
135533
+ const overloadRangeToMove = getOverloadRangeToMove(file, startStatement);
135534
+ if (overloadRangeToMove) {
135535
+ return overloadRangeToMove;
135536
+ }
135528
135537
  if (range.pos > startStatement.getStart(file))
135529
135538
  return void 0;
135530
135539
  const afterEndNodeIndex = findIndex(statements, (s) => s.end > range.end, startNodeIndex);
@@ -135720,6 +135729,19 @@ ${lanes.join("\n")}
135720
135729
  return false;
135721
135730
  }
135722
135731
  }
135732
+ function getOverloadRangeToMove(sourceFile, statement) {
135733
+ if (isFunctionLikeDeclaration(statement)) {
135734
+ const declarations = statement.symbol.declarations;
135735
+ if (declarations === void 0 || length(declarations) <= 1 || !contains(declarations, statement)) {
135736
+ return void 0;
135737
+ }
135738
+ const lastDecl = declarations[length(declarations) - 1];
135739
+ const statementsToMove = mapDefined(declarations, (d) => getSourceFileOfNode(d) === sourceFile && isStatement(d) ? d : void 0);
135740
+ const end = findLastIndex(sourceFile.statements, (s) => s.end > lastDecl.end);
135741
+ return { toMove: statementsToMove, afterLast: end >= 0 ? sourceFile.statements[end] : void 0 };
135742
+ }
135743
+ return void 0;
135744
+ }
135723
135745
  var refactorNameForMoveToFile, description2, moveToFileAction;
135724
135746
  var init_moveToFile = __esm({
135725
135747
  "src/services/refactors/moveToFile.ts"() {
@@ -135974,7 +135996,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
135974
135996
  init_ts4();
135975
135997
  init_ts_refactor();
135976
135998
  refactorName5 = "Convert overload list to single signature";
135977
- refactorDescription = Diagnostics.Convert_overload_list_to_single_signature.message;
135999
+ refactorDescription = getLocaleSpecificMessage(Diagnostics.Convert_overload_list_to_single_signature);
135978
136000
  functionOverloadAction = {
135979
136001
  name: refactorName5,
135980
136002
  description: refactorDescription,
@@ -136104,15 +136126,15 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
136104
136126
  init_ts4();
136105
136127
  init_ts_refactor();
136106
136128
  refactorName6 = "Add or remove braces in an arrow function";
136107
- refactorDescription2 = Diagnostics.Add_or_remove_braces_in_an_arrow_function.message;
136129
+ refactorDescription2 = getLocaleSpecificMessage(Diagnostics.Add_or_remove_braces_in_an_arrow_function);
136108
136130
  addBracesAction = {
136109
136131
  name: "Add braces to arrow function",
136110
- description: Diagnostics.Add_braces_to_arrow_function.message,
136132
+ description: getLocaleSpecificMessage(Diagnostics.Add_braces_to_arrow_function),
136111
136133
  kind: "refactor.rewrite.arrow.braces.add"
136112
136134
  };
136113
136135
  removeBracesAction = {
136114
136136
  name: "Remove braces from arrow function",
136115
- description: Diagnostics.Remove_braces_from_arrow_function.message,
136137
+ description: getLocaleSpecificMessage(Diagnostics.Remove_braces_from_arrow_function),
136116
136138
  kind: "refactor.rewrite.arrow.braces.remove"
136117
136139
  };
136118
136140
  registerRefactor(refactorName6, {
@@ -136983,7 +137005,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
136983
137005
  }
136984
137006
  }
136985
137007
  function isNotEqualsOperator(node) {
136986
- return node.operatorToken.kind !== 64 /* EqualsToken */;
137008
+ return !(node.operatorToken.kind === 64 /* EqualsToken */ || node.operatorToken.kind === 65 /* PlusEqualsToken */);
136987
137009
  }
136988
137010
  function getParentBinaryExpression(expr) {
136989
137011
  const container = findAncestor(expr.parent, (n) => {
@@ -139018,7 +139040,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
139018
139040
  init_ts4();
139019
139041
  init_ts_refactor();
139020
139042
  actionName = "Generate 'get' and 'set' accessors";
139021
- actionDescription = Diagnostics.Generate_get_and_set_accessors.message;
139043
+ actionDescription = getLocaleSpecificMessage(Diagnostics.Generate_get_and_set_accessors);
139022
139044
  generateGetSetAction = {
139023
139045
  name: actionName,
139024
139046
  description: actionDescription,
@@ -139170,7 +139192,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
139170
139192
  init_ts4();
139171
139193
  init_ts_refactor();
139172
139194
  refactorName12 = "Infer function return type";
139173
- refactorDescription6 = Diagnostics.Infer_function_return_type.message;
139195
+ refactorDescription6 = getLocaleSpecificMessage(Diagnostics.Infer_function_return_type);
139174
139196
  inferReturnTypeAction = {
139175
139197
  name: refactorName12,
139176
139198
  description: refactorDescription6,
@@ -139841,7 +139863,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
139841
139863
  onUnRecoverableConfigFileDiagnostic: noop
139842
139864
  };
139843
139865
  const documentRegistryBucketKey = documentRegistry.getKeyForCompilationSettings(newSettings);
139866
+ let releasedScriptKinds = /* @__PURE__ */ new Set();
139844
139867
  if (isProgramUptoDate(program, rootFileNames, newSettings, (_path, fileName) => host.getScriptVersion(fileName), (fileName) => compilerHost.fileExists(fileName), hasInvalidatedResolutions, hasInvalidatedLibResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
139868
+ compilerHost = void 0;
139869
+ parsedCommandLines = void 0;
139870
+ releasedScriptKinds = void 0;
139845
139871
  return;
139846
139872
  }
139847
139873
  const options = {
@@ -139854,6 +139880,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
139854
139880
  program = createProgram(options);
139855
139881
  compilerHost = void 0;
139856
139882
  parsedCommandLines = void 0;
139883
+ releasedScriptKinds = void 0;
139857
139884
  sourceMapper.clearCache();
139858
139885
  program.getTypeChecker();
139859
139886
  return;
@@ -139908,10 +139935,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
139908
139935
  if (!shouldCreateNewSourceFile) {
139909
139936
  const oldSourceFile = program && program.getSourceFileByPath(path);
139910
139937
  if (oldSourceFile) {
139911
- if (scriptKind === oldSourceFile.scriptKind) {
139938
+ if (scriptKind === oldSourceFile.scriptKind || releasedScriptKinds.has(oldSourceFile.resolvedPath)) {
139912
139939
  return documentRegistry.updateDocumentWithKey(fileName, path, host, documentRegistryBucketKey, scriptSnapshot, scriptVersion, scriptKind, languageVersionOrOptions);
139913
139940
  } else {
139914
139941
  documentRegistry.releaseDocumentWithKey(oldSourceFile.resolvedPath, documentRegistry.getKeyForCompilationSettings(program.getCompilerOptions()), oldSourceFile.scriptKind, oldSourceFile.impliedNodeFormat);
139942
+ releasedScriptKinds.add(oldSourceFile.resolvedPath);
139915
139943
  }
139916
139944
  }
139917
139945
  }
@@ -149207,9 +149235,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
149207
149235
  if (call === void 0) {
149208
149236
  return void 0;
149209
149237
  }
149210
- if (isPrivateIdentifier(token)) {
149211
- return void 0;
149212
- }
149213
149238
  const methodName = token.text;
149214
149239
  const addMethodDeclarationChanges = (modifierFlags2) => ts_textChanges_exports.ChangeTracker.with(context, (t) => addMethodDeclaration(context, t, call, token, modifierFlags2, parentDeclaration, declSourceFile));
149215
149240
  const actions2 = [createCodeFixAction(fixMissingMember, addMethodDeclarationChanges(modifierFlags & 32 /* Static */), [modifierFlags & 32 /* Static */ ? Diagnostics.Declare_static_method_0 : Diagnostics.Declare_method_0, methodName], fixMissingMember, Diagnostics.Add_all_missing_members)];
@@ -152546,6 +152571,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
152546
152571
  type === void 0 ? factory.createKeywordTypeNode(159 /* UnknownKeyword */) : type
152547
152572
  );
152548
152573
  case 261 /* FunctionDeclaration */:
152574
+ Debug.assert(typeof name === "string" || isIdentifier(name), "Unexpected name");
152549
152575
  return factory.createFunctionDeclaration(
152550
152576
  modifiers,
152551
152577
  asteriskToken,
@@ -160831,9 +160857,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
160831
160857
  if (refNode.parent.kind === 303 /* ShorthandPropertyAssignment */) {
160832
160858
  getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference2);
160833
160859
  }
160834
- const containingClass = getContainingClassIfInHeritageClause(refNode);
160835
- if (containingClass) {
160836
- addReference2(containingClass);
160860
+ const containingNode = getContainingNodeIfInHeritageClause(refNode);
160861
+ if (containingNode) {
160862
+ addReference2(containingNode);
160837
160863
  return;
160838
160864
  }
160839
160865
  const typeNode = findAncestor(refNode, (a) => !isQualifiedName(a.parent) && !isTypeNode(a.parent) && !isTypeElement(a.parent));
@@ -160860,8 +160886,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
160860
160886
  addReference2(e);
160861
160887
  }
160862
160888
  }
160863
- function getContainingClassIfInHeritageClause(node) {
160864
- return isIdentifier(node) || isPropertyAccessExpression(node) ? getContainingClassIfInHeritageClause(node.parent) : isExpressionWithTypeArguments(node) ? tryCast(node.parent.parent, isClassLike) : void 0;
160889
+ function getContainingNodeIfInHeritageClause(node) {
160890
+ return isIdentifier(node) || isPropertyAccessExpression(node) ? getContainingNodeIfInHeritageClause(node.parent) : isExpressionWithTypeArguments(node) ? tryCast(node.parent.parent, or(isClassLike, isInterfaceDeclaration)) : void 0;
160865
160891
  }
160866
160892
  function isImplementationExpression(node) {
160867
160893
  switch (node.kind) {
@@ -162373,7 +162399,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
162373
162399
  const tags = (parameters ? parameterDocComments(parameters || [], isJavaScriptFile, indentationStr, newLine) : "") + (hasReturn2 ? returnsDocComment(indentationStr, newLine) : "");
162374
162400
  const openComment = "/**";
162375
162401
  const closeComment = " */";
162376
- const hasTag = (commentOwnerJsDoc || []).some((jsDoc) => !!jsDoc.tags);
162402
+ const hasTag = length(getJSDocTags(commentOwner)) > 0;
162377
162403
  if (tags && !hasTag) {
162378
162404
  const preamble = openComment + newLine + indentationStr + " * ";
162379
162405
  const endLine = tokenStart === position ? newLine + indentationStr : "";
@@ -167937,7 +167963,8 @@ ${options.prefix}` : "\n" : options.prefix
167937
167963
  }
167938
167964
  processNode(enclosingNode, enclosingNode, startLine, undecoratedStartLine, initialIndentation, delta);
167939
167965
  }
167940
- if (!formattingScanner.isOnToken()) {
167966
+ const remainingTrivia = formattingScanner.getCurrentLeadingTrivia();
167967
+ if (remainingTrivia) {
167941
167968
  const indentation = SmartIndenter.nodeWillIndentChild(
167942
167969
  options,
167943
167970
  enclosingNode,
@@ -167947,25 +167974,30 @@ ${options.prefix}` : "\n" : options.prefix
167947
167974
  /*indentByDefault*/
167948
167975
  false
167949
167976
  ) ? initialIndentation + options.indentSize : initialIndentation;
167950
- const leadingTrivia = formattingScanner.getCurrentLeadingTrivia();
167951
- if (leadingTrivia) {
167952
- indentTriviaItems(
167953
- leadingTrivia,
167954
- indentation,
167955
- /*indentNextTokenOrTrivia*/
167956
- false,
167957
- (item) => processRange(
167977
+ indentTriviaItems(
167978
+ remainingTrivia,
167979
+ indentation,
167980
+ /*indentNextTokenOrTrivia*/
167981
+ true,
167982
+ (item) => {
167983
+ processRange(
167958
167984
  item,
167959
167985
  sourceFile.getLineAndCharacterOfPosition(item.pos),
167960
167986
  enclosingNode,
167961
167987
  enclosingNode,
167962
167988
  /*dynamicIndentation*/
167963
167989
  void 0
167964
- )
167965
- );
167966
- if (options.trimTrailingWhitespace !== false) {
167967
- trimTrailingWhitespacesForRemainingRange(leadingTrivia);
167990
+ );
167991
+ insertIndentation(
167992
+ item.pos,
167993
+ indentation,
167994
+ /*lineAdded*/
167995
+ false
167996
+ );
167968
167997
  }
167998
+ );
167999
+ if (options.trimTrailingWhitespace !== false) {
168000
+ trimTrailingWhitespacesForRemainingRange(remainingTrivia);
167969
168001
  }
167970
168002
  }
167971
168003
  if (previousRange && formattingScanner.getTokenFullStart() >= originalRange.end) {
package/lib/typescript.js CHANGED
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.2";
38
- version = `${versionMajorMinor}.0-insiders.20230524`;
38
+ version = `${versionMajorMinor}.0-insiders.20230526`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -60969,6 +60969,10 @@ ${lanes.join("\n")}
60969
60969
  return true;
60970
60970
  }
60971
60971
  switch (node.kind) {
60972
+ case 233 /* AsExpression */:
60973
+ if (!isConstAssertion(node)) {
60974
+ break;
60975
+ }
60972
60976
  case 293 /* JsxExpression */:
60973
60977
  case 216 /* ParenthesizedExpression */:
60974
60978
  return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer);
@@ -64216,7 +64220,7 @@ ${lanes.join("\n")}
64216
64220
  }
64217
64221
  }
64218
64222
  }
64219
- const filtered = contains(include, 0 /* False */) ? getUnionType(types.filter((_, i) => include[i])) : target;
64223
+ const filtered = contains(include, 0 /* False */) ? getUnionType(types.filter((_, i) => include[i]), 0 /* None */) : target;
64220
64224
  return filtered.flags & 131072 /* Never */ ? target : filtered;
64221
64225
  }
64222
64226
  function isWeakType(type) {
@@ -65195,8 +65199,6 @@ ${lanes.join("\n")}
65195
65199
  return context && context.mapper;
65196
65200
  }
65197
65201
  function couldContainTypeVariables(type) {
65198
- if (type.flags & 67359327 /* Intrinsic */)
65199
- return false;
65200
65202
  const objectFlags = getObjectFlags(type);
65201
65203
  if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
65202
65204
  return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
@@ -67249,7 +67251,7 @@ ${lanes.join("\n")}
67249
67251
  target.antecedents = saveAntecedents;
67250
67252
  } else if (flags & 2 /* Start */) {
67251
67253
  const container = flow.node;
67252
- if (container && container !== flowContainer && reference.kind !== 210 /* PropertyAccessExpression */ && reference.kind !== 211 /* ElementAccessExpression */ && reference.kind !== 110 /* ThisKeyword */) {
67254
+ if (container && container !== flowContainer && reference.kind !== 210 /* PropertyAccessExpression */ && reference.kind !== 211 /* ElementAccessExpression */ && !(reference.kind === 110 /* ThisKeyword */ && container.kind !== 218 /* ArrowFunction */)) {
67253
67255
  flow = container.flowNode;
67254
67256
  continue;
67255
67257
  }
@@ -75736,7 +75738,7 @@ ${lanes.join("\n")}
75736
75738
  Debug.assertIsDefined(leftType);
75737
75739
  const rightType = getLastResult(state);
75738
75740
  Debug.assertIsDefined(rightType);
75739
- result = checkBinaryLikeExpressionWorker(node.left, node.operatorToken, node.right, leftType, rightType, node);
75741
+ result = checkBinaryLikeExpressionWorker(node.left, node.operatorToken, node.right, leftType, rightType, state.checkMode, node);
75740
75742
  }
75741
75743
  state.skip = false;
75742
75744
  setLeftType(
@@ -75798,9 +75800,9 @@ ${lanes.join("\n")}
75798
75800
  leftType = checkExpression(left, checkMode);
75799
75801
  }
75800
75802
  const rightType = checkExpression(right, checkMode);
75801
- return checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, errorNode);
75803
+ return checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, checkMode, errorNode);
75802
75804
  }
75803
- function checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, errorNode) {
75805
+ function checkBinaryLikeExpressionWorker(left, operatorToken, right, leftType, rightType, checkMode, errorNode) {
75804
75806
  const operator = operatorToken.kind;
75805
75807
  switch (operator) {
75806
75808
  case 42 /* AsteriskToken */:
@@ -75957,12 +75959,14 @@ ${lanes.join("\n")}
75957
75959
  case 36 /* ExclamationEqualsToken */:
75958
75960
  case 37 /* EqualsEqualsEqualsToken */:
75959
75961
  case 38 /* ExclamationEqualsEqualsToken */:
75960
- if (isLiteralExpressionOfObject(left) || isLiteralExpressionOfObject(right)) {
75961
- const eqType = operator === 35 /* EqualsEqualsToken */ || operator === 37 /* EqualsEqualsEqualsToken */;
75962
- error(errorNode, Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value, eqType ? "false" : "true");
75962
+ if (!(checkMode && checkMode & 128 /* TypeOnly */)) {
75963
+ if (isLiteralExpressionOfObject(left) || isLiteralExpressionOfObject(right)) {
75964
+ const eqType = operator === 35 /* EqualsEqualsToken */ || operator === 37 /* EqualsEqualsEqualsToken */;
75965
+ error(errorNode, Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value, eqType ? "false" : "true");
75966
+ }
75967
+ checkNaNEquality(errorNode, operator, left, right);
75968
+ reportOperatorErrorUnless((left2, right2) => isTypeEqualityComparableTo(left2, right2) || isTypeEqualityComparableTo(right2, left2));
75963
75969
  }
75964
- checkNaNEquality(errorNode, operator, left, right);
75965
- reportOperatorErrorUnless((left2, right2) => isTypeEqualityComparableTo(left2, right2) || isTypeEqualityComparableTo(right2, left2));
75966
75970
  return booleanType;
75967
75971
  case 104 /* InstanceOfKeyword */:
75968
75972
  return checkInstanceOfExpression(left, right, leftType, rightType);
@@ -76273,7 +76277,7 @@ ${lanes.join("\n")}
76273
76277
  }
76274
76278
  }
76275
76279
  function checkConditionalExpression(node, checkMode) {
76276
- const type = checkTruthinessExpression(node.condition);
76280
+ const type = checkTruthinessExpression(node.condition, checkMode);
76277
76281
  checkTestingKnownTruthyCallableOrAwaitableType(node.condition, type, node.whenTrue);
76278
76282
  const type1 = checkExpression(node.whenTrue, checkMode);
76279
76283
  const type2 = checkExpression(node.whenFalse, checkMode);
@@ -76614,7 +76618,7 @@ ${lanes.join("\n")}
76614
76618
  }
76615
76619
  }
76616
76620
  const startInvocationCount = flowInvocationCount;
76617
- const type = checkExpression(node);
76621
+ const type = checkExpression(node, 128 /* TypeOnly */);
76618
76622
  if (flowInvocationCount !== startInvocationCount) {
76619
76623
  const cache = flowTypeCache || (flowTypeCache = []);
76620
76624
  cache[getNodeId(node)] = type;
@@ -85824,6 +85828,7 @@ ${lanes.join("\n")}
85824
85828
  CheckMode3[CheckMode3["IsForSignatureHelp"] = 16] = "IsForSignatureHelp";
85825
85829
  CheckMode3[CheckMode3["IsForStringLiteralArgumentCompletions"] = 32] = "IsForStringLiteralArgumentCompletions";
85826
85830
  CheckMode3[CheckMode3["RestBindingElement"] = 64] = "RestBindingElement";
85831
+ CheckMode3[CheckMode3["TypeOnly"] = 128] = "TypeOnly";
85827
85832
  return CheckMode3;
85828
85833
  })(CheckMode || {});
85829
85834
  SignatureCheckMode = /* @__PURE__ */ ((SignatureCheckMode3) => {
@@ -134203,12 +134208,12 @@ ${lanes.join("\n")}
134203
134208
  refactorName = "Convert export";
134204
134209
  defaultToNamedAction = {
134205
134210
  name: "Convert default export to named export",
134206
- description: Diagnostics.Convert_default_export_to_named_export.message,
134211
+ description: getLocaleSpecificMessage(Diagnostics.Convert_default_export_to_named_export),
134207
134212
  kind: "refactor.rewrite.export.named"
134208
134213
  };
134209
134214
  namedToDefaultAction = {
134210
134215
  name: "Convert named export to default export",
134211
- description: Diagnostics.Convert_named_export_to_default_export.message,
134216
+ description: getLocaleSpecificMessage(Diagnostics.Convert_named_export_to_default_export),
134212
134217
  kind: "refactor.rewrite.export.default"
134213
134218
  };
134214
134219
  registerRefactor(refactorName, {
@@ -134226,7 +134231,7 @@ ${lanes.join("\n")}
134226
134231
  }
134227
134232
  if (context.preferences.provideRefactorNotApplicableReason) {
134228
134233
  return [
134229
- { name: refactorName, description: Diagnostics.Convert_default_export_to_named_export.message, actions: [
134234
+ { name: refactorName, description: getLocaleSpecificMessage(Diagnostics.Convert_default_export_to_named_export), actions: [
134230
134235
  { ...defaultToNamedAction, notApplicableReason: info.error },
134231
134236
  { ...namedToDefaultAction, notApplicableReason: info.error }
134232
134237
  ] }
@@ -134428,17 +134433,17 @@ ${lanes.join("\n")}
134428
134433
  actions = {
134429
134434
  [0 /* Named */]: {
134430
134435
  name: "Convert namespace import to named imports",
134431
- description: Diagnostics.Convert_namespace_import_to_named_imports.message,
134436
+ description: getLocaleSpecificMessage(Diagnostics.Convert_namespace_import_to_named_imports),
134432
134437
  kind: "refactor.rewrite.import.named"
134433
134438
  },
134434
134439
  [2 /* Namespace */]: {
134435
134440
  name: "Convert named imports to namespace import",
134436
- description: Diagnostics.Convert_named_imports_to_namespace_import.message,
134441
+ description: getLocaleSpecificMessage(Diagnostics.Convert_named_imports_to_namespace_import),
134437
134442
  kind: "refactor.rewrite.import.namespace"
134438
134443
  },
134439
134444
  [1 /* Default */]: {
134440
134445
  name: "Convert named imports to default import",
134441
- description: Diagnostics.Convert_named_imports_to_default_import.message,
134446
+ description: getLocaleSpecificMessage(Diagnostics.Convert_named_imports_to_default_import),
134442
134447
  kind: "refactor.rewrite.import.default"
134443
134448
  }
134444
134449
  };
@@ -135540,6 +135545,10 @@ ${lanes.join("\n")}
135540
135545
  if (isNamedDeclaration(startStatement) && startStatement.name && rangeContainsRange(startStatement.name, range)) {
135541
135546
  return { toMove: [statements[startNodeIndex]], afterLast: statements[startNodeIndex + 1] };
135542
135547
  }
135548
+ const overloadRangeToMove = getOverloadRangeToMove(file, startStatement);
135549
+ if (overloadRangeToMove) {
135550
+ return overloadRangeToMove;
135551
+ }
135543
135552
  if (range.pos > startStatement.getStart(file))
135544
135553
  return void 0;
135545
135554
  const afterEndNodeIndex = findIndex(statements, (s) => s.end > range.end, startNodeIndex);
@@ -135735,6 +135744,19 @@ ${lanes.join("\n")}
135735
135744
  return false;
135736
135745
  }
135737
135746
  }
135747
+ function getOverloadRangeToMove(sourceFile, statement) {
135748
+ if (isFunctionLikeDeclaration(statement)) {
135749
+ const declarations = statement.symbol.declarations;
135750
+ if (declarations === void 0 || length(declarations) <= 1 || !contains(declarations, statement)) {
135751
+ return void 0;
135752
+ }
135753
+ const lastDecl = declarations[length(declarations) - 1];
135754
+ const statementsToMove = mapDefined(declarations, (d) => getSourceFileOfNode(d) === sourceFile && isStatement(d) ? d : void 0);
135755
+ const end = findLastIndex(sourceFile.statements, (s) => s.end > lastDecl.end);
135756
+ return { toMove: statementsToMove, afterLast: end >= 0 ? sourceFile.statements[end] : void 0 };
135757
+ }
135758
+ return void 0;
135759
+ }
135738
135760
  var refactorNameForMoveToFile, description2, moveToFileAction;
135739
135761
  var init_moveToFile = __esm({
135740
135762
  "src/services/refactors/moveToFile.ts"() {
@@ -135989,7 +136011,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
135989
136011
  init_ts4();
135990
136012
  init_ts_refactor();
135991
136013
  refactorName5 = "Convert overload list to single signature";
135992
- refactorDescription = Diagnostics.Convert_overload_list_to_single_signature.message;
136014
+ refactorDescription = getLocaleSpecificMessage(Diagnostics.Convert_overload_list_to_single_signature);
135993
136015
  functionOverloadAction = {
135994
136016
  name: refactorName5,
135995
136017
  description: refactorDescription,
@@ -136119,15 +136141,15 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
136119
136141
  init_ts4();
136120
136142
  init_ts_refactor();
136121
136143
  refactorName6 = "Add or remove braces in an arrow function";
136122
- refactorDescription2 = Diagnostics.Add_or_remove_braces_in_an_arrow_function.message;
136144
+ refactorDescription2 = getLocaleSpecificMessage(Diagnostics.Add_or_remove_braces_in_an_arrow_function);
136123
136145
  addBracesAction = {
136124
136146
  name: "Add braces to arrow function",
136125
- description: Diagnostics.Add_braces_to_arrow_function.message,
136147
+ description: getLocaleSpecificMessage(Diagnostics.Add_braces_to_arrow_function),
136126
136148
  kind: "refactor.rewrite.arrow.braces.add"
136127
136149
  };
136128
136150
  removeBracesAction = {
136129
136151
  name: "Remove braces from arrow function",
136130
- description: Diagnostics.Remove_braces_from_arrow_function.message,
136152
+ description: getLocaleSpecificMessage(Diagnostics.Remove_braces_from_arrow_function),
136131
136153
  kind: "refactor.rewrite.arrow.braces.remove"
136132
136154
  };
136133
136155
  registerRefactor(refactorName6, {
@@ -136998,7 +137020,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
136998
137020
  }
136999
137021
  }
137000
137022
  function isNotEqualsOperator(node) {
137001
- return node.operatorToken.kind !== 64 /* EqualsToken */;
137023
+ return !(node.operatorToken.kind === 64 /* EqualsToken */ || node.operatorToken.kind === 65 /* PlusEqualsToken */);
137002
137024
  }
137003
137025
  function getParentBinaryExpression(expr) {
137004
137026
  const container = findAncestor(expr.parent, (n) => {
@@ -139033,7 +139055,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
139033
139055
  init_ts4();
139034
139056
  init_ts_refactor();
139035
139057
  actionName = "Generate 'get' and 'set' accessors";
139036
- actionDescription = Diagnostics.Generate_get_and_set_accessors.message;
139058
+ actionDescription = getLocaleSpecificMessage(Diagnostics.Generate_get_and_set_accessors);
139037
139059
  generateGetSetAction = {
139038
139060
  name: actionName,
139039
139061
  description: actionDescription,
@@ -139185,7 +139207,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
139185
139207
  init_ts4();
139186
139208
  init_ts_refactor();
139187
139209
  refactorName12 = "Infer function return type";
139188
- refactorDescription6 = Diagnostics.Infer_function_return_type.message;
139210
+ refactorDescription6 = getLocaleSpecificMessage(Diagnostics.Infer_function_return_type);
139189
139211
  inferReturnTypeAction = {
139190
139212
  name: refactorName12,
139191
139213
  description: refactorDescription6,
@@ -139856,7 +139878,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
139856
139878
  onUnRecoverableConfigFileDiagnostic: noop
139857
139879
  };
139858
139880
  const documentRegistryBucketKey = documentRegistry.getKeyForCompilationSettings(newSettings);
139881
+ let releasedScriptKinds = /* @__PURE__ */ new Set();
139859
139882
  if (isProgramUptoDate(program, rootFileNames, newSettings, (_path, fileName) => host.getScriptVersion(fileName), (fileName) => compilerHost.fileExists(fileName), hasInvalidatedResolutions, hasInvalidatedLibResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
139883
+ compilerHost = void 0;
139884
+ parsedCommandLines = void 0;
139885
+ releasedScriptKinds = void 0;
139860
139886
  return;
139861
139887
  }
139862
139888
  const options = {
@@ -139869,6 +139895,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
139869
139895
  program = createProgram(options);
139870
139896
  compilerHost = void 0;
139871
139897
  parsedCommandLines = void 0;
139898
+ releasedScriptKinds = void 0;
139872
139899
  sourceMapper.clearCache();
139873
139900
  program.getTypeChecker();
139874
139901
  return;
@@ -139923,10 +139950,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
139923
139950
  if (!shouldCreateNewSourceFile) {
139924
139951
  const oldSourceFile = program && program.getSourceFileByPath(path);
139925
139952
  if (oldSourceFile) {
139926
- if (scriptKind === oldSourceFile.scriptKind) {
139953
+ if (scriptKind === oldSourceFile.scriptKind || releasedScriptKinds.has(oldSourceFile.resolvedPath)) {
139927
139954
  return documentRegistry.updateDocumentWithKey(fileName, path, host, documentRegistryBucketKey, scriptSnapshot, scriptVersion, scriptKind, languageVersionOrOptions);
139928
139955
  } else {
139929
139956
  documentRegistry.releaseDocumentWithKey(oldSourceFile.resolvedPath, documentRegistry.getKeyForCompilationSettings(program.getCompilerOptions()), oldSourceFile.scriptKind, oldSourceFile.impliedNodeFormat);
139957
+ releasedScriptKinds.add(oldSourceFile.resolvedPath);
139930
139958
  }
139931
139959
  }
139932
139960
  }
@@ -149222,9 +149250,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
149222
149250
  if (call === void 0) {
149223
149251
  return void 0;
149224
149252
  }
149225
- if (isPrivateIdentifier(token)) {
149226
- return void 0;
149227
- }
149228
149253
  const methodName = token.text;
149229
149254
  const addMethodDeclarationChanges = (modifierFlags2) => ts_textChanges_exports.ChangeTracker.with(context, (t) => addMethodDeclaration(context, t, call, token, modifierFlags2, parentDeclaration, declSourceFile));
149230
149255
  const actions2 = [createCodeFixAction(fixMissingMember, addMethodDeclarationChanges(modifierFlags & 32 /* Static */), [modifierFlags & 32 /* Static */ ? Diagnostics.Declare_static_method_0 : Diagnostics.Declare_method_0, methodName], fixMissingMember, Diagnostics.Add_all_missing_members)];
@@ -152561,6 +152586,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
152561
152586
  type === void 0 ? factory.createKeywordTypeNode(159 /* UnknownKeyword */) : type
152562
152587
  );
152563
152588
  case 261 /* FunctionDeclaration */:
152589
+ Debug.assert(typeof name === "string" || isIdentifier(name), "Unexpected name");
152564
152590
  return factory.createFunctionDeclaration(
152565
152591
  modifiers,
152566
152592
  asteriskToken,
@@ -160846,9 +160872,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
160846
160872
  if (refNode.parent.kind === 303 /* ShorthandPropertyAssignment */) {
160847
160873
  getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference2);
160848
160874
  }
160849
- const containingClass = getContainingClassIfInHeritageClause(refNode);
160850
- if (containingClass) {
160851
- addReference2(containingClass);
160875
+ const containingNode = getContainingNodeIfInHeritageClause(refNode);
160876
+ if (containingNode) {
160877
+ addReference2(containingNode);
160852
160878
  return;
160853
160879
  }
160854
160880
  const typeNode = findAncestor(refNode, (a) => !isQualifiedName(a.parent) && !isTypeNode(a.parent) && !isTypeElement(a.parent));
@@ -160875,8 +160901,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
160875
160901
  addReference2(e);
160876
160902
  }
160877
160903
  }
160878
- function getContainingClassIfInHeritageClause(node) {
160879
- return isIdentifier(node) || isPropertyAccessExpression(node) ? getContainingClassIfInHeritageClause(node.parent) : isExpressionWithTypeArguments(node) ? tryCast(node.parent.parent, isClassLike) : void 0;
160904
+ function getContainingNodeIfInHeritageClause(node) {
160905
+ return isIdentifier(node) || isPropertyAccessExpression(node) ? getContainingNodeIfInHeritageClause(node.parent) : isExpressionWithTypeArguments(node) ? tryCast(node.parent.parent, or(isClassLike, isInterfaceDeclaration)) : void 0;
160880
160906
  }
160881
160907
  function isImplementationExpression(node) {
160882
160908
  switch (node.kind) {
@@ -162388,7 +162414,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
162388
162414
  const tags = (parameters ? parameterDocComments(parameters || [], isJavaScriptFile, indentationStr, newLine) : "") + (hasReturn2 ? returnsDocComment(indentationStr, newLine) : "");
162389
162415
  const openComment = "/**";
162390
162416
  const closeComment = " */";
162391
- const hasTag = (commentOwnerJsDoc || []).some((jsDoc) => !!jsDoc.tags);
162417
+ const hasTag = length(getJSDocTags(commentOwner)) > 0;
162392
162418
  if (tags && !hasTag) {
162393
162419
  const preamble = openComment + newLine + indentationStr + " * ";
162394
162420
  const endLine = tokenStart === position ? newLine + indentationStr : "";
@@ -167952,7 +167978,8 @@ ${options.prefix}` : "\n" : options.prefix
167952
167978
  }
167953
167979
  processNode(enclosingNode, enclosingNode, startLine, undecoratedStartLine, initialIndentation, delta);
167954
167980
  }
167955
- if (!formattingScanner.isOnToken()) {
167981
+ const remainingTrivia = formattingScanner.getCurrentLeadingTrivia();
167982
+ if (remainingTrivia) {
167956
167983
  const indentation = SmartIndenter.nodeWillIndentChild(
167957
167984
  options,
167958
167985
  enclosingNode,
@@ -167962,25 +167989,30 @@ ${options.prefix}` : "\n" : options.prefix
167962
167989
  /*indentByDefault*/
167963
167990
  false
167964
167991
  ) ? initialIndentation + options.indentSize : initialIndentation;
167965
- const leadingTrivia = formattingScanner.getCurrentLeadingTrivia();
167966
- if (leadingTrivia) {
167967
- indentTriviaItems(
167968
- leadingTrivia,
167969
- indentation,
167970
- /*indentNextTokenOrTrivia*/
167971
- false,
167972
- (item) => processRange(
167992
+ indentTriviaItems(
167993
+ remainingTrivia,
167994
+ indentation,
167995
+ /*indentNextTokenOrTrivia*/
167996
+ true,
167997
+ (item) => {
167998
+ processRange(
167973
167999
  item,
167974
168000
  sourceFile.getLineAndCharacterOfPosition(item.pos),
167975
168001
  enclosingNode,
167976
168002
  enclosingNode,
167977
168003
  /*dynamicIndentation*/
167978
168004
  void 0
167979
- )
167980
- );
167981
- if (options.trimTrailingWhitespace !== false) {
167982
- trimTrailingWhitespacesForRemainingRange(leadingTrivia);
168005
+ );
168006
+ insertIndentation(
168007
+ item.pos,
168008
+ indentation,
168009
+ /*lineAdded*/
168010
+ false
168011
+ );
167983
168012
  }
168013
+ );
168014
+ if (options.trimTrailingWhitespace !== false) {
168015
+ trimTrailingWhitespacesForRemainingRange(remainingTrivia);
167984
168016
  }
167985
168017
  }
167986
168018
  if (previousRange && formattingScanner.getTokenFullStart() >= originalRange.end) {
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.2";
57
- var version = `${versionMajorMinor}.0-insiders.20230524`;
57
+ var version = `${versionMajorMinor}.0-insiders.20230526`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -28916,6 +28916,7 @@ var CheckMode = /* @__PURE__ */ ((CheckMode3) => {
28916
28916
  CheckMode3[CheckMode3["IsForSignatureHelp"] = 16] = "IsForSignatureHelp";
28917
28917
  CheckMode3[CheckMode3["IsForStringLiteralArgumentCompletions"] = 32] = "IsForStringLiteralArgumentCompletions";
28918
28918
  CheckMode3[CheckMode3["RestBindingElement"] = 64] = "RestBindingElement";
28919
+ CheckMode3[CheckMode3["TypeOnly"] = 128] = "TypeOnly";
28919
28920
  return CheckMode3;
28920
28921
  })(CheckMode || {});
28921
28922
  var SignatureCheckMode = /* @__PURE__ */ ((SignatureCheckMode3) => {
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.2.0-pr-54377-7",
5
+ "version": "5.2.0-pr-54052-23",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -114,5 +114,5 @@
114
114
  "node": "20.1.0",
115
115
  "npm": "8.19.4"
116
116
  },
117
- "gitHead": "d72224104a48673dadda349d19e7974c5d979205"
117
+ "gitHead": "173034c4007a3992ea049b4f13cd7b44f9217679"
118
118
  }