in testSupport/src/debugClient.ts [88:119]
public start(port?: number): Promise<void> {
return new Promise<void>((resolve, reject) => {
if (typeof port === 'number') {
this._socket = net.createConnection(port, '127.0.0.1', () => {
this.connect(this._socket, this._socket);
resolve();
});
} else {
this._adapterProcess = cp.spawn(this._runtime, [ this._executable ], this._spawnOptions);
const sanitize = (s: string) => s.toString().replace(/\r?\n$/mg, '');
this._adapterProcess.stderr.on('data', (data: string) => {
if (this._enableStderr) {
console.log(sanitize(data));
}
});
this._adapterProcess.on('error', (err) => {
console.log(err);
reject(err);
});
this._adapterProcess.on('exit', (code: number, signal: string) => {
if (code) {
// done(new Error('debug adapter exit code: ' + code));
}
});
this.connect(this._adapterProcess.stdout, this._adapterProcess.stdin);
resolve();
}
});
}