typescript 5.3.0-dev.20230924 → 5.3.0-dev.20230926

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-dev.20230924`;
21
+ var version = `${versionMajorMinor}.0-dev.20230926`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -10930,6 +10930,9 @@ function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) {
10930
10930
  const kind = node.kind;
10931
10931
  return kind === 211 /* PropertyAccessExpression */ || kind === 166 /* QualifiedName */ || kind === 205 /* ImportType */;
10932
10932
  }
10933
+ function isCallLikeOrFunctionLikeExpression(node) {
10934
+ return isCallLikeExpression(node) || isFunctionLike(node);
10935
+ }
10933
10936
  function isCallLikeExpression(node) {
10934
10937
  switch (node.kind) {
10935
10938
  case 286 /* JsxOpeningElement */:
@@ -16473,7 +16476,7 @@ function createSymlinkCache(cwd, getCanonicalFileName) {
16473
16476
  if (!containsIgnoredPath(symlinkPath)) {
16474
16477
  symlinkPath = ensureTrailingDirectorySeparator(symlinkPath);
16475
16478
  if (real !== false && !(symlinkedDirectories == null ? void 0 : symlinkedDirectories.has(symlinkPath))) {
16476
- (symlinkedDirectoriesByRealpath || (symlinkedDirectoriesByRealpath = createMultiMap())).add(ensureTrailingDirectorySeparator(real.realPath), symlink);
16479
+ (symlinkedDirectoriesByRealpath || (symlinkedDirectoriesByRealpath = createMultiMap())).add(real.realPath, symlink);
16477
16480
  }
16478
16481
  (symlinkedDirectories || (symlinkedDirectories = /* @__PURE__ */ new Map())).set(symlinkPath, real);
16479
16482
  }
@@ -16496,7 +16499,10 @@ function createSymlinkCache(cwd, getCanonicalFileName) {
16496
16499
  if (commonResolved && commonOriginal) {
16497
16500
  cache.setSymlinkedDirectory(
16498
16501
  commonOriginal,
16499
- { real: commonResolved, realPath: toPath(commonResolved, cwd, getCanonicalFileName) }
16502
+ {
16503
+ real: ensureTrailingDirectorySeparator(commonResolved),
16504
+ realPath: ensureTrailingDirectorySeparator(toPath(commonResolved, cwd, getCanonicalFileName))
16505
+ }
16500
16506
  );
16501
16507
  }
16502
16508
  }
@@ -43279,24 +43285,7 @@ function createTypeChecker(host) {
43279
43285
  getTypeOfPropertyOfContextualType,
43280
43286
  getFullyQualifiedName,
43281
43287
  getResolvedSignature: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */),
43282
- getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray, checkMode = 32 /* IsForStringLiteralArgumentCompletions */) => {
43283
- if (checkMode & 32 /* IsForStringLiteralArgumentCompletions */) {
43284
- return runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker(
43285
- call,
43286
- candidatesOutArray,
43287
- /*argumentCount*/
43288
- void 0,
43289
- checkMode & ~32 /* IsForStringLiteralArgumentCompletions */
43290
- ));
43291
- }
43292
- return runWithoutResolvedSignatureCaching(editingArgument, () => getResolvedSignatureWorker(
43293
- call,
43294
- candidatesOutArray,
43295
- /*argumentCount*/
43296
- void 0,
43297
- checkMode & ~32 /* IsForStringLiteralArgumentCompletions */
43298
- ));
43299
- },
43288
+ getCandidateSignaturesForStringLiteralCompletions,
43300
43289
  getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */)),
43301
43290
  getExpandedParameters,
43302
43291
  hasEffectiveRestParameter,
@@ -43495,32 +43484,59 @@ function createTypeChecker(host) {
43495
43484
  isTypeParameterPossiblyReferenced,
43496
43485
  typeHasCallOrConstructSignatures
43497
43486
  };
43487
+ function getCandidateSignaturesForStringLiteralCompletions(call, editingArgument) {
43488
+ const candidatesSet = /* @__PURE__ */ new Set();
43489
+ const candidates = [];
43490
+ runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker(
43491
+ call,
43492
+ candidates,
43493
+ /*argumentCount*/
43494
+ void 0,
43495
+ 32 /* IsForStringLiteralArgumentCompletions */
43496
+ ));
43497
+ for (const candidate of candidates) {
43498
+ candidatesSet.add(candidate);
43499
+ }
43500
+ candidates.length = 0;
43501
+ runWithoutResolvedSignatureCaching(editingArgument, () => getResolvedSignatureWorker(
43502
+ call,
43503
+ candidates,
43504
+ /*argumentCount*/
43505
+ void 0,
43506
+ 0 /* Normal */
43507
+ ));
43508
+ for (const candidate of candidates) {
43509
+ candidatesSet.add(candidate);
43510
+ }
43511
+ return arrayFrom(candidatesSet);
43512
+ }
43498
43513
  function runWithoutResolvedSignatureCaching(node, fn) {
43499
- const cachedResolvedSignatures = [];
43500
- const cachedTypes2 = [];
43501
- while (node) {
43502
- if (isCallLikeExpression(node) || isFunctionLike(node)) {
43514
+ node = findAncestor(node, isCallLikeOrFunctionLikeExpression);
43515
+ if (node) {
43516
+ const cachedResolvedSignatures = [];
43517
+ const cachedTypes2 = [];
43518
+ while (node) {
43503
43519
  const nodeLinks2 = getNodeLinks(node);
43504
- const resolvedSignature = nodeLinks2.resolvedSignature;
43505
- cachedResolvedSignatures.push([nodeLinks2, resolvedSignature]);
43520
+ cachedResolvedSignatures.push([nodeLinks2, nodeLinks2.resolvedSignature]);
43506
43521
  nodeLinks2.resolvedSignature = void 0;
43522
+ if (isFunctionLike(node)) {
43523
+ const symbolLinks2 = getSymbolLinks(getSymbolOfDeclaration(node));
43524
+ const type = symbolLinks2.type;
43525
+ cachedTypes2.push([symbolLinks2, type]);
43526
+ symbolLinks2.type = void 0;
43527
+ }
43528
+ node = findAncestor(node.parent, isCallLikeOrFunctionLikeExpression);
43507
43529
  }
43508
- if (isFunctionLike(node)) {
43509
- const symbolLinks2 = getSymbolLinks(getSymbolOfDeclaration(node));
43510
- const type = symbolLinks2.type;
43511
- cachedTypes2.push([symbolLinks2, type]);
43512
- symbolLinks2.type = void 0;
43530
+ const result = fn();
43531
+ for (const [nodeLinks2, resolvedSignature] of cachedResolvedSignatures) {
43532
+ nodeLinks2.resolvedSignature = resolvedSignature;
43513
43533
  }
43514
- node = node.parent;
43515
- }
43516
- const result = fn();
43517
- for (const [nodeLinks2, resolvedSignature] of cachedResolvedSignatures) {
43518
- nodeLinks2.resolvedSignature = resolvedSignature;
43519
- }
43520
- for (const [symbolLinks2, type] of cachedTypes2) {
43521
- symbolLinks2.type = type;
43534
+ for (const [symbolLinks2, type] of cachedTypes2) {
43535
+ symbolLinks2.type = type;
43536
+ }
43537
+ return result;
43522
43538
  }
43523
- return result;
43539
+ return fn();
43524
43540
  }
43525
43541
  function runWithInferenceBlockedFromSourceNode(node, fn) {
43526
43542
  const containingCall = findAncestor(node, isCallLikeExpression);
@@ -70234,7 +70250,7 @@ function createTypeChecker(host) {
70234
70250
  }
70235
70251
  for (let i = 0; i < argCount; i++) {
70236
70252
  const arg = args[i];
70237
- if (arg.kind !== 232 /* OmittedExpression */) {
70253
+ if (arg.kind !== 232 /* OmittedExpression */ && !(checkMode & 32 /* IsForStringLiteralArgumentCompletions */ && hasSkipDirectInferenceFlag(arg))) {
70238
70254
  const paramType = getTypeAtPosition(signature, i);
70239
70255
  if (couldContainTypeVariables(paramType)) {
70240
70256
  const argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);
@@ -70837,6 +70853,7 @@ function createTypeChecker(host) {
70837
70853
  const args = getEffectiveCallArguments(node);
70838
70854
  const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters;
70839
70855
  let argCheckMode = !isDecorator2 && !isSingleNonGenericCandidate && some(args, isContextSensitive) ? 4 /* SkipContextSensitive */ : 0 /* Normal */;
70856
+ argCheckMode |= checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
70840
70857
  let candidatesForArgumentError;
70841
70858
  let candidateForArgumentArityError;
70842
70859
  let candidateForTypeArgumentError;
package/lib/tsserver.js CHANGED
@@ -1238,6 +1238,7 @@ __export(server_exports, {
1238
1238
  isCallExpression: () => isCallExpression,
1239
1239
  isCallExpressionTarget: () => isCallExpressionTarget,
1240
1240
  isCallLikeExpression: () => isCallLikeExpression,
1241
+ isCallLikeOrFunctionLikeExpression: () => isCallLikeOrFunctionLikeExpression,
1241
1242
  isCallOrNewExpression: () => isCallOrNewExpression,
1242
1243
  isCallOrNewExpressionTarget: () => isCallOrNewExpressionTarget,
1243
1244
  isCallSignatureDeclaration: () => isCallSignatureDeclaration,
@@ -2327,7 +2328,7 @@ module.exports = __toCommonJS(server_exports);
2327
2328
 
2328
2329
  // src/compiler/corePublic.ts
2329
2330
  var versionMajorMinor = "5.3";
2330
- var version = `${versionMajorMinor}.0-dev.20230924`;
2331
+ var version = `${versionMajorMinor}.0-dev.20230926`;
2331
2332
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2332
2333
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2333
2334
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -14606,6 +14607,9 @@ function isPropertyAccessOrQualifiedName(node) {
14606
14607
  const kind = node.kind;
14607
14608
  return kind === 211 /* PropertyAccessExpression */ || kind === 166 /* QualifiedName */;
14608
14609
  }
14610
+ function isCallLikeOrFunctionLikeExpression(node) {
14611
+ return isCallLikeExpression(node) || isFunctionLike(node);
14612
+ }
14609
14613
  function isCallLikeExpression(node) {
14610
14614
  switch (node.kind) {
14611
14615
  case 286 /* JsxOpeningElement */:
@@ -20624,7 +20628,7 @@ function createSymlinkCache(cwd, getCanonicalFileName) {
20624
20628
  if (!containsIgnoredPath(symlinkPath)) {
20625
20629
  symlinkPath = ensureTrailingDirectorySeparator(symlinkPath);
20626
20630
  if (real !== false && !(symlinkedDirectories == null ? void 0 : symlinkedDirectories.has(symlinkPath))) {
20627
- (symlinkedDirectoriesByRealpath || (symlinkedDirectoriesByRealpath = createMultiMap())).add(ensureTrailingDirectorySeparator(real.realPath), symlink);
20631
+ (symlinkedDirectoriesByRealpath || (symlinkedDirectoriesByRealpath = createMultiMap())).add(real.realPath, symlink);
20628
20632
  }
20629
20633
  (symlinkedDirectories || (symlinkedDirectories = /* @__PURE__ */ new Map())).set(symlinkPath, real);
20630
20634
  }
@@ -20647,7 +20651,10 @@ function createSymlinkCache(cwd, getCanonicalFileName) {
20647
20651
  if (commonResolved && commonOriginal) {
20648
20652
  cache.setSymlinkedDirectory(
20649
20653
  commonOriginal,
20650
- { real: commonResolved, realPath: toPath(commonResolved, cwd, getCanonicalFileName) }
20654
+ {
20655
+ real: ensureTrailingDirectorySeparator(commonResolved),
20656
+ realPath: ensureTrailingDirectorySeparator(toPath(commonResolved, cwd, getCanonicalFileName))
20657
+ }
20651
20658
  );
20652
20659
  }
20653
20660
  }
@@ -47757,7 +47764,7 @@ function createTypeChecker(host) {
47757
47764
  var externalHelpersModule;
47758
47765
  var Symbol47 = objectAllocator.getSymbolConstructor();
47759
47766
  var Type27 = objectAllocator.getTypeConstructor();
47760
- var Signature15 = objectAllocator.getSignatureConstructor();
47767
+ var Signature14 = objectAllocator.getSignatureConstructor();
47761
47768
  var typeCount = 0;
47762
47769
  var symbolCount = 0;
47763
47770
  var totalInstantiationCount = 0;
@@ -47983,24 +47990,7 @@ function createTypeChecker(host) {
47983
47990
  getTypeOfPropertyOfContextualType,
47984
47991
  getFullyQualifiedName,
47985
47992
  getResolvedSignature: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */),
47986
- getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray, checkMode = 32 /* IsForStringLiteralArgumentCompletions */) => {
47987
- if (checkMode & 32 /* IsForStringLiteralArgumentCompletions */) {
47988
- return runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker(
47989
- call,
47990
- candidatesOutArray,
47991
- /*argumentCount*/
47992
- void 0,
47993
- checkMode & ~32 /* IsForStringLiteralArgumentCompletions */
47994
- ));
47995
- }
47996
- return runWithoutResolvedSignatureCaching(editingArgument, () => getResolvedSignatureWorker(
47997
- call,
47998
- candidatesOutArray,
47999
- /*argumentCount*/
48000
- void 0,
48001
- checkMode & ~32 /* IsForStringLiteralArgumentCompletions */
48002
- ));
48003
- },
47993
+ getCandidateSignaturesForStringLiteralCompletions,
48004
47994
  getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */)),
48005
47995
  getExpandedParameters,
48006
47996
  hasEffectiveRestParameter,
@@ -48199,32 +48189,59 @@ function createTypeChecker(host) {
48199
48189
  isTypeParameterPossiblyReferenced,
48200
48190
  typeHasCallOrConstructSignatures
48201
48191
  };
48192
+ function getCandidateSignaturesForStringLiteralCompletions(call, editingArgument) {
48193
+ const candidatesSet = /* @__PURE__ */ new Set();
48194
+ const candidates = [];
48195
+ runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker(
48196
+ call,
48197
+ candidates,
48198
+ /*argumentCount*/
48199
+ void 0,
48200
+ 32 /* IsForStringLiteralArgumentCompletions */
48201
+ ));
48202
+ for (const candidate of candidates) {
48203
+ candidatesSet.add(candidate);
48204
+ }
48205
+ candidates.length = 0;
48206
+ runWithoutResolvedSignatureCaching(editingArgument, () => getResolvedSignatureWorker(
48207
+ call,
48208
+ candidates,
48209
+ /*argumentCount*/
48210
+ void 0,
48211
+ 0 /* Normal */
48212
+ ));
48213
+ for (const candidate of candidates) {
48214
+ candidatesSet.add(candidate);
48215
+ }
48216
+ return arrayFrom(candidatesSet);
48217
+ }
48202
48218
  function runWithoutResolvedSignatureCaching(node, fn) {
48203
- const cachedResolvedSignatures = [];
48204
- const cachedTypes2 = [];
48205
- while (node) {
48206
- if (isCallLikeExpression(node) || isFunctionLike(node)) {
48219
+ node = findAncestor(node, isCallLikeOrFunctionLikeExpression);
48220
+ if (node) {
48221
+ const cachedResolvedSignatures = [];
48222
+ const cachedTypes2 = [];
48223
+ while (node) {
48207
48224
  const nodeLinks2 = getNodeLinks(node);
48208
- const resolvedSignature = nodeLinks2.resolvedSignature;
48209
- cachedResolvedSignatures.push([nodeLinks2, resolvedSignature]);
48225
+ cachedResolvedSignatures.push([nodeLinks2, nodeLinks2.resolvedSignature]);
48210
48226
  nodeLinks2.resolvedSignature = void 0;
48227
+ if (isFunctionLike(node)) {
48228
+ const symbolLinks2 = getSymbolLinks(getSymbolOfDeclaration(node));
48229
+ const type = symbolLinks2.type;
48230
+ cachedTypes2.push([symbolLinks2, type]);
48231
+ symbolLinks2.type = void 0;
48232
+ }
48233
+ node = findAncestor(node.parent, isCallLikeOrFunctionLikeExpression);
48211
48234
  }
48212
- if (isFunctionLike(node)) {
48213
- const symbolLinks2 = getSymbolLinks(getSymbolOfDeclaration(node));
48214
- const type = symbolLinks2.type;
48215
- cachedTypes2.push([symbolLinks2, type]);
48216
- symbolLinks2.type = void 0;
48235
+ const result = fn();
48236
+ for (const [nodeLinks2, resolvedSignature] of cachedResolvedSignatures) {
48237
+ nodeLinks2.resolvedSignature = resolvedSignature;
48217
48238
  }
48218
- node = node.parent;
48219
- }
48220
- const result = fn();
48221
- for (const [nodeLinks2, resolvedSignature] of cachedResolvedSignatures) {
48222
- nodeLinks2.resolvedSignature = resolvedSignature;
48223
- }
48224
- for (const [symbolLinks2, type] of cachedTypes2) {
48225
- symbolLinks2.type = type;
48239
+ for (const [symbolLinks2, type] of cachedTypes2) {
48240
+ symbolLinks2.type = type;
48241
+ }
48242
+ return result;
48226
48243
  }
48227
- return result;
48244
+ return fn();
48228
48245
  }
48229
48246
  function runWithInferenceBlockedFromSourceNode(node, fn) {
48230
48247
  const containingCall = findAncestor(node, isCallLikeExpression);
@@ -58044,7 +58061,7 @@ function createTypeChecker(host) {
58044
58061
  resolveObjectTypeMembers(type, source, typeParameters, paddedTypeArguments);
58045
58062
  }
58046
58063
  function createSignature(declaration, typeParameters, thisParameter, parameters, resolvedReturnType, resolvedTypePredicate, minArgumentCount, flags) {
58047
- const sig = new Signature15(checker, flags);
58064
+ const sig = new Signature14(checker, flags);
58048
58065
  sig.declaration = declaration;
58049
58066
  sig.typeParameters = typeParameters;
58050
58067
  sig.parameters = parameters;
@@ -74938,7 +74955,7 @@ function createTypeChecker(host) {
74938
74955
  }
74939
74956
  for (let i = 0; i < argCount; i++) {
74940
74957
  const arg = args[i];
74941
- if (arg.kind !== 232 /* OmittedExpression */) {
74958
+ if (arg.kind !== 232 /* OmittedExpression */ && !(checkMode & 32 /* IsForStringLiteralArgumentCompletions */ && hasSkipDirectInferenceFlag(arg))) {
74942
74959
  const paramType = getTypeAtPosition(signature, i);
74943
74960
  if (couldContainTypeVariables(paramType)) {
74944
74961
  const argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);
@@ -75541,6 +75558,7 @@ function createTypeChecker(host) {
75541
75558
  const args = getEffectiveCallArguments(node);
75542
75559
  const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters;
75543
75560
  let argCheckMode = !isDecorator2 && !isSingleNonGenericCandidate && some(args, isContextSensitive) ? 4 /* SkipContextSensitive */ : 0 /* Normal */;
75561
+ argCheckMode |= checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
75544
75562
  let candidatesForArgumentError;
75545
75563
  let candidateForArgumentArityError;
75546
75564
  let candidateForTypeArgumentError;
@@ -161324,7 +161342,7 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, typeCheck
161324
161342
  case 291 /* JsxAttribute */:
161325
161343
  if (!isRequireCallArgument(node) && !isImportCall(parent2)) {
161326
161344
  const argumentInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(parent2.kind === 291 /* JsxAttribute */ ? parent2.parent : node, position, sourceFile);
161327
- return argumentInfo && (getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker) || getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker, 0 /* Normal */)) || fromContextualType(0 /* None */);
161345
+ return argumentInfo && getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker) || fromContextualType(0 /* None */);
161328
161346
  }
161329
161347
  case 272 /* ImportDeclaration */:
161330
161348
  case 278 /* ExportDeclaration */:
@@ -161393,12 +161411,11 @@ function walkUpParentheses(node) {
161393
161411
  function getAlreadyUsedTypesInStringLiteralUnion(union, current) {
161394
161412
  return mapDefined(union.types, (type) => type !== current && isLiteralTypeNode(type) && isStringLiteral(type.literal) ? type.literal.text : void 0);
161395
161413
  }
161396
- function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker, checkMode = 32 /* IsForStringLiteralArgumentCompletions */) {
161414
+ function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker) {
161397
161415
  let isNewIdentifier = false;
161398
161416
  const uniques = /* @__PURE__ */ new Map();
161399
- const candidates = [];
161400
161417
  const editingArgument = isJsxOpeningLikeElement(call) ? Debug.checkDefined(findAncestor(arg.parent, isJsxAttribute)) : arg;
161401
- checker.getResolvedSignatureForStringLiteralCompletions(call, editingArgument, candidates, checkMode);
161418
+ const candidates = checker.getCandidateSignaturesForStringLiteralCompletions(call, editingArgument);
161402
161419
  const types = flatMap(candidates, (candidate) => {
161403
161420
  if (!signatureHasRestParameter(candidate) && argumentInfo.argumentCount > candidate.parameters.length)
161404
161421
  return;
@@ -173840,6 +173857,7 @@ __export(ts_exports2, {
173840
173857
  isCallExpression: () => isCallExpression,
173841
173858
  isCallExpressionTarget: () => isCallExpressionTarget,
173842
173859
  isCallLikeExpression: () => isCallLikeExpression,
173860
+ isCallLikeOrFunctionLikeExpression: () => isCallLikeOrFunctionLikeExpression,
173843
173861
  isCallOrNewExpression: () => isCallOrNewExpression,
173844
173862
  isCallOrNewExpressionTarget: () => isCallOrNewExpressionTarget,
173845
173863
  isCallSignatureDeclaration: () => isCallSignatureDeclaration,
@@ -178482,8 +178500,8 @@ var _AutoImportProviderProject = class _AutoImportProviderProject extends Projec
178482
178500
  const isSymlink = realPath2 && realPath2 !== hostProject.toPath(packageJson.packageDirectory);
178483
178501
  if (isSymlink) {
178484
178502
  symlinkCache.setSymlinkedDirectory(packageJson.packageDirectory, {
178485
- real,
178486
- realPath: realPath2
178503
+ real: ensureTrailingDirectorySeparator(real),
178504
+ realPath: ensureTrailingDirectorySeparator(realPath2)
178487
178505
  });
178488
178506
  }
178489
178507
  return mapDefined(entrypoints, (entrypoint) => {
@@ -188518,6 +188536,7 @@ start(initializeNodeSystem(), require("os").platform());
188518
188536
  isCallExpression,
188519
188537
  isCallExpressionTarget,
188520
188538
  isCallLikeExpression,
188539
+ isCallLikeOrFunctionLikeExpression,
188521
188540
  isCallOrNewExpression,
188522
188541
  isCallOrNewExpressionTarget,
188523
188542
  isCallSignatureDeclaration,
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-dev.20230924`;
38
+ version = `${versionMajorMinor}.0-dev.20230926`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -12396,6 +12396,9 @@ ${lanes.join("\n")}
12396
12396
  const kind = node.kind;
12397
12397
  return kind === 211 /* PropertyAccessExpression */ || kind === 166 /* QualifiedName */;
12398
12398
  }
12399
+ function isCallLikeOrFunctionLikeExpression(node) {
12400
+ return isCallLikeExpression(node) || isFunctionLike(node);
12401
+ }
12399
12402
  function isCallLikeExpression(node) {
12400
12403
  switch (node.kind) {
12401
12404
  case 286 /* JsxOpeningElement */:
@@ -17913,7 +17916,7 @@ ${lanes.join("\n")}
17913
17916
  if (!containsIgnoredPath(symlinkPath)) {
17914
17917
  symlinkPath = ensureTrailingDirectorySeparator(symlinkPath);
17915
17918
  if (real !== false && !(symlinkedDirectories == null ? void 0 : symlinkedDirectories.has(symlinkPath))) {
17916
- (symlinkedDirectoriesByRealpath || (symlinkedDirectoriesByRealpath = createMultiMap())).add(ensureTrailingDirectorySeparator(real.realPath), symlink);
17919
+ (symlinkedDirectoriesByRealpath || (symlinkedDirectoriesByRealpath = createMultiMap())).add(real.realPath, symlink);
17917
17920
  }
17918
17921
  (symlinkedDirectories || (symlinkedDirectories = /* @__PURE__ */ new Map())).set(symlinkPath, real);
17919
17922
  }
@@ -17936,7 +17939,10 @@ ${lanes.join("\n")}
17936
17939
  if (commonResolved && commonOriginal) {
17937
17940
  cache.setSymlinkedDirectory(
17938
17941
  commonOriginal,
17939
- { real: commonResolved, realPath: toPath(commonResolved, cwd, getCanonicalFileName) }
17942
+ {
17943
+ real: ensureTrailingDirectorySeparator(commonResolved),
17944
+ realPath: ensureTrailingDirectorySeparator(toPath(commonResolved, cwd, getCanonicalFileName))
17945
+ }
17940
17946
  );
17941
17947
  }
17942
17948
  }
@@ -45524,7 +45530,7 @@ ${lanes.join("\n")}
45524
45530
  var externalHelpersModule;
45525
45531
  var Symbol47 = objectAllocator.getSymbolConstructor();
45526
45532
  var Type27 = objectAllocator.getTypeConstructor();
45527
- var Signature15 = objectAllocator.getSignatureConstructor();
45533
+ var Signature14 = objectAllocator.getSignatureConstructor();
45528
45534
  var typeCount = 0;
45529
45535
  var symbolCount = 0;
45530
45536
  var totalInstantiationCount = 0;
@@ -45750,24 +45756,7 @@ ${lanes.join("\n")}
45750
45756
  getTypeOfPropertyOfContextualType,
45751
45757
  getFullyQualifiedName,
45752
45758
  getResolvedSignature: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */),
45753
- getResolvedSignatureForStringLiteralCompletions: (call, editingArgument, candidatesOutArray, checkMode = 32 /* IsForStringLiteralArgumentCompletions */) => {
45754
- if (checkMode & 32 /* IsForStringLiteralArgumentCompletions */) {
45755
- return runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker(
45756
- call,
45757
- candidatesOutArray,
45758
- /*argumentCount*/
45759
- void 0,
45760
- checkMode & ~32 /* IsForStringLiteralArgumentCompletions */
45761
- ));
45762
- }
45763
- return runWithoutResolvedSignatureCaching(editingArgument, () => getResolvedSignatureWorker(
45764
- call,
45765
- candidatesOutArray,
45766
- /*argumentCount*/
45767
- void 0,
45768
- checkMode & ~32 /* IsForStringLiteralArgumentCompletions */
45769
- ));
45770
- },
45759
+ getCandidateSignaturesForStringLiteralCompletions,
45771
45760
  getResolvedSignatureForSignatureHelp: (node, candidatesOutArray, argumentCount) => runWithoutResolvedSignatureCaching(node, () => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 16 /* IsForSignatureHelp */)),
45772
45761
  getExpandedParameters,
45773
45762
  hasEffectiveRestParameter,
@@ -45966,32 +45955,59 @@ ${lanes.join("\n")}
45966
45955
  isTypeParameterPossiblyReferenced,
45967
45956
  typeHasCallOrConstructSignatures
45968
45957
  };
45958
+ function getCandidateSignaturesForStringLiteralCompletions(call, editingArgument) {
45959
+ const candidatesSet = /* @__PURE__ */ new Set();
45960
+ const candidates = [];
45961
+ runWithInferenceBlockedFromSourceNode(editingArgument, () => getResolvedSignatureWorker(
45962
+ call,
45963
+ candidates,
45964
+ /*argumentCount*/
45965
+ void 0,
45966
+ 32 /* IsForStringLiteralArgumentCompletions */
45967
+ ));
45968
+ for (const candidate of candidates) {
45969
+ candidatesSet.add(candidate);
45970
+ }
45971
+ candidates.length = 0;
45972
+ runWithoutResolvedSignatureCaching(editingArgument, () => getResolvedSignatureWorker(
45973
+ call,
45974
+ candidates,
45975
+ /*argumentCount*/
45976
+ void 0,
45977
+ 0 /* Normal */
45978
+ ));
45979
+ for (const candidate of candidates) {
45980
+ candidatesSet.add(candidate);
45981
+ }
45982
+ return arrayFrom(candidatesSet);
45983
+ }
45969
45984
  function runWithoutResolvedSignatureCaching(node, fn) {
45970
- const cachedResolvedSignatures = [];
45971
- const cachedTypes2 = [];
45972
- while (node) {
45973
- if (isCallLikeExpression(node) || isFunctionLike(node)) {
45985
+ node = findAncestor(node, isCallLikeOrFunctionLikeExpression);
45986
+ if (node) {
45987
+ const cachedResolvedSignatures = [];
45988
+ const cachedTypes2 = [];
45989
+ while (node) {
45974
45990
  const nodeLinks2 = getNodeLinks(node);
45975
- const resolvedSignature = nodeLinks2.resolvedSignature;
45976
- cachedResolvedSignatures.push([nodeLinks2, resolvedSignature]);
45991
+ cachedResolvedSignatures.push([nodeLinks2, nodeLinks2.resolvedSignature]);
45977
45992
  nodeLinks2.resolvedSignature = void 0;
45993
+ if (isFunctionLike(node)) {
45994
+ const symbolLinks2 = getSymbolLinks(getSymbolOfDeclaration(node));
45995
+ const type = symbolLinks2.type;
45996
+ cachedTypes2.push([symbolLinks2, type]);
45997
+ symbolLinks2.type = void 0;
45998
+ }
45999
+ node = findAncestor(node.parent, isCallLikeOrFunctionLikeExpression);
45978
46000
  }
45979
- if (isFunctionLike(node)) {
45980
- const symbolLinks2 = getSymbolLinks(getSymbolOfDeclaration(node));
45981
- const type = symbolLinks2.type;
45982
- cachedTypes2.push([symbolLinks2, type]);
45983
- symbolLinks2.type = void 0;
46001
+ const result = fn();
46002
+ for (const [nodeLinks2, resolvedSignature] of cachedResolvedSignatures) {
46003
+ nodeLinks2.resolvedSignature = resolvedSignature;
45984
46004
  }
45985
- node = node.parent;
45986
- }
45987
- const result = fn();
45988
- for (const [nodeLinks2, resolvedSignature] of cachedResolvedSignatures) {
45989
- nodeLinks2.resolvedSignature = resolvedSignature;
45990
- }
45991
- for (const [symbolLinks2, type] of cachedTypes2) {
45992
- symbolLinks2.type = type;
46005
+ for (const [symbolLinks2, type] of cachedTypes2) {
46006
+ symbolLinks2.type = type;
46007
+ }
46008
+ return result;
45993
46009
  }
45994
- return result;
46010
+ return fn();
45995
46011
  }
45996
46012
  function runWithInferenceBlockedFromSourceNode(node, fn) {
45997
46013
  const containingCall = findAncestor(node, isCallLikeExpression);
@@ -55811,7 +55827,7 @@ ${lanes.join("\n")}
55811
55827
  resolveObjectTypeMembers(type, source, typeParameters, paddedTypeArguments);
55812
55828
  }
55813
55829
  function createSignature(declaration, typeParameters, thisParameter, parameters, resolvedReturnType, resolvedTypePredicate, minArgumentCount, flags) {
55814
- const sig = new Signature15(checker, flags);
55830
+ const sig = new Signature14(checker, flags);
55815
55831
  sig.declaration = declaration;
55816
55832
  sig.typeParameters = typeParameters;
55817
55833
  sig.parameters = parameters;
@@ -72705,7 +72721,7 @@ ${lanes.join("\n")}
72705
72721
  }
72706
72722
  for (let i = 0; i < argCount; i++) {
72707
72723
  const arg = args[i];
72708
- if (arg.kind !== 232 /* OmittedExpression */) {
72724
+ if (arg.kind !== 232 /* OmittedExpression */ && !(checkMode & 32 /* IsForStringLiteralArgumentCompletions */ && hasSkipDirectInferenceFlag(arg))) {
72709
72725
  const paramType = getTypeAtPosition(signature, i);
72710
72726
  if (couldContainTypeVariables(paramType)) {
72711
72727
  const argType = checkExpressionWithContextualType(arg, paramType, context, checkMode);
@@ -73308,6 +73324,7 @@ ${lanes.join("\n")}
73308
73324
  const args = getEffectiveCallArguments(node);
73309
73325
  const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters;
73310
73326
  let argCheckMode = !isDecorator2 && !isSingleNonGenericCandidate && some(args, isContextSensitive) ? 4 /* SkipContextSensitive */ : 0 /* Normal */;
73327
+ argCheckMode |= checkMode & 32 /* IsForStringLiteralArgumentCompletions */;
73311
73328
  let candidatesForArgumentError;
73312
73329
  let candidateForArgumentArityError;
73313
73330
  let candidateForTypeArgumentError;
@@ -160600,7 +160617,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
160600
160617
  case 291 /* JsxAttribute */:
160601
160618
  if (!isRequireCallArgument(node) && !isImportCall(parent2)) {
160602
160619
  const argumentInfo = ts_SignatureHelp_exports.getArgumentInfoForCompletions(parent2.kind === 291 /* JsxAttribute */ ? parent2.parent : node, position, sourceFile);
160603
- return argumentInfo && (getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker) || getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker, 0 /* Normal */)) || fromContextualType(0 /* None */);
160620
+ return argumentInfo && getStringLiteralCompletionsFromSignature(argumentInfo.invocation, node, argumentInfo, typeChecker) || fromContextualType(0 /* None */);
160604
160621
  }
160605
160622
  case 272 /* ImportDeclaration */:
160606
160623
  case 278 /* ExportDeclaration */:
@@ -160669,12 +160686,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
160669
160686
  function getAlreadyUsedTypesInStringLiteralUnion(union, current) {
160670
160687
  return mapDefined(union.types, (type) => type !== current && isLiteralTypeNode(type) && isStringLiteral(type.literal) ? type.literal.text : void 0);
160671
160688
  }
160672
- function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker, checkMode = 32 /* IsForStringLiteralArgumentCompletions */) {
160689
+ function getStringLiteralCompletionsFromSignature(call, arg, argumentInfo, checker) {
160673
160690
  let isNewIdentifier = false;
160674
160691
  const uniques = /* @__PURE__ */ new Map();
160675
- const candidates = [];
160676
160692
  const editingArgument = isJsxOpeningLikeElement(call) ? Debug.checkDefined(findAncestor(arg.parent, isJsxAttribute)) : arg;
160677
- checker.getResolvedSignatureForStringLiteralCompletions(call, editingArgument, candidates, checkMode);
160693
+ const candidates = checker.getCandidateSignaturesForStringLiteralCompletions(call, editingArgument);
160678
160694
  const types = flatMap(candidates, (candidate) => {
160679
160695
  if (!signatureHasRestParameter(candidate) && argumentInfo.argumentCount > candidate.parameters.length)
160680
160696
  return;
@@ -175799,8 +175815,8 @@ ${options.prefix}` : "\n" : options.prefix
175799
175815
  const isSymlink = realPath2 && realPath2 !== hostProject.toPath(packageJson.packageDirectory);
175800
175816
  if (isSymlink) {
175801
175817
  symlinkCache.setSymlinkedDirectory(packageJson.packageDirectory, {
175802
- real,
175803
- realPath: realPath2
175818
+ real: ensureTrailingDirectorySeparator(real),
175819
+ realPath: ensureTrailingDirectorySeparator(realPath2)
175804
175820
  });
175805
175821
  }
175806
175822
  return mapDefined(entrypoints, (entrypoint) => {
@@ -185142,6 +185158,7 @@ ${e.message}`;
185142
185158
  isCallExpression: () => isCallExpression,
185143
185159
  isCallExpressionTarget: () => isCallExpressionTarget,
185144
185160
  isCallLikeExpression: () => isCallLikeExpression,
185161
+ isCallLikeOrFunctionLikeExpression: () => isCallLikeOrFunctionLikeExpression,
185145
185162
  isCallOrNewExpression: () => isCallOrNewExpression,
185146
185163
  isCallOrNewExpressionTarget: () => isCallOrNewExpressionTarget,
185147
185164
  isCallSignatureDeclaration: () => isCallSignatureDeclaration,
@@ -187548,6 +187565,7 @@ ${e.message}`;
187548
187565
  isCallExpression: () => isCallExpression,
187549
187566
  isCallExpressionTarget: () => isCallExpressionTarget,
187550
187567
  isCallLikeExpression: () => isCallLikeExpression,
187568
+ isCallLikeOrFunctionLikeExpression: () => isCallLikeOrFunctionLikeExpression,
187551
187569
  isCallOrNewExpression: () => isCallOrNewExpression,
187552
187570
  isCallOrNewExpressionTarget: () => isCallOrNewExpressionTarget,
187553
187571
  isCallSignatureDeclaration: () => isCallSignatureDeclaration,
@@ -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-dev.20230924`;
57
+ var version = `${versionMajorMinor}.0-dev.20230926`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "typescript",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.3.0-dev.20230924",
5
+ "version": "5.3.0-dev.20230926",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -113,5 +113,5 @@
113
113
  "node": "20.1.0",
114
114
  "npm": "8.19.4"
115
115
  },
116
- "gitHead": "97147915ab667a52e31ac743843786cbc9049559"
116
+ "gitHead": "b12af0fa2bbd4b015e59adcfb49988cea7f919a1"
117
117
  }