@typescript-deploys/pr-build 5.6.0-pr-52095-71 → 5.6.0-pr-59689-2

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.
@@ -6121,6 +6121,27 @@ declare namespace ts {
6121
6121
  getBaseTypes(type: InterfaceType): BaseType[];
6122
6122
  getBaseTypeOfLiteralType(type: Type): Type;
6123
6123
  getWidenedType(type: Type): Type;
6124
+ /**
6125
+ * Gets the "awaited type" of a type.
6126
+ *
6127
+ * If an expression has a Promise-like type, the "awaited type" of the expression is
6128
+ * derived from the type of the first argument of the fulfillment callback for that
6129
+ * Promise's `then` method. If the "awaited type" is itself a Promise-like, it is
6130
+ * recursively unwrapped in the same manner until a non-promise type is found.
6131
+ *
6132
+ * If an expression does not have a Promise-like type, its "awaited type" is the type
6133
+ * of the expression.
6134
+ *
6135
+ * If the resulting "awaited type" is a generic object type, then it is wrapped in
6136
+ * an `Awaited<T>`.
6137
+ *
6138
+ * In the event the "awaited type" circularly references itself, or is a non-Promise
6139
+ * object-type with a callable `then()` method, an "awaited type" cannot be determined
6140
+ * and the value `undefined` will be returned.
6141
+ *
6142
+ * This is used to reflect the runtime behavior of the `await` keyword.
6143
+ */
6144
+ getAwaitedType(type: Type): Type | undefined;
6124
6145
  getReturnTypeOfSignature(signature: Signature): Type;
6125
6146
  getNullableType(type: Type, flags: TypeFlags): Type;
6126
6147
  getNonNullableType(type: Type): Type;
package/lib/typescript.js CHANGED
@@ -163543,6 +163543,8 @@ var SortText = {
163543
163543
  return sortText + "1";
163544
163544
  }
163545
163545
  };
