Let extensions prepopulate the issue reporter title and description (#91039)

* Let extensions prepopulate the issue reporter title and description

Fixes #91028

Adds two new optional arguments to the `vscode.openIssueReporter` command: `issueTitle` and `issueBody`. These are taken using an options object and are used to pre-populate the native issue reporter fields

Hooks up these fields for TypeScript's report issue prompt. We use this to post the most recent TS Server error stack

* Extract duplicate command id to constant

* Log version directly instead of prompting users for it
This commit is contained in:
Matt Bierner
2020-02-20 10:31:09 -08:00
committed by GitHub
parent 9061a91fed
commit 0b3aa0a6ea
8 changed files with 99 additions and 23 deletions

View File

@@ -174,10 +174,20 @@ export class RemoveFromRecentlyOpenedAPICommand {
}
CommandsRegistry.registerCommand(RemoveFromRecentlyOpenedAPICommand.ID, adjustHandler(RemoveFromRecentlyOpenedAPICommand.execute));
export interface OpenIssueReporterArgs {
readonly extensionId: string;
readonly issueTitle?: string;
readonly issueBody?: string;
}
export class OpenIssueReporter {
public static readonly ID = 'vscode.openIssueReporter';
public static execute(executor: ICommandsExecutor, extensionId: string): Promise<void> {
return executor.executeCommand('workbench.action.openIssueReporter', [extensionId]);
public static execute(executor: ICommandsExecutor, args: string | OpenIssueReporterArgs): Promise<void> {
const commandArgs = typeof args === 'string'
? { extensionId: args }
: args;
return executor.executeCommand('workbench.action.openIssueReporter', commandArgs);
}
}