Skip to content

Allow passing runspace name #1954

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
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,11 @@
"description": "Optional: The ID of the runspace to debug in the attached process. Defaults to 1. Works only on PowerShell 5 and above.",
"default": null
},
"runspaceName": {
"type": "string",
"description": "Optional: The Name of the runspace to debug in the attached process. Works only on PowerShell 5 and above.",
"default": null
},
"customPipeName": {
"type": "string",
"description": "The custom pipe name of the PowerShell host process to attach to. Works only on PowerShell 6.2 and above.",
Expand Down
2 changes: 1 addition & 1 deletion src/features/DebugSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider
}
}

if (!config.runspaceId) {
if (!config.runspaceId && !config.runspaceName) {
config.runspaceId = await vscode.commands.executeCommand("PowerShell.PickRunspace", config.processId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we change the runspace picker to allow picking by name instead of id? If not for v1.x, then perhaps for 2.x where we only support >= 5?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

It says the name in the runspace picker so I think we're good here


// No runspace selected. Cancel attach.
Expand Down