diff --git a/CHANGELOG.md b/CHANGELOG.md index 114c3aacbd..e4a662e78f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # vscode-powershell Release History +## 0.12.1 +### Tuesday, April 4, 2017 + +- Fixed [#648](https://github.com/PowerShell/vscode-powershell/issues/648) - + Resolved an error when launching an untitled script file in a workspace + with no launch.json or in a window without a workspace path + ## 0.12.0 ### Tuesday, April 4, 2017 diff --git a/appveyor.yml b/appveyor.yml index 4101e3f152..0321a9a234 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: '0.12.0-insiders-{build}' +version: '0.12.1-insiders-{build}' image: Visual Studio 2017 clone_depth: 10 skip_tags: true diff --git a/package.json b/package.json index f5f007d343..3a4235bef9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "PowerShell", "displayName": "PowerShell", - "version": "0.12.0", + "version": "0.12.1", "publisher": "ms-vscode", "description": "Develop PowerShell scripts in Visual Studio Code!", "engines": { diff --git a/src/features/DebugSession.ts b/src/features/DebugSession.ts index f827607f67..1da3ff44bd 100644 --- a/src/features/DebugSession.ts +++ b/src/features/DebugSession.ts @@ -25,13 +25,19 @@ export class DebugSessionFeature implements IFeature { private startDebugSession(config: any) { + let currentDocument = vscode.window.activeTextEditor.document; + if (!config.request) { // No launch.json, create the default configuration config.type = 'PowerShell'; config.name = 'PowerShell Launch Current File'; config.request = 'launch'; config.args = []; - config.script = vscode.window.activeTextEditor.document.fileName; + + config.script = + currentDocument.isUntitled + ? currentDocument.uri.toString() + : currentDocument.fileName; } if (config.request === 'launch') { @@ -41,7 +47,6 @@ export class DebugSessionFeature implements IFeature { // For launch of "current script", don't start the debugger if the current file // is not a file that can be debugged by PowerShell if (config.script === "${file}") { - let currentDocument = vscode.window.activeTextEditor.document; if (currentDocument.isUntitled) { if (currentDocument.languageId === 'powershell') {