Skip to content

Commit b528275

Browse files
committed
Add dbg snippet for args prompt.
Also reworded the dbg configuration names. The drop down control in VSCode is on the narrow side. By putting in PowerShell, we take up most of the width. I notice that Node doesn't bother to prefix their dbg configs "Launch Program", "Mocha Tests". However I've already used cross language dbg configs in a single project and it is nice to know which language the dbg config is for. Therefore I think a good compromise is to prefix our dbg snippets with "PS". In the launch.json file, you can still see the config type = "PowerShell". I'll post some screen shots so you can see what this results look like.
1 parent c208181 commit b528275

File tree

2 files changed

+43
-15
lines changed

2 files changed

+43
-15
lines changed

examples/.vscode/launch.json

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,45 @@
44
{
55
"type": "PowerShell",
66
"request": "launch",
7-
"name": "PowerShell Launch (current file)",
7+
"name": "PS Launch - Current File",
88
"script": "${file}",
99
"args": [],
1010
"cwd": "${file}"
1111
},
1212
{
1313
"type": "PowerShell",
1414
"request": "launch",
15-
"name": "PowerShell Launch (DebugTest.ps1)",
15+
"name": "PS Launch - Current File w/Args Prompt",
16+
"script": "${file}",
17+
"args": [ "${command:SpecifyScriptArgs}" ],
18+
"cwd": "${file}"
19+
},
20+
{
21+
"type": "PowerShell",
22+
"request": "launch",
23+
"name": "PS Launch - DebugTest.ps1",
1624
"script": "${workspaceRoot}/DebugTest.ps1",
1725
"args": ["-Count 55 -DelayMilliseconds 250"],
1826
"cwd": "${workspaceRoot}"
1927
},
2028
{
2129
"type": "PowerShell",
2230
"request": "launch",
23-
"name": "PowerShell Interactive Session",
31+
"name": "PS Interactive Session",
2432
"cwd": "${workspaceRoot}"
2533
},
2634
{
2735
"type": "PowerShell",
2836
"request": "launch",
29-
"name": "PowerShell Pester Tests",
37+
"name": "PS Pester Tests",
3038
"script": "Invoke-Pester",
3139
"args": [],
3240
"cwd": "${workspaceRoot}"
3341
},
3442
{
3543
"type": "PowerShell",
3644
"request": "attach",
37-
"name": "PowerShell Attach to Host Process",
45+
"name": "PS Attach to Host Process",
3846
"processId": "${command:PickPSHostProcess}",
3947
"runspaceId": 1
4048
}

package.json

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -185,24 +185,36 @@
185185
"startSessionCommand": "PowerShell.StartDebugSession",
186186
"configurationSnippets": [
187187
{
188-
"label": "PowerShell: Launch (current file)",
188+
"label": "PowerShell: Launch - Current File",
189189
"description": "Launch current file (in active editor window) under debugger",
190190
"body": {
191191
"type": "PowerShell",
192192
"request": "launch",
193-
"name": "PowerShell Launch (current file)",
193+
"name": "PS Launch - Current File",
194+
"script": "^\"\\${file}\"",
195+
"args": [],
196+
"cwd": "^\"\\${file}\""
197+
}
198+
},
199+
{
200+
"label": "PowerShell: Launch - Current File w/Args Prompt",
201+
"description": "Launch current file (in active editor window) under debugger, prompting first for script arguments",
202+
"body": {
203+
"type": "PowerShell",
204+
"request": "launch",
205+
"name": "PS Launch - Current File w/Args Prompt",
194206
"script": "^\"\\${file}\"",
195207
"args": [],
196208
"cwd": "^\"\\${file}\""
197209
}
198210
},
199211
{
200212
"label": "PowerShell: Launch Script",
201-
"description": "Launch specified script under debugger",
213+
"description": "Launch specified script or path to script under debugger",
202214
"body": {
203215
"type": "PowerShell",
204216
"request": "launch",
205-
"name": "PowerShell Launch (${Script})",
217+
"name": "PS Launch - ${Script}",
206218
"script": "^\"\\${workspaceRoot}/${Script}\"",
207219
"args": [],
208220
"cwd": "^\"\\${workspaceRoot}\""
@@ -214,7 +226,7 @@
214226
"body": {
215227
"type": "PowerShell",
216228
"request": "launch",
217-
"name": "PowerShell Pester Tests",
229+
"name": "PS Pester Tests",
218230
"script": "Invoke-Pester",
219231
"args": [],
220232
"cwd": "^\"\\${workspaceRoot}\""
@@ -226,7 +238,7 @@
226238
"body": {
227239
"type": "PowerShell",
228240
"request": "attach",
229-
"name": "PowerShell Attach to Host Process",
241+
"name": "PS Attach to Host Process",
230242
"processId": "^\"\\${command:PickPSHostProcess}\"",
231243
"runspaceId": 1
232244
}
@@ -237,7 +249,7 @@
237249
"body": {
238250
"type": "PowerShell",
239251
"request": "launch",
240-
"name": "PowerShell Interactive Session",
252+
"name": "PS Interactive Session",
241253
"cwd": "^\"\\${workspaceRoot}\""
242254
}
243255
}
@@ -291,22 +303,30 @@
291303
{
292304
"type": "PowerShell",
293305
"request": "launch",
294-
"name": "PowerShell Launch (current file)",
306+
"name": "PS Launch - Current File",
295307
"script": "${file}",
296308
"args": [],
297309
"cwd": "${file}"
298310
},
311+
{
312+
"type": "PowerShell",
313+
"request": "launch",
314+
"name": "PS Launch - Current File w/Args Prompt",
315+
"script": "${file}",
316+
"args": [ "${command:SpecifyScriptArgs}" ],
317+
"cwd": "${file}"
318+
},
299319
{
300320
"type": "PowerShell",
301321
"request": "attach",
302-
"name": "PowerShell Attach to Host Process",
322+
"name": "PS Attach to Host Process",
303323
"processId": "${command:PickPSHostProcess}",
304324
"runspaceId": 1
305325
},
306326
{
307327
"type": "PowerShell",
308328
"request": "launch",
309-
"name": "PowerShell Interactive Session",
329+
"name": "PS Interactive Session",
310330
"cwd": "${workspaceRoot}"
311331
}
312332
]

0 commit comments

Comments
 (0)