From 171c3def4d6734489be6e6bbe48b77e18894d04d Mon Sep 17 00:00:00 2001 From: Keith Hill Date: Sat, 10 Dec 2016 17:01:54 -0700 Subject: [PATCH 1/2] 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. --- examples/.vscode/launch.json | 2 +- package.json | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 3 deletions(-) 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..0860725261 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}" From d7720de5f3a2bee9421dc27203c8b2d92aba1783 Mon Sep 17 00:00:00 2001 From: Keith Hill Date: Sat, 10 Dec 2016 17:16:47 -0700 Subject: [PATCH 2/2] Replace tabs with spaces in copy/pasted config. --- package.json | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index 0860725261..e664dc905d 100644 --- a/package.json +++ b/package.json @@ -121,32 +121,32 @@ "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}\"", + "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}\"", + } + }, + { + "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": {