MCPcopy Index your code
hub / github.com/microsoft/vscode-js-debug / SubprocessProgram

Class SubprocessProgram

src/targets/node/program.ts:55–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53 * Program created from a subprocess.
54 */
55export class SubprocessProgram implements IProgram {
56 public readonly stopped: Promise<IStopMetadata>;
57 private killed = false;
58
59 constructor(
60 private readonly child: ChildProcess,
61 private readonly logger: ILogger,
62 private readonly killBehavior: KillBehavior,
63 ) {
64 this.stopped = new Promise((resolve, reject) => {
65 child.once('exit', code => resolve({ killed: this.killed, code: code || 0 }));
66 child.once('error', error => reject({ killed: this.killed, code: 1, error }));
67 });
68 }
69
70 public gotTelemetery() {
71 // no-op
72 }
73
74 public stop(): Promise<IStopMetadata> {
75 this.killed = true;
76 killTree(this.child.pid as number, this.logger, this.killBehavior);
77 return this.stopped;
78 }
79}
80
81/**
82 * A no-op program that never stops until stop() is called. Currently, we use

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected