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

Synchronize PowerShell debugger and DAP server state #1685

Merged
merged 5 commits into from
Jan 27, 2022

Conversation

andyleejordan
Copy link
Member

@andyleejordan andyleejordan commented Jan 26, 2022

This fixes PowerShell/vscode-powershell#3522 by resurrecting the bug-fix originally implemented in #1570. This allows the user to start a debug session within the integrated console and then have the VS Code debugger stop when the PowerShell debug session stops.

Also resolves #1677 and now fixes PowerShell/vscode-powershell#3700.

Copy link

@PaulHigin PaulHigin left a comment

Choose a reason for hiding this comment

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

This looks right to me. Debugger.InBreakpoint property is intended to inform when the runspace associated script debugger has stopped script execution (in breakpoint) and is awaiting debug commands to process, for both local and remote cases. When normal script execution resumes, InBreakpoint becomes false.

This synchronizes the `DebugContext` and LSP debug server state during
both edge cases:

1. A REPL happened, the debugger was marked active, and the debugger is
   now no longer running (it was quit, detached, or continued to the end
   of the script or function).

2. A user manually cancelled a task, and it was running under the
   "debugger" (whether or not the PowerShell debugger was active).
@andyleejordan
Copy link
Member Author

The newest commit should also fix PowerShell/vscode-powershell#3700.

@andyleejordan andyleejordan changed the title Send stopDebugger during REPL if no longer debugging Synchronize PowerShell debugger and DAP server state Jan 27, 2022
@andyleejordan andyleejordan merged commit f890a75 into master Jan 27, 2022
@andyleejordan andyleejordan deleted the andschwa/stopDebugger branch January 27, 2022 21:41
@SydneyhSmith SydneyhSmith mentioned this pull request Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants