@typescript-deploys/pr-build 5.2.0-pr-54688-11 → 5.2.0-pr-52899-13

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.20230620`;
21
+ var version = `${versionMajorMinor}.0-insiders.20230621`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -7732,6 +7732,7 @@ var Diagnostics = {
7732
7732
  Inline_variable: diag(95184, 3 /* Message */, "Inline_variable_95184", "Inline variable"),
7733
7733
  Could_not_find_variable_to_inline: diag(95185, 3 /* Message */, "Could_not_find_variable_to_inline_95185", "Could not find variable to inline."),
7734
7734
  Variables_with_multiple_declarations_cannot_be_inlined: diag(95186, 3 /* Message */, "Variables_with_multiple_declarations_cannot_be_inlined_95186", "Variables with multiple declarations cannot be inlined."),
7735
+ Add_missing_comma_for_an_object_member_completion_0: diag(95187, 3 /* Message */, "Add_missing_comma_for_an_object_member_completion_0_95187", "Add missing comma for an object member completion '{0}'."),
7735
7736
  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."),
7736
7737
  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'."),
7737
7738
  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?"),
@@ -28835,7 +28836,7 @@ var Parser;
28835
28836
  }
28836
28837
  const pos = getNodePos();
28837
28838
  const type = parseUnionTypeOrHigher();
28838
- if (!inDisallowConditionalTypesContext() && tryParse(parseConditionalTypeExtends)) {
28839
+ if (!inDisallowConditionalTypesContext() && !scanner.hasPrecedingLineBreak() && parseOptional(96 /* ExtendsKeyword */)) {
28839
28840
  const extendsType = disallowConditionalTypesAnd(parseType);
28840
28841
  parseExpected(58 /* QuestionToken */);
28841
28842
  const trueType = allowConditionalTypesAnd(parseType);
@@ -28845,9 +28846,6 @@ var Parser;
28845
28846
  }
28846
28847
  return type;
28847
28848
  }
28848
- function parseConditionalTypeExtends() {
28849
- return parseOptional(96 /* ExtendsKeyword */) && !(parseOptional(58 /* QuestionToken */) || parseOptional(59 /* ColonToken */));
28850
- }
28851
28849
  function parseTypeAnnotation() {
28852
28850
  return parseOptional(59 /* ColonToken */) ? parseType() : void 0;
28853
28851
  }
@@ -43182,14 +43180,19 @@ function createTypeChecker(host) {
43182
43180
  typeHasCallOrConstructSignatures
43183
43181
  };
43184
43182
  function runWithoutResolvedSignatureCaching(node, fn) {
43185
- const containingCall = findAncestor(node, isCallLikeExpression);
43186
- const containingCallResolvedSignature = containingCall && getNodeLinks(containingCall).resolvedSignature;
43187
- if (containingCall) {
43188
- getNodeLinks(containingCall).resolvedSignature = void 0;
43183
+ const cachedSignatures = [];
43184
+ while (node) {
43185
+ if (isCallLikeExpression(node)) {
43186
+ const nodeLinks2 = getNodeLinks(node);
43187
+ const resolvedSignature = nodeLinks2.resolvedSignature;
43188
+ cachedSignatures.push([nodeLinks2, resolvedSignature]);
43189
+ nodeLinks2.resolvedSignature = void 0;
43190
+ }
43191
+ node = node.parent;
43189
43192
  }
43190
43193
  const result = fn();
43191
- if (containingCall) {
43192
- getNodeLinks(containingCall).resolvedSignature = containingCallResolvedSignature;
43194
+ for (const [nodeLinks2, resolvedSignature] of cachedSignatures) {
43195
+ nodeLinks2.resolvedSignature = resolvedSignature;
43193
43196
  }
43194
43197
  return result;
43195
43198
  }
@@ -50809,15 +50812,20 @@ function createTypeChecker(host) {
50809
50812
  const prop = getPropertyOfType(type, name);
50810
50813
  return prop ? getTypeOfSymbol(prop) : void 0;
50811
50814
  }
50812
- function getTypeOfPropertyOrIndexSignature(type, name, addOptionalityToIndex) {
50815
+ function getTypeOfPropertyOrIndexSignature(type, name) {
50816
+ var _a;
50817
+ return getTypeOfPropertyOfType(type, name) || ((_a = getApplicableIndexInfoForName(type, name)) == null ? void 0 : _a.type) || unknownType;
50818
+ }
50819
+ function getTypeOfPropertyOrIndexSignatureOfType(type, name) {
50813
50820
  var _a;
50814
50821
  let propType;
50815
50822
  return getTypeOfPropertyOfType(type, name) || (propType = (_a = getApplicableIndexInfoForName(type, name)) == null ? void 0 : _a.type) && addOptionality(
50816
50823
  propType,
50817
50824
  /*isProperty*/
50818
50825
  true,
50819
- addOptionalityToIndex
50820
- ) || unknownType;
50826
+ /*isOptional*/
50827
+ true
50828
+ );
50821
50829
  }
50822
50830
  function isTypeAny(type) {
50823
50831
  return type && (type.flags & 1 /* Any */) !== 0;
@@ -61819,12 +61827,7 @@ function createTypeChecker(host) {
61819
61827
  let matched = false;
61820
61828
  for (let i = 0; i < types.length; i++) {
61821
61829
  if (include[i]) {
61822
- const targetType = getTypeOfPropertyOrIndexSignature(
61823
- types[i],
61824
- propertyName,
61825
- /*addOptionalityToIndex*/
61826
- true
61827
- );
61830
+ const targetType = getTypeOfPropertyOrIndexSignatureOfType(types[i], propertyName);
61828
61831
  if (targetType && related(getDiscriminatingType(), targetType)) {
61829
61832
  matched = true;
61830
61833
  } else {
@@ -65222,12 +65225,7 @@ function createTypeChecker(host) {
65222
65225
  propType = removeNullable && optionalChain ? getOptionalType(propType) : propType;
65223
65226
  const narrowedPropType = narrowType2(propType);
65224
65227
  return filterType(type, (t) => {
65225
- const discriminantType = getTypeOfPropertyOrIndexSignature(
65226
- t,
65227
- propName,
65228
- /*addOptionalityToIndex*/
65229
- false
65230
- );
65228
+ const discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
65231
65229
  return !(discriminantType.flags & 131072 /* Never */) && !(narrowedPropType.flags & 131072 /* Never */) && areTypesComparable(narrowedPropType, discriminantType);
65232
65230
  });
65233
65231
  }
package/lib/tsserver.js CHANGED
@@ -2305,7 +2305,7 @@ module.exports = __toCommonJS(server_exports);
2305
2305
 
2306
2306
  // src/compiler/corePublic.ts
2307
2307
  var versionMajorMinor = "5.2";
2308
- var version = `${versionMajorMinor}.0-insiders.20230620`;
2308
+ var version = `${versionMajorMinor}.0-insiders.20230621`;
2309
2309
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2310
2310
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2311
2311
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -11230,6 +11230,7 @@ var Diagnostics = {
11230
11230
  Inline_variable: diag(95184, 3 /* Message */, "Inline_variable_95184", "Inline variable"),
11231
11231
  Could_not_find_variable_to_inline: diag(95185, 3 /* Message */, "Could_not_find_variable_to_inline_95185", "Could not find variable to inline."),
11232
11232
  Variables_with_multiple_declarations_cannot_be_inlined: diag(95186, 3 /* Message */, "Variables_with_multiple_declarations_cannot_be_inlined_95186", "Variables with multiple declarations cannot be inlined."),
11233
+ Add_missing_comma_for_an_object_member_completion_0: diag(95187, 3 /* Message */, "Add_missing_comma_for_an_object_member_completion_0_95187", "Add missing comma for an object member completion '{0}'."),
11233
11234
  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."),
11234
11235
  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'."),
11235
11236
  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?"),
@@ -33210,7 +33211,7 @@ var Parser;
33210
33211
  }
33211
33212
  const pos = getNodePos();
33212
33213
  const type = parseUnionTypeOrHigher();
33213
- if (!inDisallowConditionalTypesContext() && tryParse(parseConditionalTypeExtends)) {
33214
+ if (!inDisallowConditionalTypesContext() && !scanner2.hasPrecedingLineBreak() && parseOptional(96 /* ExtendsKeyword */)) {
33214
33215
  const extendsType = disallowConditionalTypesAnd(parseType);
33215
33216
  parseExpected(58 /* QuestionToken */);
33216
33217
  const trueType = allowConditionalTypesAnd(parseType);
@@ -33220,9 +33221,6 @@ var Parser;
33220
33221
  }
33221
33222
  return type;
33222
33223
  }
33223
- function parseConditionalTypeExtends() {
33224
- return parseOptional(96 /* ExtendsKeyword */) && !(parseOptional(58 /* QuestionToken */) || parseOptional(59 /* ColonToken */));
33225
- }
33226
33224
  function parseTypeAnnotation() {
33227
33225
  return parseOptional(59 /* ColonToken */) ? parseType() : void 0;
33228
33226
  }
@@ -47823,14 +47821,19 @@ function createTypeChecker(host) {
47823
47821
  typeHasCallOrConstructSignatures
47824
47822
  };
47825
47823
  function runWithoutResolvedSignatureCaching(node, fn) {
47826
- const containingCall = findAncestor(node, isCallLikeExpression);
47827
- const containingCallResolvedSignature = containingCall && getNodeLinks(containingCall).resolvedSignature;
47828
- if (containingCall) {
47829
- getNodeLinks(containingCall).resolvedSignature = void 0;
47824
+ const cachedSignatures = [];
47825
+ while (node) {
47826
+ if (isCallLikeExpression(node)) {
47827
+ const nodeLinks2 = getNodeLinks(node);
47828
+ const resolvedSignature = nodeLinks2.resolvedSignature;
47829
+ cachedSignatures.push([nodeLinks2, resolvedSignature]);
47830
+ nodeLinks2.resolvedSignature = void 0;
47831
+ }
47832
+ node = node.parent;
47830
47833
  }
47831
47834
  const result = fn();
47832
- if (containingCall) {
47833
- getNodeLinks(containingCall).resolvedSignature = containingCallResolvedSignature;
47835
+ for (const [nodeLinks2, resolvedSignature] of cachedSignatures) {
47836
+ nodeLinks2.resolvedSignature = resolvedSignature;
47834
47837
  }
47835
47838
  return result;
47836
47839
  }
@@ -55450,15 +55453,20 @@ function createTypeChecker(host) {
55450
55453
  const prop = getPropertyOfType(type, name);
55451
55454
  return prop ? getTypeOfSymbol(prop) : void 0;
55452
55455
  }
55453
- function getTypeOfPropertyOrIndexSignature(type, name, addOptionalityToIndex) {
55456
+ function getTypeOfPropertyOrIndexSignature(type, name) {
55457
+ var _a;
55458
+ return getTypeOfPropertyOfType(type, name) || ((_a = getApplicableIndexInfoForName(type, name)) == null ? void 0 : _a.type) || unknownType;
55459
+ }
55460
+ function getTypeOfPropertyOrIndexSignatureOfType(type, name) {
55454
55461
  var _a;
55455
55462
  let propType;
55456
55463
  return getTypeOfPropertyOfType(type, name) || (propType = (_a = getApplicableIndexInfoForName(type, name)) == null ? void 0 : _a.type) && addOptionality(
55457
55464
  propType,
55458
55465
  /*isProperty*/
55459
55466
  true,
55460
- addOptionalityToIndex
55461
- ) || unknownType;
55467
+ /*isOptional*/
55468
+ true
55469
+ );
55462
55470
  }
55463
55471
  function isTypeAny(type) {
55464
55472
  return type && (type.flags & 1 /* Any */) !== 0;
@@ -66460,12 +66468,7 @@ function createTypeChecker(host) {
66460
66468
  let matched = false;
66461
66469
  for (let i = 0; i < types.length; i++) {
66462
66470
  if (include[i]) {
66463
- const targetType = getTypeOfPropertyOrIndexSignature(
66464
- types[i],
66465
- propertyName,
66466
- /*addOptionalityToIndex*/
66467
- true
66468
- );
66471
+ const targetType = getTypeOfPropertyOrIndexSignatureOfType(types[i], propertyName);
66469
66472
  if (targetType && related(getDiscriminatingType(), targetType)) {
66470
66473
  matched = true;
66471
66474
  } else {
@@ -69863,12 +69866,7 @@ function createTypeChecker(host) {
69863
69866
  propType = removeNullable && optionalChain ? getOptionalType(propType) : propType;
69864
69867
  const narrowedPropType = narrowType2(propType);
69865
69868
  return filterType(type, (t) => {
69866
- const discriminantType = getTypeOfPropertyOrIndexSignature(
69867
- t,
69868
- propName,
69869
- /*addOptionalityToIndex*/
69870
- false
69871
- );
69869
+ const discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
69872
69870
  return !(discriminantType.flags & 131072 /* Never */) && !(narrowedPropType.flags & 131072 /* Never */) && areTypesComparable(narrowedPropType, discriminantType);
69873
69871
  });
69874
69872
  }
@@ -155214,6 +155212,7 @@ var CompletionSource = /* @__PURE__ */ ((CompletionSource2) => {
155214
155212
  CompletionSource2["TypeOnlyAlias"] = "TypeOnlyAlias/";
155215
155213
  CompletionSource2["ObjectLiteralMethodSnippet"] = "ObjectLiteralMethodSnippet/";
155216
155214
  CompletionSource2["SwitchCases"] = "SwitchCases/";
155215
+ CompletionSource2["ObjectLiteralMemberWithComma"] = "ObjectLiteralMemberWithComma/";
155217
155216
  return CompletionSource2;
155218
155217
  })(CompletionSource || {});
155219
155218
  var SymbolOriginInfoKind = /* @__PURE__ */ ((SymbolOriginInfoKind2) => {
@@ -156092,6 +156091,7 @@ function createCompletionEntryForLiteral(sourceFile, preferences, literal) {
156092
156091
  return { name: completionNameForLiteral(sourceFile, preferences, literal), kind: "string" /* string */, kindModifiers: "" /* none */, sortText: SortText.LocationPriority };
156093
156092
  }
156094
156093
  function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, position, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag, includeSymbol) {
156094
+ var _a, _b, _c;
156095
156095
  let insertText;
156096
156096
  let filterText;
156097
156097
  let replacementSpan = getReplacementSpanForContextToken(replacementToken);
@@ -156150,6 +156150,10 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken,
156150
156150
  if ((origin == null ? void 0 : origin.kind) === 64 /* TypeOnlyAlias */) {
156151
156151
  hasAction = true;
156152
156152
  }
156153
+ if (completionKind === 0 /* ObjectPropertyDeclaration */ && contextToken && ((_a = findPrecedingToken(contextToken.pos, sourceFile, contextToken)) == null ? void 0 : _a.kind) !== 28 /* CommaToken */ && ((_b = findNextToken(contextToken, contextToken.parent, sourceFile)) == null ? void 0 : _b.kind) !== 28 /* CommaToken */ && (((_c = findAncestor(contextToken.parent, (node) => isPropertyAssignment(node))) == null ? void 0 : _c.getLastToken()) === contextToken || isMethodDeclaration(contextToken.parent.parent))) {
156154
+ source = "ObjectLiteralMemberWithComma/" /* ObjectLiteralMemberWithComma */;
156155
+ hasAction = true;
156156
+ }
156153
156157
  if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === 3 /* MemberLike */ && isClassLikeMemberCompletion(symbol, location, sourceFile)) {
156154
156158
  let importAdder;
156155
156159
  const memberCompletionEntry = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext);
@@ -156880,7 +156884,7 @@ function getSymbolCompletionFromEntryId(program, log, sourceFile, position, entr
156880
156884
  return firstDefined(symbols, (symbol, index) => {
156881
156885
  const origin = symbolToOriginInfoMap[index];
156882
156886
  const info = getCompletionEntryDisplayNameForSymbol(symbol, getEmitScriptTarget(compilerOptions), origin, completionKind, completionData.isJsxIdentifierExpected);
156883
- return info && info.name === entryId.name && (entryId.source === "ClassMemberSnippet/" /* ClassMemberSnippet */ && symbol.flags & 106500 /* ClassMember */ || entryId.source === "ObjectLiteralMethodSnippet/" /* ObjectLiteralMethodSnippet */ && symbol.flags & (4 /* Property */ | 8192 /* Method */) || getSourceFromOrigin(origin) === entryId.source) ? { type: "symbol", symbol, location, origin, contextToken, previousToken, isJsxInitializer, isTypeOnlyLocation } : void 0;
156887
+ return info && info.name === entryId.name && (entryId.source === "ClassMemberSnippet/" /* ClassMemberSnippet */ && symbol.flags & 106500 /* ClassMember */ || entryId.source === "ObjectLiteralMethodSnippet/" /* ObjectLiteralMethodSnippet */ && symbol.flags & (4 /* Property */ | 8192 /* Method */) || getSourceFromOrigin(origin) === entryId.source || entryId.source === "ObjectLiteralMemberWithComma/" /* ObjectLiteralMemberWithComma */) ? { type: "symbol", symbol, location, origin, contextToken, previousToken, isJsxInitializer, isTypeOnlyLocation } : void 0;
156884
156888
  }) || { type: "none" };
156885
156889
  }
156886
156890
  function getCompletionEntryDetails(program, log, sourceFile, position, entryId, host, formatContext, preferences, cancellationToken) {
@@ -157025,6 +157029,21 @@ function getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextTo
157025
157029
  Debug.assertIsDefined(codeAction2, "Expected to have a code action for promoting type-only alias");
157026
157030
  return { codeActions: [codeAction2], sourceDisplay: void 0 };
157027
157031
  }
157032
+ if (source === "ObjectLiteralMemberWithComma/" /* ObjectLiteralMemberWithComma */ && contextToken) {
157033
+ const changes = ts_textChanges_exports.ChangeTracker.with(
157034
+ { host, formatContext, preferences },
157035
+ (tracker) => tracker.insertText(sourceFile, contextToken.end, ",")
157036
+ );
157037
+ if (changes) {
157038
+ return {
157039
+ sourceDisplay: void 0,
157040
+ codeActions: [{
157041
+ changes,
157042
+ description: diagnosticToString([Diagnostics.Add_missing_comma_for_an_object_member_completion_0, name])
157043
+ }]
157044
+ };
157045
+ }
157046
+ }
157028
157047
  if (!origin || !(originIsExport(origin) || originIsResolvedExport(origin))) {
157029
157048
  return { codeActions: void 0, sourceDisplay: void 0 };
157030
157049
  }
@@ -158427,12 +158446,22 @@ function tryGetObjectLikeCompletionContainer(contextToken) {
158427
158446
  return parent2;
158428
158447
  }
158429
158448
  break;
158449
+ case 20 /* CloseBraceToken */:
158450
+ if (parent2.parent && parent2.parent.parent && isMethodDeclaration(parent2.parent) && isObjectLiteralExpression(parent2.parent.parent)) {
158451
+ return parent2.parent.parent;
158452
+ }
158453
+ break;
158430
158454
  case 42 /* AsteriskToken */:
158431
158455
  return isMethodDeclaration(parent2) ? tryCast(parent2.parent, isObjectLiteralExpression) : void 0;
158432
158456
  case 134 /* AsyncKeyword */:
158433
158457
  return tryCast(parent2.parent, isObjectLiteralExpression);
158434
158458
  case 80 /* Identifier */:
158435
158459
  return contextToken.text === "async" && isShorthandPropertyAssignment(contextToken.parent) ? contextToken.parent.parent : void 0;
158460
+ default:
158461
+ const ancestorNode = findAncestor(parent2, (node) => isPropertyAssignment(node));
158462
+ if (contextToken.kind !== 59 /* ColonToken */ && ancestorNode && ancestorNode.getLastToken() === contextToken && isObjectLiteralExpression(ancestorNode.parent)) {
158463
+ return ancestorNode.parent;
158464
+ }
158436
158465
  }
158437
158466
  }
158438
158467
  return void 0;
@@ -5451,7 +5451,6 @@ declare namespace ts {
5451
5451
  type JsxAttributeValue = StringLiteral | JsxExpression | JsxElement | JsxSelfClosingElement | JsxFragment;
5452
5452
  interface JsxSpreadAttribute extends ObjectLiteralElement {
5453
5453
  readonly kind: SyntaxKind.JsxSpreadAttribute;
5454
- readonly name: PropertyName;
5455
5454
  readonly parent: JsxAttributes;
5456
5455
  readonly expression: Expression;
5457
5456
  }
@@ -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.20230620`;
38
+ version = `${versionMajorMinor}.0-insiders.20230621`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -9035,6 +9035,7 @@ ${lanes.join("\n")}
9035
9035
  Inline_variable: diag(95184, 3 /* Message */, "Inline_variable_95184", "Inline variable"),
