Skip to content

Commit a25bd9d

Browse files
committed
Debugger is now activated when breakpoints are hit in Integrated Console
This change adds new behavior which causes VS Code's debugger UI to be activated when a breakpoint is hit in the Integrated Console while not currently in debug mode. This allows the user to set breakpoints and run scripts from the console while still leveraging VS Code's rich debugging UI. Resolves PowerShell#619.
1 parent 069e897 commit a25bd9d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/features/DebugSession.ts

+12-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ import { IFeature } from '../feature';
88
import { SessionManager } from '../session';
99
import { LanguageClient, RequestType, NotificationType } from 'vscode-languageclient';
1010

11+
export namespace StartDebuggerNotification {
12+
export const type = new NotificationType<void, void>('powerShell/startDebugger');
13+
}
14+
1115
export class DebugSessionFeature implements IFeature {
1216
private command: vscode.Disposable;
1317
private examplesPath: string;
@@ -18,7 +22,14 @@ export class DebugSessionFeature implements IFeature {
1822
config => { this.startDebugSession(config); });
1923
}
2024

21-
public setLanguageClient(languageclient: LanguageClient) {
25+
public setLanguageClient(languageClient: LanguageClient) {
26+
languageClient.onNotification(
27+
StartDebuggerNotification.type,
28+
none => this.startDebugSession({
29+
request: 'launch',
30+
type: 'PowerShell',
31+
name: 'PowerShell Interactive Session'
32+
}));
2233
}
2334

2435
public dispose() {

0 commit comments

Comments
 (0)