Skip to content

Commit 47c7543

Browse files
authored
Add support for debug configurationSnippets. (#369)
* Add support for debug configurationSnippets. Rename debug target from "PowerShell" to "PowerShell Launch (current file)" this makes room for an eventual "PowerShell Attach" debug target. Fix #364. * Replace tabs with spaces in copy/pasted config.
1 parent 6819cdc commit 47c7543

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

examples/.vscode/launch.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"version": "0.2.0",
33
"configurations": [
44
{
5-
"name": "PowerShell",
65
"type": "PowerShell",
76
"request": "launch",
7+
"name": "PowerShell Launch (current file)",
88
"script": "${file}",
99
"args": [],
1010
"cwd": "${file}"

package.json

+30-2
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,34 @@
146146
},
147147
"program": "./out/debugAdapter.js",
148148
"runtime": "node",
149+
150+
"configurationSnippets": [
151+
{
152+
"label": "PowerShell: Launch Current File Configuration",
153+
"description": "A new configuration for launching the current opened PowerShell script",
154+
"body": {
155+
"type": "PowerShell",
156+
"request": "launch",
157+
"name": "PowerShell Launch (current file)",
158+
"script": "^\"\\${file}\"",
159+
"args": [],
160+
"cwd": "^\"\\${file}\""
161+
}
162+
},
163+
{
164+
"label": "PowerShell: Launch Configuration",
165+
"description": "A new configuration for launching a PowerShell script",
166+
"body": {
167+
"type": "PowerShell",
168+
"request": "launch",
169+
"name": "PowerShell Launch (${Script})",
170+
"script": "^\"\\${workspaceRoot}/${Script}\"",
171+
"args": [],
172+
"cwd": "^\"\\${workspaceRoot}\""
173+
}
174+
}
175+
],
176+
149177
"configurationAttributes": {
150178
"launch": {
151179
"required": [
@@ -171,16 +199,16 @@
171199
"cwd": {
172200
"type": "string",
173201
"description": "Absolute path to the working directory. Default is the current workspace.",
174-
"default": "."
202+
"default": "${workspaceRoot}"
175203
}
176204
}
177205
}
178206
},
179207
"initialConfigurations": [
180208
{
181-
"name": "PowerShell",
182209
"type": "PowerShell",
183210
"request": "launch",
211+
"name": "PowerShell Launch (current file)",
184212
"script": "${file}",
185213
"args": [],
186214
"cwd": "${file}"

0 commit comments

Comments
 (0)