Skip to content

Commit 0f39d44

Browse files
committed
Remove w/Args prompt debug config snippet
Switch to int id check in provideDebugConfig
1 parent e2aeecd commit 0f39d44

File tree

2 files changed

+14
-23
lines changed

2 files changed

+14
-23
lines changed

package.json

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -339,20 +339,6 @@
339339
"cwd": "^\"\\${file}\""
340340
}
341341
},
342-
{
343-
"label": "PowerShell: Launch Current File w/Args Prompt",
344-
"description": "Launch and debug the file in the currently active editor window, prompting first for arguments",
345-
"body": {
346-
"name": "PowerShell Launch Current File w/Args Prompt",
347-
"type": "PowerShell",
348-
"request": "launch",
349-
"script": "^\"\\${file}\"",
350-
"args": [
351-
"^\"\\${command:SpecifyScriptArgs}\""
352-
],
353-
"cwd": "^\"\\${file}\""
354-
}
355-
},
356342
{
357343
"label": "PowerShell: Launch Script",
358344
"description": "Launch and debug the specified file or command",

src/features/DebugSession.ts

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,29 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider
4747
folder: WorkspaceFolder | undefined,
4848
token?: CancellationToken): Promise<DebugConfiguration[]> {
4949

50-
const launchCurrentFileLabel = "Launch Current File";
51-
const launchScriptLabel = "Launch Script";
52-
const interactiveSessionLabel = "Interactive Session";
50+
const launchCurrentFileId = 0;
51+
const launchScriptId = 1;
52+
const interactiveSessionId = 2;
53+
const attachHostProcessId = 3;
5354

5455
const debugConfigPickItems = [
5556
{
56-
label: launchCurrentFileLabel,
57+
id: launchCurrentFileId,
58+
label: "Launch Current File",
5759
description: "Launch and debug the file in the currently active editor window",
5860
},
5961
{
60-
label: launchScriptLabel,
62+
id: launchScriptId,
63+
label: "Launch Script",
6164
description: "Launch and debug the specified file or command",
6265
},
6366
{
64-
label: interactiveSessionLabel,
67+
id: interactiveSessionId,
68+
label: "Interactive Session",
6569
description: "Debug commands executed from the Integrated Console",
6670
},
6771
{
72+
id: attachHostProcessId,
6873
label: "Attach",
6974
description: "Attach the debugger to a running PowerShell Host Process",
7075
},
@@ -75,7 +80,7 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider
7580
debugConfigPickItems,
7681
{ placeHolder: "Select a PowerShell debug configuration" });
7782

78-
if (launchSelection.label === launchCurrentFileLabel) {
83+
if (launchSelection.id === launchCurrentFileId) {
7984
return [
8085
{
8186
name: "PowerShell: Launch Current File",
@@ -85,7 +90,7 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider
8590
cwd: "${file}",
8691
},
8792
];
88-
} else if (launchSelection.label === launchScriptLabel) {
93+
} else if (launchSelection.id === launchScriptId) {
8994
return [
9095
{
9196
name: "PowerShell: Launch Script",
@@ -95,7 +100,7 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider
95100
cwd: "${workspaceFolder}",
96101
},
97102
];
98-
} else if (launchSelection.label === interactiveSessionLabel) {
103+
} else if (launchSelection.id === interactiveSessionId) {
99104
return [
100105
{
101106
name: "PowerShell: Interactive Session",

0 commit comments

Comments
 (0)