Skip to content

Commit 49d6214

Browse files
committed
Fix issue with debugging unsaved file.
1 parent 928d9d8 commit 49d6214

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/features/DebugSession.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,15 @@ export class DebugSessionFeature implements IFeature {
4444
let currentDocument = vscode.window.activeTextEditor.document;
4545

4646
if (currentDocument.isUntitled) {
47-
config.script = currentDocument.uri.toString();
47+
if (currentDocument.languageId === 'powershell') {
48+
config.script = currentDocument.uri.toString();
49+
}
50+
else {
51+
let msg = "In order to debug '" + currentDocument.fileName +
52+
"', set the document's language mode to PowerShell or save the file with a PowerShell extension.";
53+
vscode.window.showErrorMessage(msg);
54+
return;
55+
}
4856
}
4957
else {
5058
let isValidExtension = false;

0 commit comments

Comments
 (0)