Include server id in telemetry and in user issue reports

From https://github.com/microsoft/TypeScript/issues/39795#issuecomment-668250348
This commit is contained in:
Matt Bierner
2020-08-03 16:03:27 -07:00
parent 358cc674a7
commit 4430401028
2 changed files with 6 additions and 2 deletions

View File

@@ -18,7 +18,7 @@ export class TypeScriptServerError extends Error {
}
private constructor(
serverId: string,
public readonly serverId: string,
public readonly version: TypeScriptVersion,
private readonly response: Proto.Response,
public readonly serverMessage: string | undefined,
@@ -38,11 +38,13 @@ export class TypeScriptServerError extends Error {
/* __GDPR__FRAGMENT__
"TypeScriptRequestErrorProperties" : {
"command" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"sanitizedstack" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
"serverid" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
"sanitizedstack" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" },
}
*/
return {
command: this.serverCommand,
serverid: this.serverId,
sanitizedstack: this.sanitizedStack || '',
} as const;
}

View File

@@ -963,6 +963,8 @@ After enabling this setting, future crash reports will include the server log.`)
sections.push(`**TS Server Error Stack**
Server: \`${error.serverId}\`
\`\`\`
${error.serverStack}
\`\`\``);