Skip to content

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

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

Closed
SydneyhSmith opened this issue Mar 29, 2021 · 1 comment

Comments

@SydneyhSmith
Copy link
Collaborator

SydneyhSmith commented Mar 29, 2021

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

@ghost ghost added the Needs: Triage Maintainer attention needed! label Mar 29, 2021
@SydneyhSmith SydneyhSmith added Area-Debugging Area-Engine Issue-Bug A bug to squash. and removed Needs: Triage Maintainer attention needed! labels Mar 29, 2021
@rjmholt
Copy link
Contributor

rjmholt commented Oct 11, 2021

Fixed in #1574

@rjmholt rjmholt closed this as completed Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants