diff --git a/package.json b/package.json index 75eaf159e8..22b6f9098a 100644 --- a/package.json +++ b/package.json @@ -545,6 +545,20 @@ "cwd": "^\"\\${cwd}\"" } }, + { + "label": "PowerShell: Launch Current File w/Args Prompt", + "description": "Launch and debug the current file, prompting for command-line arguments", + "body": { + "name": "PowerShell Launch Current File w/Args Prompt", + "type": "PowerShell", + "request": "launch", + "script": "^\"\\${file}\"", + "args": [ + "\\${command:SpecifyScriptArgs}" + ], + "cwd": "^\"\\${cwd}\"" + } + }, { "label": "PowerShell: Launch Script", "description": "Launch and debug the specified file or command", diff --git a/src/features/DebugSession.ts b/src/features/DebugSession.ts index 020dff73b0..3f9a568b93 100644 --- a/src/features/DebugSession.ts +++ b/src/features/DebugSession.ts @@ -48,6 +48,7 @@ export const StopDebuggerNotificationType = new NotificationType( export enum DebugConfig { LaunchCurrentFile, + LaunchCurrentFileWithArgsPrompt, LaunchScript, InteractiveSession, AttachHostProcess, @@ -79,6 +80,13 @@ export const DebugConfigurations: Record = { script: "${file}", args: [], }, + [DebugConfig.LaunchCurrentFileWithArgsPrompt]: { + name: "PowerShell: Launch Current File w/Args Prompt", + type: "PowerShell", + request: "launch", + script: "${file}", + args: ["${command:SpecifyScriptArgs}"], + }, [DebugConfig.LaunchScript]: { name: "PowerShell: Launch Script", type: "PowerShell", @@ -241,6 +249,12 @@ export class DebugSessionFeature description: "Launch and debug the file in the currently active editor window", }, + { + id: DebugConfig.LaunchCurrentFileWithArgsPrompt, + label: "Launch Current File w/Args Prompt", + description: + "Launch and debug the current file, prompting for command-line arguments", + }, { id: DebugConfig.LaunchScript, label: "Launch Script",