Commit 3f2046a 1 parent a356ce3 commit 3f2046a Copy full SHA for 3f2046a
File tree 2 files changed +35
-1
lines changed
2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 486
486
}
487
487
}
488
488
},
489
- "attach" : {}
489
+ "attach" : {
490
+ "properties" : {
491
+ "debugSocketPath" : {
492
+ "type" : " string" ,
493
+ "description" : " The path to the debug socket. This is used to connect to the debugger"
494
+ },
495
+ "debugPort" : {
496
+ "type" : " number" ,
497
+ "description" : " The port to use to connect to the debugger"
498
+ },
499
+ "debugHost" : {
500
+ "type" : " string" ,
501
+ "description" : " The host to use to connect to the debugger"
502
+ }
503
+ }
504
+ }
490
505
},
491
506
"configurationSnippets" : [
492
507
{
Original file line number Diff line number Diff line change @@ -161,6 +161,13 @@ export class Debugger
161
161
162
162
private async getSockets ( session : vscode . DebugSession ) {
163
163
const configuration = session . configuration ;
164
+
165
+ const debugSocketPath = session . configuration . debugSocketPath ;
166
+
167
+ if ( debugSocketPath ) {
168
+ return [ debugSocketPath ] ;
169
+ }
170
+
164
171
let sockets : string [ ] = [ ] ;
165
172
166
173
try {
@@ -182,6 +189,18 @@ export class Debugger
182
189
private async attachDebuggee (
183
190
session : vscode . DebugSession ,
184
191
) : 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
+
185
204
// When using attach, a process will be launched using Ruby debug and it will create a socket automatically. We have
186
205
// to find the available sockets and ask the user which one they want to attach to
187
206
const sockets = await this . getSockets ( session ) ;
You can’t perform that action at this time.
0 commit comments