9036
9036
  Could_not_find_variable_to_inline: diag(95185, 3 /* Message */, "Could_not_find_variable_to_inline_95185", "Could not find variable to inline."),
9037
9037
  Variables_with_multiple_declarations_cannot_be_inlined: diag(95186, 3 /* Message */, "Variables_with_multiple_declarations_cannot_be_inlined_95186", "Variables with multiple declarations cannot be inlined."),
9038
+ Add_missing_comma_for_an_object_member_completion_0: diag(95187, 3 /* Message */, "Add_missing_comma_for_an_object_member_completion_0_95187", "Add missing comma for an object member completion '{0}'."),
9038
9039
  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."),
9039
9040
  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'."),
9040
9041
  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?"),
@@ -31305,7 +31306,7 @@ ${lanes.join("\n")}
31305
31306
  }
31306
31307
  const pos = getNodePos();
31307
31308
  const type = parseUnionTypeOrHigher();
31308
- if (!inDisallowConditionalTypesContext() && tryParse(parseConditionalTypeExtends)) {
31309
+ if (!inDisallowConditionalTypesContext() && !scanner2.hasPrecedingLineBreak() && parseOptional(96 /* ExtendsKeyword */)) {
31309
31310
  const extendsType = disallowConditionalTypesAnd(parseType);
31310
31311
  parseExpected(58 /* QuestionToken */);
31311
31312
  const trueType = allowConditionalTypesAnd(parseType);
@@ -31315,9 +31316,6 @@ ${lanes.join("\n")}
31315
31316
  }
31316
31317
  return type;
31317
31318
  }
31318
- function parseConditionalTypeExtends() {
31319
- return parseOptional(96 /* ExtendsKeyword */) && !(parseOptional(58 /* QuestionToken */) || parseOptional(59 /* ColonToken */));
31320
- }
31321
31319
  function parseTypeAnnotation() {
31322
31320
  return parseOptional(59 /* ColonToken */) ? parseType() : void 0;
31323
31321
  }
@@ -45612,14 +45610,19 @@ ${lanes.join("\n")}
45612
45610
  typeHasCallOrConstructSignatures
45613
45611
  };
45614
45612
  function runWithoutResolvedSignatureCaching(node, fn) {
45615
- const containingCall = findAncestor(node, isCallLikeExpression);
45616
- const containingCallResolvedSignature = containingCall && getNodeLinks(containingCall).resolvedSignature;
45617
- if (containingCall) {
45618
- getNodeLinks(containingCall).resolvedSignature = void 0;
45613
+ const cachedSignatures = [];
45614
+ while (node) {
45615
+ if (isCallLikeExpression(node)) {
45616
+ const nodeLinks2 = getNodeLinks(node);
45617
+ const resolvedSignature = nodeLinks2.resolvedSignature;
45618
+ cachedSignatures.push([nodeLinks2, resolvedSignature]);
45619
+ nodeLinks2.resolvedSignature = void 0;
45620
+ }
45621
+ node = node.parent;
45619
45622
  }
45620
45623
  const result = fn();
45621
- if (containingCall) {
45622
- getNodeLinks(containingCall).resolvedSignature = containingCallResolvedSignature;
45624
+ for (const [nodeLinks2, resolvedSignature] of cachedSignatures) {
45625
+ nodeLinks2.resolvedSignature = resolvedSignature;
45623
45626
  }
45624
45627
  return result;
45625
45628
  }
@@ -53239,15 +53242,20 @@ ${lanes.join("\n")}
53239
53242
  const prop = getPropertyOfType(type, name);
53240
53243
  return prop ? getTypeOfSymbol(prop) : void 0;
53241
53244
  }
53242
- function getTypeOfPropertyOrIndexSignature(type, name, addOptionalityToIndex) {
53245
+ function getTypeOfPropertyOrIndexSignature(type, name) {
53246
+ var _a;
53247
+ return getTypeOfPropertyOfType(type, name) || ((_a = getApplicableIndexInfoForName(type, name)) == null ? void 0 : _a.type) || unknownType;
53248
+ }
53249
+ function getTypeOfPropertyOrIndexSignatureOfType(type, name) {
53243
53250
  var _a;
53244
53251
  let propType;
53245
53252
  return getTypeOfPropertyOfType(type, name) || (propType = (_a = getApplicableIndexInfoForName(type, name)) == null ? void 0 : _a.type) && addOptionality(
53246
53253
  propType,
53247
53254
  /*isProperty*/
53248
53255
  true,
53249
- addOptionalityToIndex
53250
- ) || unknownType;
53256
+ /*isOptional*/
53257
+ true
53258
+ );
53251
53259
  }
53252
53260
  function isTypeAny(type) {
53253
53261
  return type && (type.flags & 1 /* Any */) !== 0;
@@ -64249,12 +64257,7 @@ ${lanes.join("\n")}
64249
64257
  let matched = false;
64250
64258
  for (let i = 0; i < types.length; i++) {
64251
64259
  if (include[i]) {
64252
- const targetType = getTypeOfPropertyOrIndexSignature(
64253
- types[i],
64254
- propertyName,
64255
- /*addOptionalityToIndex*/
64256
- true
64257
- );
64260
+ const targetType = getTypeOfPropertyOrIndexSignatureOfType(types[i], propertyName);
64258
64261
  if (targetType && related(getDiscriminatingType(), targetType)) {
64259
64262
  matched = true;
64260
64263
  } else {
@@ -67652,12 +67655,7 @@ ${lanes.join("\n")}
67652
67655
  propType = removeNullable && optionalChain ? getOptionalType(propType) : propType;
67653
67656
  const narrowedPropType = narrowType2(propType);
67654
67657
  return filterType(type, (t) => {
67655
- const discriminantType = getTypeOfPropertyOrIndexSignature(
67656
- t,
67657
- propName,
67658
- /*addOptionalityToIndex*/
67659
- false
67660
- );
67658
+ const discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
67661
67659
  return !(discriminantType.flags & 131072 /* Never */) && !(narrowedPropType.flags & 131072 /* Never */) && areTypesComparable(narrowedPropType, discriminantType);
67662
67660
  });
67663
67661
  }
@@ -155332,6 +155330,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
155332
155330
  return { name: completionNameForLiteral(sourceFile, preferences, literal), kind: "string" /* string */, kindModifiers: "" /* none */, sortText: SortText.LocationPriority };
155333
155331
  }
155334
155332
  function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, position, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag, includeSymbol) {
155333
+ var _a, _b, _c;
155335
155334
  let insertText;
155336
155335
  let filterText;
155337
155336
  let replacementSpan = getReplacementSpanForContextToken(replacementToken);
@@ -155390,6 +155389,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
155390
155389
  if ((origin == null ? void 0 : origin.kind) === 64 /* TypeOnlyAlias */) {
155391
155390
  hasAction = true;
155392
155391
  }
155392
+ if (completionKind === 0 /* ObjectPropertyDeclaration */ && contextToken && ((_a = findPrecedingToken(contextToken.pos, sourceFile, contextToken)) == null ? void 0 : _a.kind) !== 28 /* CommaToken */ && ((_b = findNextToken(contextToken, contextToken.parent, sourceFile)) == null ? void 0 : _b.kind) !== 28 /* CommaToken */ && (((_c = findAncestor(contextToken.parent, (node) => isPropertyAssignment(node))) == null ? void 0 : _c.getLastToken()) === contextToken || isMethodDeclaration(contextToken.parent.parent))) {
155393
+ source = "ObjectLiteralMemberWithComma/" /* ObjectLiteralMemberWithComma */;
155394
+ hasAction = true;
155395
+ }
155393
155396
  if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === 3 /* MemberLike */ && isClassLikeMemberCompletion(symbol, location, sourceFile)) {
155394
155397
  let importAdder;
155395
155398
  const memberCompletionEntry = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext);
@@ -156120,7 +156123,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
156120
156123
  return firstDefined(symbols, (symbol, index) => {
156121
156124
  const origin = symbolToOriginInfoMap[index];
156122
156125
  const info = getCompletionEntryDisplayNameForSymbol(symbol, getEmitScriptTarget(compilerOptions), origin, completionKind, completionData.isJsxIdentifierExpected);
156123
- return info && info.name === entryId.name && (entryId.source === "ClassMemberSnippet/" /* ClassMemberSnippet */ && symbol.flags & 106500 /* ClassMember */ || entryId.source === "ObjectLiteralMethodSnippet/" /* ObjectLiteralMethodSnippet */ && symbol.flags & (4 /* Property */ | 8192 /* Method */) || getSourceFromOrigin(origin) === entryId.source) ? { type: "symbol", symbol, location, origin, contextToken, previousToken, isJsxInitializer, isTypeOnlyLocation } : void 0;
156126
+ return info && info.name === entryId.name && (entryId.source === "ClassMemberSnippet/" /* ClassMemberSnippet */ && symbol.flags & 106500 /* ClassMember */ || entryId.source === "ObjectLiteralMethodSnippet/" /* ObjectLiteralMethodSnippet */ && symbol.flags & (4 /* Property */ | 8192 /* Method */) || getSourceFromOrigin(origin) === entryId.source || entryId.source === "ObjectLiteralMemberWithComma/" /* ObjectLiteralMemberWithComma */) ? { type: "symbol", symbol, location, origin, contextToken, previousToken, isJsxInitializer, isTypeOnlyLocation } : void 0;
156124
156127
  }) || { type: "none" };
156125
156128
  }
156126
156129
  function getCompletionEntryDetails(program, log, sourceFile, position, entryId, host, formatContext, preferences, cancellationToken) {
@@ -156265,6 +156268,21 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
156265
156268
  Debug.assertIsDefined(codeAction2, "Expected to have a code action for promoting type-only alias");
156266
156269
  return { codeActions: [codeAction2], sourceDisplay: void 0 };
156267
156270
  }
156271
+ if (source === "ObjectLiteralMemberWithComma/" /* ObjectLiteralMemberWithComma */ && contextToken) {
156272
+ const changes = ts_textChanges_exports.ChangeTracker.with(
156273
+ { host, formatContext, preferences },
156274
+ (tracker) => tracker.insertText(sourceFile, contextToken.end, ",")
156275
+ );
156276
+ if (changes) {
156277
+ return {
156278
+ sourceDisplay: void 0,
156279
+ codeActions: [{
156280
+ changes,
156281
+ description: diagnosticToString([Diagnostics.Add_missing_comma_for_an_object_member_completion_0, name])
156282
+ }]
156283
+ };
156284
+ }
156285
+ }
156268
156286
  if (!origin || !(originIsExport(origin) || originIsResolvedExport(origin))) {
156269
156287
  return { codeActions: void 0, sourceDisplay: void 0 };
156270
156288
  }
@@ -157658,12 +157676,22 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
157658
157676
  return parent2;
157659
157677
  }
