Skip to content

Commit

Permalink
Add dbg snippet for args prompt.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rkeithhill authored and daviwil committed May 8, 2017
1 parent 3c98c9f commit 1383334
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 15 deletions.
18 changes: 13 additions & 5 deletions examples/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,45 @@
{
"type": "PowerShell",
"request": "launch",
"name": "PowerShell Launch (current file)",
"name": "PS Launch - Current File",
"script": "${file}",
"args": [],
"cwd": "${file}"
},
{
"type": "PowerShell",
"request": "launch",
"name": "PowerShell Launch (DebugTest.ps1)",
"name": "PS Launch - Current File w/Args Prompt",
"script": "${file}",
"args": [ "${command:SpecifyScriptArgs}" ],
"cwd": "${file}"
},
{
"type": "PowerShell",
"request": "launch",
"name": "PS Launch - DebugTest.ps1",
"script": "${workspaceRoot}/DebugTest.ps1",
"args": ["-Count 55 -DelayMilliseconds 250"],
"cwd": "${workspaceRoot}"
},
{
"type": "PowerShell",
"request": "launch",
"name": "PowerShell Interactive Session",
"name": "PS Interactive Session",
"cwd": "${workspaceRoot}"
},
{
"type": "PowerShell",
"request": "launch",
"name": "PowerShell Pester Tests",
"name": "PS Pester Tests",
"script": "Invoke-Pester",
"args": [],
"cwd": "${workspaceRoot}"
},
{
"type": "PowerShell",
"request": "attach",
"name": "PowerShell Attach to Host Process",
"name": "PS Attach to Host Process",
"processId": "${command:PickPSHostProcess}",
"runspaceId": 1
}
Expand Down
40 changes: 30 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,24 +185,36 @@
"startSessionCommand": "PowerShell.StartDebugSession",
"configurationSnippets": [
{
"label": "PowerShell: Launch (current file)",
"label": "PowerShell: Launch - Current File",
"description": "Launch current file (in active editor window) under debugger",
"body": {
"type": "PowerShell",
"request": "launch",
"name": "PowerShell Launch (current file)",
"name": "PS Launch - Current File",
"script": "^\"\\${file}\"",
"args": [],
"cwd": "^\"\\${file}\""
}
},
{
"label": "PowerShell: Launch - Current File w/Args Prompt",
"description": "Launch current file (in active editor window) under debugger, prompting first for script arguments",
"body": {
"type": "PowerShell",
"request": "launch",
"name": "PS Launch - Current File w/Args Prompt",
"script": "^\"\\${file}\"",
"args": [],
"cwd": "^\"\\${file}\""
}
},
{
"label": "PowerShell: Launch Script",
"description": "Launch specified script under debugger",
"description": "Launch specified script or path to script under debugger",
"body": {
"type": "PowerShell",
"request": "launch",
"name": "PowerShell Launch (${Script})",
"name": "PS Launch - ${Script}",
"script": "^\"\\${workspaceRoot}/${Script}\"",
"args": [],
"cwd": "^\"\\${workspaceRoot}\""
Expand All @@ -214,7 +226,7 @@
"body": {
"type": "PowerShell",
"request": "launch",
"name": "PowerShell Pester Tests",
"name": "PS Pester Tests",
"script": "Invoke-Pester",
"args": [],
"cwd": "^\"\\${workspaceRoot}\""
Expand All @@ -226,7 +238,7 @@
"body": {
"type": "PowerShell",
"request": "attach",
"name": "PowerShell Attach to Host Process",
"name": "PS Attach to Host Process",
"processId": "^\"\\${command:PickPSHostProcess}\"",
"runspaceId": 1
}
Expand All @@ -237,7 +249,7 @@
"body": {
"type": "PowerShell",
"request": "launch",
"name": "PowerShell Interactive Session",
"name": "PS Interactive Session",
"cwd": "^\"\\${workspaceRoot}\""
}
}
Expand Down Expand Up @@ -291,22 +303,30 @@
{
"type": "PowerShell",
"request": "launch",
"name": "PowerShell Launch (current file)",
"name": "PS Launch - Current File",
"script": "${file}",
"args": [],
"cwd": "${file}"
},
{
"type": "PowerShell",
"request": "launch",
"name": "PS Launch - Current File w/Args Prompt",
"script": "${file}",
"args": [ "${command:SpecifyScriptArgs}" ],
"cwd": "${file}"
},
{
"type": "PowerShell",
"request": "attach",
"name": "PowerShell Attach to Host Process",
"name": "PS Attach to Host Process",
"processId": "${command:PickPSHostProcess}",
"runspaceId": 1
},
{
"type": "PowerShell",
"request": "launch",
"name": "PowerShell Interactive Session",
"name": "PS Interactive Session",
"cwd": "${workspaceRoot}"
}
]
Expand Down

0 comments on commit 1383334

Please sign in to comment.