Skip to content

Commit 76871c7

Browse files
ko1andyjeffries
andcommitted
Show simplified UNIX socket pathes
on chosing available debug ports. See #349 Co-authored-by: Andy Jeffries <[email protected]>
1 parent 8f38149 commit 76871c7

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/extension.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,15 @@ class RdbgAdapterDescriptorFactory implements DebugAdapterDescriptorFactory, Ver
447447
}
448448
}
449449

450+
simplifySockList(list: string[]): string[] {
451+
const simplified = list.map (sock_path => {
452+
sock_path = path.basename(sock_path);
453+
return sock_path;
454+
});
455+
456+
return simplified;
457+
}
458+
450459
async attach(session: DebugSession): Promise<DebugAdapterDescriptor> {
451460
const config = session.configuration as AttachConfiguration;
452461
let port: number | undefined;
@@ -473,9 +482,13 @@ class RdbgAdapterDescriptorFactory implements DebugAdapterDescriptorFactory, Ver
473482
sockPath = list[0];
474483
break;
475484
default:
476-
const sock = await vscode.window.showQuickPick(list);
485+
const simplifiedList = this.simplifySockList(list);
486+
const sock = await vscode.window.showQuickPick(simplifiedList, {
487+
title: "debug ports in " + path.dirname(list[0])
488+
});
477489
if (sock) {
478-
sockPath = sock;
490+
const index = simplifiedList.indexOf(sock);
491+
sockPath = list[index];
479492
}
480493
else {
481494
return new DebugAdapterInlineImplementation(new StopDebugAdapter);

0 commit comments

Comments
 (0)