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

Support Set-PSBreakpoint showing breakpoints in the editor #1091

Open
TylerLeonhardt opened this issue Nov 4, 2019 · 1 comment
Open

Support Set-PSBreakpoint showing breakpoints in the editor #1091

TylerLeonhardt opened this issue Nov 4, 2019 · 1 comment
Labels
Area-Debugging Issue-Enhancement A feature request (enhancement).

Comments

@TylerLeonhardt
Copy link
Member

By creating a Proxy function of Set-PSBreakpoint, we can fire the breakpoint event as seen in the DAP spec to notify the client that a breakpoint has been added.

This is the really the final feature needed to provide the "console debugging in PSES experience" that feels totally integrated.

Creating a Proxy cmdlet is easy with:

$Metadata = [System.Management.Automation.CommandMetaData]::new((Get-Command Set-PSBreakpoint))
[System.Management.Automation.ProxyCommand]::Create($Metadata)

Then we'll need a way to give the EditorObject the state of the debugger... but mainly the JsonRpcServer object so that we can use it to send the SendNotification( method to send the breakpoint information to the client.

Then we take that proxy function and add something like:

$psEditor.Components
    .GetService([OmniSharp.Extensions.LanguageServer.Protocol.Server.ILanguageServer])
    .SendNotification("breakpoint", [OmniSharp.Extensions.DebugAdapter.Protocol.Events.BreakpointEvent]::new(<#...#>))

with some error handling and we should be good to go.

@ghost ghost added the Needs: Triage Maintainer attention needed! label Nov 4, 2019
@SeeminglyScience
Copy link
Collaborator

SMA's Debugger also has a BreakpointUpdated event that might be a little bit more sturdy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Debugging Issue-Enhancement A feature request (enhancement).
Projects
None yet
Development

No branches or pull requests

2 participants