Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/server/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,15 @@ namespace ts.server.protocol {
*/
metadata?: unknown;

/* @internal */
performanceData?: PerformanceData;
}

/* @internal */
export interface PerformanceData {
/**
* Time spent updating the program graph, in milliseconds.
*/
/* @internal */
updateGraphDurationMs?: number;
}

Expand Down
6 changes: 5 additions & 1 deletion src/server/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,11 @@ namespace ts.server {
command: cmdName,
request_seq: reqSeq,
success,
updateGraphDurationMs: this.updateGraphDurationMs,
performanceData: !this.updateGraphDurationMs
? undefined
: {
updateGraphDurationMs: this.updateGraphDurationMs,
},
};

if (success) {
Expand Down
10 changes: 5 additions & 5 deletions src/testRunner/unittests/tsserver/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ namespace ts.server {
message: "Unrecognized JSON command: foobar",
request_seq: 0,
success: false,
updateGraphDurationMs: undefined,
performanceData: undefined,
};
expect(lastSent).to.deep.equal(expected);
});
Expand All @@ -128,7 +128,7 @@ namespace ts.server {
request_seq: 0,
seq: 0,
body: undefined,
updateGraphDurationMs: undefined,
performanceData: undefined,
});
});
it("should handle literal types in request", () => {
Expand Down Expand Up @@ -329,7 +329,7 @@ namespace ts.server {
request_seq: 0,
seq: 0,
body: undefined,
updateGraphDurationMs: undefined,
performanceData: undefined,
});
});
});
Expand Down Expand Up @@ -420,7 +420,7 @@ namespace ts.server {
command,
body,
success: true,
updateGraphDurationMs: undefined,
performanceData: undefined,
});
});
});
Expand Down Expand Up @@ -540,7 +540,7 @@ namespace ts.server {
command,
body,
success: true,
updateGraphDurationMs: undefined,
performanceData: undefined,
});
});
it("can add and respond to new protocol handlers", () => {
Expand Down