163546
+ var allCommitCharacters = [".", ",", ";"];
163547
+ var noCommaCommitCharacters = [".", ";"];
163546
163548
  var CompletionSource = /* @__PURE__ */ ((CompletionSource2) => {
163547
163549
  CompletionSource2["ThisProperty"] = "ThisProperty/";
163548
163550
  CompletionSource2["ClassMemberSnippet"] = "ClassMemberSnippet/";
@@ -163649,7 +163651,7 @@ function getDefaultCommitCharacters(isNewIdentifierLocation) {
163649
163651
  if (isNewIdentifierLocation) {
163650
163652
  return [];
163651
163653
  }
163652
- return [".", ",", ";"];
163654
+ return allCommitCharacters;
163653
163655
  }
163654
163656
  function getCompletionsAtPosition(host, program, log, sourceFile, position, preferences, triggerCharacter, completionKind, cancellationToken, formatContext, includeSymbol = false) {
163655
163657
  var _a;
@@ -164147,7 +164149,8 @@ function completionInfoFromData(sourceFile, host, program, compilerOptions, log,
164147
164149
  importStatementCompletion,
164148
164150
  insideJsDocTagTypeExpression,
164149
164151
  symbolToSortTextMap,
164150
- hasUnresolvedAutoImports
164152
+ hasUnresolvedAutoImports,
164153
+ defaultCommitCharacters
164151
164154
  } = completionData;
164152
164155
  let literals = completionData.literals;
164153
164156
  const checker = program.getTypeChecker();
@@ -164265,7 +164268,7 @@ function completionInfoFromData(sourceFile, host, program, compilerOptions, log,
164265
164268
  isNewIdentifierLocation,
164266
164269
  optionalReplacementSpan: getOptionalReplacementSpan(location),
164267
164270
  entries,
164268
- defaultCommitCharacters: getDefaultCommitCharacters(isNewIdentifierLocation)
164271
+ defaultCommitCharacters: defaultCommitCharacters ?? getDefaultCommitCharacters(isNewIdentifierLocation)
164269
164272
  };
164270
164273
  }
164271
164274
  function isCheckedFile(sourceFile, compilerOptions) {
@@ -165664,6 +165667,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
165664
165667
  let keywordFilters = 0 /* None */;
165665
165668
  let isNewIdentifierLocation = false;
165666
165669
  let flags = 0 /* None */;
165670
+ let defaultCommitCharacters;
165667
165671
  if (contextToken) {
165668
165672
  const importStatementCompletionInfo = getImportStatementCompletionInfo(contextToken, sourceFile);
165669
165673
  if (importStatementCompletionInfo.keywordCompletion) {
@@ -165683,7 +165687,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
165683
165687
  }
165684
165688
  if (!importStatementCompletionInfo.replacementSpan && isCompletionListBlocker(contextToken)) {
165685
165689
  log("Returning an empty list because completion was requested in an invalid position.");
165686
- return keywordFilters ? keywordCompletionData(keywordFilters, isJsOnlyLocation, isNewIdentifierDefinitionLocation()) : void 0;
165690
+ return keywordFilters ? keywordCompletionData(keywordFilters, isJsOnlyLocation, computeCommitCharactersAndIsNewIdentifier().isNewIdentifierLocation) : void 0;
165687
165691
  }
165688
165692
  let parent2 = contextToken.parent;
165689
165693
  if (contextToken.kind === 25 /* DotToken */ || contextToken.kind === 29 /* QuestionDotToken */) {
@@ -165842,7 +165846,8 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
165842
165846
  isRightOfDotOrQuestionDot: isRightOfDot || isRightOfQuestionDot,
165843
165847
  importStatementCompletion,
165844
165848
  hasUnresolvedAutoImports,
165845
- flags
165849
+ flags,
165850
+ defaultCommitCharacters
165846
165851
  };
165847
165852
  function isTagWithTypeExpression(tag) {
165848
165853
  switch (tag.kind) {
@@ -165877,7 +165882,10 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
165877
165882
  const isRhsOfImportDeclaration = isInRightSideOfInternalImportEqualsDeclaration(node);
165878
165883
  if (isEntityName(node) || isImportType || isPropertyAccessExpression(node)) {
165879
165884
  const isNamespaceName = isModuleDeclaration(node.parent);
165880
- if (isNamespaceName) isNewIdentifierLocation = true;
165885
+ if (isNamespaceName) {
165886
+ isNewIdentifierLocation = true;
165887
+ defaultCommitCharacters = [];
165888
+ }
165881
165889
  let symbol = typeChecker.getSymbolAtLocation(node);
165882
165890
  if (symbol) {
165883
165891
  symbol = skipAlias(symbol, typeChecker);
@@ -165947,9 +165955,13 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
165947
165955
  }
165948
165956
  }
165949
165957
  function addTypeProperties(type, insertAwait, insertQuestionDot) {
165950
- isNewIdentifierLocation = !!type.getStringIndexType();
165958
+ if (type.getStringIndexType()) {
165959
+ isNewIdentifierLocation = true;
165960
+ defaultCommitCharacters = [];
165961
+ }
165951
165962
  if (isRightOfQuestionDot && some(type.getCallSignatures())) {
165952
165963
  isNewIdentifierLocation = true;
165964
+ defaultCommitCharacters ?? (defaultCommitCharacters = allCommitCharacters);
165953
165965
  }
165954
165966
  const propertyAccess = node.kind === 205 /* ImportType */ ? node : node.parent;
165955
165967
  if (inCheckedFile) {
@@ -166088,7 +166100,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
166088
166100
  function getGlobalCompletions() {
166089
166101
  keywordFilters = tryGetFunctionLikeBodyCompletionContainer(contextToken) ? 5 /* FunctionLikeBodyKeywords */ : 1 /* All */;
166090
166102
  completionKind = 1 /* Global */;
166091
- isNewIdentifierLocation = isNewIdentifierDefinitionLocation();
166103
+ ({ isNewIdentifierLocation, defaultCommitCharacters } = computeCommitCharactersAndIsNewIdentifier());
166092
166104
  if (previousToken !== contextToken) {
166093
166105
  Debug.assert(!!previousToken, "Expected 'contextToken' to be defined when different from 'previousToken'.");
166094
166106
  }
@@ -166354,41 +166366,109 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
166354
166366
  }
166355
166367
  return false;
166356
166368
  }
166357
- function isNewIdentifierDefinitionLocation() {
166369
+ function computeCommitCharactersAndIsNewIdentifier() {
166358
166370
  if (contextToken) {
166359
166371
  const containingNodeKind = contextToken.parent.kind;
166360
166372
  const tokenKind = keywordForNode(contextToken);
166361
166373
  switch (tokenKind) {
166362
166374
  case 28 /* CommaToken */:
166363
- return containingNodeKind === 213 /* CallExpression */ || containingNodeKind === 176 /* Constructor */ || containingNodeKind === 214 /* NewExpression */ || containingNodeKind === 209 /* ArrayLiteralExpression */ || containingNodeKind === 226 /* BinaryExpression */ || containingNodeKind === 184 /* FunctionType */ || containingNodeKind === 210 /* ObjectLiteralExpression */;
166375
+ switch (containingNodeKind) {
166376
+ case 213 /* CallExpression */:
166377
+ case 214 /* NewExpression */: {
166378
+ const expression = contextToken.parent.expression;
166379
+ if (getLineAndCharacterOfPosition(sourceFile, expression.end).line !== getLineAndCharacterOfPosition(sourceFile, position).line) {
166380
+ return { defaultCommitCharacters: noCommaCommitCharacters, isNewIdentifierLocation: true };
166381
+ }
166382
+ return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: true };
166383
+ }
166384
+ case 226 /* BinaryExpression */:
166385
+ return { defaultCommitCharacters: noCommaCommitCharacters, isNewIdentifierLocation: true };
166386
+ case 176 /* Constructor */:
166387
+ case 184 /* FunctionType */:
166388
+ case 210 /* ObjectLiteralExpression */:
166389
+ return { defaultCommitCharacters: [], isNewIdentifierLocation: true };
166390
+ case 209 /* ArrayLiteralExpression */:
166391
+ return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: true };
166392
+ default:
166393
+ return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false };
166394
+ }
166364
166395
  case 21 /* OpenParenToken */:
166365
- return containingNodeKind === 213 /* CallExpression */ || containingNodeKind === 176 /* Constructor */ || containingNodeKind === 214 /* NewExpression */ || containingNodeKind === 217 /* ParenthesizedExpression */ || containingNodeKind === 196 /* ParenthesizedType */;
166396
+ switch (containingNodeKind) {
166397
+ case 213 /* CallExpression */:
166398
+ case 214 /* NewExpression */: {
166399
+ const expression = contextToken.parent.expression;
166400
+ if (getLineAndCharacterOfPosition(sourceFile, expression.end).line !== getLineAndCharacterOfPosition(sourceFile, position).line) {
166401
+ return { defaultCommitCharacters: noCommaCommitCharacters, isNewIdentifierLocation: true };
166402
+ }
166403
+ return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: true };
166404
+ }
166405
+ case 217 /* ParenthesizedExpression */:
166406
+ return { defaultCommitCharacters: noCommaCommitCharacters, isNewIdentifierLocation: true };
166407
+ case 176 /* Constructor */:
166408
+ case 196 /* ParenthesizedType */:
166409
+ return { defaultCommitCharacters: [], isNewIdentifierLocation: true };
166410
+ default:
166411
+ return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false };
166412
+ }
166366
166413
  case 23 /* OpenBracketToken */:
166367
- return containingNodeKind === 209 /* ArrayLiteralExpression */ || containingNodeKind === 181 /* IndexSignature */ || containingNodeKind === 167 /* ComputedPropertyName */;
166414
+ switch (containingNodeKind) {
166415
+ case 209 /* ArrayLiteralExpression */:
166416
+ case 181 /* IndexSignature */:
166417
+ case 189 /* TupleType */:
166418
+ case 167 /* ComputedPropertyName */:
166419
+ return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: true };
166420
+ default:
166421
+ return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false };
166422
+ }
166368
166423
  case 144 /* ModuleKeyword */:
166369
166424
  case 145 /* NamespaceKeyword */:
166370
166425
  case 102 /* ImportKeyword */:
166371
- return true;
166426
+ return { defaultCommitCharacters: [], isNewIdentifierLocation: true };
166372
166427
  case 25 /* DotToken */:
166373
- return containingNodeKind === 267 /* ModuleDeclaration */;
166428
+ switch (containingNodeKind) {
166429
+ case 267 /* ModuleDeclaration */:
166430
+ return { defaultCommitCharacters: [], isNewIdentifierLocation: true };
166431
+ default:
166432
+ return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false };
166433
+ }
166374
166434
  case 19 /* OpenBraceToken */:
166375
- return containingNodeKind === 263 /* ClassDeclaration */ || containingNodeKind === 210 /* ObjectLiteralExpression */;
166435
+ switch (containingNodeKind) {
166436
+ case 263 /* ClassDeclaration */:
166437
+ case 210 /* ObjectLiteralExpression */:
166438
+ return { defaultCommitCharacters: [], isNewIdentifierLocation: true };
166439
+ default:
166440
+ return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false };
166441
+ }
166376
166442
  case 64 /* EqualsToken */:
166377
- return containingNodeKind === 260 /* VariableDeclaration */ || containingNodeKind === 226 /* BinaryExpression */;
166443
+ switch (containingNodeKind) {
166444
+ case 260 /* VariableDeclaration */:
166445
+ case 226 /* BinaryExpression */:
166446
+ return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: true };
166447
+ default:
166448
+ return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false };
166449
+ }
166378
166450
  case 16 /* TemplateHead */:
166379
- return containingNodeKind === 228 /* TemplateExpression */;
166451
+ return {
166452
+ defaultCommitCharacters: allCommitCharacters,
166453
+ isNewIdentifierLocation: containingNodeKind === 228 /* TemplateExpression */
166454
+ // `aa ${|
166455
+ };
166380
166456
  case 17 /* TemplateMiddle */:
166381
- return containingNodeKind === 239 /* TemplateSpan */;
166457
+ return {
166458
+ defaultCommitCharacters: allCommitCharacters,
166459
+ isNewIdentifierLocation: containingNodeKind === 239 /* TemplateSpan */
166460
+ // `aa ${10} dd ${|
166461
+ };
166382
166462
  case 134 /* AsyncKeyword */:
166383
- return containingNodeKind === 174 /* MethodDeclaration */ || containingNodeKind === 304 /* ShorthandPropertyAssignment */;
166463
+ return containingNodeKind === 174 /* MethodDeclaration */ || containingNodeKind === 304 /* ShorthandPropertyAssignment */ ? { defaultCommitCharacters: [], isNewIdentifierLocation: true } : { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false };
166384
166464
  case 42 /* AsteriskToken */:
166385
- return containingNodeKind === 174 /* MethodDeclaration */;
166465
+ return containingNodeKind === 174 /* MethodDeclaration */ ? { defaultCommitCharacters: [], isNewIdentifierLocation: true } : { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false };
166386
166466
  }
