typescript 5.4.0-dev.20231207 → 5.4.0-dev.20231209

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/tsserver.js CHANGED
@@ -333,6 +333,7 @@ __export(server_exports, {
333
333
  computeSignature: () => computeSignature,
334
334
  computeSignatureWithDiagnostics: () => computeSignatureWithDiagnostics,
335
335
  computeSuggestionDiagnostics: () => computeSuggestionDiagnostics,
336
+ computedOptions: () => computedOptions,
336
337
  concatenate: () => concatenate,
337
338
  concatenateDiagnosticMessageChains: () => concatenateDiagnosticMessageChains,
338
339
  consumesNodeCoreModules: () => consumesNodeCoreModules,
@@ -2334,7 +2335,7 @@ module.exports = __toCommonJS(server_exports);
2334
2335
 
2335
2336
  // src/compiler/corePublic.ts
2336
2337
  var versionMajorMinor = "5.4";
2337
- var version = `${versionMajorMinor}.0-dev.20231207`;
2338
+ var version = `${versionMajorMinor}.0-dev.20231209`;
2338
2339
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2339
2340
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2340
2341
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -7291,6 +7292,7 @@ var EmitHint = /* @__PURE__ */ ((EmitHint6) => {
7291
7292
  EmitHint6[EmitHint6["Unspecified"] = 4] = "Unspecified";
7292
7293
  EmitHint6[EmitHint6["EmbeddedStatement"] = 5] = "EmbeddedStatement";
7293
7294
  EmitHint6[EmitHint6["JsxAttributeValue"] = 6] = "JsxAttributeValue";
7295
+ EmitHint6[EmitHint6["ImportTypeNodeAttributes"] = 7] = "ImportTypeNodeAttributes";
7294
7296
  return EmitHint6;
7295
7297
  })(EmitHint || {});
7296
7298
  var OuterExpressionKinds = /* @__PURE__ */ ((OuterExpressionKinds2) => {
@@ -20521,37 +20523,230 @@ function getSetExternalModuleIndicator(options) {
20521
20523
  return callback;
20522
20524
  }
20523
20525
  }
20524
- function getEmitScriptTarget(compilerOptions) {
20525
- return compilerOptions.target ?? (compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */);
20526
- }
20527
- function getEmitModuleKind(compilerOptions) {
20528
- return typeof compilerOptions.module === "number" ? compilerOptions.module : getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
20529
- }
20530
- function emitModuleKindIsNonNodeESM(moduleKind) {
20531
- return moduleKind >= 5 /* ES2015 */ && moduleKind <= 99 /* ESNext */;
20526
+ function createComputedCompilerOptions(options) {
20527
+ return options;
20532
20528
  }
20533
- function getEmitModuleResolutionKind(compilerOptions) {
20534
- let moduleResolution = compilerOptions.moduleResolution;
20535
- if (moduleResolution === void 0) {
20536
- switch (getEmitModuleKind(compilerOptions)) {
20537
- case 1 /* CommonJS */:
20538
- moduleResolution = 2 /* Node10 */;
20539
- break;
20540
- case 100 /* Node16 */:
20541
- moduleResolution = 3 /* Node16 */;
20542
- break;
20543
- case 199 /* NodeNext */:
20544
- moduleResolution = 99 /* NodeNext */;
20545
- break;
20546
- default:
20547
- moduleResolution = 1 /* Classic */;
20548
- break;
20529
+ var computedOptions = createComputedCompilerOptions({
20530
+ target: {
20531
+ dependencies: ["module"],
20532
+ computeValue: (compilerOptions) => {
20533
+ return compilerOptions.target ?? (compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */);
20534
+ }
20535
+ },
20536
+ module: {
20537
+ dependencies: ["target"],
20538
+ computeValue: (compilerOptions) => {
20539
+ return typeof compilerOptions.module === "number" ? compilerOptions.module : computedOptions.target.computeValue(compilerOptions) >= 2 /* ES2015 */ ? 5 /* ES2015 */ : 1 /* CommonJS */;
20540
+ }
20541
+ },
20542
+ moduleResolution: {
20543
+ dependencies: ["module", "target"],
20544
+ computeValue: (compilerOptions) => {
20545
+ let moduleResolution = compilerOptions.moduleResolution;
20546
+ if (moduleResolution === void 0) {
20547
+ switch (computedOptions.module.computeValue(compilerOptions)) {
20548
+ case 1 /* CommonJS */:
20549
+ moduleResolution = 2 /* Node10 */;
20550
+ break;
20551
+ case 100 /* Node16 */:
20552
+ moduleResolution = 3 /* Node16 */;
20553
+ break;
20554
+ case 199 /* NodeNext */:
20555
+ moduleResolution = 99 /* NodeNext */;
20556
+ break;
20557
+ default:
20558
+ moduleResolution = 1 /* Classic */;
20559
+ break;
20560
+ }
20561
+ }
20562
+ return moduleResolution;
20563
+ }
20564
+ },
20565
+ moduleDetection: {
20566
+ dependencies: ["module", "target"],
20567
+ computeValue: (compilerOptions) => {
20568
+ return compilerOptions.moduleDetection || (computedOptions.module.computeValue(compilerOptions) === 100 /* Node16 */ || computedOptions.module.computeValue(compilerOptions) === 199 /* NodeNext */ ? 3 /* Force */ : 2 /* Auto */);
20569
+ }
20570
+ },
20571
+ isolatedModules: {
20572
+ dependencies: ["verbatimModuleSyntax"],
20573
+ computeValue: (compilerOptions) => {
20574
+ return !!(compilerOptions.isolatedModules || compilerOptions.verbatimModuleSyntax);
20575
+ }
20576
+ },
20577
+ esModuleInterop: {
20578
+ dependencies: ["module", "target"],
20579
+ computeValue: (compilerOptions) => {
20580
+ if (compilerOptions.esModuleInterop !== void 0) {
20581
+ return compilerOptions.esModuleInterop;
20582
+ }
20583
+ switch (computedOptions.module.computeValue(compilerOptions)) {
20584
+ case 100 /* Node16 */:
20585
+ case 199 /* NodeNext */:
20586
+ return true;
20587
+ }
20588
+ return false;
20589
+ }
20590
+ },
20591
+ allowSyntheticDefaultImports: {
20592
+ dependencies: ["module", "target", "moduleResolution"],
20593
+ computeValue: (compilerOptions) => {
20594
+ if (compilerOptions.allowSyntheticDefaultImports !== void 0) {
20595
+ return compilerOptions.allowSyntheticDefaultImports;
20596
+ }
20597
+ return computedOptions.esModuleInterop.computeValue(compilerOptions) || computedOptions.module.computeValue(compilerOptions) === 4 /* System */ || computedOptions.moduleResolution.computeValue(compilerOptions) === 100 /* Bundler */;
20598
+ }
20599
+ },
20600
+ resolvePackageJsonExports: {
20601
+ dependencies: ["moduleResolution"],
20602
+ computeValue: (compilerOptions) => {
20603
+ const moduleResolution = computedOptions.moduleResolution.computeValue(compilerOptions);
20604
+ if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
20605
+ return false;
20606
+ }
20607
+ if (compilerOptions.resolvePackageJsonExports !== void 0) {
20608
+ return compilerOptions.resolvePackageJsonExports;
20609
+ }
20610
+ switch (moduleResolution) {
20611
+ case 3 /* Node16 */:
20612
+ case 99 /* NodeNext */:
20613
+ case 100 /* Bundler */:
20614
+ return true;
20615
+ }
20616
+ return false;
20617
+ }
20618
+ },
20619
+ resolvePackageJsonImports: {
20620
+ dependencies: ["moduleResolution", "resolvePackageJsonExports"],
20621
+ computeValue: (compilerOptions) => {
20622
+ const moduleResolution = computedOptions.moduleResolution.computeValue(compilerOptions);
20623
+ if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
20624
+ return false;
20625
+ }
20626
+ if (compilerOptions.resolvePackageJsonExports !== void 0) {
20627
+ return compilerOptions.resolvePackageJsonExports;
20628
+ }
20629
+ switch (moduleResolution) {
20630
+ case 3 /* Node16 */:
20631
+ case 99 /* NodeNext */:
20632
+ case 100 /* Bundler */:
20633
+ return true;
20634
+ }
20635
+ return false;
20636
+ }
20637
+ },
20638
+ resolveJsonModule: {
20639
+ dependencies: ["moduleResolution", "module", "target"],
20640
+ computeValue: (compilerOptions) => {
20641
+ if (compilerOptions.resolveJsonModule !== void 0) {
20642
+ return compilerOptions.resolveJsonModule;
20643
+ }
20644
+ return computedOptions.moduleResolution.computeValue(compilerOptions) === 100 /* Bundler */;
20645
+ }
20646
+ },
20647
+ declaration: {
20648
+ dependencies: ["composite"],
20649
+ computeValue: (compilerOptions) => {
20650
+ return !!(compilerOptions.declaration || compilerOptions.composite);
20651
+ }
20652
+ },
20653
+ preserveConstEnums: {
20654
+ dependencies: ["isolatedModules", "verbatimModuleSyntax"],
20655
+ computeValue: (compilerOptions) => {
20656
+ return !!(compilerOptions.preserveConstEnums || computedOptions.isolatedModules.computeValue(compilerOptions));
20657
+ }
20658
+ },
20659
+ incremental: {
20660
+ dependencies: ["composite"],
20661
+ computeValue: (compilerOptions) => {
20662
+ return !!(compilerOptions.incremental || compilerOptions.composite);
20663
+ }
20664
+ },
20665
+ declarationMap: {
20666
+ dependencies: ["declaration", "composite"],
20667
+ computeValue: (compilerOptions) => {
20668
+ return !!(compilerOptions.declarationMap && computedOptions.declaration.computeValue(compilerOptions));
20669
+ }
20670
+ },
20671
+ allowJs: {
20672
+ dependencies: ["checkJs"],
20673
+ computeValue: (compilerOptions) => {
20674
+ return compilerOptions.allowJs === void 0 ? !!compilerOptions.checkJs : compilerOptions.allowJs;
20675
+ }
20676
+ },
20677
+ useDefineForClassFields: {
20678
+ dependencies: ["target", "module"],
20679
+ computeValue: (compilerOptions) => {
20680
+ return compilerOptions.useDefineForClassFields === void 0 ? computedOptions.target.computeValue(compilerOptions) >= 9 /* ES2022 */ : compilerOptions.useDefineForClassFields;
20681
+ }
20682
+ },
20683
+ noImplicitAny: {
20684
+ dependencies: ["strict"],
20685
+ computeValue: (compilerOptions) => {
20686
+ return getStrictOptionValue(compilerOptions, "noImplicitAny");
20687
+ }
20688
+ },
20689
+ noImplicitThis: {
20690
+ dependencies: ["strict"],
20691
+ computeValue: (compilerOptions) => {
20692
+ return getStrictOptionValue(compilerOptions, "noImplicitThis");
20693
+ }
20694
+ },
20695
+ strictNullChecks: {
20696
+ dependencies: ["strict"],
20697
+ computeValue: (compilerOptions) => {
20698
+ return getStrictOptionValue(compilerOptions, "strictNullChecks");
20699
+ }
20700
+ },
20701
+ strictFunctionTypes: {
20702
+ dependencies: ["strict"],
20703
+ computeValue: (compilerOptions) => {
20704
+ return getStrictOptionValue(compilerOptions, "strictFunctionTypes");
20705
+ }
20706
+ },
20707
+ strictBindCallApply: {
20708
+ dependencies: ["strict"],
20709
+ computeValue: (compilerOptions) => {
20710
+ return getStrictOptionValue(compilerOptions, "strictBindCallApply");
20711
+ }
20712
+ },
20713
+ strictPropertyInitialization: {
20714
+ dependencies: ["strict"],
20715
+ computeValue: (compilerOptions) => {
20716
+ return getStrictOptionValue(compilerOptions, "strictPropertyInitialization");
20717
+ }
20718
+ },
20719
+ alwaysStrict: {
20720
+ dependencies: ["strict"],
20721
+ computeValue: (compilerOptions) => {
20722
+ return getStrictOptionValue(compilerOptions, "alwaysStrict");
20723
+ }
20724
+ },
20725
+ useUnknownInCatchVariables: {
20726
+ dependencies: ["strict"],
20727
+ computeValue: (compilerOptions) => {
20728
+ return getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
20549
20729
  }
20550
20730
  }
20551
- return moduleResolution;
20552
- }
20553
- function getEmitModuleDetectionKind(options) {
20554
- return options.moduleDetection || (getEmitModuleKind(options) === 100 /* Node16 */ || getEmitModuleKind(options) === 199 /* NodeNext */ ? 3 /* Force */ : 2 /* Auto */);
20731
+ });
20732
+ var getEmitScriptTarget = computedOptions.target.computeValue;
20733
+ var getEmitModuleKind = computedOptions.module.computeValue;
20734
+ var getEmitModuleResolutionKind = computedOptions.moduleResolution.computeValue;
20735
+ var getEmitModuleDetectionKind = computedOptions.moduleDetection.computeValue;
20736
+ var getIsolatedModules = computedOptions.isolatedModules.computeValue;
20737
+ var getESModuleInterop = computedOptions.esModuleInterop.computeValue;
20738
+ var getAllowSyntheticDefaultImports = computedOptions.allowSyntheticDefaultImports.computeValue;
20739
+ var getResolvePackageJsonExports = computedOptions.resolvePackageJsonExports.computeValue;
20740
+ var getResolvePackageJsonImports = computedOptions.resolvePackageJsonImports.computeValue;
20741
+ var getResolveJsonModule = computedOptions.resolveJsonModule.computeValue;
20742
+ var getEmitDeclarations = computedOptions.declaration.computeValue;
20743
+ var shouldPreserveConstEnums = computedOptions.preserveConstEnums.computeValue;
20744
+ var isIncrementalCompilation = computedOptions.incremental.computeValue;
20745
+ var getAreDeclarationMapsEnabled = computedOptions.declarationMap.computeValue;
20746
+ var getAllowJSCompilerOption = computedOptions.allowJs.computeValue;
20747
+ var getUseDefineForClassFields = computedOptions.useDefineForClassFields.computeValue;
20748
+ function emitModuleKindIsNonNodeESM(moduleKind) {
20749
+ return moduleKind >= 5 /* ES2015 */ && moduleKind <= 99 /* ESNext */;
20555
20750
  }
20556
20751
  function hasJsonModuleEmitEnabled(options) {
20557
20752
  switch (getEmitModuleKind(options)) {
@@ -20568,9 +20763,6 @@ function hasJsonModuleEmitEnabled(options) {
20568
20763
  return false;
20569
20764
  }
20570
20765
  }
20571
- function getIsolatedModules(options) {
20572
- return !!(options.isolatedModules || options.verbatimModuleSyntax);
20573
- }
20574
20766
  function importNameElisionDisabled(options) {
20575
20767
  return options.verbatimModuleSyntax || options.isolatedModules && options.preserveValueImports;
20576
20768
  }
@@ -20580,88 +20772,15 @@ function unreachableCodeIsError(options) {
20580
20772
  function unusedLabelIsError(options) {
20581
20773
  return options.allowUnusedLabels === false;
20582
20774
  }
20583
- function getAreDeclarationMapsEnabled(options) {
20584
- return !!(getEmitDeclarations(options) && options.declarationMap);
20585
- }
20586
- function getESModuleInterop(compilerOptions) {
20587
- if (compilerOptions.esModuleInterop !== void 0) {
20588
- return compilerOptions.esModuleInterop;
20589
- }
20590
- switch (getEmitModuleKind(compilerOptions)) {
20591
- case 100 /* Node16 */:
20592
- case 199 /* NodeNext */:
20593
- return true;
20594
- }
20595
- return void 0;
20596
- }
20597
- function getAllowSyntheticDefaultImports(compilerOptions) {
20598
- if (compilerOptions.allowSyntheticDefaultImports !== void 0) {
20599
- return compilerOptions.allowSyntheticDefaultImports;
20600
- }
20601
- return getESModuleInterop(compilerOptions) || getEmitModuleKind(compilerOptions) === 4 /* System */ || getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */;
20602
- }
20603
20775
  function moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution) {
20604
20776
  return moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */ || moduleResolution === 100 /* Bundler */;
20605
20777
  }
20606
20778
  function shouldResolveJsRequire(compilerOptions) {
20607
20779
  return !!compilerOptions.noDtsResolution || getEmitModuleResolutionKind(compilerOptions) !== 100 /* Bundler */;
20608
20780
  }
20609
- function getResolvePackageJsonExports(compilerOptions) {
20610
- const moduleResolution = getEmitModuleResolutionKind(compilerOptions);
20611
- if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
20612
- return false;
20613
- }
20614
- if (compilerOptions.resolvePackageJsonExports !== void 0) {
20615
- return compilerOptions.resolvePackageJsonExports;
20616
- }
20617
- switch (moduleResolution) {
20618
- case 3 /* Node16 */:
20619
- case 99 /* NodeNext */:
20620
- case 100 /* Bundler */:
20621
- return true;
20622
- }
20623
- return false;
20624
- }
20625
- function getResolvePackageJsonImports(compilerOptions) {
20626
- const moduleResolution = getEmitModuleResolutionKind(compilerOptions);
20627
- if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
20628
- return false;
20629
- }
20630
- if (compilerOptions.resolvePackageJsonExports !== void 0) {
20631
- return compilerOptions.resolvePackageJsonExports;
20632
- }
20633
- switch (moduleResolution) {
20634
- case 3 /* Node16 */:
20635
- case 99 /* NodeNext */:
20636
- case 100 /* Bundler */:
20637
- return true;
20638
- }
20639
- return false;
20640
- }
20641
- function getResolveJsonModule(compilerOptions) {
20642
- if (compilerOptions.resolveJsonModule !== void 0) {
20643
- return compilerOptions.resolveJsonModule;
20644
- }
20645
- return getEmitModuleResolutionKind(compilerOptions) === 100 /* Bundler */;
20646
- }
20647
- function getEmitDeclarations(compilerOptions) {
20648
- return !!(compilerOptions.declaration || compilerOptions.composite);
20649
- }
20650
- function shouldPreserveConstEnums(compilerOptions) {
20651
- return !!(compilerOptions.preserveConstEnums || getIsolatedModules(compilerOptions));
20652
- }
20653
- function isIncrementalCompilation(options) {
20654
- return !!(options.incremental || options.composite);
20655
- }
20656
20781
  function getStrictOptionValue(compilerOptions, flag) {
20657
20782
  return compilerOptions[flag] === void 0 ? !!compilerOptions.strict : !!compilerOptions[flag];
20658
20783
  }
20659
- function getAllowJSCompilerOption(compilerOptions) {
20660
- return compilerOptions.allowJs === void 0 ? !!compilerOptions.checkJs : compilerOptions.allowJs;
20661
- }
20662
- function getUseDefineForClassFields(compilerOptions) {
20663
- return compilerOptions.useDefineForClassFields === void 0 ? getEmitScriptTarget(compilerOptions) >= 9 /* ES2022 */ : compilerOptions.useDefineForClassFields;
20664
- }
20665
20784
  function getEmitStandardClassFields(compilerOptions) {
20666
20785
  return compilerOptions.useDefineForClassFields !== false && getEmitScriptTarget(compilerOptions) >= 9 /* ES2022 */;
20667
20786
  }
@@ -23072,8 +23191,10 @@ function createNodeFactory(flags, baseFactory2) {
23072
23191
  return update(updated, original);
23073
23192
  }
23074
23193
  function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
23194
+ const text = typeof value === "number" ? value + "" : value;
23195
+ Debug.assert(text.charCodeAt(0) !== 45 /* minus */, "Negative numbers should be created in combination with createPrefixUnaryExpression");
23075
23196
  const node = createBaseDeclaration(9 /* NumericLiteral */);
23076
- node.text = typeof value === "number" ? value + "" : value;
23197
+ node.text = text;
23077
23198
  node.numericLiteralFlags = numericLiteralFlags;
23078
23199
  if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
23079
23200
  node.transformFlags |= 1024 /* ContainsES2015 */;
@@ -40332,7 +40453,8 @@ function convertToTSConfig(configParseResult, configFileName, host) {
40332
40453
  ),
40333
40454
  (f) => getRelativePathFromFile(getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), getNormalizedAbsolutePath(f, host.getCurrentDirectory()), getCanonicalFileName)
40334
40455
  );
40335
- const optionMap = serializeCompilerOptions(configParseResult.options, { configFilePath: getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), useCaseSensitiveFileNames: host.useCaseSensitiveFileNames });
40456
+ const pathOptions = { configFilePath: getNormalizedAbsolutePath(configFileName, host.getCurrentDirectory()), useCaseSensitiveFileNames: host.useCaseSensitiveFileNames };
40457
+ const optionMap = serializeCompilerOptions(configParseResult.options, pathOptions);
40336
40458
  const watchOptionMap = configParseResult.watchOptions && serializeWatchOptions(configParseResult.watchOptions);
40337
40459
  const config = {
40338
40460
  compilerOptions: {
@@ -40357,6 +40479,18 @@ function convertToTSConfig(configParseResult, configFileName, host) {
40357
40479
  } : {},
40358
40480
  compileOnSave: !!configParseResult.compileOnSave ? true : void 0
40359
40481
  };
40482
+ const providedKeys = new Set(optionMap.keys());
40483
+ const impliedCompilerOptions = {};
40484
+ for (const option in computedOptions) {
40485
+ if (!providedKeys.has(option) && some(computedOptions[option].dependencies, (dep) => providedKeys.has(dep))) {
40486
+ const implied = computedOptions[option].computeValue(configParseResult.options);
40487
+ const defaultValue = computedOptions[option].computeValue({});
40488
+ if (implied !== defaultValue) {
40489
+ impliedCompilerOptions[option] = computedOptions[option].computeValue(configParseResult.options);
40490
+ }
40491
+ }
40492
+ }
40493
+ assign(config.compilerOptions, optionMapToObject(serializeCompilerOptions(impliedCompilerOptions, pathOptions)));
40360
40494
  return config;
40361
40495
  }
40362
40496
  function optionMapToObject(optionMap) {
@@ -54296,7 +54430,7 @@ function createTypeChecker(host) {
54296
54430
  return factory.createStringLiteral(name, !!singleQuote);
54297
54431
  }
54298
54432
  if (isNumericLiteralName(name) && startsWith(name, "-")) {
54299
- return factory.createComputedPropertyName(factory.createNumericLiteral(+name));
54433
+ return factory.createComputedPropertyName(factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createNumericLiteral(-name)));
54300
54434
  }
54301
54435
  return createPropertyNameNodeForIdentifierOrLiteral(name, getEmitScriptTarget(compilerOptions), singleQuote, stringNamed, isMethod);
54302
54436
  }
@@ -58362,11 +58496,10 @@ function createTypeChecker(host) {
58362
58496
  const baseTypes = getBaseTypes(source);
58363
58497
  if (baseTypes.length) {
58364
58498
  if (source.symbol && members === getMembersOfSymbol(source.symbol)) {
58365
- const symbolTable = createSymbolTable();
58366
- for (const symbol of members.values()) {
58367
- if (!(symbol.flags & 262144 /* TypeParameter */)) {
58368
- symbolTable.set(symbol.escapedName, symbol);
58369
- }
58499
+ const symbolTable = createSymbolTable(source.declaredProperties);
58500
+ const sourceIndex = getIndexSymbol(source.symbol);
58501
+ if (sourceIndex) {
58502
+ symbolTable.set("__index" /* Index */, sourceIndex);
58370
58503
  }
58371
58504
  members = symbolTable;
58372
58505
  }
@@ -63031,7 +63164,9 @@ function createTypeChecker(host) {
63031
63164
  if (checkType === wildcardType || extendsType === wildcardType) {
63032
63165
  return wildcardType;
63033
63166
  }
63034
- const checkTuples = isSimpleTupleType(root.node.checkType) && isSimpleTupleType(root.node.extendsType) && length(root.node.checkType.elements) === length(root.node.extendsType.elements);
63167
+ const checkTypeNode = skipTypeParentheses(root.node.checkType);
63168
+ const extendsTypeNode = skipTypeParentheses(root.node.extendsType);
63169
+ const checkTuples = isSimpleTupleType(checkTypeNode) && isSimpleTupleType(extendsTypeNode) && length(checkTypeNode.elements) === length(extendsTypeNode.elements);
63035
63170
  const checkTypeDeferred = isDeferredType(checkType, checkTuples);
63036
63171
  let combinedMapper;
63037
63172
  if (root.inferTypeParameters) {
@@ -87377,7 +87512,7 @@ function createTypeChecker(host) {
87377
87512
  if (enumResult)
87378
87513
  return enumResult;
87379
87514
  const literalValue = type.value;
87380
- return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "number" ? factory.createNumericLiteral(literalValue) : factory.createStringLiteral(literalValue);
87515
+ return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "string" ? factory.createStringLiteral(literalValue) : literalValue < 0 ? factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createNumericLiteral(-literalValue)) : factory.createNumericLiteral(literalValue);
87381
87516
  }
87382
87517
  function createLiteralConstValue(node, tracker) {
87383
87518
  const type = getTypeOfSymbol(getSymbolOfDeclaration(node));
@@ -93977,7 +94112,7 @@ function transformTypeScript(context) {
93977
94112
  function transformEnumMemberDeclarationValue(member) {
93978
94113
  const value = resolver.getConstantValue(member);
93979
94114
  if (value !== void 0) {
93980
- return typeof value === "string" ? factory2.createStringLiteral(value) : factory2.createNumericLiteral(value);
94115
+ return typeof value === "string" ? factory2.createStringLiteral(value) : value < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-value)) : factory2.createNumericLiteral(value);
93981
94116
  } else {
93982
94117
  enableSubstitutionForNonQualifiedEnumMembers();
93983
94118
  if (member.initializer) {
@@ -94507,7 +94642,7 @@ function transformTypeScript(context) {
94507
94642
  const constantValue = tryGetConstEnumValue(node);
94508
94643
  if (constantValue !== void 0) {
94509
94644
  setConstantValue(node, constantValue);
94510
- const substitute = typeof constantValue === "string" ? factory2.createStringLiteral(constantValue) : constantValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(Math.abs(constantValue))) : factory2.createNumericLiteral(constantValue);
94645
+ const substitute = typeof constantValue === "string" ? factory2.createStringLiteral(constantValue) : constantValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-constantValue)) : factory2.createNumericLiteral(constantValue);
94511
94646
  if (!compilerOptions.removeComments) {
94512
94647
  const originalNode = getOriginalNode(node, isAccessExpression);
94513
94648
  addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, ` ${safeMultiLineComment(getTextOfNode(originalNode))} `);
@@ -108297,7 +108432,7 @@ function transformGenerators(context) {
108297
108432
  if (labelExpressions === void 0) {
108298
108433
  labelExpressions = [];
108299
108434
  }
108300
- const expression = factory2.createNumericLiteral(-1);
108435
+ const expression = factory2.createNumericLiteral(Number.MAX_SAFE_INTEGER);
108301
108436
  if (labelExpressions[label] === void 0) {
108302
108437
  labelExpressions[label] = [expression];
108303
108438
  } else {
@@ -114172,7 +114307,8 @@ function transformDeclarations(context) {
114172
114307
  if (shouldStripInternal(m))
114173
114308
  return;
114174
114309
  const constValue = resolver.getConstantValue(m);
114175
- return preserveJsDoc(factory2.updateEnumMember(m, m.name, constValue !== void 0 ? typeof constValue === "string" ? factory2.createStringLiteral(constValue) : factory2.createNumericLiteral(constValue) : void 0), m);
114310
+ const newInitializer = constValue === void 0 ? void 0 : typeof constValue === "string" ? factory2.createStringLiteral(constValue) : constValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-constValue)) : factory2.createNumericLiteral(constValue);
114311
+ return preserveJsDoc(factory2.updateEnumMember(m, m.name, newInitializer), m);
114176
114312
  }))
114177
114313
  ));
114178
114314
  }
@@ -116073,6 +116209,8 @@ function createPrinter(printerOptions = {}, handlers = {}) {
116073
116209
  );
116074
116210
  if (hint === 3 /* MappedTypeParameter */)
116075
116211
  return emitMappedTypeParameter(cast(node, isTypeParameterDeclaration));
116212
+ if (hint === 7 /* ImportTypeNodeAttributes */)
116213
+ return emitImportTypeNodeAttributes(cast(node, isImportAttributes));
116076
116214
  if (hint === 5 /* EmbeddedStatement */) {
116077
116215
  Debug.assertNode(node, isEmptyStatement);
116078
116216
  return emitEmptyStatement(
@@ -117049,15 +117187,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
117049
117187
  if (node.attributes) {
117050
117188
  writePunctuation(",");
117051
117189
  writeSpace();
117052
- writePunctuation("{");
117053
- writeSpace();
117054
- writeKeyword(node.attributes.token === 132 /* AssertKeyword */ ? "assert" : "with");
117055
- writePunctuation(":");
117056
- writeSpace();
117057
- const elements = node.attributes.elements;
117058
- emitList(node.attributes, elements, 526226 /* ImportAttributes */);
117059
- writeSpace();
117060
- writePunctuation("}");
117190
+ pipelineEmit(7 /* ImportTypeNodeAttributes */, node.attributes);
117061
117191
  }
117062
117192
  writePunctuation(")");
117063
117193
  if (node.qualifier) {
@@ -118119,6 +118249,17 @@ function createPrinter(printerOptions = {}, handlers = {}) {
118119
118249
  }
118120
118250
  writeTrailingSemicolon();
118121
118251
  }
118252
+ function emitImportTypeNodeAttributes(node) {
118253
+ writePunctuation("{");
118254
+ writeSpace();
118255
+ writeKeyword(node.token === 132 /* AssertKeyword */ ? "assert" : "with");
118256
+ writePunctuation(":");
118257
+ writeSpace();
118258
+ const elements = node.elements;
118259
+ emitList(node, elements, 526226 /* ImportAttributes */);
118260
+ writeSpace();
118261
+ writePunctuation("}");
118262
+ }
118122
118263
  function emitImportAttributes(node) {
118123
118264
  emitTokenWithComment(node.token, node.pos, writeKeyword, node);
118124
118265
  writeSpace();
@@ -159762,7 +159903,6 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
159762
159903
  }
159763
159904
  const semanticStart = timestamp();
159764
159905
  let completionKind = 5 /* None */;
159765
- let isNonContextualObjectLiteral = false;
159766
159906
  let hasUnresolvedAutoImports = false;
159767
159907
  let symbols = [];
159768
159908
  let importSpecifierResolver;
@@ -160122,8 +160262,6 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
160122
160262
  function shouldOfferImportCompletions() {
160123
160263
  if (importStatementCompletion)
160124
160264
  return true;
160125
- if (isNonContextualObjectLiteral)
160126
- return false;
160127
160265
  if (!preferences.includeCompletionsForModuleExports)
160128
160266
  return false;
160129
160267
  if (sourceFile.externalModuleIndicator || sourceFile.commonJsModuleIndicator)
@@ -160426,7 +160564,6 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
160426
160564
  if (objectLikeContainer.flags & 67108864 /* InWithStatement */) {
160427
160565
  return 2 /* Fail */;
160428
160566
  }
160429
- isNonContextualObjectLiteral = true;
160430
160567
  return 0 /* Continue */;
160431
160568
  }
160432
160569
  const completionsType = typeChecker.getContextualType(objectLikeContainer, 4 /* Completions */);
@@ -160437,7 +160574,6 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
160437
160574
  existingMembers = objectLikeContainer.properties;
160438
160575
  if (typeMembers.length === 0) {
160439
160576
  if (!hasNumberIndextype) {
160440
- isNonContextualObjectLiteral = true;
160441
160577
  return 0 /* Continue */;
160442
160578
  }
160443
160579
  }
@@ -165954,9 +166090,8 @@ function provideInlayHints(context) {
165954
166090
  break;
165955
166091
  case 181 /* IndexSignature */:
165956
166092
  Debug.assertNode(node, isIndexSignatureDeclaration);
165957
- Debug.assertEqual(node.parameters.length, 1);
165958
166093
  parts.push({ text: "[" });
165959
- visitForDisplayParts(node.parameters[0]);
166094
+ visitDisplayPartList(node.parameters, ", ");
165960
166095
  parts.push({ text: "]" });
165961
166096
  if (node.type) {
165962
166097
  parts.push({ text: ": " });
@@ -167623,16 +167758,16 @@ function getRenameInfoForModule(node, sourceFile, moduleSymbol) {
167623
167758
  if (!moduleSourceFile)
167624
167759
  return void 0;
167625
167760
  const withoutIndex = endsWith(node.text, "/index") || endsWith(node.text, "/index.js") ? void 0 : tryRemoveSuffix(removeFileExtension(moduleSourceFile.fileName), "/index");
167626
- const name = withoutIndex === void 0 ? moduleSourceFile.fileName : withoutIndex;
167761
+ const fileName = withoutIndex === void 0 ? moduleSourceFile.fileName : withoutIndex;
167627
167762
  const kind = withoutIndex === void 0 ? "module" /* moduleElement */ : "directory" /* directory */;
167628
167763
  const indexAfterLastSlash = node.text.lastIndexOf("/") + 1;
167629
167764
  const triggerSpan = createTextSpan(node.getStart(sourceFile) + 1 + indexAfterLastSlash, node.text.length - indexAfterLastSlash);
167630
167765
  return {
167631
167766
  canRename: true,
167632
- fileToRename: name,
167767
+ fileToRename: fileName,
167633
167768
  kind,
167634
- displayName: name,
167635
- fullDisplayName: name,
167769
+ displayName: fileName,
167770
+ fullDisplayName: node.text,
167636
167771
  kindModifiers: "" /* none */,
167637
167772
  triggerSpan
167638
167773
  };
@@ -173454,6 +173589,7 @@ __export(ts_exports2, {
173454
173589
  computeSignature: () => computeSignature,
173455
173590
  computeSignatureWithDiagnostics: () => computeSignatureWithDiagnostics,
173456
173591
  computeSuggestionDiagnostics: () => computeSuggestionDiagnostics,
173592
+ computedOptions: () => computedOptions,
173457
173593
  concatenate: () => concatenate,
173458
173594
  concatenateDiagnosticMessageChains: () => concatenateDiagnosticMessageChains,
173459
173595
  consumesNodeCoreModules: () => consumesNodeCoreModules,
@@ -188248,6 +188384,7 @@ start(initializeNodeSystem(), require("os").platform());
188248
188384
  computeSignature,
188249
188385
  computeSignatureWithDiagnostics,
188250
188386
  computeSuggestionDiagnostics,
188387
+ computedOptions,
188251
188388
  concatenate,
188252
188389
  concatenateDiagnosticMessageChains,
188253
188390
  consumesNodeCoreModules,
@@ -1087,6 +1087,7 @@ declare namespace ts {
1087
1087
  displayName: string;
1088
1088
  /**
1089
1089
  * Full display name of item to be renamed.
1090
+ * If item to be renamed is a file, then this is the original text of the module specifer
1090
1091
  */
1091
1092
  fullDisplayName: string;
1092
1093
  /**
@@ -6831,6 +6832,20 @@ declare namespace ts {
6831
6832
  * is `never`. Instead, use `type.flags & TypeFlags.Never`.
6832
6833
  */
6833
6834
  getNeverType(): Type;
6835
+ /**
6836
+ * Returns true if the "source" type is assignable to the "target" type.
6837
+ *
6838
+ * ```ts
6839
+ * declare const abcLiteral: ts.Type; // Type of "abc"
6840
+ * declare const stringType: ts.Type; // Type of string
6841
+ *
6842
+ * isTypeAssignableTo(abcLiteral, abcLiteral); // true; "abc" is assignable to "abc"
6843
+ * isTypeAssignableTo(abcLiteral, stringType); // true; "abc" is assignable to string
6844
+ * isTypeAssignableTo(stringType, abcLiteral); // false; string is not assignable to "abc"
6845
+ * isTypeAssignableTo(stringType, stringType); // true; string is assignable to string
6846
+ * ```
6847
+ */
6848
+ isTypeAssignableTo(source: Type, target: Type): boolean;
6834
6849
  /**
6835
6850
  * True if this type is the `Array` or `ReadonlyArray` type from lib.d.ts.
6836
6851
  * This function will _not_ return true if passed a type which
@@ -7896,6 +7911,7 @@ declare namespace ts {
7896
7911
  Unspecified = 4,
7897
7912
  EmbeddedStatement = 5,
7898
7913
  JsxAttributeValue = 6,
7914
+ ImportTypeNodeAttributes = 7,
7899
7915
  }
7900
7916
  enum OuterExpressionKinds {
7901
7917
  Parentheses = 1,
@@ -11091,6 +11107,10 @@ declare namespace ts {
11091
11107
  */
11092
11108
  fileToRename?: string;
11093
11109
  displayName: string;
11110
+ /**
11111
+ * Full display name of item to be renamed.
11112
+ * If item to be renamed is a file, then this is the original text of the module specifer
11113
+ */
11094
11114
  fullDisplayName: string;
11095
11115
  kind: ScriptElementKind;
11096
11116
  kindModifiers: string;