Add VS Code launch and task files

This enables building PowerShell through VS Code. The build task
launches the installed version of PowerShell and runs
`Start-PSBuild` (after importing the module).

This enables a `launch` debug task to immediately debug the `powershell`
process, without having to attach to an external process.

The defaults of `justMyCode` and `stopAtEntry` have been reversed, so
that all code is debugged, and the process is stopped at entry for
easier debugging.

Note that an interactive PowerShell process requires access to `stdin`,
which the debug console does not provide, so once it requests access,
`System.Console` will throw a (correct) exception.
This commit is contained in:
Andrew Schwartzmeyer 2016-03-18 12:22:00 -07:00
parent 06ab38e757
commit 94e3a905bd
2 changed files with 32 additions and 0 deletions

16
.vscode/launch.json vendored Normal file
View file

@ -0,0 +1,16 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "powershell",
"type": "coreclr",
"request": "launch",
"justMyCode": false,
"stopAtEntry": true,
"program": "${workspaceRoot}/bin/powershell",
"args": [ ],
"preLaunchTask": "build",
"cwd": "${workspaceRoot}"
}
]
}

16
.vscode/tasks.json vendored Normal file
View file

@ -0,0 +1,16 @@
{
"version": "0.1.0",
"command": "powershell",
"isShellCommand": true,
"showOutput": "verbose",
"args": [ "--command" ],
"tasks": [
{
"taskName": "build",
"args": [ "Import-Module ${workspaceRoot}/PowerShellGitHubDev.psm1; Start-PSBuild" ],
"isBuildCommand": true,
"problemMatcher": "$msCompile"
}
]
}