Description
Refs: #46726
- anyOS Aiday Marlen Kyzy (@aiday-mar)
- anyOS Joyce Er (@joyceerhl)
- anyOS Raymond Zhao (@rzhao271)
- anyOS Paula (@paulacamargo25)
Complexity: 4
Roles: Developer, Engineering Manager
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.
To test
- 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
- Once the extension is installed/adopted the API, navigate to
Help: Report Issueand file an issue on that extension. To test loading, you could force a timeout, etc. - 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
justschen commentedon Oct 24, 2023
Known bug atm that issue data is not being sent over after something I changed yesterday.
rzhao271 commentedon Oct 24, 2023
Not sure how I reassigned Joyce
Just Paula left to verify this issue.