typescript 5.6.0-dev.20240623 → 5.6.0-dev.20240625

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.6";
21
- var version = `${versionMajorMinor}.0-dev.20240623`;
21
+ var version = `${versionMajorMinor}.0-dev.20240625`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -46524,6 +46524,8 @@ function createTypeChecker(host) {
46524
46524
  moduleName,
46525
46525
  moduleName,
46526
46526
  moduleNotFoundError,
46527
+ /*ignoreErrors*/
46528
+ false,
46527
46529
  /*isForAugmentation*/
46528
46530
  true
46529
46531
  );
@@ -48085,14 +48087,14 @@ function createTypeChecker(host) {
48085
48087
  function resolveExternalModuleName(location, moduleReferenceExpression, ignoreErrors) {
48086
48088
  const isClassic = getEmitModuleResolutionKind(compilerOptions) === 1 /* Classic */;
48087
48089
  const errorMessage = isClassic ? Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option : Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations;
48088
- return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? void 0 : errorMessage);
48090
+ return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? void 0 : errorMessage, ignoreErrors);
48089
48091
  }
48090
- function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation = false) {
48091
- return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) : void 0;
48092
+ function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, ignoreErrors = false, isForAugmentation = false) {
48093
+ return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, !ignoreErrors ? moduleReferenceExpression : void 0, isForAugmentation) : void 0;
48092
48094
  }
48093
48095
  function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) {
48094
48096
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
48095
- if (startsWith(moduleReference, "@types/")) {
48097
+ if (errorNode && startsWith(moduleReference, "@types/")) {
48096
48098
  const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
48097
48099
  const withoutAtTypePrefix = removePrefix(moduleReference, "@types/");
48098
48100
  error(errorNode, diag2, withoutAtTypePrefix, moduleReference);
@@ -48114,7 +48116,7 @@ function createTypeChecker(host) {
48114
48116
  const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? host.getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
48115
48117
  const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
48116
48118
  const resolvedModule = (_g = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _g.resolvedModule;
48117
- const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule, currentSourceFile);
48119
+ const resolutionDiagnostic = errorNode && resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule, currentSourceFile);
48118
48120
  const sourceFile = resolvedModule && (!resolutionDiagnostic || resolutionDiagnostic === Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set) && host.getSourceFile(resolvedModule.resolvedFileName);
48119
48121
  if (sourceFile) {
48120
48122
  if (resolutionDiagnostic) {
@@ -48122,7 +48124,7 @@ function createTypeChecker(host) {
48122
48124
  }
48123
48125
  if (resolvedModule.resolvedUsingTsExtension && isDeclarationFileName(moduleReference)) {
48124
48126
  const importOrExport = ((_h = findAncestor(location, isImportDeclaration)) == null ? void 0 : _h.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
48125
- if (importOrExport && !importOrExport.isTypeOnly || findAncestor(location, isImportCall)) {
48127
+ if (errorNode && importOrExport && !importOrExport.isTypeOnly || findAncestor(location, isImportCall)) {
48126
48128
  error(
48127
48129
  errorNode,
48128
48130
  Diagnostics.A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_file_0_instead,
@@ -48131,13 +48133,13 @@ function createTypeChecker(host) {
48131
48133
  }
48132
48134
  } else if (resolvedModule.resolvedUsingTsExtension && !shouldAllowImportingTsExtension(compilerOptions, currentSourceFile.fileName)) {
48133
48135
  const importOrExport = ((_i = findAncestor(location, isImportDeclaration)) == null ? void 0 : _i.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
48134
- if (!((importOrExport == null ? void 0 : importOrExport.isTypeOnly) || findAncestor(location, isImportTypeNode))) {
48136
+ if (errorNode && !((importOrExport == null ? void 0 : importOrExport.isTypeOnly) || findAncestor(location, isImportTypeNode))) {
48135
48137
  const tsExtension = Debug.checkDefined(tryExtractTSExtension(moduleReference));
48136
48138
  error(errorNode, Diagnostics.An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled, tsExtension);
48137
48139
  }
48138
48140
  }
48139
48141
  if (sourceFile.symbol) {
48140
- if (resolvedModule.isExternalLibraryImport && !resolutionExtensionIsTSOrJson(resolvedModule.extension)) {
48142
+ if (errorNode && resolvedModule.isExternalLibraryImport && !resolutionExtensionIsTSOrJson(resolvedModule.extension)) {
48141
48143
  errorOnImplicitAnyModule(
48142
48144
  /*isError*/
48143
48145
  false,
@@ -48148,9 +48150,9 @@ function createTypeChecker(host) {
48148
48150
  moduleReference
48149
48151
  );
48150
48152
  }
48151
- if (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */) {
48153
+ if (errorNode && (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */)) {
48152
48154
  const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
48153
- const overrideHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l));
48155
+ const overrideHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l) || isJSDocImportTag(l));
48154
48156
  if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !hasResolutionModeOverride(overrideHost)) {
48155
48157
  if (findAncestor(location, isImportEqualsDeclaration)) {
48156
48158
  error(errorNode, Diagnostics.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead, moduleReference);
@@ -48208,7 +48210,7 @@ function createTypeChecker(host) {
48208
48210
  }
48209
48211
  return getMergedSymbol(sourceFile.symbol);
48210
48212
  }
48211
- if (moduleNotFoundError) {
48213
+ if (errorNode && moduleNotFoundError) {
48212
48214
  error(errorNode, Diagnostics.File_0_is_not_a_module, sourceFile.fileName);
48213
48215
  }
48214
48216
  return void 0;
@@ -48223,6 +48225,9 @@ function createTypeChecker(host) {
48223
48225
  return getMergedSymbol(pattern.symbol);
48224
48226
  }
48225
48227
  }
48228
+ if (!errorNode) {
48229
+ return void 0;
48230
+ }
48226
48231
  if (resolvedModule && !resolutionExtensionIsTSOrJson(resolvedModule.extension) && resolutionDiagnostic === void 0 || resolutionDiagnostic === Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type) {
48227
48232
  if (isForAugmentation) {
48228
48233
  const diag2 = Diagnostics.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented;
@@ -65195,7 +65200,7 @@ function createTypeChecker(host) {
65195
65200
  for (let i = 0; i < types.length; i++) {
65196
65201
  if (include[i]) {
65197
65202
  const targetType = getTypeOfPropertyOrIndexSignatureOfType(types[i], propertyName);
65198
- if (targetType && related(getDiscriminatingType(), targetType)) {
65203
+ if (targetType && someType(getDiscriminatingType(), (t) => !!related(t, targetType))) {
65199
65204
  matched = true;
65200
65205
  } else {
65201
65206
  include[i] = 3 /* Maybe */;
@@ -92611,8 +92616,6 @@ function transformClassFields(context) {
92611
92616
  return node;
92612
92617
  }
92613
92618
  switch (node.kind) {
92614
- case 129 /* AccessorKeyword */:
92615
- return Debug.fail("Use `modifierVisitor` instead.");
92616
92619
  case 263 /* ClassDeclaration */:
92617
92620
  return visitClassDeclaration(node);
92618
92621
  case 231 /* ClassExpression */:
@@ -118788,7 +118791,7 @@ function getModeForUsageLocation(file, usage, compilerOptions) {
118788
118791
  }
118789
118792
  function getModeForUsageLocationWorker(file, usage, compilerOptions) {
118790
118793
  var _a;
118791
- if (isImportDeclaration(usage.parent) || isExportDeclaration(usage.parent)) {
118794
+ if (isImportDeclaration(usage.parent) || isExportDeclaration(usage.parent) || isJSDocImportTag(usage.parent)) {
118792
118795
  const isTypeOnly = isExclusivelyTypeOnlyImportOrExport(usage.parent);
118793
118796
  if (isTypeOnly) {
118794
118797
  const override = getResolutionModeOverride(usage.parent.attributes);
package/lib/typescript.js CHANGED
@@ -2377,7 +2377,7 @@ module.exports = __toCommonJS(typescript_exports);
2377
2377
 
2378
2378
  // src/compiler/corePublic.ts
2379
2379
  var versionMajorMinor = "5.6";
2380
- var version = `${versionMajorMinor}.0-dev.20240623`;
2380
+ var version = `${versionMajorMinor}.0-dev.20240625`;
2381
2381
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2382
2382
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2383
2383
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -51407,6 +51407,8 @@ function createTypeChecker(host) {
51407
51407
  moduleName,
51408
51408
  moduleName,
51409
51409
  moduleNotFoundError,
51410
+ /*ignoreErrors*/
51411
+ false,
51410
51412
  /*isForAugmentation*/
51411
51413
  true
51412
51414
  );
@@ -52968,14 +52970,14 @@ function createTypeChecker(host) {
52968
52970
  function resolveExternalModuleName(location, moduleReferenceExpression, ignoreErrors) {
52969
52971
  const isClassic = getEmitModuleResolutionKind(compilerOptions) === 1 /* Classic */;
52970
52972
  const errorMessage = isClassic ? Diagnostics.Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_nodenext_or_to_add_aliases_to_the_paths_option : Diagnostics.Cannot_find_module_0_or_its_corresponding_type_declarations;
52971
- return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? void 0 : errorMessage);
52973
+ return resolveExternalModuleNameWorker(location, moduleReferenceExpression, ignoreErrors ? void 0 : errorMessage, ignoreErrors);
52972
52974
  }
52973
- function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation = false) {
52974
- return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) : void 0;
52975
+ function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, ignoreErrors = false, isForAugmentation = false) {
52976
+ return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, !ignoreErrors ? moduleReferenceExpression : void 0, isForAugmentation) : void 0;
52975
52977
  }
52976
52978
  function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) {
52977
52979
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
52978
- if (startsWith(moduleReference, "@types/")) {
52980
+ if (errorNode && startsWith(moduleReference, "@types/")) {
52979
52981
  const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
52980
52982
  const withoutAtTypePrefix = removePrefix(moduleReference, "@types/");
52981
52983
  error2(errorNode, diag2, withoutAtTypePrefix, moduleReference);
@@ -52997,7 +52999,7 @@ function createTypeChecker(host) {
52997
52999
  const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? host.getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
52998
53000
  const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
52999
53001
  const resolvedModule = (_g = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _g.resolvedModule;
53000
- const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule, currentSourceFile);
53002
+ const resolutionDiagnostic = errorNode && resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule, currentSourceFile);
53001
53003
  const sourceFile = resolvedModule && (!resolutionDiagnostic || resolutionDiagnostic === Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set) && host.getSourceFile(resolvedModule.resolvedFileName);
53002
53004
  if (sourceFile) {
53003
53005
  if (resolutionDiagnostic) {
@@ -53005,7 +53007,7 @@ function createTypeChecker(host) {
53005
53007
  }
53006
53008
  if (resolvedModule.resolvedUsingTsExtension && isDeclarationFileName(moduleReference)) {
53007
53009
  const importOrExport = ((_h = findAncestor(location, isImportDeclaration)) == null ? void 0 : _h.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
53008
- if (importOrExport && !importOrExport.isTypeOnly || findAncestor(location, isImportCall)) {
53010
+ if (errorNode && importOrExport && !importOrExport.isTypeOnly || findAncestor(location, isImportCall)) {
53009
53011
  error2(
53010
53012
  errorNode,
53011
53013
  Diagnostics.A_declaration_file_cannot_be_imported_without_import_type_Did_you_mean_to_import_an_implementation_file_0_instead,
@@ -53014,13 +53016,13 @@ function createTypeChecker(host) {
53014
53016
  }
53015
53017
  } else if (resolvedModule.resolvedUsingTsExtension && !shouldAllowImportingTsExtension(compilerOptions, currentSourceFile.fileName)) {
53016
53018
  const importOrExport = ((_i = findAncestor(location, isImportDeclaration)) == null ? void 0 : _i.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
53017
- if (!((importOrExport == null ? void 0 : importOrExport.isTypeOnly) || findAncestor(location, isImportTypeNode))) {
53019
+ if (errorNode && !((importOrExport == null ? void 0 : importOrExport.isTypeOnly) || findAncestor(location, isImportTypeNode))) {
53018
53020
  const tsExtension = Debug.checkDefined(tryExtractTSExtension(moduleReference));
53019
53021
  error2(errorNode, Diagnostics.An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled, tsExtension);
53020
53022
  }
53021
53023
  }
53022
53024
  if (sourceFile.symbol) {
53023
- if (resolvedModule.isExternalLibraryImport && !resolutionExtensionIsTSOrJson(resolvedModule.extension)) {
53025
+ if (errorNode && resolvedModule.isExternalLibraryImport && !resolutionExtensionIsTSOrJson(resolvedModule.extension)) {
53024
53026
  errorOnImplicitAnyModule(
53025
53027
  /*isError*/
53026
53028
  false,
@@ -53031,9 +53033,9 @@ function createTypeChecker(host) {
53031
53033
  moduleReference
53032
53034
  );
53033
53035
  }
53034
- if (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */) {
53036
+ if (errorNode && (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */)) {
53035
53037
  const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
53036
- const overrideHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l));
53038
+ const overrideHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l) || isJSDocImportTag(l));
53037
53039
  if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !hasResolutionModeOverride(overrideHost)) {
53038
53040
  if (findAncestor(location, isImportEqualsDeclaration)) {
53039
53041
  error2(errorNode, Diagnostics.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead, moduleReference);
@@ -53091,7 +53093,7 @@ function createTypeChecker(host) {
53091
53093
  }
53092
53094
  return getMergedSymbol(sourceFile.symbol);
53093
53095
  }
53094
- if (moduleNotFoundError) {
53096
+ if (errorNode && moduleNotFoundError) {
53095
53097
  error2(errorNode, Diagnostics.File_0_is_not_a_module, sourceFile.fileName);
53096
53098
  }
53097
53099
  return void 0;
@@ -53106,6 +53108,9 @@ function createTypeChecker(host) {
53106
53108
  return getMergedSymbol(pattern.symbol);
53107
53109
  }
53108
53110
  }
53111
+ if (!errorNode) {
53112
+ return void 0;
53113
+ }
53109
53114
  if (resolvedModule && !resolutionExtensionIsTSOrJson(resolvedModule.extension) && resolutionDiagnostic === void 0 || resolutionDiagnostic === Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type) {
53110
53115
  if (isForAugmentation) {
53111
53116
  const diag2 = Diagnostics.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented;
@@ -70078,7 +70083,7 @@ function createTypeChecker(host) {
70078
70083
  for (let i = 0; i < types.length; i++) {
70079
70084
  if (include[i]) {
70080
70085
  const targetType = getTypeOfPropertyOrIndexSignatureOfType(types[i], propertyName);
70081
- if (targetType && related(getDiscriminatingType(), targetType)) {
70086
+ if (targetType && someType(getDiscriminatingType(), (t) => !!related(t, targetType))) {
70082
70087
  matched = true;
70083
70088
  } else {
70084
70089
  include[i] = 3 /* Maybe */;
@@ -97676,8 +97681,6 @@ function transformClassFields(context) {
97676
97681
  return node;
97677
97682
  }
97678
97683
  switch (node.kind) {
97679
- case 129 /* AccessorKeyword */:
97680
- return Debug.fail("Use `modifierVisitor` instead.");
97681
97684
  case 263 /* ClassDeclaration */:
97682
97685
  return visitClassDeclaration(node);
97683
97686
  case 231 /* ClassExpression */:
@@ -123903,7 +123906,7 @@ function getModeForUsageLocation(file, usage, compilerOptions) {
123903
123906
  }
123904
123907
  function getModeForUsageLocationWorker(file, usage, compilerOptions) {
123905
123908
  var _a;
123906
- if (isImportDeclaration(usage.parent) || isExportDeclaration(usage.parent)) {
123909
+ if (isImportDeclaration(usage.parent) || isExportDeclaration(usage.parent) || isJSDocImportTag(usage.parent)) {
123907
123910
  const isTypeOnly = isExclusivelyTypeOnlyImportOrExport(usage.parent);
123908
123911
  if (isTypeOnly) {
123909
123912
  const override = getResolutionModeOverride(usage.parent.attributes);
@@ -188826,11 +188829,12 @@ var MultistepOperation = class {
188826
188829
  }
188827
188830
  complete() {
188828
188831
  if (this.requestId !== void 0) {
188829
- this.operationHost.sendRequestCompletedEvent(this.requestId);
188832
+ this.operationHost.sendRequestCompletedEvent(this.requestId, this.performanceData);
188830
188833
  this.requestId = void 0;
188831
188834
  }
188832
188835
  this.setTimerHandle(void 0);
188833
188836
  this.setImmediateId(void 0);
188837
+ this.performanceData = void 0;
188834
188838
  }
188835
188839
  immediate(actionType, action) {
188836
188840
  const requestId = this.requestId;
@@ -188838,7 +188842,7 @@ var MultistepOperation = class {
188838
188842
  this.setImmediateId(
188839
188843
  this.operationHost.getServerHost().setImmediate(() => {
188840
188844
  this.immediateId = void 0;
188841
- this.operationHost.executeWithRequestId(requestId, () => this.executeAction(action));
188845
+ this.operationHost.executeWithRequestId(requestId, () => this.executeAction(action), this.performanceData);
188842
188846
  }, actionType)
188843
188847
  );
188844
188848
  }
@@ -188849,7 +188853,7 @@ var MultistepOperation = class {
188849
188853
  this.operationHost.getServerHost().setTimeout(
188850
188854
  () => {
188851
188855
  this.timerHandle = void 0;
188852
- this.operationHost.executeWithRequestId(requestId, () => this.executeAction(action));
188856
+ this.operationHost.executeWithRequestId(requestId, () => this.executeAction(action), this.performanceData);
188853
188857
  },
188854
188858
  ms,
188855
188859
  actionType
@@ -188878,6 +188882,7 @@ var MultistepOperation = class {
188878
188882
  this.operationHost.logError(e, `delayed processing of request ${this.requestId}`);
188879
188883
  }
188880
188884
  }
188885
+ this.performanceData = this.operationHost.getPerformanceData();
188881
188886
  if (stop || !this.hasPendingWork()) {
188882
188887
  this.complete();
188883
188888
  }
@@ -189334,7 +189339,10 @@ var Session3 = class _Session {
189334
189339
  },
189335
189340
  ["exit" /* Exit */]: () => {
189336
189341
  this.exit();
189337
- return this.notRequired();
189342
+ return this.notRequired(
189343
+ /*request*/
189344
+ void 0
189345
+ );
189338
189346
  },
189339
189347
  ["definition" /* Definition */]: (request) => {
189340
189348
  return this.requiredResponse(this.getDefinition(
@@ -189426,7 +189434,7 @@ var Session3 = class _Session {
189426
189434
  // TODO: GH#18217
189427
189435
  request.arguments.projectRootPath ? toNormalizedPath(request.arguments.projectRootPath) : void 0
189428
189436
  );
189429
- return this.notRequired();
189437
+ return this.notRequired(request);
189430
189438
  },
189431
189439
  ["quickinfo" /* Quickinfo */]: (request) => {
189432
189440
  return this.requiredResponse(this.getQuickInfoWorker(
@@ -189576,41 +189584,39 @@ var Session3 = class _Session {
189576
189584
  },
189577
189585
  ["geterr" /* Geterr */]: (request) => {
189578
189586
  this.errorCheck.startNew((next) => this.getDiagnostics(next, request.arguments.delay, request.arguments.files));
189579
- return this.notRequired();
189587
+ return this.notRequired(
189588
+ /*request*/
189589
+ void 0
189590
+ );
189580
189591
  },
189581
189592
  ["geterrForProject" /* GeterrForProject */]: (request) => {
189582
189593
  this.errorCheck.startNew((next) => this.getDiagnosticsForProject(next, request.arguments.delay, request.arguments.file));
189583
- return this.notRequired();
189594
+ return this.notRequired(
189595
+ /*request*/
189596
+ void 0
189597
+ );
189584
189598
  },
189585
189599
  ["change" /* Change */]: (request) => {
189586
189600
  this.change(request.arguments);
189587
- return this.notRequired();
189601
+ return this.notRequired(request);
189588
189602
  },
189589
189603
  ["configure" /* Configure */]: (request) => {
189590
189604
  this.projectService.setHostConfiguration(request.arguments);
189591
- this.doOutput(
189592
- /*info*/
189593
- void 0,
189594
- "configure" /* Configure */,
189595
- request.seq,
189596
- /*success*/
189597
- true
189598
- );
189599
- return this.notRequired();
189605
+ return this.notRequired(request);
189600
189606
  },
189601
189607
  ["reload" /* Reload */]: (request) => {
189602
- this.reload(request.arguments, request.seq);
189608
+ this.reload(request.arguments);
189603
189609
  return this.requiredResponse({ reloadFinished: true });
189604
189610
  },
189605
189611
  ["saveto" /* Saveto */]: (request) => {
189606
189612
  const savetoArgs = request.arguments;
189607
189613
  this.saveToTmp(savetoArgs.file, savetoArgs.tmpfile);
189608
- return this.notRequired();
189614
+ return this.notRequired(request);
189609
189615
  },
189610
189616
  ["close" /* Close */]: (request) => {
189611
189617
  const closeArgs = request.arguments;
189612
189618
  this.closeClientFile(closeArgs.file);
189613
- return this.notRequired();
189619
+ return this.notRequired(request);
189614
189620
  },
189615
189621
  ["navto" /* Navto */]: (request) => {
189616
189622
  return this.requiredResponse(this.getNavigateToItems(
@@ -189692,9 +189698,9 @@ var Session3 = class _Session {
189692
189698
  ["projectInfo" /* ProjectInfo */]: (request) => {
189693
189699
  return this.requiredResponse(this.getProjectInfo(request.arguments));
189694
189700
  },
189695
- ["reloadProjects" /* ReloadProjects */]: () => {
189701
+ ["reloadProjects" /* ReloadProjects */]: (request) => {
189696
189702
  this.projectService.reloadProjects();
189697
- return this.notRequired();
189703
+ return this.notRequired(request);
189698
189704
  },
189699
189705
  ["jsxClosingTag" /* JsxClosingTag */]: (request) => {
189700
189706
  return this.requiredResponse(this.getJsxClosingTag(request.arguments));
@@ -189789,15 +189795,7 @@ var Session3 = class _Session {
189789
189795
  },
189790
189796
  ["configurePlugin" /* ConfigurePlugin */]: (request) => {
189791
189797
  this.configurePlugin(request.arguments);
189792
- this.doOutput(
189793
- /*info*/
189794
- void 0,
189795
- "configurePlugin" /* ConfigurePlugin */,
189796
- request.seq,
189797
- /*success*/
189798
- true
189799
- );
189800
- return this.notRequired();
189798
+ return this.notRequired(request);
189801
189799
  },
189802
189800
  ["selectionRange" /* SelectionRange */]: (request) => {
189803
189801
  return this.requiredResponse(this.getSmartSelectionRange(
@@ -189897,11 +189895,12 @@ var Session3 = class _Session {
189897
189895
  const { throttleWaitMilliseconds } = opts;
189898
189896
  this.eventHandler = this.canUseEvents ? opts.eventHandler || ((event) => this.defaultEventHandler(event)) : void 0;
189899
189897
  const multistepOperationHost = {
189900
- executeWithRequestId: (requestId, action) => this.executeWithRequestId(requestId, action),
189898
+ executeWithRequestId: (requestId, action, performanceData) => this.executeWithRequestId(requestId, action, performanceData),
189901
189899
  getCurrentRequestId: () => this.currentRequestId,
189900
+ getPerformanceData: () => this.performanceData,
189902
189901
  getServerHost: () => this.host,
189903
189902
  logError: (err, cmd) => this.logError(err, cmd),
189904
- sendRequestCompletedEvent: (requestId) => this.sendRequestCompletedEvent(requestId),
189903
+ sendRequestCompletedEvent: (requestId, performanceData) => this.sendRequestCompletedEvent(requestId, performanceData),
189905
189904
  isCancellationRequested: () => this.cancellationToken.isCancellationRequested()
189906
189905
  };
189907
189906
  this.errorCheck = new MultistepOperation(multistepOperationHost);
@@ -189953,8 +189952,8 @@ var Session3 = class _Session {
189953
189952
  Debug.assertNever(this.projectService.serverMode);
189954
189953
  }
189955
189954
  }
189956
- sendRequestCompletedEvent(requestId) {
189957
- this.event({ request_seq: requestId, performanceData: this.performanceData }, "requestCompleted");
189955
+ sendRequestCompletedEvent(requestId, performanceData) {
189956
+ this.event({ request_seq: requestId, performanceData }, "requestCompleted");
189958
189957
  }
189959
189958
  addPerformanceData(key, value) {
189960
189959
  if (!this.performanceData) {
@@ -190111,14 +190110,14 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
190111
190110
  this.send(toEvent(eventName, body));
190112
190111
  }
190113
190112
  /** @internal */
190114
- doOutput(info, cmdName, reqSeq, success, message) {
190113
+ doOutput(info, cmdName, reqSeq, success, performanceData, message) {
190115
190114
  const res = {
190116
190115
  seq: 0,
190117
190116
  type: "response",
190118
190117
  command: cmdName,
190119
190118
  request_seq: reqSeq,
190120
190119
  success,
190121
- performanceData: this.performanceData
190120
+ performanceData
190122
190121
  };
190123
190122
  if (success) {
190124
190123
  let metadata;
@@ -190148,7 +190147,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
190148
190147
  }
190149
190148
  semanticCheck(file, project) {
190150
190149
  var _a, _b;
190151
- const diagnosticsStartTime = this.hrtime();
190150
+ const diagnosticsStartTime = timestamp();
190152
190151
  (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "semanticCheck", { file, configFilePath: project.canonicalConfigFilePath });
190153
190152
  const diags = isDeclarationFileInJSOnlyNonConfiguredProject(project, file) ? emptyArray2 : project.getLanguageService().getSemanticDiagnostics(file).filter((d) => !!d.file);
190154
190153
  this.sendDiagnosticsEvent(file, project, diags, "semanticDiag", diagnosticsStartTime);
@@ -190156,21 +190155,21 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
190156
190155
  }
190157
190156
  syntacticCheck(file, project) {
190158
190157
  var _a, _b;
190159
- const diagnosticsStartTime = this.hrtime();
190158
+ const diagnosticsStartTime = timestamp();
190160
190159
  (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "syntacticCheck", { file, configFilePath: project.canonicalConfigFilePath });
190161
190160
  this.sendDiagnosticsEvent(file, project, project.getLanguageService().getSyntacticDiagnostics(file), "syntaxDiag", diagnosticsStartTime);
190162
190161
  (_b = tracing) == null ? void 0 : _b.pop();
190163
190162
  }
190164
190163
  suggestionCheck(file, project) {
190165
190164
  var _a, _b;
190166
- const diagnosticsStartTime = this.hrtime();
190165
+ const diagnosticsStartTime = timestamp();
190167
190166
  (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "suggestionCheck", { file, configFilePath: project.canonicalConfigFilePath });
190168
190167
  this.sendDiagnosticsEvent(file, project, project.getLanguageService().getSuggestionDiagnostics(file), "suggestionDiag", diagnosticsStartTime);
190169
190168
  (_b = tracing) == null ? void 0 : _b.pop();
190170
190169
  }
190171
190170
  regionSemanticCheck(file, project, ranges) {
190172
190171
  var _a, _b, _c;
190173
- const diagnosticsStartTime = this.hrtime();
190172
+ const diagnosticsStartTime = timestamp();
190174
190173
  (_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "regionSemanticCheck", { file, configFilePath: project.canonicalConfigFilePath });
190175
190174
  let diagnosticsResult;
190176
190175
  if (!this.shouldDoRegionCheck(file) || !(diagnosticsResult = project.getLanguageService().getRegionSemanticDiagnostics(file, ranges))) {
@@ -190192,7 +190191,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
190192
190191
  sendDiagnosticsEvent(file, project, diagnostics, kind, diagnosticsStartTime, spans) {
190193
190192
  try {
190194
190193
  const scriptInfo = Debug.checkDefined(project.getScriptInfo(file));
190195
- const duration = hrTimeToMilliseconds(this.hrtime(diagnosticsStartTime));
190194
+ const duration = timestamp() - diagnosticsStartTime;
190196
190195
  const body = {
190197
190196
  file,
190198
190197
  diagnostics: diagnostics.map((diag2) => formatDiag(file, project, diag2)),
@@ -191379,22 +191378,13 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
191379
191378
  );
191380
191379
  }
191381
191380
  }
191382
- reload(args, reqSeq) {
191381
+ reload(args) {
191383
191382
  const file = toNormalizedPath(args.file);
191384
191383
  const tempFileName = args.tmpfile === void 0 ? void 0 : toNormalizedPath(args.tmpfile);
191385
191384
  const info = this.projectService.getScriptInfoForNormalizedPath(file);
191386
191385
  if (info) {
191387
191386
  this.changeSeq++;
191388
- if (info.reloadFromFile(tempFileName)) {
191389
- this.doOutput(
191390
- /*info*/
191391
- void 0,
191392
- "reload" /* Reload */,
191393
- reqSeq,
191394
- /*success*/
191395
- true
191396
- );
191397
- }
191387
+ info.reloadFromFile(tempFileName);
191398
191388
  }
191399
191389
  }
191400
191390
  saveToTmp(fileName, tempFileName) {
@@ -191943,11 +191933,20 @@ ${e.message}`;
191943
191933
  }
191944
191934
  exit() {
191945
191935
  }
191946
- notRequired() {
191947
- return { responseRequired: false };
191936
+ notRequired(request) {
191937
+ if (request) this.doOutput(
191938
+ /*info*/
191939
+ void 0,
191940
+ request.command,
191941
+ request.seq,
191942
+ /*success*/
191943
+ true,
191944
+ this.performanceData
191945
+ );
191946
+ return { responseRequired: false, performanceData: this.performanceData };
191948
191947
  }
191949
191948
  requiredResponse(response) {
191950
- return { response, responseRequired: true };
191949
+ return { response, responseRequired: true, performanceData: this.performanceData };
191951
191950
  }
191952
191951
  addProtocolHandler(command, handler) {
191953
191952
  if (this.handlers.has(command)) {
@@ -191965,18 +191964,27 @@ ${e.message}`;
191965
191964
  this.currentRequestId = void 0;
191966
191965
  this.cancellationToken.resetRequest(requestId);
191967
191966
  }
191968
- executeWithRequestId(requestId, f) {
191967
+ // eslint-disable-line @typescript-eslint/unified-signatures
191968
+ executeWithRequestId(requestId, f, perfomanceData) {
191969
+ const currentPerformanceData = this.performanceData;
191969
191970
  try {
191971
+ this.performanceData = perfomanceData;
191970
191972
  this.setCurrentRequest(requestId);
191971
191973
  return f();
191972
191974
  } finally {
191973
191975
  this.resetCurrentRequest(requestId);
191976
+ this.performanceData = currentPerformanceData;
191974
191977
  }
191975
191978
  }
191976
191979
  executeCommand(request) {
191977
191980
  const handler = this.handlers.get(request.command);
191978
191981
  if (handler) {
191979
- const response = this.executeWithRequestId(request.seq, () => handler(request));
191982
+ const response = this.executeWithRequestId(
191983
+ request.seq,
191984
+ () => handler(request),
191985
+ /*perfomanceData*/
191986
+ void 0
191987
+ );
191980
191988
  this.projectService.enableRequestedPlugins();
191981
191989
  return response;
191982
191990
  } else {
@@ -191988,6 +191996,8 @@ ${e.message}`;
191988
191996
  request.seq,
191989
191997
  /*success*/
191990
191998
  false,
191999
+ /*performanceData*/
192000
+ void 0,
191991
192001
  `Unrecognized JSON command: ${request.command}`
191992
192002
  );
191993
192003
  return { responseRequired: false };
@@ -191996,8 +192006,8 @@ ${e.message}`;
191996
192006
  onMessage(message) {
191997
192007
  var _a, _b, _c, _d, _e, _f, _g;
191998
192008
  this.gcTimer.scheduleCollect();
191999
- this.performanceData = void 0;
192000
192009
  let start;
192010
+ const currentPerformanceData = this.performanceData;
192001
192011
  if (this.logger.hasLevel(2 /* requestTime */)) {
192002
192012
  start = this.hrtime();
192003
192013
  if (this.logger.hasLevel(3 /* verbose */)) {
@@ -192017,7 +192027,7 @@ ${e.message}`;
192017
192027
  /*separateBeginAndEnd*/
192018
192028
  true
192019
192029
  );
192020
- const { response, responseRequired } = this.executeCommand(request);
192030
+ const { response, responseRequired, performanceData } = this.executeCommand(request);
192021
192031
  (_c = tracing) == null ? void 0 : _c.pop();
192022
192032
  if (this.logger.hasLevel(2 /* requestTime */)) {
192023
192033
  const elapsedTime = hrTimeToMilliseconds(this.hrtime(start)).toFixed(4);
@@ -192034,7 +192044,8 @@ ${e.message}`;
192034
192044
  request.command,
192035
192045
  request.seq,
192036
192046
  /*success*/
192037
- true
192047
+ true,
192048
+ performanceData
192038
192049
  );
192039
192050
  } else if (responseRequired) {
192040
192051
  this.doOutput(
@@ -192044,6 +192055,7 @@ ${e.message}`;
192044
192055
  request.seq,
192045
192056
  /*success*/
192046
192057
  false,
192058
+ performanceData,
192047
192059
  "No content available."
192048
192060
  );
192049
192061
  }
@@ -192056,7 +192068,8 @@ ${e.message}`;
192056
192068
  request.command,
192057
192069
  request.seq,
192058
192070
  /*success*/
192059
- true
192071
+ true,
192072
+ this.performanceData
192060
192073
  );
192061
192074
  return;
192062
192075
  }
@@ -192069,8 +192082,11 @@ ${e.message}`;
192069
192082
  request ? request.seq : 0,
192070
192083
  /*success*/
192071
192084
  false,
192085
+ this.performanceData,
192072
192086
  "Error processing request. " + err.message + "\n" + err.stack
192073
192087
  );
192088
+ } finally {
192089
+ this.performanceData = currentPerformanceData;
192074
192090
  }
192075
192091
  }
192076
192092
  parseMessage(message) {
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.6.0-dev.20240623",
5
+ "version": "5.6.0-dev.20240625",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -110,5 +110,5 @@
110
110
  "node": "20.1.0",
111
111
  "npm": "8.19.4"
112
112
  },
113
- "gitHead": "5d70bf894efe9014d24d4ba439807311e5b33fb8"
113
+ "gitHead": "6c01f6c584b01caf58f2e860fe954591e8591166"
114
114
  }