166387
166467
  if (isClassMemberCompletionKeyword(tokenKind)) {
166388
- return true;
166468
+ return { defaultCommitCharacters: [], isNewIdentifierLocation: true };
166389
166469
  }
166390
166470
  }
166391
- return false;
166471
+ return { defaultCommitCharacters: allCommitCharacters, isNewIdentifierLocation: false };
166392
166472
  }
166393
166473
  function isInStringOrRegularExpressionOrTemplateLiteral(contextToken2) {
166394
166474
  return (isRegularExpressionLiteral(contextToken2) || isStringTextContainingNode(contextToken2)) && (rangeContainsPositionExclusive(contextToken2, position) || position === contextToken2.end && (!!contextToken2.isUnterminated || isRegularExpressionLiteral(contextToken2)));
@@ -188668,6 +188748,7 @@ Dynamic files must always be opened with service's current directory or service
188668
188748
  }
188669
188749
  };
188670
188750
  toRetainConfiguredProjects == null ? void 0 : toRetainConfiguredProjects.forEach(retainConfiguredProject);
188751
+ if (!toRemoveConfiguredProjects.size) return toRemoveConfiguredProjects;
188671
188752
  this.inferredProjects.forEach(markOriginalProjectsAsUsed);
188672
188753
  this.externalProjects.forEach(markOriginalProjectsAsUsed);
188673
188754
  this.externalProjectToConfiguredProjectMap.forEach((projects, externalProjectName) => {
@@ -188675,7 +188756,8 @@ Dynamic files must always be opened with service's current directory or service
188675
188756
  projects.forEach(retainConfiguredProject);
188676
188757
  }
188677
188758
  });
188678
- this.openFiles.forEach((_projectRootPath, path) => {
188759
+ if (!toRemoveConfiguredProjects.size) return toRemoveConfiguredProjects;
188760
+ forEachEntry(this.openFiles, (_projectRootPath, path) => {
188679
188761
  if (openFilesWithRetainedConfiguredProject == null ? void 0 : openFilesWithRetainedConfiguredProject.has(path)) return;
188680
188762
  const info = this.getScriptInfoForPath(path);
188681
188763
  if (find(info.containingProjects, isExternalProject)) return;
@@ -188685,12 +188767,15 @@ Dynamic files must always be opened with service's current directory or service
188685
188767
  );
188686
188768
  if (result == null ? void 0 : result.defaultProject) {
188687
188769
  result == null ? void 0 : result.seenProjects.forEach(retainConfiguredProject);
188770
+ if (!toRemoveConfiguredProjects.size) return toRemoveConfiguredProjects;
188688
188771
  }
188689
188772
  });
188690
- this.configuredProjects.forEach((project) => {
188773
+ if (!toRemoveConfiguredProjects.size) return toRemoveConfiguredProjects;
188774
+ forEachEntry(this.configuredProjects, (project) => {
188691
188775
  if (toRemoveConfiguredProjects.has(project)) {
188692
188776
  if (isPendingUpdate(project) || forEachReferencedProject(project, isRetained)) {
188693
188777
  retainConfiguredProject(project);
188778
+ if (!toRemoveConfiguredProjects.size) return toRemoveConfiguredProjects;
188694
188779
  }
188695
188780
  }
188696
188781
  });
@@ -189049,7 +189134,7 @@ Dynamic files must always be opened with service's current directory or service
189049
189134
  if (cleanupAfter) {
189050
189135
  this.cleanupConfiguredProjects(
189051
189136
  configuredProjects,
189052
- new Set(proj.projectFileName)
189137
+ /* @__PURE__ */ new Set([proj.projectFileName])
189053
189138
  );
189054
189139
  this.printProjects();
189055
189140
  }
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.6.0-pr-52095-71",
5
+ "version": "5.6.0-pr-59689-2",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [