Skip to content

Commit 0bc35c0

Browse files
committed
Use issue reporter command
1 parent 153f19c commit 0bc35c0

File tree

3 files changed

+9
-16
lines changed

3 files changed

+9
-16
lines changed

src/coreclr-debug/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export function getTargetArchitecture(platformInfo: PlatformInformation, launchJ
128128

129129
// Otherwise, look at the runtime ID.
130130
if (!dotnetInfo.RuntimeId) {
131-
throw new Error(`Unable to determine RuntimeId. Please set 'targetArchitecture' in your launch.json configuration.`)
131+
throw new Error(`Unable to determine RuntimeId. Please set 'targetArchitecture' in your launch.json configuration.`);
132132
}
133133

134134
if (dotnetInfo.RuntimeId.includes('arm64'))

src/shared/reportIssue.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ import { Options } from "../shared/options";
88
import { IHostExecutableResolver } from "../shared/constants/IHostExecutableResolver";
99
import { basename, dirname } from "path";
1010
import { DotnetInfo } from "./utils/getDotnetInfo";
11-
12-
const issuesUrl = "https://github.com/dotnet/vscode-csharp/issues/new";
11+
import { CSharpExtensionId } from "../constants/CSharpExtensionId";
1312

1413
export default async function reportIssue(
1514
vscode: vscode,
@@ -65,10 +64,10 @@ ${generateExtensionTable(extensions)}
6564
</details>
6665
`;
6766

68-
const issueDefault = "Please paste the output from your clipboard";
69-
const fullUrl = `${issuesUrl}?body=${issueDefault}`;
70-
await vscode.env.clipboard.writeText(body);
71-
vscode.env.openExternal(vscode.Uri.parse(fullUrl));
67+
await vscode.commands.executeCommand("workbench.action.openIssueReporter", {
68+
extensionId: CSharpExtensionId,
69+
issueBody: body
70+
});
7271
}
7372

7473
function sortExtensions(a: Extension<any>, b: Extension<any>): number {

test/unitTests/features/reportIssue.test.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import { URI } from 'vscode-uri';
76
import { getFakeVsCode } from "../testAssets/Fakes";
87
import reportIssue from "../../../src/shared/reportIssue";
98
import { expect } from "chai";
@@ -55,14 +54,9 @@ suite(`${reportIssue.name}`, () => {
5554

5655
setup(() => {
5756
vscode = getFakeVsCode();
58-
vscode.Uri.parse = (value) => { return URI.parse(value); };
59-
vscode.env.openExternal = async (value) => {
60-
return Promise.resolve(true);
61-
};
62-
63-
vscode.env.clipboard.writeText = async (body: string) => {
64-
issueBody = body;
65-
return Promise.resolve();
57+
vscode.commands.executeCommand = async (command: string, ...rest: any[]) => {
58+
issueBody = rest[0].issueBody;
59+
return undefined;
6660
};
6761

6862
vscode.version = vscodeVersion;

0 commit comments

Comments
 (0)