Skip to content

Commit 777f7b1

Browse files
authored
Restore ability to start debug session when script run in PSIC hits bkpt (#1408)
Fix #956
1 parent 2e12b8e commit 777f7b1

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/features/DebugSession.ts

+12-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@
55
import vscode = require("vscode");
66
import { CancellationToken, DebugConfiguration, DebugConfigurationProvider,
77
ExtensionContext, ProviderResult, WorkspaceFolder } from "vscode";
8-
import { LanguageClient, RequestType } from "vscode-languageclient";
8+
import { LanguageClient, NotificationType, RequestType } from "vscode-languageclient";
99
import { IFeature } from "../feature";
1010
import { getPlatformDetails, OperatingSystem } from "../platform";
1111
import { PowerShellProcess} from "../process";
1212
import { SessionManager } from "../session";
1313
import Settings = require("../settings");
1414
import utils = require("../utils");
1515

16+
export const StartDebuggerNotificationType =
17+
new NotificationType<void, void>("powerShell/startDebugger");
18+
1619
export class DebugSessionFeature implements IFeature, DebugConfigurationProvider {
1720

1821
private sessionCount: number = 1;
@@ -29,7 +32,14 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider
2932
}
3033

3134
public setLanguageClient(languageClient: LanguageClient) {
32-
// There is no implementation for this IFeature method
35+
languageClient.onNotification(
36+
StartDebuggerNotificationType,
37+
() =>
38+
vscode.debug.startDebugging(undefined, {
39+
request: "launch",
40+
type: "PowerShell",
41+
name: "PowerShell Interactive Session",
42+
}));
3343
}
3444

3545
// DebugConfigurationProvider method

0 commit comments

Comments
 (0)