Skip to content

Commit 4bfbf09

Browse files
Fix PowerShell launch current file args snippet (#4671)
1 parent 9c59338 commit 4bfbf09

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

‎package.json‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,20 @@
545545
"cwd": "^\"\\${cwd}\""
546546
}
547547
},
548+
{
549+
"label": "PowerShell: Launch Current File w/Args Prompt",
550+
"description": "Launch and debug the current file, prompting for command-line arguments",
551+
"body": {
552+
"name": "PowerShell Launch Current File w/Args Prompt",
553+
"type": "PowerShell",
554+
"request": "launch",
555+
"script": "^\"\\${file}\"",
556+
"args": [
557+
"\\${command:SpecifyScriptArgs}"
558+
],
559+
"cwd": "^\"\\${cwd}\""
560+
}
561+
},
548562
{
549563
"label": "PowerShell: Launch Script",
550564
"description": "Launch and debug the specified file or command",

‎src/features/DebugSession.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export const StopDebuggerNotificationType = new NotificationType<void>(
4848

4949
export enum DebugConfig {
5050
LaunchCurrentFile,
51+
LaunchCurrentFileWithArgsPrompt,
5152
LaunchScript,
5253
InteractiveSession,
5354
AttachHostProcess,
@@ -79,6 +80,13 @@ export const DebugConfigurations: Record<DebugConfig, DebugConfiguration> = {
7980
script: "${file}",
8081
args: [],
8182
},
83+
[DebugConfig.LaunchCurrentFileWithArgsPrompt]: {
84+
name: "PowerShell: Launch Current File w/Args Prompt",
85+
type: "PowerShell",
86+
request: "launch",
87+
script: "${file}",
88+
args: ["${command:SpecifyScriptArgs}"],
89+
},
8290
[DebugConfig.LaunchScript]: {
8391
name: "PowerShell: Launch Script",
8492
type: "PowerShell",
@@ -241,6 +249,12 @@ export class DebugSessionFeature
241249
description:
242250
"Launch and debug the file in the currently active editor window",
243251
},
252+
{
253+
id: DebugConfig.LaunchCurrentFileWithArgsPrompt,
254+
label: "Launch Current File w/Args Prompt",
255+
description:
256+
"Launch and debug the current file, prompting for command-line arguments",
257+
},
244258
{
245259
id: DebugConfig.LaunchScript,
246260
label: "Launch Script",

0 commit comments

Comments
 (0)