mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 18:49:00 +01:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user