forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNonDebugClient.ts
More file actions
36 lines (33 loc) · 1.32 KB
/
NonDebugClient.ts
File metadata and controls
36 lines (33 loc) · 1.32 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 { ChildProcess } from 'child_process';
import * as path from 'path';
import { DebugSession } from 'vscode-debugadapter';
import { LaunchRequestArguments } from '../Common/Contracts';
import { DebugType } from './DebugClient';
import { LocalDebugClient } from './LocalDebugClient';
export class NonDebugClient extends LocalDebugClient {
// tslint:disable-next-line:no-any
constructor(args: LaunchRequestArguments, debugSession: DebugSession, canLaunchTerminal: boolean) {
super(args, debugSession, canLaunchTerminal);
}
public get DebugType(): DebugType {
return DebugType.RunLocal;
}
public Stop() {
super.Stop();
if (this.pyProc) {
try {
this.pyProc!.kill();
// tslint:disable-next-line:no-empty
} catch { }
this.pyProc = undefined;
}
}
protected handleProcessOutput(proc: ChildProcess, _failedToLaunch: (error: Error | string | Buffer) => void) {
this.pythonProcess.attach(proc);
}
protected getLauncherFilePath(): string {
const currentFileName = module.filename;
const ptVSToolsPath = path.join(path.dirname(currentFileName), '..', '..', '..', '..', 'pythonFiles', 'PythonTools');
return path.join(ptVSToolsPath, 'visualstudio_py_launcher_nodebug.py');
}
}