typescript 5.3.0-dev.20231102 → 5.4.0-dev.20231103

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
@@ -2327,8 +2327,8 @@ __export(server_exports, {
2327
2327
  module.exports = __toCommonJS(server_exports);
2328
2328
 
2329
2329
  // src/compiler/corePublic.ts
2330
- var versionMajorMinor = "5.3";
2331
- var version = `${versionMajorMinor}.0-dev.20231102`;
2330
+ var versionMajorMinor = "5.4";
2331
+ var version = `${versionMajorMinor}.0-dev.20231103`;
2332
2332
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2333
2333
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2334
2334
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -114634,27 +114634,6 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
114634
114634
  (_e = tracing) == null ? void 0 : _e.push(tracing.Phase.Emit, "emitBuildInfo", { buildInfoPath });
114635
114635
  emitBuildInfo(bundleBuildInfo, buildInfoPath);
114636
114636
  (_f = tracing) == null ? void 0 : _f.pop();
114637
- if (!emitSkipped && emittedFilesList) {
114638
- if (!emitOnly) {
114639
- if (jsFilePath) {
114640
- emittedFilesList.push(jsFilePath);
114641
- }
114642
- if (sourceMapFilePath) {
114643
- emittedFilesList.push(sourceMapFilePath);
114644
- }
114645
- if (buildInfoPath) {
114646
- emittedFilesList.push(buildInfoPath);
114647
- }
114648
- }
114649
- if (emitOnly !== 0 /* Js */) {
114650
- if (declarationFilePath) {
114651
- emittedFilesList.push(declarationFilePath);
114652
- }
114653
- if (declarationMapPath) {
114654
- emittedFilesList.push(declarationMapPath);
114655
- }
114656
- }
114657
- }
114658
114637
  function relativeToBuildInfo(path) {
114659
114638
  return ensurePathIsNonModuleName(getRelativePathFromDirectory(buildInfoDirectory, path, host.getCanonicalFileName));
114660
114639
  }
@@ -114682,6 +114661,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
114682
114661
  void 0,
114683
114662
  { buildInfo }
114684
114663
  );
114664
+ emittedFilesList == null ? void 0 : emittedFilesList.push(buildInfoPath);
114685
114665
  }
114686
114666
  function emitJsFileOrBundle(sourceFileOrBundle, jsFilePath, sourceMapFilePath, relativeToBuildInfo) {
114687
114667
  if (!sourceFileOrBundle || emitOnly || !jsFilePath) {
@@ -114727,6 +114707,12 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
114727
114707
  transform2.dispose();
114728
114708
  if (bundleBuildInfo)
114729
114709
  bundleBuildInfo.js = printer.bundleFileInfo;
114710
+ if (emittedFilesList) {
114711
+ emittedFilesList.push(jsFilePath);
114712
+ if (sourceMapFilePath) {
114713
+ emittedFilesList.push(sourceMapFilePath);
114714
+ }
114715
+ }
114730
114716
  }
114731
114717
  function emitDeclarationFileOrBundle(sourceFileOrBundle, declarationFilePath, declarationMapPath, relativeToBuildInfo) {
114732
114718
  if (!sourceFileOrBundle || emitOnly === 0 /* Js */)
@@ -114757,33 +114743,33 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
114757
114743
  emitterDiagnostics.add(diagnostic);
114758
114744
  }
114759
114745
  }
114760
- const printerOptions = {
114761
- removeComments: compilerOptions.removeComments,
114762
- newLine: compilerOptions.newLine,
114763
- noEmitHelpers: true,
114764
- module: compilerOptions.module,
114765
- target: compilerOptions.target,
114766
- sourceMap: !forceDtsEmit && compilerOptions.declarationMap,
114767
- inlineSourceMap: compilerOptions.inlineSourceMap,
114768
- extendedDiagnostics: compilerOptions.extendedDiagnostics,
114769
- onlyPrintJsDocStyle: true,
114770
- omitBraceSourceMapPositions: true,
114771
- writeBundleFileInfo: !!bundleBuildInfo,
114772
- recordInternalSection: !!bundleBuildInfo,
114773
- relativeToBuildInfo
114774
- };
114775
- const declarationPrinter = createPrinter(printerOptions, {
114776
- // resolver hooks
114777
- hasGlobalName: resolver.hasGlobalName,
114778
- // transform hooks
114779
- onEmitNode: declarationTransform.emitNodeWithNotification,
114780
- isEmitNotificationEnabled: declarationTransform.isEmitNotificationEnabled,
114781
- substituteNode: declarationTransform.substituteNode
114782
- });
114783
114746
  const declBlocked = !!declarationTransform.diagnostics && !!declarationTransform.diagnostics.length || !!host.isEmitBlocked(declarationFilePath) || !!compilerOptions.noEmit;
114784
114747
  emitSkipped = emitSkipped || declBlocked;
114785
114748
  if (!declBlocked || forceDtsEmit) {
114786
114749
  Debug.assert(declarationTransform.transformed.length === 1, "Should only see one output from the decl transform");
114750
+ const printerOptions = {
114751
+ removeComments: compilerOptions.removeComments,
114752
+ newLine: compilerOptions.newLine,
114753
+ noEmitHelpers: true,
114754
+ module: compilerOptions.module,
114755
+ target: compilerOptions.target,
114756
+ sourceMap: !forceDtsEmit && compilerOptions.declarationMap,
114757
+ inlineSourceMap: compilerOptions.inlineSourceMap,
114758
+ extendedDiagnostics: compilerOptions.extendedDiagnostics,
114759
+ onlyPrintJsDocStyle: true,
114760
+ omitBraceSourceMapPositions: true,
114761
+ writeBundleFileInfo: !!bundleBuildInfo,
114762
+ recordInternalSection: !!bundleBuildInfo,
114763
+ relativeToBuildInfo
114764
+ };
114765
+ const declarationPrinter = createPrinter(printerOptions, {
114766
+ // resolver hooks
114767
+ hasGlobalName: resolver.hasGlobalName,
114768
+ // transform hooks
114769
+ onEmitNode: declarationTransform.emitNodeWithNotification,
114770
+ isEmitNotificationEnabled: declarationTransform.isEmitNotificationEnabled,
114771
+ substituteNode: declarationTransform.substituteNode
114772
+ });
114787
114773
  printSourceFileOrBundle(
114788
114774
  declarationFilePath,
114789
114775
  declarationMapPath,
@@ -114797,10 +114783,16 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
114797
114783
  // Explicitly do not passthru either `inline` option
114798
114784
  }
114799
114785
  );
114786
+ if (emittedFilesList) {
114787
+ emittedFilesList.push(declarationFilePath);
114788
+ if (declarationMapPath) {
114789
+ emittedFilesList.push(declarationMapPath);
114790
+ }
114791
+ }
114792
+ if (bundleBuildInfo)
114793
+ bundleBuildInfo.dts = declarationPrinter.bundleFileInfo;
114800
114794
  }
114801
114795
  declarationTransform.dispose();
114802
- if (bundleBuildInfo)
114803
- bundleBuildInfo.dts = declarationPrinter.bundleFileInfo;
114804
114796
  }
114805
114797
  function collectLinkedAliases(node) {
114806
114798
  if (isExportAssignment(node)) {
@@ -124924,6 +124916,7 @@ function createBuilderProgramState(newProgram, oldState) {
124924
124916
  const copyDeclarationFileDiagnostics = canCopySemanticDiagnostics && !compilerOptions.skipLibCheck === !oldCompilerOptions.skipLibCheck;
124925
124917
  const copyLibFileDiagnostics = copyDeclarationFileDiagnostics && !compilerOptions.skipDefaultLibCheck === !oldCompilerOptions.skipDefaultLibCheck;
124926
124918
  state.fileInfos.forEach((info, sourceFilePath) => {
124919
+ var _a2;
124927
124920
  let oldInfo;
124928
124921
  let newReferences;
124929
124922
  if (!useOldState || // File wasn't present in old state
@@ -124933,22 +124926,28 @@ function createBuilderProgramState(newProgram, oldState) {
124933
124926
  !hasSameKeys(newReferences = referencedMap && referencedMap.getValues(sourceFilePath), oldReferencedMap && oldReferencedMap.getValues(sourceFilePath)) || // Referenced file was deleted in the new program
124934
124927
  newReferences && forEachKey(newReferences, (path) => !state.fileInfos.has(path) && oldState.fileInfos.has(path))) {
124935
124928
  addFileToChangeSet(state, sourceFilePath);
124936
- } else if (canCopySemanticDiagnostics) {
124929
+ } else {
124937
124930
  const sourceFile = newProgram.getSourceFileByPath(sourceFilePath);
124938
- if (sourceFile.isDeclarationFile && !copyDeclarationFileDiagnostics)
124939
- return;
124940
- if (sourceFile.hasNoDefaultLib && !copyLibFileDiagnostics)
124941
- return;
124942
- const diagnostics = oldState.semanticDiagnosticsPerFile.get(sourceFilePath);
124943
- if (diagnostics) {
124944
- state.semanticDiagnosticsPerFile.set(
124931
+ const emitDiagnostics = (_a2 = oldState.emitDiagnosticsPerFile) == null ? void 0 : _a2.get(sourceFilePath);
124932
+ if (emitDiagnostics) {
124933
+ (state.emitDiagnosticsPerFile ?? (state.emitDiagnosticsPerFile = /* @__PURE__ */ new Map())).set(
124945
124934
  sourceFilePath,
124946
- oldState.hasReusableDiagnostic ? convertToDiagnostics(diagnostics, newProgram) : repopulateDiagnostics(diagnostics, newProgram)
124935
+ oldState.hasReusableDiagnostic ? convertToDiagnostics(emitDiagnostics, newProgram) : repopulateDiagnostics(emitDiagnostics, newProgram)
124947
124936
  );
124948
- if (!state.semanticDiagnosticsFromOldState) {
124949
- state.semanticDiagnosticsFromOldState = /* @__PURE__ */ new Set();
124937
+ }
124938
+ if (canCopySemanticDiagnostics) {
124939
+ if (sourceFile.isDeclarationFile && !copyDeclarationFileDiagnostics)
124940
+ return;
124941
+ if (sourceFile.hasNoDefaultLib && !copyLibFileDiagnostics)
124942
+ return;
124943
+ const diagnostics = oldState.semanticDiagnosticsPerFile.get(sourceFilePath);
124944
+ if (diagnostics) {
124945
+ state.semanticDiagnosticsPerFile.set(
124946
+ sourceFilePath,
124947
+ oldState.hasReusableDiagnostic ? convertToDiagnostics(diagnostics, newProgram) : repopulateDiagnostics(diagnostics, newProgram)
124948
+ );
124949
+ (state.semanticDiagnosticsFromOldState ?? (state.semanticDiagnosticsFromOldState = /* @__PURE__ */ new Set())).add(sourceFilePath);
124950
124950
  }
124951
- state.semanticDiagnosticsFromOldState.add(sourceFilePath);
124952
124951
  }
124953
124952
  }
124954
124953
  if (canCopyEmitSignatures) {
@@ -125085,7 +125084,9 @@ function backupBuilderProgramEmitState(state) {
125085
125084
  outSignature: state.outSignature,
125086
125085
  latestChangedDtsFile: state.latestChangedDtsFile,
125087
125086
  hasChangedEmitSignature: state.hasChangedEmitSignature,
125088
- changedFilesSet: outFilePath ? new Set(state.changedFilesSet) : void 0
125087
+ changedFilesSet: outFilePath ? new Set(state.changedFilesSet) : void 0,
125088
+ buildInfoEmitPending: state.buildInfoEmitPending,
125089
+ emitDiagnosticsPerFile: state.emitDiagnosticsPerFile && new Map(state.emitDiagnosticsPerFile)
125089
125090
  };
125090
125091
  }
125091
125092
  function restoreBuilderProgramEmitState(state, savedEmitState) {
@@ -125096,6 +125097,8 @@ function restoreBuilderProgramEmitState(state, savedEmitState) {
125096
125097
  state.outSignature = savedEmitState.outSignature;
125097
125098
  state.latestChangedDtsFile = savedEmitState.latestChangedDtsFile;
125098
125099
  state.hasChangedEmitSignature = savedEmitState.hasChangedEmitSignature;
125100
+ state.buildInfoEmitPending = savedEmitState.buildInfoEmitPending;
125101
+ state.emitDiagnosticsPerFile = savedEmitState.emitDiagnosticsPerFile;
125099
125102
  if (savedEmitState.changedFilesSet)
125100
125103
  state.changedFilesSet = savedEmitState.changedFilesSet;
125101
125104
  }
@@ -125186,6 +125189,22 @@ function getNextAffectedFilePendingEmit(state, emitOnlyDtsFiles) {
125186
125189
  return { affectedFile, emitKind: pendingKind };
125187
125190
  });
125188
125191
  }
125192
+ function getNextPendingEmitDiagnosticsFile(state) {
125193
+ var _a;
125194
+ if (!((_a = state.emitDiagnosticsPerFile) == null ? void 0 : _a.size))
125195
+ return void 0;
125196
+ return forEachEntry(state.emitDiagnosticsPerFile, (diagnostics, path) => {
125197
+ var _a2;
125198
+ const affectedFile = state.program.getSourceFileByPath(path);
125199
+ if (!affectedFile || !sourceFileMayBeEmitted(affectedFile, state.program)) {
125200
+ state.emitDiagnosticsPerFile.delete(path);
125201
+ return void 0;
125202
+ }
125203
+ const seenKind = ((_a2 = state.seenEmittedFiles) == null ? void 0 : _a2.get(affectedFile.resolvedPath)) || 0 /* None */;
125204
+ if (!(seenKind & 24 /* AllDts */))
125205
+ return { affectedFile, diagnostics, seenKind };
125206
+ });
125207
+ }
125189
125208
  function removeDiagnosticsOfLibraryFiles(state) {
125190
125209
  if (!state.cleanedDiagnosticsOfLibFiles) {
125191
125210
  state.cleanedDiagnosticsOfLibFiles = true;
@@ -125462,18 +125481,7 @@ function getBuildInfo2(state, bundle) {
125462
125481
  return void 0;
125463
125482
  });
125464
125483
  }
125465
- let semanticDiagnosticsPerFile;
125466
- if (state.semanticDiagnosticsPerFile) {
125467
- for (const key of arrayFrom(state.semanticDiagnosticsPerFile.keys()).sort(compareStringsCaseSensitive)) {
125468
- const value = state.semanticDiagnosticsPerFile.get(key);
125469
- (semanticDiagnosticsPerFile || (semanticDiagnosticsPerFile = [])).push(
125470
- value.length ? [
125471
- toFileId(key),
125472
- convertToReusableDiagnostics(value, relativeToBuildInfo)
125473
- ] : toFileId(key)
125474
- );
125475
- }
125476
- }
125484
+ const semanticDiagnosticsPerFile = convertToProgramBuildInfoDiagnostics(state.semanticDiagnosticsPerFile);
125477
125485
  let affectedFilesPendingEmit;
125478
125486
  if ((_c = state.affectedFilesPendingEmit) == null ? void 0 : _c.size) {
125479
125487
  const fullEmitForOptions = getBuilderFileEmit(state.compilerOptions);
@@ -125503,6 +125511,7 @@ function getBuildInfo2(state, bundle) {
125503
125511
  (changeFileSet || (changeFileSet = [])).push(toFileId(path));
125504
125512
  }
125505
125513
  }
125514
+ const emitDiagnosticsPerFile = convertToProgramBuildInfoDiagnostics(state.emitDiagnosticsPerFile);
125506
125515
  const program = {
125507
125516
  fileNames,
125508
125517
  fileInfos,
@@ -125512,6 +125521,7 @@ function getBuildInfo2(state, bundle) {
125512
125521
  referencedMap,
125513
125522
  exportedModulesMap,
125514
125523
  semanticDiagnosticsPerFile,
125524
+ emitDiagnosticsPerFile,
125515
125525
  affectedFilesPendingEmit,
125516
125526
  changeFileSet,
125517
125527
  emitSignatures,
@@ -125568,73 +125578,87 @@ function getBuildInfo2(state, bundle) {
125568
125578
  if (optionInfo == null ? void 0 : optionInfo.affectsBuildInfo) {
125569
125579
  (result || (result = {}))[name] = convertToReusableCompilerOptionValue(
125570
125580
  optionInfo,
125571
- options[name],
125572
- relativeToBuildInfoEnsuringAbsolutePath
125581
+ options[name]
125573
125582
  );
125574
125583
  }
125575
125584
  }
125576
125585
  return result;
125577
125586
  }
125578
- }
125579
- function convertToReusableCompilerOptionValue(option, value, relativeToBuildInfo) {
125580
- if (option) {
125581
- Debug.assert(option.type !== "listOrElement");
125582
- if (option.type === "list") {
125583
- const values = value;
125584
- if (option.element.isFilePath && values.length) {
125585
- return values.map(relativeToBuildInfo);
125587
+ function convertToReusableCompilerOptionValue(option, value) {
125588
+ if (option) {
125589
+ Debug.assert(option.type !== "listOrElement");
125590
+ if (option.type === "list") {
125591
+ const values = value;
125592
+ if (option.element.isFilePath && values.length) {
125593
+ return values.map(relativeToBuildInfoEnsuringAbsolutePath);
125594
+ }
125595
+ } else if (option.isFilePath) {
125596
+ return relativeToBuildInfoEnsuringAbsolutePath(value);
125586
125597
  }
125587
- } else if (option.isFilePath) {
125588
- return relativeToBuildInfo(value);
125589
125598
  }
125599
+ return value;
125590
125600
  }
125591
- return value;
125592
- }
125593
- function convertToReusableDiagnostics(diagnostics, relativeToBuildInfo) {
125594
- Debug.assert(!!diagnostics.length);
125595
- return diagnostics.map((diagnostic) => {
125596
- const result = convertToReusableDiagnosticRelatedInformation(diagnostic, relativeToBuildInfo);
125597
- result.reportsUnnecessary = diagnostic.reportsUnnecessary;
125598
- result.reportDeprecated = diagnostic.reportsDeprecated;
125599
- result.source = diagnostic.source;
125600
- result.skippedOn = diagnostic.skippedOn;
125601
- const { relatedInformation } = diagnostic;
125602
- result.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map((r) => convertToReusableDiagnosticRelatedInformation(r, relativeToBuildInfo)) : [] : void 0;
125601
+ function convertToProgramBuildInfoDiagnostics(diagnostics) {
125602
+ let result;
125603
+ if (diagnostics) {
125604
+ for (const key of arrayFrom(diagnostics.keys()).sort(compareStringsCaseSensitive)) {
125605
+ const value = diagnostics.get(key);
125606
+ (result || (result = [])).push(
125607
+ value.length ? [
125608
+ toFileId(key),
125609
+ convertToReusableDiagnostics(value)
125610
+ ] : toFileId(key)
125611
+ );
125612
+ }
125613
+ }
125603
125614
  return result;
125604
- });
125605
- }
125606
- function convertToReusableDiagnosticRelatedInformation(diagnostic, relativeToBuildInfo) {
125607
- const { file } = diagnostic;
125608
- return {
125609
- ...diagnostic,
125610
- file: file ? relativeToBuildInfo(file.resolvedPath) : void 0,
125611
- messageText: isString(diagnostic.messageText) ? diagnostic.messageText : convertToReusableDiagnosticMessageChain(diagnostic.messageText)
125612
- };
125613
- }
125614
- function convertToReusableDiagnosticMessageChain(chain) {
125615
- if (chain.repopulateInfo) {
125615
+ }
125616
+ function convertToReusableDiagnostics(diagnostics) {
125617
+ Debug.assert(!!diagnostics.length);
125618
+ return diagnostics.map((diagnostic) => {
125619
+ const result = convertToReusableDiagnosticRelatedInformation(diagnostic);
125620
+ result.reportsUnnecessary = diagnostic.reportsUnnecessary;
125621
+ result.reportDeprecated = diagnostic.reportsDeprecated;
125622
+ result.source = diagnostic.source;
125623
+ result.skippedOn = diagnostic.skippedOn;
125624
+ const { relatedInformation } = diagnostic;
125625
+ result.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map((r) => convertToReusableDiagnosticRelatedInformation(r)) : [] : void 0;
125626
+ return result;
125627
+ });
125628
+ }
125629
+ function convertToReusableDiagnosticRelatedInformation(diagnostic) {
125630
+ const { file } = diagnostic;
125616
125631
  return {
125617
- info: chain.repopulateInfo(),
125618
- next: convertToReusableDiagnosticMessageChainArray(chain.next)
125632
+ ...diagnostic,
125633
+ file: file ? relativeToBuildInfo(file.resolvedPath) : void 0,
125634
+ messageText: isString(diagnostic.messageText) ? diagnostic.messageText : convertToReusableDiagnosticMessageChain(diagnostic.messageText)
125619
125635
  };
125620
125636
  }
125621
- const next = convertToReusableDiagnosticMessageChainArray(chain.next);
125622
- return next === chain.next ? chain : { ...chain, next };
125623
- }
125624
- function convertToReusableDiagnosticMessageChainArray(array) {
125625
- if (!array)
125626
- return array;
125627
- return forEach(array, (chain, index) => {
125628
- const reusable = convertToReusableDiagnosticMessageChain(chain);
125629
- if (chain === reusable)
125630
- return void 0;
125631
- const result = index > 0 ? array.slice(0, index - 1) : [];
125632
- result.push(reusable);
125633
- for (let i = index + 1; i < array.length; i++) {
125634
- result.push(convertToReusableDiagnosticMessageChain(array[i]));
125637
+ function convertToReusableDiagnosticMessageChain(chain) {
125638
+ if (chain.repopulateInfo) {
125639
+ return {
125640
+ info: chain.repopulateInfo(),
125641
+ next: convertToReusableDiagnosticMessageChainArray(chain.next)
125642
+ };
125635
125643
  }
125636
- return result;
125637
- }) || array;
125644
+ const next = convertToReusableDiagnosticMessageChainArray(chain.next);
125645
+ return next === chain.next ? chain : { ...chain, next };
125646
+ }
125647
+ function convertToReusableDiagnosticMessageChainArray(array) {
125648
+ if (!array)
125649
+ return array;
125650
+ return forEach(array, (chain, index) => {
125651
+ const reusable = convertToReusableDiagnosticMessageChain(chain);
125652
+ if (chain === reusable)
125653
+ return void 0;
125654
+ const result = index > 0 ? array.slice(0, index - 1) : [];
125655
+ result.push(reusable);
125656
+ for (let i = index + 1; i < array.length; i++) {
125657
+ result.push(convertToReusableDiagnosticMessageChain(array[i]));
125658
+ }
125659
+ return result;
125660
+ }) || array;
125661
+ }
125638
125662
  }
125639
125663
  var BuilderProgramKind = /* @__PURE__ */ ((BuilderProgramKind2) => {
125640
125664
  BuilderProgramKind2[BuilderProgramKind2["SemanticDiagnosticsBuilderProgram"] = 0] = "SemanticDiagnosticsBuilderProgram";
@@ -125748,6 +125772,14 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
125748
125772
  if (!outFile(state.compilerOptions)) {
125749
125773
  const pendingAffectedFile = getNextAffectedFilePendingEmit(state, emitOnlyDtsFiles);
125750
125774
  if (!pendingAffectedFile) {
125775
+ const pendingForDiagnostics = getNextPendingEmitDiagnosticsFile(state);
125776
+ if (pendingForDiagnostics) {
125777
+ (state.seenEmittedFiles ?? (state.seenEmittedFiles = /* @__PURE__ */ new Map())).set(pendingForDiagnostics.affectedFile.resolvedPath, pendingForDiagnostics.seenKind | 24 /* AllDts */);
125778
+ return {
125779
+ result: { emitSkipped: true, diagnostics: pendingForDiagnostics.diagnostics },
125780
+ affected: pendingForDiagnostics.affectedFile
125781
+ };
125782
+ }
125751
125783
  if (!state.buildInfoEmitPending)
125752
125784
  return void 0;
125753
125785
  const affected2 = state.program;
@@ -125796,6 +125828,8 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
125796
125828
  (state.affectedFilesPendingEmit ?? (state.affectedFilesPendingEmit = /* @__PURE__ */ new Map())).set(affectedSourceFile.resolvedPath, pendingKind);
125797
125829
  else
125798
125830
  (_c = state.affectedFilesPendingEmit) == null ? void 0 : _c.delete(affectedSourceFile.resolvedPath);
125831
+ if (result.diagnostics.length)
125832
+ (state.emitDiagnosticsPerFile ?? (state.emitDiagnosticsPerFile = /* @__PURE__ */ new Map())).set(affectedSourceFile.resolvedPath, result.diagnostics);
125799
125833
  } else {
125800
125834
  state.changedFilesSet.clear();
125801
125835
  }
@@ -125968,9 +126002,10 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
125968
126002
  }
125969
126003
  }
125970
126004
  function addToAffectedFilesPendingEmit(state, affectedFilePendingEmit, kind) {
125971
- var _a;
126005
+ var _a, _b;
125972
126006
  const existingKind = ((_a = state.affectedFilesPendingEmit) == null ? void 0 : _a.get(affectedFilePendingEmit)) || 0 /* None */;
125973
126007
  (state.affectedFilesPendingEmit ?? (state.affectedFilesPendingEmit = /* @__PURE__ */ new Map())).set(affectedFilePendingEmit, existingKind | kind);
126008
+ (_b = state.emitDiagnosticsPerFile) == null ? void 0 : _b.delete(affectedFilePendingEmit);
125974
126009
  }
125975
126010
  function toBuilderStateFileInfoForMultiEmit(fileInfo) {
125976
126011
  return isString(fileInfo) ? { version: fileInfo, signature: fileInfo, affectsGlobalScope: void 0, impliedFormat: void 0 } : isString(fileInfo.signature) ? fileInfo : { version: fileInfo.version, signature: fileInfo.signature === false ? void 0 : fileInfo.version, affectsGlobalScope: fileInfo.affectsGlobalScope, impliedFormat: fileInfo.impliedFormat };
@@ -126035,7 +126070,8 @@ function createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, hos
126035
126070
  compilerOptions: program.options ? convertToOptionsWithAbsolutePaths(program.options, toAbsolutePath) : {},
126036
126071
  referencedMap: toManyToManyPathMap(program.referencedMap),
126037
126072
  exportedModulesMap: toManyToManyPathMap(program.exportedModulesMap),
126038
- semanticDiagnosticsPerFile: program.semanticDiagnosticsPerFile && arrayToMap(program.semanticDiagnosticsPerFile, (value) => toFilePath(isNumber(value) ? value : value[0]), (value) => isNumber(value) ? emptyArray : value[1]),
126073
+ semanticDiagnosticsPerFile: toPerFileDiagnostics(program.semanticDiagnosticsPerFile),
126074
+ emitDiagnosticsPerFile: toPerFileDiagnostics(program.emitDiagnosticsPerFile),
126039
126075
  hasReusableDiagnostic: true,
126040
126076
  affectedFilesPendingEmit: program.affectedFilesPendingEmit && arrayToMap(program.affectedFilesPendingEmit, (value) => toFilePath(isNumber(value) ? value : value[0]), (value) => toBuilderFileEmit(value, fullEmitForOptions)),
126041
126077
  changedFilesSet: new Set(map(program.changeFileSet, toFilePath)),
@@ -126088,6 +126124,9 @@ function createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, hos
126088
126124
  referenceMap.forEach(([fileId, fileIdListId]) => map2.set(toFilePath(fileId), toFilePathsSet(fileIdListId)));
126089
126125
  return map2;
126090
126126
  }
126127
+ function toPerFileDiagnostics(diagnostics) {
126128
+ return diagnostics && arrayToMap(diagnostics, (value) => toFilePath(isNumber(value) ? value : value[0]), (value) => isNumber(value) ? emptyArray : value[1]);
126129
+ }
126091
126130
  }
126092
126131
  function getBuildInfoFileVersionMap(program, buildInfoPath, host) {
126093
126132
  const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
@@ -129734,7 +129773,7 @@ function checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime,
129734
129773
  }
129735
129774
  }
129736
129775
  function getUpToDateStatusWorker(state, project, resolvedPath) {
129737
- var _a, _b;
129776
+ var _a, _b, _c;
129738
129777
  if (!project.fileNames.length && !canJsonReportNoInputFiles(project.raw)) {
129739
129778
  return {
129740
129779
  type: 16 /* ContainerOnly */
@@ -129808,7 +129847,7 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
129808
129847
  };
129809
129848
  }
129810
129849
  if (buildInfo.program) {
129811
- if (((_a = buildInfo.program.changeFileSet) == null ? void 0 : _a.length) || (!project.options.noEmit ? (_b = buildInfo.program.affectedFilesPendingEmit) == null ? void 0 : _b.length : some(buildInfo.program.semanticDiagnosticsPerFile, isArray))) {
129850
+ if (((_a = buildInfo.program.changeFileSet) == null ? void 0 : _a.length) || (!project.options.noEmit ? ((_b = buildInfo.program.affectedFilesPendingEmit) == null ? void 0 : _b.length) || ((_c = buildInfo.program.emitDiagnosticsPerFile) == null ? void 0 : _c.length) : some(buildInfo.program.semanticDiagnosticsPerFile, isArray))) {
129812
129851
  return {
129813
129852
  type: 8 /* OutOfDateBuildInfo */,
129814
129853
  buildInfoFile: buildInfoPath
@@ -165120,6 +165159,7 @@ function provideInlayHints(context) {
165120
165159
  visitForDisplayParts(typeNode);
165121
165160
  return parts;
165122
165161
  function visitForDisplayParts(node) {
165162
+ var _a, _b;
165123
165163
  if (!node) {
165124
165164
  return;
165125
165165
  }
@@ -165134,9 +165174,9 @@ function provideInlayHints(context) {
165134
165174
  }
165135
165175
  switch (node.kind) {
165136
165176
  case 80 /* Identifier */:
165137
- const identifier = node;
165138
- const identifierText = idText(identifier);
165139
- const name = identifier.symbol && identifier.symbol.declarations && identifier.symbol.declarations.length && getNameOfDeclaration(identifier.symbol.declarations[0]);
165177
+ Debug.assertNode(node, isIdentifier);
165178
+ const identifierText = idText(node);
165179
+ const name = node.symbol && node.symbol.declarations && node.symbol.declarations.length && getNameOfDeclaration(node.symbol.declarations[0]);
165140
165180
  if (name) {
165141
165181
  parts.push(getNodeDisplayPart(identifierText, name));
165142
165182
  } else {
@@ -165144,252 +165184,307 @@ function provideInlayHints(context) {
165144
165184
  }
165145
165185
  break;
165146
165186
  case 166 /* QualifiedName */:
165147
- const qualifiedName = node;
165148
- visitForDisplayParts(qualifiedName.left);
165187
+ Debug.assertNode(node, isQualifiedName);
165188
+ visitForDisplayParts(node.left);
165149
165189
  parts.push({ text: "." });
165150
- visitForDisplayParts(qualifiedName.right);
165190
+ visitForDisplayParts(node.right);
165151
165191
  break;
165152
165192
  case 182 /* TypePredicate */:
165153
- const predicate = node;
165154
- if (predicate.assertsModifier) {
165193
+ Debug.assertNode(node, isTypePredicateNode);
165194
+ if (node.assertsModifier) {
165155
165195
  parts.push({ text: "asserts " });
165156
165196
  }
165157
- visitForDisplayParts(predicate.parameterName);
165158
- if (predicate.type) {
165197
+ visitForDisplayParts(node.parameterName);
165198
+ if (node.type) {
165159
165199
  parts.push({ text: " is " });
165160
- visitForDisplayParts(predicate.type);
165200
+ visitForDisplayParts(node.type);
165161
165201
  }
165162
165202
  break;
165163
165203
  case 183 /* TypeReference */:
165164
- const typeReference = node;
165165
- visitForDisplayParts(typeReference.typeName);
165166
- if (typeReference.typeArguments) {
165204
+ Debug.assertNode(node, isTypeReferenceNode);
165205
+ visitForDisplayParts(node.typeName);
165206
+ if (node.typeArguments) {
165167
165207
  parts.push({ text: "<" });
165168
- visitDisplayPartList(typeReference.typeArguments, ", ");
165208
+ visitDisplayPartList(node.typeArguments, ", ");
165169
165209
  parts.push({ text: ">" });
165170
165210
  }
165171
165211
  break;
165172
165212
  case 168 /* TypeParameter */:
165173
- const typeParameter = node;
165174
- if (typeParameter.modifiers) {
165175
- visitDisplayPartList(typeParameter.modifiers, " ");
165213
+ Debug.assertNode(node, isTypeParameterDeclaration);
165214
+ if (node.modifiers) {
165215
+ visitDisplayPartList(node.modifiers, " ");
165176
165216
  }
165177
- visitForDisplayParts(typeParameter.name);
165178
- if (typeParameter.constraint) {
165217
+ visitForDisplayParts(node.name);
165218
+ if (node.constraint) {
165179
165219
  parts.push({ text: " extends " });
165180
- visitForDisplayParts(typeParameter.constraint);
165220
+ visitForDisplayParts(node.constraint);
165181
165221
  }
165182
- if (typeParameter.default) {
165222
+ if (node.default) {
165183
165223
  parts.push({ text: " = " });
165184
- visitForDisplayParts(typeParameter.default);
165224
+ visitForDisplayParts(node.default);
165185
165225
  }
165186
165226
  break;
165187
165227
  case 169 /* Parameter */:
165188
- const parameter = node;
165189
- if (parameter.modifiers) {
165190
- visitDisplayPartList(parameter.modifiers, " ");
165228
+ Debug.assertNode(node, isParameter);
165229
+ if (node.modifiers) {
165230
+ visitDisplayPartList(node.modifiers, " ");
165191
165231
  }
165192
- if (parameter.dotDotDotToken) {
165232
+ if (node.dotDotDotToken) {
165193
165233
  parts.push({ text: "..." });
165194
165234
  }
165195
- visitForDisplayParts(parameter.name);
165196
- if (parameter.questionToken) {
165235
+ visitForDisplayParts(node.name);
165236
+ if (node.questionToken) {
165197
165237
  parts.push({ text: "?" });
165198
165238
  }
165199
- if (parameter.type) {
165239
+ if (node.type) {
165200
165240
  parts.push({ text: ": " });
165201
- visitForDisplayParts(parameter.type);
165241
+ visitForDisplayParts(node.type);
165202
165242
  }
165203
165243
  break;
165204
165244
  case 185 /* ConstructorType */:
165205
- const constructorType = node;
165245
+ Debug.assertNode(node, isConstructorTypeNode);
165206
165246
  parts.push({ text: "new " });
165207
- if (constructorType.typeParameters) {
165208
- parts.push({ text: "<" });
165209
- visitDisplayPartList(constructorType.typeParameters, ", ");
165210
- parts.push({ text: ">" });
165211
- }
165212
- parts.push({ text: "(" });
165213
- visitDisplayPartList(constructorType.parameters, ", ");
165214
- parts.push({ text: ")" });
165247
+ visitParametersAndTypeParameters(node);
165215
165248
  parts.push({ text: " => " });
165216
- visitForDisplayParts(constructorType.type);
165249
+ visitForDisplayParts(node.type);
165217
165250
  break;
165218
165251
  case 186 /* TypeQuery */:
165219
- const typeQuery = node;
165252
+ Debug.assertNode(node, isTypeQueryNode);
165220
165253
  parts.push({ text: "typeof " });
165221
- visitForDisplayParts(typeQuery.exprName);
165222
- if (typeQuery.typeArguments) {
165254
+ visitForDisplayParts(node.exprName);
165255
+ if (node.typeArguments) {
165223
165256
  parts.push({ text: "<" });
165224
- visitDisplayPartList(typeQuery.typeArguments, ", ");
165257
+ visitDisplayPartList(node.typeArguments, ", ");
165225
165258
  parts.push({ text: ">" });
165226
165259
  }
165227
165260
  break;
165228
165261
  case 187 /* TypeLiteral */:
165229
- const typeLiteral = node;
165262
+ Debug.assertNode(node, isTypeLiteralNode);
165230
165263
  parts.push({ text: "{" });
165231
- if (typeLiteral.members.length) {
165264
+ if (node.members.length) {
165232
165265
  parts.push({ text: " " });
165233
- visitDisplayPartList(typeLiteral.members, "; ");
165266
+ visitDisplayPartList(node.members, "; ");
165234
165267
  parts.push({ text: " " });
165235
165268
  }
165236
165269
  parts.push({ text: "}" });
165237
165270
  break;
165238
165271
  case 188 /* ArrayType */:
165272
+ Debug.assertNode(node, isArrayTypeNode);
165239
165273
  visitForDisplayParts(node.elementType);
165240
165274
  parts.push({ text: "[]" });
165241
165275
  break;
165242
165276
  case 189 /* TupleType */:
165277
+ Debug.assertNode(node, isTupleTypeNode);
165243
165278
  parts.push({ text: "[" });
165244
165279
  visitDisplayPartList(node.elements, ", ");
165245
165280
  parts.push({ text: "]" });
165246
165281
  break;
165247
165282
  case 202 /* NamedTupleMember */:
165248
- const member = node;
165249
- if (member.dotDotDotToken) {
165283
+ Debug.assertNode(node, isNamedTupleMember);
165284
+ if (node.dotDotDotToken) {
165250
165285
  parts.push({ text: "..." });
165251
165286
  }
165252
- visitForDisplayParts(member.name);
165253
- if (member.questionToken) {
165287
+ visitForDisplayParts(node.name);
165288
+ if (node.questionToken) {
165254
165289
  parts.push({ text: "?" });
165255
165290
  }
165256
165291
  parts.push({ text: ": " });
165257
- visitForDisplayParts(member.type);
165292
+ visitForDisplayParts(node.type);
165258
165293
  break;
165259
165294
  case 190 /* OptionalType */:
165295
+ Debug.assertNode(node, isOptionalTypeNode);
165260
165296
  visitForDisplayParts(node.type);
165261
165297
  parts.push({ text: "?" });
165262
165298
  break;
165263
165299
  case 191 /* RestType */:
165300
+ Debug.assertNode(node, isRestTypeNode);
165264
165301
  parts.push({ text: "..." });
165265
165302
  visitForDisplayParts(node.type);
165266
165303
  break;
165267
165304
  case 192 /* UnionType */:
165305
+ Debug.assertNode(node, isUnionTypeNode);
165268
165306
  visitDisplayPartList(node.types, " | ");
165269
165307
  break;
165270
165308
  case 193 /* IntersectionType */:
165309
+ Debug.assertNode(node, isIntersectionTypeNode);
165271
165310
  visitDisplayPartList(node.types, " & ");
165272
165311
  break;
165273
165312
  case 194 /* ConditionalType */:
165274
- const conditionalType = node;
165275
- visitForDisplayParts(conditionalType.checkType);
165313
+ Debug.assertNode(node, isConditionalTypeNode);
165314
+ visitForDisplayParts(node.checkType);
165276
165315
  parts.push({ text: " extends " });
165277
- visitForDisplayParts(conditionalType.extendsType);
165316
+ visitForDisplayParts(node.extendsType);
165278
165317
  parts.push({ text: " ? " });
165279
- visitForDisplayParts(conditionalType.trueType);
165318
+ visitForDisplayParts(node.trueType);
165280
165319
  parts.push({ text: " : " });
165281
- visitForDisplayParts(conditionalType.falseType);
165320
+ visitForDisplayParts(node.falseType);
165282
165321
  break;
165283
165322
  case 195 /* InferType */:
165323
+ Debug.assertNode(node, isInferTypeNode);
165284
165324
  parts.push({ text: "infer " });
165285
165325
  visitForDisplayParts(node.typeParameter);
165286
165326
  break;
165287
165327
  case 196 /* ParenthesizedType */:
165328
+ Debug.assertNode(node, isParenthesizedTypeNode);
165288
165329
  parts.push({ text: "(" });
165289
165330
  visitForDisplayParts(node.type);
165290
165331
  parts.push({ text: ")" });
165291
165332
  break;
165292
165333
  case 198 /* TypeOperator */:
165293
- const typeOperator = node;
165294
- parts.push({ text: `${tokenToString(typeOperator.operator)} ` });
165295
- visitForDisplayParts(typeOperator.type);
165334
+ Debug.assertNode(node, isTypeOperatorNode);
165335
+ parts.push({ text: `${tokenToString(node.operator)} ` });
165336
+ visitForDisplayParts(node.type);
165296
165337
  break;
165297
165338
  case 199 /* IndexedAccessType */:
165298
- const indexedAccess = node;
165299
- visitForDisplayParts(indexedAccess.objectType);
165339
+ Debug.assertNode(node, isIndexedAccessTypeNode);
165340
+ visitForDisplayParts(node.objectType);
165300
165341
  parts.push({ text: "[" });
165301
- visitForDisplayParts(indexedAccess.indexType);
165342
+ visitForDisplayParts(node.indexType);
165302
165343
  parts.push({ text: "]" });
165303
165344
  break;
165304
165345
  case 200 /* MappedType */:
165305
- const mappedType = node;
165346
+ Debug.assertNode(node, isMappedTypeNode);
165306
165347
  parts.push({ text: "{ " });
165307
- if (mappedType.readonlyToken) {
165308
- if (mappedType.readonlyToken.kind === 40 /* PlusToken */) {
165348
+ if (node.readonlyToken) {
165349
+ if (node.readonlyToken.kind === 40 /* PlusToken */) {
165309
165350
  parts.push({ text: "+" });
165310
- } else if (mappedType.readonlyToken.kind === 41 /* MinusToken */) {
165351
+ } else if (node.readonlyToken.kind === 41 /* MinusToken */) {
165311
165352
  parts.push({ text: "-" });
165312
165353
  }
165313
165354
  parts.push({ text: "readonly " });
165314
165355
  }
165315
165356
  parts.push({ text: "[" });
165316
- visitForDisplayParts(mappedType.typeParameter);
165317
- if (mappedType.nameType) {
165357
+ visitForDisplayParts(node.typeParameter);
165358
+ if (node.nameType) {
165318
165359
  parts.push({ text: " as " });
165319
- visitForDisplayParts(mappedType.nameType);
165360
+ visitForDisplayParts(node.nameType);
165320
165361
  }
165321
165362
  parts.push({ text: "]" });
165322
- if (mappedType.questionToken) {
165323
- if (mappedType.questionToken.kind === 40 /* PlusToken */) {
165363
+ if (node.questionToken) {
165364
+ if (node.questionToken.kind === 40 /* PlusToken */) {
165324
165365
  parts.push({ text: "+" });
165325
- } else if (mappedType.questionToken.kind === 41 /* MinusToken */) {
165366
+ } else if (node.questionToken.kind === 41 /* MinusToken */) {
165326
165367
  parts.push({ text: "-" });
165327
165368
  }
165328
165369
  parts.push({ text: "?" });
165329
165370
  }
165330
165371
  parts.push({ text: ": " });
165331
- if (mappedType.type) {
165332
- visitForDisplayParts(mappedType.type);
165372
+ if (node.type) {
165373
+ visitForDisplayParts(node.type);
165333
165374
  }
165334
165375
  parts.push({ text: "; }" });
165335
165376
  break;
165336
165377
  case 201 /* LiteralType */:
165378
+ Debug.assertNode(node, isLiteralTypeNode);
165337
165379
  visitForDisplayParts(node.literal);
165338
165380
  break;
165339
165381
  case 184 /* FunctionType */:
165340
- const functionType = node;
165341
- if (functionType.typeParameters) {
165342
- parts.push({ text: "<" });
165343
- visitDisplayPartList(functionType.typeParameters, ", ");
165344
- parts.push({ text: ">" });
165345
- }
165346
- parts.push({ text: "(" });
165347
- visitDisplayPartList(functionType.parameters, ", ");
165348
- parts.push({ text: ")" });
165382
+ Debug.assertNode(node, isFunctionTypeNode);
165383
+ visitParametersAndTypeParameters(node);
165349
165384
  parts.push({ text: " => " });
165350
- visitForDisplayParts(functionType.type);
165385
+ visitForDisplayParts(node.type);
165351
165386
  break;
165352
165387
  case 205 /* ImportType */:
165353
- const importType = node;
165354
- if (importType.isTypeOf) {
165388
+ Debug.assertNode(node, isImportTypeNode);
165389
+ if (node.isTypeOf) {
165355
165390
  parts.push({ text: "typeof " });
165356
165391
  }
165357
165392
  parts.push({ text: "import(" });
165358
- visitForDisplayParts(importType.argument);
165359
- if (importType.assertions) {
165393
+ visitForDisplayParts(node.argument);
165394
+ if (node.assertions) {
165360
165395
  parts.push({ text: ", { assert: " });
165361
- visitDisplayPartList(importType.assertions.assertClause.elements, ", ");
165396
+ visitDisplayPartList(node.assertions.assertClause.elements, ", ");
165362
165397
  parts.push({ text: " }" });
165363
165398
  }
165364
165399
  parts.push({ text: ")" });
165365
- if (importType.qualifier) {
165400
+ if (node.qualifier) {
165366
165401
  parts.push({ text: "." });
165367
- visitForDisplayParts(importType.qualifier);
165402
+ visitForDisplayParts(node.qualifier);
165368
165403
  }
165369
- if (importType.typeArguments) {
165404
+ if (node.typeArguments) {
165370
165405
  parts.push({ text: "<" });
165371
- visitDisplayPartList(importType.typeArguments, ", ");
165406
+ visitDisplayPartList(node.typeArguments, ", ");
165372
165407
  parts.push({ text: ">" });
165373
165408
  }
165374
165409
  break;
165375
165410
  case 171 /* PropertySignature */:
165376
- const propertySignature = node;
165377
- if (propertySignature.modifiers) {
165378
- visitDisplayPartList(propertySignature.modifiers, " ");
165411
+ Debug.assertNode(node, isPropertySignature);
165412
+ if ((_a = node.modifiers) == null ? void 0 : _a.length) {
165413
+ visitDisplayPartList(node.modifiers, " ");
165414
+ parts.push({ text: " " });
165415
+ }
165416
+ visitForDisplayParts(node.name);
165417
+ if (node.questionToken) {
165418
+ parts.push({ text: "?" });
165419
+ }
165420
+ if (node.type) {
165421
+ parts.push({ text: ": " });
165422
+ visitForDisplayParts(node.type);
165423
+ }
165424
+ break;
165425
+ case 173 /* MethodSignature */:
165426
+ Debug.assertNode(node, isMethodSignature);
165427
+ if ((_b = node.modifiers) == null ? void 0 : _b.length) {
165428
+ visitDisplayPartList(node.modifiers, " ");
165429
+ parts.push({ text: " " });
165379
165430
  }
165380
- visitForDisplayParts(propertySignature.name);
165381
- if (propertySignature.questionToken) {
165431
+ visitForDisplayParts(node.name);
165432
+ if (node.questionToken) {
165382
165433
  parts.push({ text: "?" });
165383
165434
  }
165384
- if (propertySignature.type) {
165435
+ visitParametersAndTypeParameters(node);
165436
+ if (node.type) {
165385
165437
  parts.push({ text: ": " });
165386
- visitForDisplayParts(propertySignature.type);
165438
+ visitForDisplayParts(node.type);
165387
165439
  }
165388
165440
  break;
165441
+ case 179 /* CallSignature */:
165442
+ Debug.assertNode(node, isCallSignatureDeclaration);
165443
+ visitParametersAndTypeParameters(node);
165444
+ if (node.type) {
165445
+ parts.push({ text: ": " });
165446
+ visitForDisplayParts(node.type);
165447
+ }
165448
+ break;
165449
+ case 207 /* ArrayBindingPattern */:
165450
+ Debug.assertNode(node, isArrayBindingPattern);
165451
+ parts.push({ text: "[" });
165452
+ visitDisplayPartList(node.elements, ", ");
165453
+ parts.push({ text: "]" });
165454
+ break;
165455
+ case 206 /* ObjectBindingPattern */:
165456
+ Debug.assertNode(node, isObjectBindingPattern);
165457
+ parts.push({ text: "{" });
165458
+ if (node.elements.length) {
165459
+ parts.push({ text: " " });
165460
+ visitDisplayPartList(node.elements, ", ");
165461
+ parts.push({ text: " " });
165462
+ }
165463
+ parts.push({ text: "}" });
165464
+ break;
165465
+ case 208 /* BindingElement */:
165466
+ Debug.assertNode(node, isBindingElement);
165467
+ visitForDisplayParts(node.name);
165468
+ break;
165469
+ case 224 /* PrefixUnaryExpression */:
165470
+ Debug.assertNode(node, isPrefixUnaryExpression);
165471
+ parts.push({ text: tokenToString(node.operator) });
165472
+ visitForDisplayParts(node.operand);
165473
+ break;
165389
165474
  default:
165390
165475
  Debug.failBadSyntaxKind(node);
165391
165476
  }
165392
165477
  }
165478
+ function visitParametersAndTypeParameters(signatureDeclaration) {
165479
+ if (signatureDeclaration.typeParameters) {
165480
+ parts.push({ text: "<" });
165481
+ visitDisplayPartList(signatureDeclaration.typeParameters, ", ");
165482
+ parts.push({ text: ">" });
165483
+ }
165484
+ parts.push({ text: "(" });
165485
+ visitDisplayPartList(signatureDeclaration.parameters, ", ");
165486
+ parts.push({ text: ")" });
165487
+ }
165393
165488
  function visitDisplayPartList(nodes, separator) {
165394
165489
  nodes.forEach((node, index) => {
165395
165490
  if (index > 0) {