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

Fix stepping while watch expressions or interactive pipeline is running #1894

Merged

Conversation

SeeminglyScience
Copy link
Collaborator

PR Summary

Trying to step when any nested command that wasn't PSRL was running caused us to essentially ignore the request. This caused VSCode to think we were "running" while we didn't actually cancel anything.

PR Context

`CancelDebugExecution` was supposed to exit early when the runspace was
unusable. Basically forgot the `!` in the `if` statement.
When attempting to step, if we're in a nested debug frame that isn't a
REPL we should stop execution before trying to exit the REPL.
Instead of a blank watch message we now write the exception message that
was thrown from the attempt.
@SeeminglyScience SeeminglyScience requested a review from a team August 15, 2022 21:26
@@ -382,7 +382,7 @@ internal void MaybeAddToHistory()

private void CancelDebugExecution()
{
if (_pwsh.Runspace.RunspaceStateInfo.IsUsable())
if (!_pwsh.Runspace.RunspaceStateInfo.IsUsable())
Copy link
Member

Choose a reason for hiding this comment

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

Was this just a big oops?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh yeah, I meant to add a review comment pointing this out

BIG ol' oops there

@andyleejordan
Copy link
Member

@SeeminglyScience any chance you could open an issue just so we have this close a bug out?

@andyleejordan andyleejordan linked an issue Aug 15, 2022 that may be closed by this pull request
3 tasks
@andyleejordan andyleejordan merged commit c25d0d2 into PowerShell:main Aug 15, 2022
@SeeminglyScience SeeminglyScience deleted the fix-watch-expression-errors branch August 16, 2022 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Debugger step requests ignored when nested commands are running
2 participants