-
Notifications
You must be signed in to change notification settings - Fork 511
Fix PowerShell.Debug.Start
to just launch current file
#3772
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5bb5b16
to
8c94c13
Compare
8c94c13
to
7cf0249
Compare
This command previously used a private API `workbench.action.debug.start` which led to bad behavior. Namely it meant that while a PowerShell file was opened, if the triangular "Start" button was pressed, it would start Code's currently selected launch configuration which is often not what the user intended. 1. If there was no `launch.json` this worked accidentally in that we resolved a default configuration to launch the current file. 2. If a working PowerShell configuration was selected, it may work as intended, unless that configuration was to attach. 3. If any other configuration was selected, the user would be left bewildered as to why, say, a Python debugger was started for a PowerShell file. Instead we call the public API to start the debugger and give it a copy of our "Launch Current File" configuration, which is what the user intended do when clicking the "Start" button on a PowerShell file. This may introduce some breaking behavior if the user was relying on this button to start their current correctly configured (and selected) launch configuration with possible extra customizations. However, in that the case the user can use Code's built-in options to call the private API we were calling preivously, namely F5 or the triangular start button in the debugger workbench (instead of our button).
7cf0249
to
4d8bc56
Compare
PowerShell.Debug.Start
to just launch current file
See microsoft/vscode#59689 for rationale as to why we shouldn't have been calling the formerly used API. |
SeeminglyScience
approved these changes
Jan 22, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This command previously used a private API
workbench.action.debug.start
which led to bad behavior. Namely itmeant that while a PowerShell file was opened, if the triangular "Start"
button was pressed, it would start Code's currently selected launch
configuration which is often not what the user intended.
launch.json
this worked accidentally in that weresolved a default configuration to launch the current file.
intended, unless that configuration was to attach.
bewildered as to why, say, a Python debugger was started for a
PowerShell file.
Instead we call the public API to start the debugger and give it a copy
of our "Launch Current File" configuration, which is what the user
intended do when clicking the "Start" button on a PowerShell file.
This may introduce some breaking behavior if the user was relying on
this button to start their current correctly configured (and selected)
launch configuration with possible extra customizations. However, in
that the case the user can use Code's built-in options to call the
private API we were calling preivously, namely F5 or the triangular
start button in the debugger workbench (instead of our button).
Fixes #3710, cleans up some files, and reverts a bug introduced in #3518.