-
Notifications
You must be signed in to change notification settings - Fork 235
Fixes #173 - implementation for function breakpoints #176
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
Fixes #173 - implementation for function breakpoints #176
Conversation
This commit also introduces support for the configurationDone request. In fact, due to the order in which set*Breakpoints requests and the launch request come in, we now defer the execution of the script until we receive the configurationDone request. When we executed from the launch request, the debug host would appear to hang. It did not like executing Set/Remove-PSBreakpoint commands when the host debugger was running (not in a stopped state) AFAICT. This commit has a known issue with VSCode mixing up which breakpoint has a condition associated with it when you add/remove a breakpoint (see microsoft/vscode#3558). The next commit will fix this issue.
… some breakpoint setting "optimization" code that unfortunately, messes up the order the breakpoint info returned to VSCode.
psCommand.AddParameter("Command", breakpoint.Name); | ||
|
||
// Check if this is a "conditional" line breakpoint. | ||
if (breakpoint.Condition != null) |
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.
Can a breakpoint be both on a function and conditional?
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.
Maybe I'm asking the wrong question, just confused by seeing this in the SetFunctionBreakpoints method. Maybe the function name is wrong?
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.
No, the method name is correct. The comment is misleading. I just committed a fix for the comment. As I mentioned below, function breakpoints in VSCode can have conditions (at the debug protocol level) and PowerShell supports it as well.
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.
That's pretty cool!
This is really awesome! We're definitely going to need some instructive documentation on how to use the debugger for this release. It can do so much cool stuff now that it's a shame people don't use it more. I'll see what we need to do for getting a doc tool setup going in a couple weeks. |
Yes, PowerShell supports it:
And the debug protocol supports. What I haven't seen yet is UI in VSCode that supports. But once they add that, we should be able to support it. |
And I'll definitely have a few blog posts queued up. One for breakpoint enhancements and another for Pester integration. What's your target release date BTW? |
For now my mental stake in the ground is March 25 or 28th. Could be sooner depending on how fast I'm able to land certain things. I guess it'd be a little unfortunate if VS Code ships their update next week and we aren't up to date for another couple weeks. What do you think? |
At this point, I'd be ready except for anything new in the next release of VSCode that we would want to take advantage of. That would take a day or two after we find out what is new. The drag is that even though I have access to the alpha channel, I won't have a good idea on what's "new" until I see some release notes. Or I guess, look at the VSCode commit history. :-) |
They've got release notes for 0.10.10 already with the Insiders release that went out today: https://github.com/Microsoft/vscode-docs/blob/vnext/release-notes/latest.md I don't know if they'll do a "March release" this month since they're already running late on their release schedule ;) |
I have another comment cleanup commit for this PR (sigh). Anyway, before I check this in I have a question about naming. Should the method names in the debug service be Also, this is for a later API cleanup, but shouldn't all the |
Yeah, the core Editor Services library should be using PowerShell terms. As far as the -Async is concerned, I don't know. I guess that has been the standard but I don't really like having an extra word for it. Seems like a failure of tooling rather than a naming requirement. We should definitely have that discussion again for 1.0 so I've filed an issue for it: |
…SetCommandBreakpoints. This is a "PowerShell" service and as such its API should be "PowerShell" oriented.
@daviwil Let me know when you've had enough time to look this over. It is big and got bigger with subsequent commits (sorry about that). |
I checked it out already, looks good! Merge when ready. |
…eakpoints Fixes #173 - implementation for function breakpoints
This PR introduces support for the configurationDone request. In fact, due to the order in which set*Breakpoints requests and the launch request come in, we now defer the execution of the script until we receive the configurationDone request. When we executed from the launch request, the debug host would appear to hang. It did not like executing Set/Remove-PSBreakpoint commands when the host debugger was running (not in a stopped state) AFAICT.
The first commit has a known issue with VSCode mixing up which breakpoint has a condition associated with it when you add/remove a breakpoint (see microsoft/vscode#3558). The second commit fixes this issue.