Skip to content

Commit 3004872

Browse files
committed
Support attaching to debugger with host and port
1 parent 65e254a commit 3004872

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

vscode/package.json

+8
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,14 @@
474474
"debugSocketPath": {
475475
"type": "string",
476476
"description": "The path to the debug socket. This is used to connect to the debugger"
477+
},
478+
"debugPort": {
479+
"type": "number",
480+
"description": "The port to use to connect to the debugger"
481+
},
482+
"debugHost": {
483+
"type": "string",
484+
"description": "The host to use to connect to the debugger"
477485
}
478486
}
479487
}

vscode/src/debugger.ts

+12
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,18 @@ export class Debugger
189189
private async attachDebuggee(
190190
session: vscode.DebugSession,
191191
): Promise<vscode.DebugAdapterDescriptor> {
192+
const debugPort = session.configuration.debugPort;
193+
194+
if (debugPort) {
195+
const debugHost = session.configuration.debugHost;
196+
197+
if (debugHost) {
198+
return new vscode.DebugAdapterServer(debugPort, debugHost);
199+
}
200+
201+
return new vscode.DebugAdapterServer(debugPort);
202+
}
203+
192204
// When using attach, a process will be launched using Ruby debug and it will create a socket automatically. We have
193205
// to find the available sockets and ask the user which one they want to attach to
194206
const sockets = await this.getSockets(session);

0 commit comments

Comments
 (0)