From 6f5327cb2036c978cea2eb7abaff2001138c9201 Mon Sep 17 00:00:00 2001 From: Andy Jordan Date: Wed, 28 Sep 2022 10:47:32 -0700 Subject: [PATCH] Only check a script's extension if a script was given Since 'launch' can be used without a script in a weird way to debug the interactive session. --- src/features/DebugSession.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/DebugSession.ts b/src/features/DebugSession.ts index 9f5900d835..e9cc0db3ab 100644 --- a/src/features/DebugSession.ts +++ b/src/features/DebugSession.ts @@ -247,7 +247,7 @@ export class DebugSessionFeature extends LanguageClientConsumer vscode.window.showErrorMessage("Debugging untitled files in a temporary console is not supported."); return undefined; } - } else { + } else if (config.script) { const ext = path.extname(config.script).toLowerCase(); if (!(ext === ".ps1" || ext === ".psm1")) { vscode.window.showErrorMessage(`PowerShell does not support debugging this file type: '${path.basename(config.script)}'`);