Skip to content

Test: Issue Reporter Extensions Data API #196324

Closed

Description

Refs: #46726

Complexity: 4
Roles: Developer, Engineering Manager

Create Issue


Overview

Introducing additions to a proposed API that TylerLeonhardt implemented a couple iterations ago. You can read the API proposal here: #46726

The following were added to the proposed API:

	...
	export interface IssueDataProvider {
		provideIssueData(token: CancellationToken): ProviderResult<string>;
		provideIssueTemplate(token: CancellationToken): ProviderResult<string>;
	}

	export namespace env {
		....
		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

You can use this in your extension by adding this to your extension manifest (package.json):

"enabledApiProposals": [
    "handleIssueUri"
  ],

and then run: npx vscode-dts dev which will fetch the proposed API and allow you to see types.

The general idea is that when the Issue Reporter has selected an extension that implements this API, then either provideIssueData, provideIssueTemplate, or handleIssueUrlRequest will be fired. For the first two (the ones on this TPI), you can provide it a string to be filled into the text boxes on the issue reporter page. some examples:

  • for the template: markdown with places for the user to manually fill in data, in string format.
  • for the issue data: extensions data of any kind, in string format.

When you use this part of the API, the Issue Reporter will populate the description text box with the template (if any) and will add a checkbox and label, where you can click show to display the extensions data, if any. There is also a loading animation if there is extension data that takes a while. There is a timeout of 5 seconds, after which an error message will appear in the extension data text box instead.

Example:
Recording 2023-10-23 at 12 05 14

To test

  1. Must have an external extension with this API adopted. If you have a personal extension to test on, fantastic. If not, check out this extension's suuuper basic implementation
  2. Once the extension is installed/adopted the API, navigate to Help: Report Issue and file an issue on that extension. To test loading, you could force a timeout, etc.
  3. Fill in some blanks, then hit submit/preview. NOTE: if you are signed in on GitHub in Insiders, it will automatically submit the issue. You can only preview when signed out of GitHub.

Some things to make sure:

  • The right things are hidden
  • When you switch between an extension that implements this API and one that doesn't that the right info in the issue reporter is shown/hidden
  • Data is populated correctly in both template and extension data sections.
  • When loading, you should be unable to submit the issue.
  • Correct text is sent to GitHub after pressing submit
     

Let me know what you think overall!

Note: you must adopt this in an external extension (not a built-in to VS Code one)

Helpful links

Activity

  1. removed their assignment
    on Oct 24, 2023
  2. justschen commented on Oct 24, 2023

    @justschen
    CollaboratorAuthor

    Known bug atm that issue data is not being sent over after something I changed yesterday.

  3. rzhao271 commented on Oct 24, 2023

    @rzhao271
    Collaborator

    Not sure how I reassigned Joyce
    Just Paula left to verify this issue.

  4. locked and limited conversation to collaborators on Dec 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions