Skip to content

[Revamp pipeline thread handling] Enable the debugger UI and hook it up to the new context #1432

Closed
@SydneyhSmith

Description

@SydneyhSmith

The debugger in the async pipeline consumer is implemented, but is not yet hooked up to the UI.

This is done by sending messages back to the client to ensure it's kept in sync with VSCode.

Most of these are done with the debug adapter protocol, but we still need be able to start and stop the debugger from the server.

The key is for us to make sure the client debugger is active when the debugger stops. That's done today like this:

if (!IsDebugServerActive)
{
_languageServer.SendNotification("powerShell/startDebugger");
}

We'll need to implement that here:

private void OnDebuggerStopped(object sender, DebuggerStopEventArgs debuggerStopEventArgs)
{
DebugContext.SetDebuggerStopped(debuggerStopEventArgs);
try
{
CurrentPowerShell.WaitForRemoteOutputIfNeeded();
PushPowerShellAndRunLoop(_psFactory.CreateNestedPowerShell(CurrentRunspace), PowerShellFrameType.Debug | PowerShellFrameType.Nested);
CurrentPowerShell.ResumeRemoteOutputIfNeeded();
}
finally
{
DebugContext.SetDebuggerResumed();
}
}

Note that I've already tried simply putting this in, but it doesn't just work, so needs to be debugged and worked through

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions