Skip to content

Commit 92f00b8

Browse files
committed
Add info message when no host processes to attach.
1 parent 1410f49 commit 92f00b8

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

src/features/DebugSession.ts

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,23 @@ export class PickPSHostProcessFeature implements IFeature {
127127
});
128128
};
129129

130-
let options : vscode.QuickPickOptions = {
131-
placeHolder: "Select a PowerShell Host process to attach to",
132-
matchOnDescription: true,
133-
matchOnDetail: true
134-
};
135-
136-
return vscode.window.showQuickPick(items, options).then(item => {
137-
return item ? item.pid : null;
138-
});
130+
if (items.length === 0) {
131+
return vscode.window.showInformationMessage(
132+
"There are no other PowerShell host processes to attach to.").then(_ => {
133+
return null;
134+
});
135+
}
136+
else {
137+
let options : vscode.QuickPickOptions = {
138+
placeHolder: "Select a PowerShell Host process to attach to",
139+
matchOnDescription: true,
140+
matchOnDetail: true
141+
};
142+
143+
return vscode.window.showQuickPick(items, options).then(item => {
144+
return item ? item.pid : null;
145+
});
146+
}
139147
});
140148
}
141149

0 commit comments

Comments
 (0)