mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-23 19:59:37 +00:00
Fix formatting and version for TS Server issue report
This commit is contained in:
@@ -20,7 +20,7 @@ export class TypeScriptServerError extends Error {
|
|||||||
|
|
||||||
private constructor(
|
private constructor(
|
||||||
serverId: string,
|
serverId: string,
|
||||||
version: TypeScriptVersion,
|
public readonly version: TypeScriptVersion,
|
||||||
private readonly response: Proto.Response,
|
private readonly response: Proto.Response,
|
||||||
public readonly serverMessage: string | undefined,
|
public readonly serverMessage: string | undefined,
|
||||||
public readonly serverStack: string | undefined
|
public readonly serverStack: string | undefined
|
||||||
|
|||||||
@@ -529,7 +529,6 @@ export default class TypeScriptServiceClient extends Disposable implements IType
|
|||||||
id: MessageAction;
|
id: MessageAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
const previousVersion = this.apiVersion;
|
|
||||||
const previousState = this.serverState;
|
const previousState = this.serverState;
|
||||||
this.serverState = ServerState.None;
|
this.serverState = ServerState.None;
|
||||||
|
|
||||||
@@ -570,7 +569,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
|
|||||||
prompt.then(item => {
|
prompt.then(item => {
|
||||||
if (item?.id === MessageAction.reportIssue) {
|
if (item?.id === MessageAction.reportIssue) {
|
||||||
const args = previousState.type === ServerState.Type.Errored && previousState.error instanceof TypeScriptServerError
|
const args = previousState.type === ServerState.Type.Errored && previousState.error instanceof TypeScriptServerError
|
||||||
? getReportIssueArgsForError(previousState.error, previousVersion)
|
? getReportIssueArgsForError(previousState.error)
|
||||||
: undefined;
|
: undefined;
|
||||||
return vscode.commands.executeCommand('workbench.action.openIssueReporter', args);
|
return vscode.commands.executeCommand('workbench.action.openIssueReporter', args);
|
||||||
}
|
}
|
||||||
@@ -875,7 +874,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getReportIssueArgsForError(error: TypeScriptServerError, apiVersion: API): { issueTitle: string, issueBody: string } | undefined {
|
function getReportIssueArgsForError(error: TypeScriptServerError): { issueTitle: string, issueBody: string } | undefined {
|
||||||
if (!error.serverStack || !error.serverMessage) {
|
if (!error.serverStack || !error.serverMessage) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
@@ -885,7 +884,7 @@ function getReportIssueArgsForError(error: TypeScriptServerError, apiVersion: AP
|
|||||||
return {
|
return {
|
||||||
issueTitle: `TS Server fatal error: ${error.serverMessage}`,
|
issueTitle: `TS Server fatal error: ${error.serverMessage}`,
|
||||||
|
|
||||||
issueBody: `**TypeScript Version:** ${apiVersion.fullVersionString}
|
issueBody: `**TypeScript Version:** ${error.version.apiVersion?.fullVersionString}
|
||||||
|
|
||||||
**Steps to reproduce crash**
|
**Steps to reproduce crash**
|
||||||
|
|
||||||
@@ -893,7 +892,7 @@ function getReportIssueArgsForError(error: TypeScriptServerError, apiVersion: AP
|
|||||||
2.
|
2.
|
||||||
3.
|
3.
|
||||||
|
|
||||||
** TS Server Error Stack **
|
**TS Server Error Stack**
|
||||||
|
|
||||||
\`\`\`
|
\`\`\`
|
||||||
${error.serverStack}
|
${error.serverStack}
|
||||||
|
|||||||
Reference in New Issue
Block a user