@typescript-deploys/pr-build 5.3.0-pr-55991-37 → 5.3.0-pr-55991-50

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.3";
21
- var version = `${versionMajorMinor}.0-insiders.20231005`;
21
+ var version = `${versionMajorMinor}.0-insiders.20231006`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -48476,6 +48476,28 @@ function createTypeChecker(host) {
48476
48476
  const propertyName = getPropertyNameNodeForSymbol(propertySymbol, context);
48477
48477
  context.enclosingDeclaration = saveEnclosingDeclaration;
48478
48478
  context.approximateLength += symbolName(propertySymbol).length + 1;
48479
+ if (propertySymbol.flags & 98304 /* Accessor */) {
48480
+ const writeType = getWriteTypeOfSymbol(propertySymbol);
48481
+ if (propertyType !== writeType) {
48482
+ const getterDeclaration = getDeclarationOfKind(propertySymbol, 177 /* GetAccessor */);
48483
+ const getterSignature = getSignatureFromDeclaration(getterDeclaration);
48484
+ typeElements.push(
48485
+ setCommentRange(
48486
+ signatureToSignatureDeclarationHelper(getterSignature, 177 /* GetAccessor */, context, { name: propertyName }),
48487
+ getterDeclaration
48488
+ )
48489
+ );
48490
+ const setterDeclaration = getDeclarationOfKind(propertySymbol, 178 /* SetAccessor */);
48491
+ const setterSignature = getSignatureFromDeclaration(setterDeclaration);
48492
+ typeElements.push(
48493
+ setCommentRange(
48494
+ signatureToSignatureDeclarationHelper(setterSignature, 178 /* SetAccessor */, context, { name: propertyName }),
48495
+ setterDeclaration
48496
+ )
48497
+ );
48498
+ return;
48499
+ }
48500
+ }
48479
48501
  const optionalToken = propertySymbol.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0;
48480
48502
  if (propertySymbol.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(propertyType).length && !isReadonlySymbol(propertySymbol)) {
48481
48503
  const signatures = getSignaturesOfType(filterType(propertyType, (t) => !(t.flags & 32768 /* Undefined */)), 0 /* Call */);
@@ -48513,9 +48535,9 @@ function createTypeChecker(host) {
48513
48535
  typeElements.push(preserveCommentsOn(propertySignature));
48514
48536
  function preserveCommentsOn(node) {
48515
48537
  var _a2;
48516
- if (some(propertySymbol.declarations, (d) => d.kind === 355 /* JSDocPropertyTag */)) {
48517
- const d = (_a2 = propertySymbol.declarations) == null ? void 0 : _a2.find((d2) => d2.kind === 355 /* JSDocPropertyTag */);
48518
- const commentText = getTextOfJSDocComment(d.comment);
48538
+ const jsdocPropertyTag = (_a2 = propertySymbol.declarations) == null ? void 0 : _a2.find((d) => d.kind === 355 /* JSDocPropertyTag */);
48539
+ if (jsdocPropertyTag) {
48540
+ const commentText = getTextOfJSDocComment(jsdocPropertyTag.comment);
48519
48541
  if (commentText) {
48520
48542
  setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]);
48521
48543
  }
@@ -50822,7 +50844,15 @@ function createTypeChecker(host) {
50822
50844
  const ctxSrc = getSourceFileOfNode(context.enclosingDeclaration);
50823
50845
  return getObjectFlags(typeToSerialize) & (16 /* Anonymous */ | 32 /* Mapped */) && !length(getIndexInfosOfType(typeToSerialize)) && !isClassInstanceSide(typeToSerialize) && // While a class instance is potentially representable as a NS, prefer printing a reference to the instance type and serializing the class
50824
50846
  !!(length(filter(getPropertiesOfType(typeToSerialize), isNamespaceMember)) || length(getSignaturesOfType(typeToSerialize, 0 /* Call */))) && !length(getSignaturesOfType(typeToSerialize, 1 /* Construct */)) && // TODO: could probably serialize as function + ns + class, now that that's OK
50825
- !getDeclarationWithTypeAnnotation(hostSymbol, enclosingDeclaration) && !(typeToSerialize.symbol && some(typeToSerialize.symbol.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && !some(getPropertiesOfType(typeToSerialize), (p) => isLateBoundName(p.escapedName)) && !some(getPropertiesOfType(typeToSerialize), (p) => some(p.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && every(getPropertiesOfType(typeToSerialize), (p) => isIdentifierText(symbolName(p), languageVersion));
50847
+ !getDeclarationWithTypeAnnotation(hostSymbol, enclosingDeclaration) && !(typeToSerialize.symbol && some(typeToSerialize.symbol.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && !some(getPropertiesOfType(typeToSerialize), (p) => isLateBoundName(p.escapedName)) && !some(getPropertiesOfType(typeToSerialize), (p) => some(p.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && every(getPropertiesOfType(typeToSerialize), (p) => {
50848
+ if (!isIdentifierText(symbolName(p), languageVersion)) {
50849
+ return false;
50850
+ }
50851
+ if (!(p.flags & 98304 /* Accessor */)) {
50852
+ return true;
50853
+ }
50854
+ return getNonMissingTypeOfSymbol(p) === getWriteTypeOfSymbol(p);
50855
+ });
50826
50856
  }
50827
50857
  function makeSerializePropertySymbol(createProperty2, methodKind, useAccessors) {
50828
50858
  return function serializePropertySymbol(p, isStatic2, baseType) {
@@ -66257,20 +66287,35 @@ function createTypeChecker(host) {
66257
66287
  return getUnionType(map(clauseWitnesses, (text) => text ? narrowTypeByTypeName(type, text) : neverType));
66258
66288
  }
66259
66289
  function narrowTypeBySwitchOnTrue(type, switchStatement, clauseStart, clauseEnd) {
66260
- const clauses = switchStatement.caseBlock.clauses.slice(clauseStart, clauseEnd);
66261
- const clausesType = narrowTypeForTrueClauses(type, clauses);
66262
66290
  const defaultIndex = findIndex(switchStatement.caseBlock.clauses, (clause) => clause.kind === 297 /* DefaultClause */);
66263
66291
  const hasDefaultClause = clauseStart === clauseEnd || defaultIndex >= clauseStart && defaultIndex < clauseEnd;
66292
+ const clausesBefore = switchStatement.caseBlock.clauses.slice(0, clauseStart);
66293
+ for (const clause of clausesBefore) {
66294
+ if (clause.kind === 296 /* CaseClause */) {
66295
+ type = narrowType(
66296
+ type,
66297
+ clause.expression,
66298
+ /*assumeTrue*/
66299
+ false
66300
+ );
66301
+ }
66302
+ }
66264
66303
  if (hasDefaultClause) {
66265
- const clausesBefore = switchStatement.caseBlock.clauses.slice(0, clauseStart);
66266
66304
  const clausesAfter = switchStatement.caseBlock.clauses.slice(clauseEnd);
66267
- const before = narrowTypeForTrueClauses(type, clausesBefore);
66268
- const after = narrowTypeForTrueClauses(type, clausesAfter);
66269
- const other = getUnionType([before, after]);
66270
- const typeNotOther = filterType(type, (t) => !isTypeSubsetOf(t, other));
66271
- return getUnionType([clausesType, typeNotOther]);
66305
+ for (const clause of clausesAfter) {
66306
+ if (clause.kind === 296 /* CaseClause */) {
66307
+ type = narrowType(
66308
+ type,
66309
+ clause.expression,
66310
+ /*assumeTrue*/
66311
+ false
66312
+ );
66313
+ }
66314
+ }
66315
+ return type;
66272
66316
  }
66273
- return clausesType;
66317
+ const clauses = switchStatement.caseBlock.clauses.slice(clauseStart, clauseEnd);
66318
+ return narrowTypeForTrueClauses(type, clauses);
66274
66319
  }
66275
66320
  function narrowTypeForTrueClauses(type, clauses) {
66276
66321
  return getUnionType(map(clauses, (clause) => clause.kind === 296 /* CaseClause */ ? narrowType(
package/lib/tsserver.js CHANGED
@@ -2328,7 +2328,7 @@ module.exports = __toCommonJS(server_exports);
2328
2328
 
2329
2329
  // src/compiler/corePublic.ts
2330
2330
  var versionMajorMinor = "5.3";
2331
- var version = `${versionMajorMinor}.0-insiders.20231005`;
2331
+ var version = `${versionMajorMinor}.0-insiders.20231006`;
2332
2332
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2333
2333
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2334
2334
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -53188,6 +53188,28 @@ function createTypeChecker(host) {
53188
53188
  const propertyName = getPropertyNameNodeForSymbol(propertySymbol, context);
53189
53189
  context.enclosingDeclaration = saveEnclosingDeclaration;
53190
53190
  context.approximateLength += symbolName(propertySymbol).length + 1;
53191
+ if (propertySymbol.flags & 98304 /* Accessor */) {
53192
+ const writeType = getWriteTypeOfSymbol(propertySymbol);
53193
+ if (propertyType !== writeType) {
53194
+ const getterDeclaration = getDeclarationOfKind(propertySymbol, 177 /* GetAccessor */);
53195
+ const getterSignature = getSignatureFromDeclaration(getterDeclaration);
53196
+ typeElements.push(
53197
+ setCommentRange(
53198
+ signatureToSignatureDeclarationHelper(getterSignature, 177 /* GetAccessor */, context, { name: propertyName }),
53199
+ getterDeclaration
53200
+ )
53201
+ );
53202
+ const setterDeclaration = getDeclarationOfKind(propertySymbol, 178 /* SetAccessor */);
53203
+ const setterSignature = getSignatureFromDeclaration(setterDeclaration);
53204
+ typeElements.push(
53205
+ setCommentRange(
53206
+ signatureToSignatureDeclarationHelper(setterSignature, 178 /* SetAccessor */, context, { name: propertyName }),
53207
+ setterDeclaration
53208
+ )
53209
+ );
53210
+ return;
53211
+ }
53212
+ }
53191
53213
  const optionalToken = propertySymbol.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0;
53192
53214
  if (propertySymbol.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(propertyType).length && !isReadonlySymbol(propertySymbol)) {
53193
53215
  const signatures = getSignaturesOfType(filterType(propertyType, (t) => !(t.flags & 32768 /* Undefined */)), 0 /* Call */);
@@ -53225,9 +53247,9 @@ function createTypeChecker(host) {
53225
53247
  typeElements.push(preserveCommentsOn(propertySignature));
53226
53248
  function preserveCommentsOn(node) {
53227
53249
  var _a2;
53228
- if (some(propertySymbol.declarations, (d) => d.kind === 355 /* JSDocPropertyTag */)) {
53229
- const d = (_a2 = propertySymbol.declarations) == null ? void 0 : _a2.find((d2) => d2.kind === 355 /* JSDocPropertyTag */);
53230
- const commentText = getTextOfJSDocComment(d.comment);
53250
+ const jsdocPropertyTag = (_a2 = propertySymbol.declarations) == null ? void 0 : _a2.find((d) => d.kind === 355 /* JSDocPropertyTag */);
53251
+ if (jsdocPropertyTag) {
53252
+ const commentText = getTextOfJSDocComment(jsdocPropertyTag.comment);
53231
53253
  if (commentText) {
53232
53254
  setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]);
53233
53255
  }
@@ -55534,7 +55556,15 @@ function createTypeChecker(host) {
55534
55556
  const ctxSrc = getSourceFileOfNode(context.enclosingDeclaration);
55535
55557
  return getObjectFlags(typeToSerialize) & (16 /* Anonymous */ | 32 /* Mapped */) && !length(getIndexInfosOfType(typeToSerialize)) && !isClassInstanceSide(typeToSerialize) && // While a class instance is potentially representable as a NS, prefer printing a reference to the instance type and serializing the class
55536
55558
  !!(length(filter(getPropertiesOfType(typeToSerialize), isNamespaceMember)) || length(getSignaturesOfType(typeToSerialize, 0 /* Call */))) && !length(getSignaturesOfType(typeToSerialize, 1 /* Construct */)) && // TODO: could probably serialize as function + ns + class, now that that's OK
55537
- !getDeclarationWithTypeAnnotation(hostSymbol, enclosingDeclaration) && !(typeToSerialize.symbol && some(typeToSerialize.symbol.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && !some(getPropertiesOfType(typeToSerialize), (p) => isLateBoundName(p.escapedName)) && !some(getPropertiesOfType(typeToSerialize), (p) => some(p.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && every(getPropertiesOfType(typeToSerialize), (p) => isIdentifierText(symbolName(p), languageVersion));
55559
+ !getDeclarationWithTypeAnnotation(hostSymbol, enclosingDeclaration) && !(typeToSerialize.symbol && some(typeToSerialize.symbol.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && !some(getPropertiesOfType(typeToSerialize), (p) => isLateBoundName(p.escapedName)) && !some(getPropertiesOfType(typeToSerialize), (p) => some(p.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && every(getPropertiesOfType(typeToSerialize), (p) => {
55560
+ if (!isIdentifierText(symbolName(p), languageVersion)) {
55561
+ return false;
55562
+ }
55563
+ if (!(p.flags & 98304 /* Accessor */)) {
55564
+ return true;
55565
+ }
55566
+ return getNonMissingTypeOfSymbol(p) === getWriteTypeOfSymbol(p);
55567
+ });
55538
55568
  }
55539
55569
  function makeSerializePropertySymbol(createProperty2, methodKind, useAccessors) {
55540
55570
  return function serializePropertySymbol(p, isStatic2, baseType) {
@@ -70969,20 +70999,35 @@ function createTypeChecker(host) {
70969
70999
  return getUnionType(map(clauseWitnesses, (text) => text ? narrowTypeByTypeName(type, text) : neverType));
70970
71000
  }
70971
71001
  function narrowTypeBySwitchOnTrue(type, switchStatement, clauseStart, clauseEnd) {
70972
- const clauses = switchStatement.caseBlock.clauses.slice(clauseStart, clauseEnd);
70973
- const clausesType = narrowTypeForTrueClauses(type, clauses);
70974
71002
  const defaultIndex = findIndex(switchStatement.caseBlock.clauses, (clause) => clause.kind === 297 /* DefaultClause */);
70975
71003
  const hasDefaultClause = clauseStart === clauseEnd || defaultIndex >= clauseStart && defaultIndex < clauseEnd;
71004
+ const clausesBefore = switchStatement.caseBlock.clauses.slice(0, clauseStart);
71005
+ for (const clause of clausesBefore) {
71006
+ if (clause.kind === 296 /* CaseClause */) {
71007
+ type = narrowType(
71008
+ type,
71009
+ clause.expression,
71010
+ /*assumeTrue*/
71011
+ false
71012
+ );
71013
+ }
71014
+ }
70976
71015
  if (hasDefaultClause) {
70977
- const clausesBefore = switchStatement.caseBlock.clauses.slice(0, clauseStart);
70978
71016
  const clausesAfter = switchStatement.caseBlock.clauses.slice(clauseEnd);
70979
- const before = narrowTypeForTrueClauses(type, clausesBefore);
70980
- const after = narrowTypeForTrueClauses(type, clausesAfter);
70981
- const other = getUnionType([before, after]);
70982
- const typeNotOther = filterType(type, (t) => !isTypeSubsetOf(t, other));
70983
- return getUnionType([clausesType, typeNotOther]);
71017
+ for (const clause of clausesAfter) {
71018
+ if (clause.kind === 296 /* CaseClause */) {
71019
+ type = narrowType(
71020
+ type,
71021
+ clause.expression,
71022
+ /*assumeTrue*/
71023
+ false
71024
+ );
71025
+ }
71026
+ }
71027
+ return type;
70984
71028
  }
70985
- return clausesType;
71029
+ const clauses = switchStatement.caseBlock.clauses.slice(clauseStart, clauseEnd);
71030
+ return narrowTypeForTrueClauses(type, clauses);
70986
71031
  }
70987
71032
  function narrowTypeForTrueClauses(type, clauses) {
70988
71033
  return getUnionType(map(clauses, (clause) => clause.kind === 296 /* CaseClause */ ? narrowType(
@@ -157250,7 +157295,7 @@ function completionInfoFromData(sourceFile, host, program, compilerOptions, log,
157250
157295
  );
157251
157296
  if (keywordFilters !== 0 /* None */) {
157252
157297
  for (const keywordEntry of getKeywordCompletions(keywordFilters, !insideJsDocTagTypeExpression && isSourceFileJS(sourceFile))) {
157253
- if (isTypeOnlyLocation && isTypeKeyword(stringToToken(keywordEntry.name)) || !uniqueNames.has(keywordEntry.name)) {
157298
+ if (isTypeOnlyLocation && isTypeKeyword(stringToToken(keywordEntry.name)) || !isTypeOnlyLocation && isContextualKeywordInAutoImportableExpressionSpace(keywordEntry.name) || !uniqueNames.has(keywordEntry.name)) {
157254
157299
  uniqueNames.add(keywordEntry.name);
157255
157300
  insertSorted(
157256
157301
  entries,
@@ -160439,6 +160484,9 @@ function toUpperCharCode(charCode) {
160439
160484
  }
160440
160485
  return charCode;
160441
160486
  }
160487
+ function isContextualKeywordInAutoImportableExpressionSpace(keyword) {
160488
+ return keyword === "abstract" || keyword === "async" || keyword === "await" || keyword === "declare" || keyword === "module" || keyword === "namespace" || keyword === "type";
160489
+ }
160442
160490
 
160443
160491
  // src/services/_namespaces/ts.Completions.StringCompletions.ts
160444
160492
  var ts_Completions_StringCompletions_exports = {};
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.3";
38
- version = `${versionMajorMinor}.0-insiders.20231005`;
38
+ version = `${versionMajorMinor}.0-insiders.20231006`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -50955,6 +50955,28 @@ ${lanes.join("\n")}
50955
50955
  const propertyName = getPropertyNameNodeForSymbol(propertySymbol, context);
50956
50956
  context.enclosingDeclaration = saveEnclosingDeclaration;
50957
50957
  context.approximateLength += symbolName(propertySymbol).length + 1;
50958
+ if (propertySymbol.flags & 98304 /* Accessor */) {
50959
+ const writeType = getWriteTypeOfSymbol(propertySymbol);
50960
+ if (propertyType !== writeType) {
50961
+ const getterDeclaration = getDeclarationOfKind(propertySymbol, 177 /* GetAccessor */);
50962
+ const getterSignature = getSignatureFromDeclaration(getterDeclaration);
50963
+ typeElements.push(
50964
+ setCommentRange(
50965
+ signatureToSignatureDeclarationHelper(getterSignature, 177 /* GetAccessor */, context, { name: propertyName }),
50966
+ getterDeclaration
50967
+ )
50968
+ );
50969
+ const setterDeclaration = getDeclarationOfKind(propertySymbol, 178 /* SetAccessor */);
50970
+ const setterSignature = getSignatureFromDeclaration(setterDeclaration);
50971
+ typeElements.push(
50972
+ setCommentRange(
50973
+ signatureToSignatureDeclarationHelper(setterSignature, 178 /* SetAccessor */, context, { name: propertyName }),
50974
+ setterDeclaration
50975
+ )
50976
+ );
50977
+ return;
50978
+ }
50979
+ }
50958
50980
  const optionalToken = propertySymbol.flags & 16777216 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0;
50959
50981
  if (propertySymbol.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(propertyType).length && !isReadonlySymbol(propertySymbol)) {
50960
50982
  const signatures = getSignaturesOfType(filterType(propertyType, (t) => !(t.flags & 32768 /* Undefined */)), 0 /* Call */);
@@ -50992,9 +51014,9 @@ ${lanes.join("\n")}
50992
51014
  typeElements.push(preserveCommentsOn(propertySignature));
50993
51015
  function preserveCommentsOn(node) {
50994
51016
  var _a2;
50995
- if (some(propertySymbol.declarations, (d) => d.kind === 355 /* JSDocPropertyTag */)) {
50996
- const d = (_a2 = propertySymbol.declarations) == null ? void 0 : _a2.find((d2) => d2.kind === 355 /* JSDocPropertyTag */);
50997
- const commentText = getTextOfJSDocComment(d.comment);
51017
+ const jsdocPropertyTag = (_a2 = propertySymbol.declarations) == null ? void 0 : _a2.find((d) => d.kind === 355 /* JSDocPropertyTag */);
51018
+ if (jsdocPropertyTag) {
51019
+ const commentText = getTextOfJSDocComment(jsdocPropertyTag.comment);
50998
51020
  if (commentText) {
50999
51021
  setSyntheticLeadingComments(node, [{ kind: 3 /* MultiLineCommentTrivia */, text: "*\n * " + commentText.replace(/\n/g, "\n * ") + "\n ", pos: -1, end: -1, hasTrailingNewLine: true }]);
51000
51022
  }
@@ -53301,7 +53323,15 @@ ${lanes.join("\n")}
53301
53323
  const ctxSrc = getSourceFileOfNode(context.enclosingDeclaration);
53302
53324
  return getObjectFlags(typeToSerialize) & (16 /* Anonymous */ | 32 /* Mapped */) && !length(getIndexInfosOfType(typeToSerialize)) && !isClassInstanceSide(typeToSerialize) && // While a class instance is potentially representable as a NS, prefer printing a reference to the instance type and serializing the class
53303
53325
  !!(length(filter(getPropertiesOfType(typeToSerialize), isNamespaceMember)) || length(getSignaturesOfType(typeToSerialize, 0 /* Call */))) && !length(getSignaturesOfType(typeToSerialize, 1 /* Construct */)) && // TODO: could probably serialize as function + ns + class, now that that's OK
53304
- !getDeclarationWithTypeAnnotation(hostSymbol, enclosingDeclaration) && !(typeToSerialize.symbol && some(typeToSerialize.symbol.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && !some(getPropertiesOfType(typeToSerialize), (p) => isLateBoundName(p.escapedName)) && !some(getPropertiesOfType(typeToSerialize), (p) => some(p.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && every(getPropertiesOfType(typeToSerialize), (p) => isIdentifierText(symbolName(p), languageVersion));
53326
+ !getDeclarationWithTypeAnnotation(hostSymbol, enclosingDeclaration) && !(typeToSerialize.symbol && some(typeToSerialize.symbol.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && !some(getPropertiesOfType(typeToSerialize), (p) => isLateBoundName(p.escapedName)) && !some(getPropertiesOfType(typeToSerialize), (p) => some(p.declarations, (d) => getSourceFileOfNode(d) !== ctxSrc)) && every(getPropertiesOfType(typeToSerialize), (p) => {
53327
+ if (!isIdentifierText(symbolName(p), languageVersion)) {
53328
+ return false;
53329
+ }
53330
+ if (!(p.flags & 98304 /* Accessor */)) {
53331
+ return true;
53332
+ }
53333
+ return getNonMissingTypeOfSymbol(p) === getWriteTypeOfSymbol(p);
53334
+ });
53305
53335
  }
53306
53336
  function makeSerializePropertySymbol(createProperty2, methodKind, useAccessors) {
53307
53337
  return function serializePropertySymbol(p, isStatic2, baseType) {
@@ -68736,20 +68766,35 @@ ${lanes.join("\n")}
68736
68766
  return getUnionType(map(clauseWitnesses, (text) => text ? narrowTypeByTypeName(type, text) : neverType));
68737
68767
  }
68738
68768
  function narrowTypeBySwitchOnTrue(type, switchStatement, clauseStart, clauseEnd) {
68739
- const clauses = switchStatement.caseBlock.clauses.slice(clauseStart, clauseEnd);
68740
- const clausesType = narrowTypeForTrueClauses(type, clauses);
68741
68769
  const defaultIndex = findIndex(switchStatement.caseBlock.clauses, (clause) => clause.kind === 297 /* DefaultClause */);
68742
68770
  const hasDefaultClause = clauseStart === clauseEnd || defaultIndex >= clauseStart && defaultIndex < clauseEnd;
68771
+ const clausesBefore = switchStatement.caseBlock.clauses.slice(0, clauseStart);
68772
+ for (const clause of clausesBefore) {
68773
+ if (clause.kind === 296 /* CaseClause */) {
68774
+ type = narrowType(
68775
+ type,
68776
+ clause.expression,
68777
+ /*assumeTrue*/
68778
+ false
68779
+ );
68780
+ }
68781
+ }
68743
68782
  if (hasDefaultClause) {
68744
- const clausesBefore = switchStatement.caseBlock.clauses.slice(0, clauseStart);
68745
68783
  const clausesAfter = switchStatement.caseBlock.clauses.slice(clauseEnd);
68746
- const before = narrowTypeForTrueClauses(type, clausesBefore);
68747
- const after = narrowTypeForTrueClauses(type, clausesAfter);
68748
- const other = getUnionType([before, after]);
68749
- const typeNotOther = filterType(type, (t) => !isTypeSubsetOf(t, other));
68750
- return getUnionType([clausesType, typeNotOther]);
68784
+ for (const clause of clausesAfter) {
68785
+ if (clause.kind === 296 /* CaseClause */) {
68786
+ type = narrowType(
68787
+ type,
68788
+ clause.expression,
68789
+ /*assumeTrue*/
68790
+ false
68791
+ );
68792
+ }
68793
+ }
68794
+ return type;
68751
68795
  }
68752
- return clausesType;
68796
+ const clauses = switchStatement.caseBlock.clauses.slice(clauseStart, clauseEnd);
68797
+ return narrowTypeForTrueClauses(type, clauses);
68753
68798
  }
68754
68799
  function narrowTypeForTrueClauses(type, clauses) {
68755
68800
  return getUnionType(map(clauses, (clause) => clause.kind === 296 /* CaseClause */ ? narrowType(
@@ -156474,7 +156519,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
156474
156519
  );
156475
156520
  if (keywordFilters !== 0 /* None */) {
156476
156521
  for (const keywordEntry of getKeywordCompletions(keywordFilters, !insideJsDocTagTypeExpression && isSourceFileJS(sourceFile))) {
156477
- if (isTypeOnlyLocation && isTypeKeyword(stringToToken(keywordEntry.name)) || !uniqueNames.has(keywordEntry.name)) {
156522
+ if (isTypeOnlyLocation && isTypeKeyword(stringToToken(keywordEntry.name)) || !isTypeOnlyLocation && isContextualKeywordInAutoImportableExpressionSpace(keywordEntry.name) || !uniqueNames.has(keywordEntry.name)) {
156478
156523
  uniqueNames.add(keywordEntry.name);
156479
156524
  insertSorted(
156480
156525
  entries,
@@ -159641,6 +159686,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
159641
159686
  }
159642
159687
  return charCode;
159643
159688
  }
159689
+ function isContextualKeywordInAutoImportableExpressionSpace(keyword) {
159690
+ return keyword === "abstract" || keyword === "async" || keyword === "await" || keyword === "declare" || keyword === "module" || keyword === "namespace" || keyword === "type";
159691
+ }
159644
159692
  var moduleSpecifierResolutionLimit, moduleSpecifierResolutionCacheAttemptLimit, SortText, CompletionSource, SymbolOriginInfoKind, CompletionKind, _keywordCompletions, allKeywordsCompletions;
159645
159693
  var init_completions = __esm({
159646
159694
  "src/services/completions.ts"() {
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.3";
57
- var version = `${versionMajorMinor}.0-insiders.20231005`;
57
+ var version = `${versionMajorMinor}.0-insiders.20231006`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
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.3.0-pr-55991-37",
5
+ "version": "5.3.0-pr-55991-50",
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": "2c2be073b2b807b0d45edd413fb922128c517411"
117
+ "gitHead": "d46ee1f895d233aaf9267f951a06b8a60feb10c7"
118
118
  }