Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1db2283

Browse files
Support -CustomPipeName (#1775)
1 parent 38bf763 commit 1db2283

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

‎package.json‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,6 @@
394394
"name": "PowerShell Attach to Host Process",
395395
"type": "PowerShell",
396396
"request": "attach",
397-
"processId": "^\"\\${command:PickPSHostProcess}\"",
398397
"runspaceId": 1
399398
}
400399
},
@@ -445,12 +444,17 @@
445444
"processId": {
446445
"type": "string",
447446
"description": "The process id of the PowerShell host process to attach to. Works only on PowerShell 5 and above.",
448-
"default": "${command:PickPSHostProcess}"
447+
"default": null
449448
},
450449
"runspaceId": {
451450
"type": "number",
452451
"description": "Optional: The ID of the runspace to debug in the attached process. Defaults to 1. Works only on PowerShell 5 and above.",
453452
"default": 1
453+
},
454+
"customPipeName": {
455+
"type": "string",
456+
"description": "The custom pipe name of the PowerShell host process to attach to. Works only on PowerShell 6.2 and above.",
457+
"default": null
454458
}
455459
}
456460
}
@@ -487,7 +491,6 @@
487491
"name": "PowerShell Attach to Host Process",
488492
"type": "PowerShell",
489493
"request": "attach",
490-
"processId": "${command:PickPSHostProcess}",
491494
"runspaceId": 1
492495
},
493496
{

‎src/features/DebugSession.ts‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider
4343
}
4444

4545
// DebugConfigurationProvider method
46-
public resolveDebugConfiguration(
46+
public asyncresolveDebugConfiguration(
4747
folder: WorkspaceFolder | undefined,
4848
config: DebugConfiguration,
49-
token?: CancellationToken): ProviderResult<DebugConfiguration> {
49+
token?: CancellationToken): Promise<DebugConfiguration> {
5050

5151
// Make sure there is a session running before attempting to debug/run a program
5252
if (this.sessionManager.getSessionStatus() !== SessionStatus.Running) {
@@ -76,6 +76,11 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider
7676
return undefined;
7777
});
7878
}
79+
80+
// if nothing is set, prompt for the processId
81+
if (!config.customPipeName && !config.processId) {
82+
config.processId = await vscode.commands.executeCommand("PowerShell.PickPSHostProcess");
83+
}
7984
}
8085

8186
if (generateLaunchConfig) {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /