Skip to content

Proposal: Support configuring data sent to extensions for Issue Reporter #196863

@justschen

Description

@justschen

Motivation

As discussed in #46726 and #45673, now that users can choose to file on extensions, extension authors should be able to specify additional data to include in the report. This could potentially include:

  • User settings
  • launch.json information
  • Metadata about the workspace (is it multiroot)
  • Console errors
  • General data specific to the extension

Additionally, many extensions are using a similar command which creates the option in the quick pick to report on issue specifically on that extension. This flow will open the issue reporter, similarly to Help: Report Issue, but with the extension automatically selected, and can also provide a template to the issue body.

However, with many extensions installed, this can become bloated and when extensions what users to add additional information, they would like users to go through the full flow of the reporter to ensure that users never forget to fill in information.

Proposal

Adding an API with the following:

        export interface IssueUriRequestHandler {
		// Handle the request by the issue reporter for the Uri you want to direct the user to.
		handleIssueUrlRequest(): ProviderResult<Uri>;
	}

	export interface IssueDataProvider {
		// Provide the data to be used in the issue reporter.
		provideIssueData(token: CancellationToken): ProviderResult<string>;

		// Provide the template to be used in the description of issue reporter.
		provideIssueTemplate(token: CancellationToken): ProviderResult<string>;
	}

	export namespace env {
		export function registerIssueUriRequestHandler(handler: IssueUriRequestHandler): Disposable;
		export function registerIssueDataProvider(provider: IssueDataProvider): Disposable;
	}

dts can be found at https://github.com/microsoft/vscode/blob/main/src/vscode-dts/vscode.proposed.handleIssueUri.d.ts

Via IssueUriRequestHandler, extensions can choose to direct users to file the extension externally. By providing a URI to the API, the Issue Reporter will show the following:

externally handled demo

Via IssueDataProvider, extensions can apply a template and specify data, which will populate the template in the issue description body or a previewable text box with extension data, like below.

demo of issue reporter api handled issue

Additionally, we'll be adding a new activation event: onIssueReporterOpened which will activate the extension when the extension is selected in the extension selection section of the issue reporter. This ensures that extensions that are activated via means other than onStartupFinished will be able to contribute to the issue reporter via their API.

Limitations

The main limitation in this API is that the information and extension data can only be sent via the API in string format.

Additionally, at the moment, users would be unable to edit or modify the extension data that is sent. It's expected that users trust the extension to send the correct data and information and will be able to opt in or out of sending that extension data after previewing. However, if there are specific parts of the extension data that users would not want to send, they would only be able to send all or none.

The workaround is allowing the extension data text box to be editable, like the issue description. However, this may be an overload of information.

Another limitation is that only a single template can be provided, so users would break out of VS Code and have to report directly on GitHub if we want to direct them to one of the templates like below:

Screenshot 2023-11-02 at 3 05 22 PM

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions