diff --git a/examples/.vscode/launch.json b/examples/.vscode/launch.json index 0b7b52fe44..959cb1fd06 100644 --- a/examples/.vscode/launch.json +++ b/examples/.vscode/launch.json @@ -2,9 +2,9 @@ "version": "0.2.0", "configurations": [ { - "name": "PowerShell", "type": "PowerShell", "request": "launch", + "name": "PowerShell Launch (current file)", "script": "${file}", "args": [], "cwd": "${file}" diff --git a/package.json b/package.json index a88d2e4059..e664dc905d 100644 --- a/package.json +++ b/package.json @@ -120,6 +120,34 @@ }, "program": "./out/debugAdapter.js", "runtime": "node", + + "configurationSnippets": [ + { + "label": "PowerShell: Launch Current File Configuration", + "description": "A new configuration for launching the current opened PowerShell script", + "body": { + "type": "PowerShell", + "request": "launch", + "name": "PowerShell Launch (current file)", + "script": "^\"\\${file}\"", + "args": [], + "cwd": "^\"\\${file}\"" + } + }, + { + "label": "PowerShell: Launch Configuration", + "description": "A new configuration for launching a PowerShell script", + "body": { + "type": "PowerShell", + "request": "launch", + "name": "PowerShell Launch (${Script})", + "script": "^\"\\${workspaceRoot}/${Script}\"", + "args": [], + "cwd": "^\"\\${workspaceRoot}\"" + } + } + ], + "configurationAttributes": { "launch": { "required": [ @@ -145,16 +173,16 @@ "cwd": { "type": "string", "description": "Absolute path to the working directory. Default is the current workspace.", - "default": "." + "default": "${workspaceRoot}" } } } }, "initialConfigurations": [ { - "name": "PowerShell", "type": "PowerShell", "request": "launch", + "name": "PowerShell Launch (current file)", "script": "${file}", "args": [], "cwd": "${file}"