-
Notifications
You must be signed in to change notification settings - Fork 511
Breakpoints not cleaned up if Debug Interactive Session is stopped. #2371
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
Comments
So this is a hard one because VS Code only gives us breakpoint gutter events "while debugging". That's why the Interactive Session exists. I opened a SO question to see if there's some mechanism that we can use to support this, but I think our hands are tied, unfortunately: This is also related PowerShell/PowerShellEditorServices#1091 but kinda the opposite ask. |
So is it not possible to just clear all the breakpoints in the PSES powershell instance on the "stop debugging" event? That will fix the problem. EDIT: To be clear, clear the breakpoints within PSES but not remove them in VSCode. Then the next time the debugger starts it will just reassign them based on what is currently set in VSCode. Basically this is a PSES post-debug cleanup item, even if the debug ends "unexpectedly" e.g. stop is pressed in Interactive Mode. |
I suppose we could do that. The question is really what the expected behavior is... and how do we want to confuse the user given the limitation of VS Code. If we clear all the breakpoints when the debugger is stopped, a user might run a script (or command from a module) directly in the PSIC that has a breakpoint set in it (clearly looking at the editor) and expect that breakpoint to be hit and the debugger to kick in. |
That would still work though wouldn't it? It would get set at time of run.
Also if you set breakpoints prior to starting a debug run in PSES, whatever
is in vscode would just be additive.
Seems like a hard edge case for default behavior, whereas the way it
behaves now affects me every single day.
…On Thu, Dec 19, 2019, 3:26 PM Tyler James Leonhardt < ***@***.***> wrote:
I suppose we could do that. The question is really what the expected
behavior is... and *how* do we want to confuse the user given the
limitation of VS Code.
If we clear all the breakpoints when the debugger is stopped, a user might
run a script (or command from a module) directly in the PSIC that has a
breakpoint set in it (clearly looking at the editor) and expect that
breakpoint to be hit and the debugger to kick in.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2371?email_source=notifications&email_token=ADUNKUQUTDRNHGQSQWOIHCLQZP7JNA5CNFSM4J4CF3K2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHLMBQQ#issuecomment-567722178>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADUNKUTUBTKUEUGYLXD57L3QZP7JNANCNFSM4J4CF3KQ>
.
|
Basically, my recommendation would be:
(Sorry for the pseudo-language, I'm not great at typescript and haven't tried to delve into the actual code) |
An alternative thought, is it possible for the extension on a pause to "re-poll" the breakpoints? That way if you had an interruption and start again, the breakpoint list would refresh and you could clean them up at that time. |
@JustinGrote that could be an interesting idea, let's reengage on this after our next release |
Issue Description
If the Interactive Debugger is started, then a breakpoint is set, but then the Interactive Debugger is then stopped, the breakpoints are still present and are not synced with the breakpoint activity bar. Further runs will still trigger debug mode even if the system currently isn't in the interactive debugger.
If PSBreakpoints are cleared when the debugger stops, this should fix it. This may be a PSES issue.
Attached Logs
Follow the instructions in the README about
capturing and sending logs.
Environment Information
Visual Studio Code
PowerShell Information
Visual Studio Code Extensions
Visual Studio Code Extensions(Click to Expand)
The text was updated successfully, but these errors were encountered: