Skip to content
This repository was archived by the owner on Jul 20, 2026. It is now read-only.

Commit e1706d4

Browse files
authored
Use built-in issue reporter to hopefully get higher quality issues (#4437)
1 parent 4799004 commit e1706d4

4 files changed

Lines changed: 29 additions & 11 deletions

File tree

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,11 @@
600600
"when": "view == dockerContainers && viewItem == containerFile",
601601
"group": "inline@1"
602602
}
603+
],
604+
"issue/reporter": [
605+
{
606+
"command": "vscode-docker.help.reportIssue"
607+
}
603608
]
604609
},
605610
"debuggers": [

src/commands/help.ts

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export async function help(context: IActionContext): Promise<void> {
1616
const items: HelpMenuItem[] = [
1717
{ label: vscode.l10n.t('Get started with Docker...'), handler: getStarted, telemetryID: 'getStarted' },
1818
{ label: vscode.l10n.t('Review Docker extension issues...'), handler: reviewIssues, telemetryID: 'reviewIssues' },
19-
{ label: vscode.l10n.t('Report Docker extension issue...'), handler: reportIssue, telemetryID: 'reportIssue' },
19+
{ label: vscode.l10n.t('Report Docker extension issue...'), handler: reportIssueFromHelpMenu, telemetryID: 'reportIssue' },
2020
{ label: vscode.l10n.t('Edit settings...'), handler: editSettings, telemetryID: 'editSettings' }
2121
];
2222

@@ -26,20 +26,34 @@ export async function help(context: IActionContext): Promise<void> {
2626
await selectedItem.handler();
2727
}
2828

29+
export async function reportIssue(context: IActionContext): Promise<void> {
30+
await vscode.commands.executeCommand('workbench.action.openIssueReporter', {
31+
extensionId: extensionId,
32+
issueBody: undefined, // Leaving repro steps undefined forces the user to type in *something*, which is hopefully helpful
33+
data: await getIssueData(),
34+
});
35+
}
36+
2937
async function getStarted(): Promise<void> {
30-
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
31-
vscode.env.openExternal(vscode.Uri.parse('https://code.visualstudio.com/docs/containers/overview'));
38+
void vscode.env.openExternal(vscode.Uri.parse('https://code.visualstudio.com/docs/containers/overview'));
3239
}
3340

3441
async function reviewIssues(): Promise<void> {
35-
/* eslint-disable-next-line @typescript-eslint/no-floating-promises */
36-
vscode.env.openExternal(vscode.Uri.parse('https://github.com/microsoft/vscode-docker/issues'));
42+
void vscode.env.openExternal(vscode.Uri.parse('https://github.com/microsoft/vscode-docker/issues'));
3743
}
3844

39-
async function reportIssue(): Promise<void> {
40-
return vscode.commands.executeCommand('vscode.openIssueReporter', `${extensionId}`);
45+
async function reportIssueFromHelpMenu(): Promise<void> {
46+
return vscode.commands.executeCommand('vscode-docker.help.reportIssue');
4147
}
4248

4349
async function editSettings(): Promise<void> {
4450
return vscode.commands.executeCommand('workbench.action.openSettings', `@ext:${extensionId}`);
4551
}
52+
53+
async function getIssueData(): Promise<string> {
54+
return `App Host: ${vscode.env.appHost}
55+
Remote Name: ${vscode.env.remoteName}
56+
Language: ${vscode.env.language}
57+
58+
`; // Add a couple newlines after the data because VSCode doesn't
59+
}

src/commands/registerCommands.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import { configureDockerContextsExplorer, dockerContextsHelp } from "./context/D
3030
import { inspectDockerContext } from "./context/inspectDockerContext";
3131
import { removeDockerContext } from "./context/removeDockerContext";
3232
import { useDockerContext } from "./context/useDockerContext";
33-
import { help } from "./help";
33+
import { help, reportIssue } from "./help";
3434
import { buildImage } from "./images/buildImage";
3535
import { configureImagesExplorer } from "./images/configureImagesExplorer";
3636
import { copyFullTag } from "./images/copyFullTag";
@@ -208,6 +208,7 @@ export function registerCommands(): void {
208208
registerCommand('vscode-docker.openDockerDownloadPage', openDockerDownloadPage);
209209
registerCommand('vscode-docker.help', help);
210210
registerCommand('vscode-docker.help.openWalkthrough', () => commands.executeCommand('workbench.action.openWalkthrough', 'ms-azuretools.vscode-docker#dockerStart'));
211+
registerCommand('vscode-docker.help.reportIssue', reportIssue);
211212

212213
registerCommand('vscode-docker.activateRegistryProviders', (context: IActionContext) => {
213214
// Do nothing, but registry provider extensions can use this command as an activation event

src/extension.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import { TelemetryEvent } from '@microsoft/compose-language-service/lib/client/TelemetryEvent';
7-
import { callWithTelemetryAndErrorHandling, createExperimentationService, IActionContext, registerErrorHandler, registerEvent, registerReportIssueCommand, registerUIExtensionVariables, UserCancelledError } from '@microsoft/vscode-azext-utils';
7+
import { callWithTelemetryAndErrorHandling, createExperimentationService, IActionContext, registerErrorHandler, registerEvent, registerUIExtensionVariables, UserCancelledError } from '@microsoft/vscode-azext-utils';
88
import * as path from 'path';
99
import * as vscode from 'vscode';
1010
import { ConfigurationParams, DidChangeConfigurationNotification, DocumentSelector, LanguageClient, LanguageClientOptions, Middleware, ServerOptions, TransportKind } from 'vscode-languageclient/node';
@@ -78,9 +78,7 @@ export async function activateInternal(ctx: vscode.ExtensionContext, perfStats:
7878
// (new SurveyManager()).activate();
7979

8080
// Remove the "Report Issue" button from all error messages in favor of the command
81-
// TODO: use built-in issue reporter if/when support is added to include arbitrary info in addition to repro steps (which we would leave blank to force the user to type *something*)
8281
registerErrorHandler(ctx => ctx.errorHandling.suppressReportIssue = true);
83-
registerReportIssueCommand('vscode-docker.help.reportIssue');
8482

8583
// Set up Dockerfile completion provider
8684
ctx.subscriptions.push(

0 commit comments

Comments
 (0)