Skip to content

Commit 4430401

Browse files
committed
Include server id in telemetry and in user issue reports
From microsoft/TypeScript#39795 (comment)
1 parent 358cc67 commit 4430401

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

extensions/typescript-language-features/src/tsServer/serverError.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class TypeScriptServerError extends Error {
1818
}
1919

2020
private constructor(
21-
serverId: string,
21+
public readonly serverId: string,
2222
public readonly version: TypeScriptVersion,
2323
private readonly response: Proto.Response,
2424
public readonly serverMessage: string | undefined,
@@ -38,11 +38,13 @@ export class TypeScriptServerError extends Error {
3838
/* __GDPR__FRAGMENT__
3939
"TypeScriptRequestErrorProperties" : {
4040
"command" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
41-
"sanitizedstack" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
41+
"serverid" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
42+
"sanitizedstack" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
4243
}
4344
*/
4445
return {
4546
command: this.serverCommand,
47+
serverid: this.serverId,
4648
sanitizedstack: this.sanitizedStack || '',
4749
} as const;
4850
}

extensions/typescript-language-features/src/typescriptServiceClient.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -963,6 +963,8 @@ After enabling this setting, future crash reports will include the server log.`)
963963

964964
sections.push(`**TS Server Error Stack**
965965
966+
Server: \`${error.serverId}\`
967+
966968
\`\`\`
967969
${error.serverStack}
968970
\`\`\``);

0 commit comments

Comments
 (0)