forked from freewayz/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRemoteDebugClient.ts
More file actions
36 lines (32 loc) · 1.21 KB
/
Copy pathRemoteDebugClient.ts
File metadata and controls
36 lines (32 loc) · 1.21 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
import { BaseDebugServer } from "../DebugServers/BaseDebugServer";
import { RemoteDebugServer } from "../DebugServers/RemoteDebugServer";
import { IPythonProcess } from "../Common/Contracts";
import { DebugSession } from "vscode-debugadapter";
import { AttachRequestArguments } from "../Common/Contracts";
import { DebugClient, DebugType } from "./DebugClient";
export class RemoteDebugClient extends DebugClient {
private args: AttachRequestArguments;
constructor(args: any, debugSession: DebugSession) {
super(args, debugSession);
this.args = args;
}
private pythonProcess: IPythonProcess;
private debugServer: BaseDebugServer;
public CreateDebugServer(pythonProcess: IPythonProcess): BaseDebugServer {
this.pythonProcess = pythonProcess;
this.debugServer = new RemoteDebugServer(this.debugSession, this.pythonProcess, this.args);
return this.debugServer;
}
public get DebugType(): DebugType {
return DebugType.Remote;
}
public Stop() {
if (this.pythonProcess) {
this.pythonProcess.Detach();
}
if (this.debugServer) {
this.debugServer.Stop();
this.debugServer = null;
}
}
}