Skip to content

Commit bf5580a

Browse files
committed
filter 'attach' and 'launch' type
1 parent 1905641 commit bf5580a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/extension.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2262,9 +2262,15 @@ async function startDebugging(attach?: boolean) {
22622262

22632263
const provider = new ExternalDebugConfigProvider();
22642264
let cfgs = await provider.provideDebugConfigurations(vscWorkspaceFolder);
2265-
if (cfgs && attach)
2265+
if (!cfgs)
2266+
return;
2267+
2268+
if (attach)
22662269
cfgs = cfgs.filter(cfg => cfg.request === 'attach');
2267-
if (cfgs && cfgs.length > 0) {
2270+
else
2271+
cfgs = cfgs.filter(cfg => cfg.request === 'launch');
2272+
2273+
if (cfgs.length > 0) {
22682274
let cfg = cfgs[0];
22692275
if (cfgs.length > 1) {
22702276
const val = await vscode.window.showQuickPick(cfgs.map(e => e.name), {

0 commit comments

Comments
 (0)