Skip to content
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

Add option in launch.json to create a new PS process for each script debug session #367

Closed
daviwil opened this issue Dec 9, 2016 · 2 comments
Labels
Area-Debugging Issue-Enhancement A feature request (enhancement).
Milestone

Comments

@daviwil
Copy link
Contributor

daviwil commented Dec 9, 2016

There are some cases where it's useful to create an entirely new PowerShell process instance when debugging a script. For example, when writing PowerShell classes it isn't easy to quickly make tweaks to your class code in the same session because PS classes are generated into assemblies at runtime and can't be unloaded/reloaded. In this case, creating a fresh PowerShell process for each run of the debugger would enable the developer to have a faster turnaround time when writing PowerShell code with classes.

We should add a new option in launch.json which causes our debug adapter to create a new PowerShell process, load PSES and start a fresh debug server.

@daviwil daviwil added the Issue-Enhancement A feature request (enhancement). label Dec 9, 2016
@daviwil daviwil added this to the 0.9.0 milestone Dec 9, 2016
@rkeithhill
Copy link
Contributor

Definitely. I have been worried about this sort of thing leading to an incorrect assumption that a script is working because of "left-overs" in the debug session. Or in the case you outline, troubles debugging on subsequent runs.

@daviwil
Copy link
Contributor Author

daviwil commented Mar 16, 2017

From @Glober777:

I was wondering if there's a clean way of getting the integrated console automatically restarted when I'm starting the debug session (preferably configurable through launch.json, i.e. by referencing a task or via a separate attribute)? What I currently do, is I'm deleting the integrated console, which brings up a prompt suggesting me to restart it, but there were a few times when I forgot to do that and got burned by that.

@daviwil daviwil modified the milestones: 0.11.0, 0.12.0 Mar 22, 2017
@daviwil daviwil modified the milestones: 0.12.0, Next Feature Update Apr 4, 2017
@daviwil daviwil modified the milestones: April 2017, May 2017 May 8, 2017
@daviwil daviwil modified the milestones: May 2017, June 2017 Jun 1, 2017
daviwil added a commit to daviwil/PowerShellEditorServices that referenced this issue Jun 15, 2017
This change finishes the work necessary to enable debug-only sessions
where a new PowerShell process is launched strictly for the purpose of
providing a fresh debugging session.  This is useful when debugging
modules which use PowerShell classes or binary components which cannot
be reloaded in the same process.

Part of the implementation for PowerShell/vscode-powershell#367.
daviwil added a commit to daviwil/vscode-powershell that referenced this issue Jun 15, 2017
This change enables the user to configure their debugging sessions to
launch a fresh PowerShell process each time they start the debugger.
This is useful when debugging scripts or modules which use PowerShell
classes or managed assemblies which cannot be reloaded within the same
process.

Resolves PowerShell#367.
daviwil added a commit to PowerShell/PowerShellEditorServices that referenced this issue Jun 15, 2017
This change finishes the work necessary to enable debug-only sessions
where a new PowerShell process is launched strictly for the purpose of
providing a fresh debugging session.  This is useful when debugging
modules which use PowerShell classes or binary components which cannot
be reloaded in the same process.

Part of the implementation for PowerShell/vscode-powershell#367.
daviwil added a commit to daviwil/vscode-powershell that referenced this issue Jun 21, 2017
This change enables the user to configure their debugging sessions to
launch a temporary Integrated Console each time they start the debugger.
This is useful when debugging scripts or modules which use PowerShell
classes or managed assemblies which cannot be reloaded within the same
process.

Resolves PowerShell#367.
daviwil added a commit to daviwil/vscode-powershell that referenced this issue Jun 21, 2017
This change enables the user to configure their debugging sessions to
launch a temporary Integrated Console each time they start the debugger.
This is useful when debugging scripts or modules which use PowerShell
classes or managed assemblies which cannot be reloaded within the same
process.

Resolves PowerShell#367.
daviwil added a commit that referenced this issue Jun 21, 2017
This change enables the user to configure their debugging sessions to
launch a temporary Integrated Console each time they start the debugger.
This is useful when debugging scripts or modules which use PowerShell
classes or managed assemblies which cannot be reloaded within the same
process.

Resolves #367.
@daviwil daviwil modified the milestones: June 2017, 1.4.0 Jun 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Debugging Issue-Enhancement A feature request (enhancement).
Projects
None yet
Development

No branches or pull requests

2 participants