typescript 5.6.0-dev.20240703 → 5.6.0-dev.20240704

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.20240703`;
21
+ var version = `${versionMajorMinor}.0-dev.20240704`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -214,6 +214,22 @@ declare namespace ts {
214
214
  * The time spent creating or updating the auto-import program, in milliseconds.
215
215
  */
216
216
  createAutoImportProviderProgramDurationMs?: number;
217
+ /**
218
+ * The time spent computing diagnostics, in milliseconds.
219
+ */
220
+ diagnosticsDuration?: FileDiagnosticPerformanceData[];
221
+ }
222
+ /**
223
+ * Time spent computing each kind of diagnostics, in milliseconds.
224
+ */
225
+ export type DiagnosticPerformanceData = {
226
+ [Kind in DiagnosticEventKind]?: number;
227
+ };
228
+ export interface FileDiagnosticPerformanceData extends DiagnosticPerformanceData {
229
+ /**
230
+ * The file for which the performance data is reported.
231
+ */
232
+ file: string;
217
233
  }
218
234
  /**
219
235
  * Arguments for FileRequest messages.
@@ -1979,10 +1995,6 @@ declare namespace ts {
1979
1995
  * Spans where the region diagnostic was requested, if this is a region semantic diagnostic event.
1980
1996
  */
1981
1997
  spans?: TextSpan[];
1982
- /**
1983
- * Time spent computing the diagnostics, in milliseconds.
1984
- */
1985
- duration?: number;
1986
1998
  }
1987
1999
  export type DiagnosticEventKind = "semanticDiag" | "syntaxDiag" | "suggestionDiag" | "regionSemanticDiag";
1988
2000
  /**
@@ -3416,6 +3428,7 @@ declare namespace ts {
3416
3428
  constructor(opts: SessionOptions);
3417
3429
  private sendRequestCompletedEvent;
3418
3430
  private addPerformanceData;
3431
+ private addDiagnosticsPerformanceData;
3419
3432
  private performanceEventHandler;
3420
3433
  private defaultEventHandler;
3421
3434
  private projectsUpdatedInBackgroundEvent;
package/lib/typescript.js CHANGED
@@ -2250,7 +2250,7 @@ module.exports = __toCommonJS(typescript_exports);
2250
2250
 
2251
2251
  // src/compiler/corePublic.ts
2252
2252
  var versionMajorMinor = "5.6";
2253
- var version = `${versionMajorMinor}.0-dev.20240703`;
2253
+ var version = `${versionMajorMinor}.0-dev.20240704`;
2254
2254
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2255
2255
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2256
2256
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -189594,7 +189594,13 @@ var Session3 = class _Session {
189594
189594
  }
189595
189595
  }
189596
189596
  sendRequestCompletedEvent(requestId, performanceData) {
189597
- this.event({ request_seq: requestId, performanceData }, "requestCompleted");
189597
+ this.event(
189598
+ {
189599
+ request_seq: requestId,
189600
+ performanceData: performanceData && toProtocolPerformanceData(performanceData)
189601
+ },
189602
+ "requestCompleted"
189603
+ );
189598
189604
  }
189599
189605
  addPerformanceData(key, value) {
189600
189606
  if (!this.performanceData) {
@@ -189602,6 +189608,15 @@ var Session3 = class _Session {
189602
189608
  }
189603
189609
  this.performanceData[key] = (this.performanceData[key] ?? 0) + value;
189604
189610
  }
189611
+ addDiagnosticsPerformanceData(file, kind, duration) {
189612
+ var _a, _b;
189613
+ if (!this.performanceData) {
189614
+ this.performanceData = {};
189615
+ }
189616
+ let fileDiagnosticDuration = (_a = this.performanceData.diagnosticsDuration) == null ? void 0 : _a.get(file);
189617
+ if (!fileDiagnosticDuration) ((_b = this.performanceData).diagnosticsDuration ?? (_b.diagnosticsDuration = /* @__PURE__ */ new Map())).set(file, fileDiagnosticDuration = {});
189618
+ fileDiagnosticDuration[kind] = duration;
189619
+ }
189605
189620
  performanceEventHandler(event) {
189606
189621
  switch (event.kind) {
189607
189622
  case "UpdateGraph":
@@ -189758,7 +189773,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
189758
189773
  command: cmdName,
189759
189774
  request_seq: reqSeq,
189760
189775
  success,
189761
- performanceData
189776
+ performanceData: performanceData && toProtocolPerformanceData(performanceData)
189762
189777
  };
189763
189778
  if (success) {
189764
189779
  let metadata;
@@ -189836,13 +189851,13 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
189836
189851
  const body = {
189837
189852
  file,
189838
189853
  diagnostics: diagnostics.map((diag2) => formatDiag(file, project, diag2)),
189839
- spans: spans == null ? void 0 : spans.map((span) => toProtocolTextSpan(span, scriptInfo)),
189840
- duration
189854
+ spans: spans == null ? void 0 : spans.map((span) => toProtocolTextSpan(span, scriptInfo))
189841
189855
  };
189842
189856
  this.event(
189843
189857
  body,
189844
189858
  kind
189845
189859
  );
189860
+ this.addDiagnosticsPerformanceData(file, kind, duration);
189846
189861
  } catch (err) {
189847
189862
  this.logError(err, kind);
189848
189863
  }
@@ -191749,6 +191764,10 @@ ${e.message}`;
191749
191764
  return this.projectService.getHostPreferences();
191750
191765
  }
191751
191766
  };
191767
+ function toProtocolPerformanceData(performanceData) {
191768
+ const diagnosticsDuration = performanceData.diagnosticsDuration && arrayFrom(performanceData.diagnosticsDuration, ([file, data]) => ({ ...data, file }));
191769
+ return { ...performanceData, diagnosticsDuration };
191770
+ }
191752
191771
  function toProtocolTextSpan(textSpan, scriptInfo) {
191753
191772
  return {
191754
191773
  start: scriptInfo.positionToLineOffset(textSpan.start),
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.20240703",
5
+ "version": "5.6.0-dev.20240704",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -113,5 +113,5 @@
113
113
  "node": "20.1.0",
114
114
  "npm": "8.19.4"
115
115
  },
116
- "gitHead": "7bd7dfc007999f6ed2ab0491821d9d136b6293d4"
116
+ "gitHead": "c3efeb9d1b7414319d006cb6a6aa770051c70fad"
117
117
  }