forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBaseDebugServer.ts
More file actions
29 lines (25 loc) · 990 Bytes
/
BaseDebugServer.ts
File metadata and controls
29 lines (25 loc) · 990 Bytes
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
"use strict";
import {DebugSession} from "vscode-debugadapter";
import {IPythonProcess, IDebugServer} from "../Common/Contracts";
import {EventEmitter} from "events";
import {Deferred, createDeferred} from '../../common/helpers';
export abstract class BaseDebugServer extends EventEmitter {
protected pythonProcess: IPythonProcess;
protected debugSession: DebugSession;
protected isRunning: boolean;
public get IsRunning(): boolean {
return this.isRunning;
}
protected debugClientConnected: Deferred<boolean>;
public get DebugClientConnected(): Promise<boolean> {
return this.debugClientConnected.promise;
}
constructor(debugSession: DebugSession, pythonProcess: IPythonProcess) {
super();
this.debugSession = debugSession;
this.pythonProcess = pythonProcess;
this.debugClientConnected = createDeferred<boolean>();
}
public abstract Start(): Promise<IDebugServer>;
public abstract Stop();
}