-
Notifications
You must be signed in to change notification settings - Fork 514
Feature: Add sessionName debug setting to allow different PS for temp console #5208
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,7 @@ export enum DebugConfig { | |
ModuleInteractiveSession, | ||
BinaryModule, | ||
BinaryModulePester, | ||
WindowsPowerShell, | ||
} | ||
|
||
/** Make the implicit behavior of undefined and null in the debug api more explicit */ | ||
|
@@ -126,6 +127,12 @@ export const DebugConfigurations: Record<DebugConfig, DebugConfiguration> = { | |
createTemporaryIntegratedConsole: true, | ||
attachDotnetDebugger: true, | ||
}, | ||
[DebugConfig.WindowsPowerShell]: { | ||
name: "PowerShell: Windows PowerShell", | ||
type: "PowerShell", | ||
request: "launch", | ||
sessionName: "Windows PowerShell (x64)", | ||
}, | ||
}; | ||
|
||
export class DebugSessionFeature | ||
|
@@ -271,13 +278,24 @@ export class DebugSessionFeature | |
"Debug a .NET binary or hybrid module loaded into a PowerShell session. Breakpoints you set in your .NET (C#/F#/VB/etc.) code will be hit upon command execution. You may want to add a compile or watch action as a pre-launch task to this configuration.", | ||
}, | ||
{ | ||
id: DebugConfig.RunPester, | ||
id: DebugConfig.BinaryModulePester, | ||
label: "Run Pester Tests (Binary Module)", | ||
description: | ||
"Debug a .NET binary or hybrid module by running Pester tests. Breakpoints you set in your .NET (C#/F#/VB/etc.) code will be hit upon command execution. You may want to add a compile or watch action as a pre-launch task to this configuration.", | ||
}, | ||
]; | ||
|
||
// Only show the Windows PowerShell option if the platform is Windows | ||
const platformDetails = getPlatformDetails(); | ||
if (platformDetails.operatingSystem === OperatingSystem.Windows) { | ||
debugConfigPickItems.push({ | ||
id: DebugConfig.WindowsPowerShell, | ||
label: "Windows PowerShell", | ||
description: | ||
"Launch Windows PowerShell in a temporary integrated console for debugging", | ||
}); | ||
} | ||
|
||
const launchSelection = await window.showQuickPick( | ||
debugConfigPickItems, | ||
{ placeHolder: "Select a PowerShell debug configuration" }, | ||
|
@@ -440,6 +458,10 @@ export class DebugSessionFeature | |
return PREVENT_DEBUG_START_AND_OPEN_DEBUGCONFIG; | ||
} | ||
|
||
if (config.sessionName) { | ||
config.createTemporaryIntegratedConsole = true; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My only thought is that we tried to move away from "integrated console" to "extension terminal" but I am unsure how much of that name change made it to this particular feature. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can probably fix that up, stay tuned. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So I can either fix it in this PR or we commit this and I submit another PR to rename/alias createTemporaryIntegratedConsole to createTemporaryPowershellSession. Which would you prefer? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seeing as this was merged I will address it in separate PR. |
||
} | ||
|
||
if (config.attachDotnetDebugger) { | ||
return this.resolveAttachDotnetDebugConfiguration(config); | ||
} | ||
|
@@ -477,7 +499,10 @@ export class DebugSessionFeature | |
): Promise<IEditorServicesSessionDetails | undefined> { | ||
const settings = getSettings(); | ||
this.tempDebugProcess = | ||
await this.sessionManager.createDebugSessionProcess(settings); | ||
await this.sessionManager.createDebugSessionProcess( | ||
settings, | ||
session.configuration.sessionName, | ||
); | ||
// TODO: Maybe set a timeout on the cancellation token? | ||
const cancellationTokenSource = new CancellationTokenSource(); | ||
this.tempSessionDetails = await this.tempDebugProcess.start( | ||
|
Uh oh!
There was an error while loading. Please reload this page.