157660
157678
  break;
157679
+ case 20 /* CloseBraceToken */:
157680
+ if (parent2.parent && parent2.parent.parent && isMethodDeclaration(parent2.parent) && isObjectLiteralExpression(parent2.parent.parent)) {
157681
+ return parent2.parent.parent;
157682
+ }
157683
+ break;
157661
157684
  case 42 /* AsteriskToken */:
157662
157685
  return isMethodDeclaration(parent2) ? tryCast(parent2.parent, isObjectLiteralExpression) : void 0;
157663
157686
  case 134 /* AsyncKeyword */:
157664
157687
  return tryCast(parent2.parent, isObjectLiteralExpression);
157665
157688
  case 80 /* Identifier */:
157666
157689
  return contextToken.text === "async" && isShorthandPropertyAssignment(contextToken.parent) ? contextToken.parent.parent : void 0;
157690
+ default:
157691
+ const ancestorNode = findAncestor(parent2, (node) => isPropertyAssignment(node));
157692
+ if (contextToken.kind !== 59 /* ColonToken */ && ancestorNode && ancestorNode.getLastToken() === contextToken && isObjectLiteralExpression(ancestorNode.parent)) {
157693
+ return ancestorNode.parent;
157694
+ }
157667
157695
  }
157668
157696
  }
157669
157697
  return void 0;
@@ -158205,6 +158233,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
158205
158233
  CompletionSource2["TypeOnlyAlias"] = "TypeOnlyAlias/";
158206
158234
  CompletionSource2["ObjectLiteralMethodSnippet"] = "ObjectLiteralMethodSnippet/";
158207
158235
  CompletionSource2["SwitchCases"] = "SwitchCases/";
158236
+ CompletionSource2["ObjectLiteralMemberWithComma"] = "ObjectLiteralMemberWithComma/";
158208
158237
  return CompletionSource2;
158209
158238
  })(CompletionSource || {});
158210
158239
  SymbolOriginInfoKind = /* @__PURE__ */ ((SymbolOriginInfoKind2) => {
@@ -1398,7 +1398,6 @@ declare namespace ts {
1398
1398
  type JsxAttributeValue = StringLiteral | JsxExpression | JsxElement | JsxSelfClosingElement | JsxFragment;
1399
1399
  interface JsxSpreadAttribute extends ObjectLiteralElement {
1400
1400
  readonly kind: SyntaxKind.JsxSpreadAttribute;
1401
- readonly name: PropertyName;
1402
1401
  readonly parent: JsxAttributes;
1403
1402
  readonly expression: Expression;
1404
1403
  }
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.20230620`;
38
+ version = `${versionMajorMinor}.0-insiders.20230621`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -9035,6 +9035,7 @@ ${lanes.join("\n")}
9035
9035
  Inline_variable: diag(95184, 3 /* Message */, "Inline_variable_95184", "Inline variable"),
9036
9036
  Could_not_find_variable_to_inline: diag(95185, 3 /* Message */, "Could_not_find_variable_to_inline_95185", "Could not find variable to inline."),
9037
9037
  Variables_with_multiple_declarations_cannot_be_inlined: diag(95186, 3 /* Message */, "Variables_with_multiple_declarations_cannot_be_inlined_95186", "Variables with multiple declarations cannot be inlined."),
9038
+ Add_missing_comma_for_an_object_member_completion_0: diag(95187, 3 /* Message */, "Add_missing_comma_for_an_object_member_completion_0_95187", "Add missing comma for an object member completion '{0}'."),
9038
9039
  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."),
9039
9040
  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'."),
9040
9041
  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?"),
@@ -31305,7 +31306,7 @@ ${lanes.join("\n")}
31305
31306
  }
31306
31307
  const pos = getNodePos();
31307
31308
  const type = parseUnionTypeOrHigher();
31308
- if (!inDisallowConditionalTypesContext() && tryParse(parseConditionalTypeExtends)) {
31309
+ if (!inDisallowConditionalTypesContext() && !scanner2.hasPrecedingLineBreak() && parseOptional(96 /* ExtendsKeyword */)) {
31309
31310
  const extendsType = disallowConditionalTypesAnd(parseType);
31310
31311
  parseExpected(58 /* QuestionToken */);
31311
31312
  const trueType = allowConditionalTypesAnd(parseType);
@@ -31315,9 +31316,6 @@ ${lanes.join("\n")}
31315
31316
  }
31316
31317
  return type;
31317
31318
  }
31318
- function parseConditionalTypeExtends() {
31319
- return parseOptional(96 /* ExtendsKeyword */) && !(parseOptional(58 /* QuestionToken */) || parseOptional(59 /* ColonToken */));
31320
- }
31321
31319
  function parseTypeAnnotation() {
31322
31320
  return parseOptional(59 /* ColonToken */) ? parseType() : void 0;
31323
31321
  }
@@ -45612,14 +45610,19 @@ ${lanes.join("\n")}
45612
45610
  typeHasCallOrConstructSignatures
45613
45611
  };
45614
45612
  function runWithoutResolvedSignatureCaching(node, fn) {
45615
- const containingCall = findAncestor(node, isCallLikeExpression);
45616
- const containingCallResolvedSignature = containingCall && getNodeLinks(containingCall).resolvedSignature;
45617
- if (containingCall) {
45618
- getNodeLinks(containingCall).resolvedSignature = void 0;
45613
+ const cachedSignatures = [];
45614
+ while (node) {
45615
+ if (isCallLikeExpression(node)) {
45616
+ const nodeLinks2 = getNodeLinks(node);
45617
+ const resolvedSignature = nodeLinks2.resolvedSignature;
45618
+ cachedSignatures.push([nodeLinks2, resolvedSignature]);
45619
+ nodeLinks2.resolvedSignature = void 0;
45620
+ }
45621
+ node = node.parent;
45619
45622
  }
45620
45623
  const result = fn();
45621
- if (containingCall) {
45622
- getNodeLinks(containingCall).resolvedSignature = containingCallResolvedSignature;
45624
+ for (const [nodeLinks2, resolvedSignature] of cachedSignatures) {
45625
+ nodeLinks2.resolvedSignature = resolvedSignature;
45623
45626
  }
45624
45627
  return result;
45625
45628
  }
@@ -53239,15 +53242,20 @@ ${lanes.join("\n")}
53239
53242
  const prop = getPropertyOfType(type, name);
53240
53243
  return prop ? getTypeOfSymbol(prop) : void 0;
53241
53244
  }
53242
- function getTypeOfPropertyOrIndexSignature(type, name, addOptionalityToIndex) {
53245
+ function getTypeOfPropertyOrIndexSignature(type, name) {
53246
+ var _a;
53247
+ return getTypeOfPropertyOfType(type, name) || ((_a = getApplicableIndexInfoForName(type, name)) == null ? void 0 : _a.type) || unknownType;
53248
+ }
53249
+ function getTypeOfPropertyOrIndexSignatureOfType(type, name) {
53243
53250
  var _a;
53244
53251
  let propType;
53245
53252
  return getTypeOfPropertyOfType(type, name) || (propType = (_a = getApplicableIndexInfoForName(type, name)) == null ? void 0 : _a.type) && addOptionality(
53246
53253
  propType,
53247
53254
  /*isProperty*/
53248
53255
  true,
53249
- addOptionalityToIndex
53250
- ) || unknownType;
53256
+ /*isOptional*/
53257
+ true
53258
+ );
53251
53259
  }
53252
53260
  function isTypeAny(type) {
53253
53261
  return type && (type.flags & 1 /* Any */) !== 0;
@@ -64249,12 +64257,7 @@ ${lanes.join("\n")}
64249
64257
  let matched = false;
64250
64258
  for (let i = 0; i < types.length; i++) {
64251
64259
  if (include[i]) {
64252
- const targetType = getTypeOfPropertyOrIndexSignature(
64253
- types[i],
64254
- propertyName,
64255
- /*addOptionalityToIndex*/
64256
- true
64257
- );
64260
+ const targetType = getTypeOfPropertyOrIndexSignatureOfType(types[i], propertyName);
64258
64261
  if (targetType && related(getDiscriminatingType(), targetType)) {
64259
64262
  matched = true;
64260
64263
  } else {
@@ -67652,12 +67655,7 @@ ${lanes.join("\n")}
67652
67655
  propType = removeNullable && optionalChain ? getOptionalType(propType) : propType;
67653
67656
  const narrowedPropType = narrowType2(propType);
67654
67657
  return filterType(type, (t) => {
67655
- const discriminantType = getTypeOfPropertyOrIndexSignature(
67656
- t,
67657
- propName,
67658
- /*addOptionalityToIndex*/
67659
- false
67660
- );
67658
+ const discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
67661
67659
  return !(discriminantType.flags & 131072 /* Never */) && !(narrowedPropType.flags & 131072 /* Never */) && areTypesComparable(narrowedPropType, discriminantType);
67662
67660
  });
67663
67661
  }
@@ -155347,6 +155345,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
155347
155345
  return { name: completionNameForLiteral(sourceFile, preferences, literal), kind: "string" /* string */, kindModifiers: "" /* none */, sortText: SortText.LocationPriority };
155348
155346
  }
155349
155347
  function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, position, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag, includeSymbol) {
155348
+ var _a, _b, _c;
155350
155349
  let insertText;
155351
155350
  let filterText;
155352
155351
  let replacementSpan = getReplacementSpanForContextToken(replacementToken);
@@ -155405,6 +155404,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
155405
155404
  if ((origin == null ? void 0 : origin.kind) === 64 /* TypeOnlyAlias */) {
155406
155405
  hasAction = true;
155407
155406
  }
155407
+ if (completionKind === 0 /* ObjectPropertyDeclaration */ && contextToken && ((_a = findPrecedingToken(contextToken.pos, sourceFile, contextToken)) == null ? void 0 : _a.kind) !== 28 /* CommaToken */ && ((_b = findNextToken(contextToken, contextToken.parent, sourceFile)) == null ? void 0 : _b.kind) !== 28 /* CommaToken */ && (((_c = findAncestor(contextToken.parent, (node) => isPropertyAssignment(node))) == null ? void 0 : _c.getLastToken()) === contextToken || isMethodDeclaration(contextToken.parent.parent))) {
155408
+ source = "ObjectLiteralMemberWithComma/" /* ObjectLiteralMemberWithComma */;
155409
+ hasAction = true;
155410
+ }
155408
155411
  if (preferences.includeCompletionsWithClassMemberSnippets && preferences.includeCompletionsWithInsertText && completionKind === 3 /* MemberLike */ && isClassLikeMemberCompletion(symbol, location, sourceFile)) {
155409
155412
  let importAdder;
155410
155413
  const memberCompletionEntry = getEntryForMemberCompletion(host, program, options, preferences, name, symbol, location, position, contextToken, formatContext);
@@ -156135,7 +156138,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
156135
156138
  return firstDefined(symbols, (symbol, index) => {
156136
156139
  const origin = symbolToOriginInfoMap[index];
156137
156140
  const info = getCompletionEntryDisplayNameForSymbol(symbol, getEmitScriptTarget(compilerOptions), origin, completionKind, completionData.isJsxIdentifierExpected);
156138
- return info && info.name === entryId.name && (entryId.source === "ClassMemberSnippet/" /* ClassMemberSnippet */ && symbol.flags & 106500 /* ClassMember */ || entryId.source === "ObjectLiteralMethodSnippet/" /* ObjectLiteralMethodSnippet */ && symbol.flags & (4 /* Property */ | 8192 /* Method */) || getSourceFromOrigin(origin) === entryId.source) ? { type: "symbol", symbol, location, origin, contextToken, previousToken, isJsxInitializer, isTypeOnlyLocation } : void 0;
156141
+ return info && info.name === entryId.name && (entryId.source === "ClassMemberSnippet/" /* ClassMemberSnippet */ && symbol.flags & 106500 /* ClassMember */ || entryId.source === "ObjectLiteralMethodSnippet/" /* ObjectLiteralMethodSnippet */ && symbol.flags & (4 /* Property */ | 8192 /* Method */) || getSourceFromOrigin(origin) === entryId.source || entryId.source === "ObjectLiteralMemberWithComma/" /* ObjectLiteralMemberWithComma */) ? { type: "symbol", symbol, location, origin, contextToken, previousToken, isJsxInitializer, isTypeOnlyLocation } : void 0;
156139
156142
  }) || { type: "none" };
156140
156143
  }
156141
156144
  function getCompletionEntryDetails(program, log, sourceFile, position, entryId, host, formatContext, preferences, cancellationToken) {
@@ -156280,6 +156283,21 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
156280
156283
  Debug.assertIsDefined(codeAction2, "Expected to have a code action for promoting type-only alias");
156281
156284
  return { codeActions: [codeAction2], sourceDisplay: void 0 };
156282
156285
  }
156286
+ if (source === "ObjectLiteralMemberWithComma/" /* ObjectLiteralMemberWithComma */ && contextToken) {
156287
+ const changes = ts_textChanges_exports.ChangeTracker.with(
156288
+ { host, formatContext, preferences },
156289
+ (tracker) => tracker.insertText(sourceFile, contextToken.end, ",")
156290
+ );
156291
+ if (changes) {
156292
+ return {
156293
+ sourceDisplay: void 0,
156294
+ codeActions: [{
156295
+ changes,
156296
+ description: diagnosticToString([Diagnostics.Add_missing_comma_for_an_object_member_completion_0, name])
156297
+ }]
156298
+ };
156299
+ }
156300
+ }
156283
156301
  if (!origin || !(originIsExport(origin) || originIsResolvedExport(origin))) {
156284
156302
  return { codeActions: void 0, sourceDisplay: void 0 };
156285
156303
  }
@@ -157673,12 +157691,22 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
157673
157691
  return parent2;
157674
157692
  }
157675
157693
  break;
157694
+ case 20 /* CloseBraceToken */:
157695
+ if (parent2.parent && parent2.parent.parent && isMethodDeclaration(parent2.parent) && isObjectLiteralExpression(parent2.parent.parent)) {
157696
+ return parent2.parent.parent;
157697
+ }
157698
+ break;
157676
157699
  case 42 /* AsteriskToken */:
157677
157700
  return isMethodDeclaration(parent2) ? tryCast(parent2.parent, isObjectLiteralExpression) : void 0;
157678
157701
  case 134 /* AsyncKeyword */:
157679
157702
  return tryCast(parent2.parent, isObjectLiteralExpression);
157680
157703
  case 80 /* Identifier */:
157681
157704
  return contextToken.text === "async" && isShorthandPropertyAssignment(contextToken.parent) ? contextToken.parent.parent : void 0;
157705
+ default:
157706
+ const ancestorNode = findAncestor(parent2, (node) => isPropertyAssignment(node));
157707
+ if (contextToken.kind !== 59 /* ColonToken */ && ancestorNode && ancestorNode.getLastToken() === contextToken && isObjectLiteralExpression(ancestorNode.parent)) {
157708
+ return ancestorNode.parent;
157709
+ }
157682
157710
  }
157683
157711
  }
157684
157712
  return void 0;
@@ -158220,6 +158248,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
158220
158248
  CompletionSource2["TypeOnlyAlias"] = "TypeOnlyAlias/";
158221
158249
  CompletionSource2["ObjectLiteralMethodSnippet"] = "ObjectLiteralMethodSnippet/";
158222
158250
  CompletionSource2["SwitchCases"] = "SwitchCases/";
158251
+ CompletionSource2["ObjectLiteralMemberWithComma"] = "ObjectLiteralMemberWithComma/";
158223
158252
  return CompletionSource2;
158224
158253
  })(CompletionSource || {});
158225
158254
  SymbolOriginInfoKind = /* @__PURE__ */ ((SymbolOriginInfoKind2) => {
@@ -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.20230620`;
57
+ var version = `${versionMajorMinor}.0-insiders.20230621`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -7106,6 +7106,7 @@ var Diagnostics = {
7106
7106
  Inline_variable: diag(95184, 3 /* Message */, "Inline_variable_95184", "Inline variable"),
7107
7107
  Could_not_find_variable_to_inline: diag(95185, 3 /* Message */, "Could_not_find_variable_to_inline_95185", "Could not find variable to inline."),
7108
7108
  Variables_with_multiple_declarations_cannot_be_inlined: diag(95186, 3 /* Message */, "Variables_with_multiple_declarations_cannot_be_inlined_95186", "Variables with multiple declarations cannot be inlined."),
7109
+ Add_missing_comma_for_an_object_member_completion_0: diag(95187, 3 /* Message */, "Add_missing_comma_for_an_object_member_completion_0_95187", "Add missing comma for an object member completion '{0}'."),
7109
7110
  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."),
7110
7111
  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'."),
7111
7112
  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?"),
@@ -20844,7 +20845,7 @@ var Parser;
20844
20845
  }
20845
20846
  const pos = getNodePos();
20846
20847
  const type = parseUnionTypeOrHigher();
20847
- if (!inDisallowConditionalTypesContext() && tryParse(parseConditionalTypeExtends)) {
20848
+ if (!inDisallowConditionalTypesContext() && !scanner.hasPrecedingLineBreak() && parseOptional(96 /* ExtendsKeyword */)) {
20848
20849
  const extendsType = disallowConditionalTypesAnd(parseType);
20849
20850
  parseExpected(58 /* QuestionToken */);
20850
20851
  const trueType = allowConditionalTypesAnd(parseType);
@@ -20854,9 +20855,6 @@ var Parser;
20854
20855
  }
20855
20856
  return type;
20856
20857
  }
20857
- function parseConditionalTypeExtends() {
20858
- return parseOptional(96 /* ExtendsKeyword */) && !(parseOptional(58 /* QuestionToken */) || parseOptional(59 /* ColonToken */));
20859
- }
20860
20858
  function parseTypeAnnotation() {
20861
20859
  return parseOptional(59 /* ColonToken */) ? parseType() : void 0;
20862
20860
  }
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-54688-11",
5
+ "version": "5.2.0-pr-52899-13",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -115,5 +115,5 @@
115
115
  "node": "20.1.0",
116
116
  "npm": "8.19.4"
117
117
  },
118
- "gitHead": "93f6572f86164d3d5973c7956b7d43a8e57c4aef"
118
+ "gitHead": "125466225f3ce8d2ae30073da465e3094a93247f"
119
119
  }