From ac146c705572e685ddd9d6be55d34ec7d8f9b6ca Mon Sep 17 00:00:00 2001 From: Andy Jordan <2226434+andyleejordan@users.noreply.github.com> Date: Tue, 25 Nov 2025 12:22:51 -0800 Subject: [PATCH] Replace `GenerateBugReport` We think it's probably causing our spam issues. --- package.json | 11 ------ src/extension.ts | 2 -- src/features/GenerateBugReport.ts | 57 ------------------------------- src/session.ts | 6 ++-- 4 files changed, 4 insertions(+), 72 deletions(-) delete mode 100644 src/features/GenerateBugReport.ts diff --git a/package.json b/package.json index ab43bb8176..ba508c418c 100644 --- a/package.json +++ b/package.json @@ -233,11 +233,6 @@ "title": "Open PowerShell Extension Logs Folder", "category": "PowerShell" }, - { - "command": "PowerShell.GenerateBugReport", - "title": "Upload Bug Report to GitHub", - "category": "PowerShell" - }, { "command": "PowerShell.OpenInISE", "title": "Open Current File in PowerShell ISE", @@ -1150,12 +1145,6 @@ "type": "number", "default": 240, "markdownDescription": "Specifies how many seconds the extension will wait for the LSP server, PowerShell Editor Services, to connect. The default is four minutes; try increasing this value if your computer is particularly slow (often caused by overactive anti-malware programs)." - }, - "powershell.bugReporting.project": { - "type": "string", - "default": "https://github.com/PowerShell/vscode-powershell", - "markdownDescription": "**Deprecated:** Specifies the URL of the GitHub project in which to generate bug reports.", - "markdownDeprecationMessage": "**Deprecated:** This setting was never meant to be changed!" } } } diff --git a/src/extension.ts b/src/extension.ts index d89708440f..f7eec99171 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -17,7 +17,6 @@ import { ExternalApiFeature, type IPowerShellExtensionClient, } from "./features/ExternalApi"; -import { GenerateBugReportFeature } from "./features/GenerateBugReport"; import { GetCommandsFeature } from "./features/GetCommands"; import { HelpCompletionFeature } from "./features/HelpCompletion"; import { ISECompatibilityFeature } from "./features/ISECompatibility"; @@ -162,7 +161,6 @@ export async function activate( // Register commands that do not require Language client commandRegistrations = [ new ExamplesFeature(), - new GenerateBugReportFeature(sessionManager), new ISECompatibilityFeature(), new OpenInISEFeature(), new PesterTestsFeature(sessionManager, logger), diff --git a/src/features/GenerateBugReport.ts b/src/features/GenerateBugReport.ts deleted file mode 100644 index 6539f978d9..0000000000 --- a/src/features/GenerateBugReport.ts +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import vscode = require("vscode"); -import child_process = require("child_process"); -import { SessionManager } from "../session"; - -const issuesUrl = "https://github.com/PowerShell/vscode-powershell/issues/new?"; - -export class GenerateBugReportFeature implements vscode.Disposable { - private command: vscode.Disposable; - - constructor(private sessionManager: SessionManager) { - this.command = vscode.commands.registerCommand( - "PowerShell.GenerateBugReport", - async () => { - const params = [ - "labels=Issue-Bug", - "template=bug-report.yml", - "powershell-version=" + this.getRuntimeInfo(), - "vscode-version=" + vscode.version + "\n" + process.arch, - "extension-version=" + - sessionManager.Publisher + - "." + - sessionManager.HostName + - "@" + - sessionManager.HostVersion, - ]; - const url = vscode.Uri.parse( - issuesUrl + encodeURIComponent(params.join("&")), - ); - await vscode.env.openExternal(url); - }, - ); - } - - public dispose(): void { - this.command.dispose(); - } - - private getRuntimeInfo(): string { - if (this.sessionManager.PowerShellExeDetails === undefined) { - return "Session's PowerShell details are unknown!"; - } - const child = child_process.spawnSync( - this.sessionManager.PowerShellExeDetails.exePath, - [ - "-NoProfile", - "-NoLogo", - "-Command", - "$PSVersionTable | Out-String", - ], - ); - // Replace semicolons as they'll cause the URI component to truncate - return child.stdout.toString().trim().replace(";", ","); - } -} diff --git a/src/session.ts b/src/session.ts index df8fd9fbe9..a6bfde9b94 100644 --- a/src/session.ts +++ b/src/session.ts @@ -1270,8 +1270,10 @@ Type 'help' to get help. { prompt: "Open an Issue", action: async (): Promise => { - await vscode.commands.executeCommand( - "PowerShell.GenerateBugReport", + await vscode.env.openExternal( + vscode.Uri.parse( + "https://github.com/PowerShell/vscode-powershell/issues/new/choose", + ), ); }, },