Skip to content

include current runspace and runspace 1 if should #1800

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 18, 2019
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/features/DebugSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,12 @@ export class PickPSHostProcessFeature implements IFeature {

private pickPSHostProcess(): Thenable<string> {
return this.languageClient.sendRequest(GetPSHostProcessesRequestType, null).then((hostProcesses) => {
const items: IProcessItem[] = [];
// Start with the current PowerShell process in the list.
const items: IProcessItem[] = [{
label: "Current",
description: "The current PowerShell process.",
pid: "current",
}];

for (const p in hostProcesses) {
if (hostProcesses.hasOwnProperty(p)) {
Expand Down Expand Up @@ -487,7 +492,8 @@ export class PickRunspaceFeature implements IFeature {

for (const runspace of response) {
// Skip default runspace
if (runspace.id === 1 || runspace.name === "PSAttachRunspace") {
if ((runspace.id === 1 || runspace.name === "PSAttachRunspace")
&& processId === "current") {
continue;
}

Expand Down