forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmockDebugService.ts
More file actions
103 lines (101 loc) · 3.93 KB
/
mockDebugService.ts
File metadata and controls
103 lines (101 loc) · 3.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import { inject, injectable, named } from 'inversify';
import {
Breakpoint,
BreakpointsChangeEvent,
DebugAdapterDescriptorFactory,
DebugAdapterTrackerFactory,
DebugConfiguration,
DebugConfigurationProvider,
DebugConsole,
DebugSession,
DebugSessionCustomEvent,
Disposable,
Event,
WorkspaceFolder
} from 'vscode';
import { DebugProtocol } from 'vscode-debugprotocol';
import { Identifiers } from '../../client/datascience/constants';
import { IJupyterDebugService } from '../../client/datascience/types';
@injectable()
export class MockDebuggerService implements IJupyterDebugService {
constructor(
@inject(IJupyterDebugService)
@named(Identifiers.RUN_BY_LINE_DEBUGSERVICE)
private jupyterDebugService: IJupyterDebugService
) {}
public get activeDebugSession(): DebugSession | undefined {
return this.activeService.activeDebugSession;
}
public get activeDebugConsole(): DebugConsole {
return this.activeService.activeDebugConsole;
}
public get breakpoints(): Breakpoint[] {
return this.activeService.breakpoints;
}
public get onDidChangeActiveDebugSession(): Event<DebugSession | undefined> {
return this.activeService.onDidChangeActiveDebugSession;
}
public get onDidStartDebugSession(): Event<DebugSession> {
return this.activeService.onDidStartDebugSession;
}
public get onDidReceiveDebugSessionCustomEvent(): Event<DebugSessionCustomEvent> {
return this.activeService.onDidReceiveDebugSessionCustomEvent;
}
public get onDidTerminateDebugSession(): Event<DebugSession> {
return this.activeService.onDidTerminateDebugSession;
}
public get onDidChangeBreakpoints(): Event<BreakpointsChangeEvent> {
return this.onDidChangeBreakpoints;
}
public get onBreakpointHit(): Event<void> {
return this.activeService.onBreakpointHit;
}
public startRunByLine(config: DebugConfiguration): Thenable<boolean> {
return this.jupyterDebugService.startRunByLine(config);
}
public registerDebugConfigurationProvider(debugType: string, provider: DebugConfigurationProvider): Disposable {
return this.jupyterDebugService.registerDebugConfigurationProvider(debugType, provider);
}
public registerDebugAdapterDescriptorFactory(
debugType: string,
factory: DebugAdapterDescriptorFactory
): Disposable {
return this.jupyterDebugService.registerDebugAdapterDescriptorFactory(debugType, factory);
}
public registerDebugAdapterTrackerFactory(debugType: string, factory: DebugAdapterTrackerFactory): Disposable {
return this.jupyterDebugService.registerDebugAdapterTrackerFactory(debugType, factory);
}
public startDebugging(
folder: WorkspaceFolder | undefined,
nameOrConfiguration: string | DebugConfiguration,
parentSession?: DebugSession | undefined
): Thenable<boolean> {
return this.activeService.startDebugging(folder, nameOrConfiguration, parentSession);
}
public addBreakpoints(breakpoints: Breakpoint[]): void {
return this.activeService.addBreakpoints(breakpoints);
}
public removeBreakpoints(breakpoints: Breakpoint[]): void {
return this.activeService.removeBreakpoints(breakpoints);
}
public getStack(): Promise<DebugProtocol.StackFrame[]> {
return this.activeService.getStack();
}
public step(): Promise<void> {
return this.activeService.step();
}
public continue(): Promise<void> {
return this.activeService.continue();
}
public requestVariables(): Promise<void> {
return this.activeService.requestVariables();
}
public stop(): void {
return this.activeService.stop();
}
private get activeService(): IJupyterDebugService {
return this.jupyterDebugService;
}
}