Skip to content

Fix missing prompt when launching temporary interactive debug session #539

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

Merged
merged 1 commit into from
Jul 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/PowerShellEditorServices.Host/EditorServicesHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ private EditorSession CreateDebugSession(

editorSession.StartDebugSession(
powerShellContext,
hostUserInterface,
editorOperations);

return editorSession;
Expand Down
25 changes: 17 additions & 8 deletions src/PowerShellEditorServices.Protocol/Server/DebugAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,23 @@ protected async Task HandleConfigurationDoneRequest(

await requestContext.SendResult(null);

if (this.isInteractiveDebugSession &&
this.editorSession.DebugService.IsDebuggerStopped)
if (this.isInteractiveDebugSession)
{
// If this is an interactive session and there's a pending breakpoint,
// send that information along to the debugger client
this.DebugService_DebuggerStopped(
this,
this.editorSession.DebugService.CurrentDebuggerStoppedEventArgs);
if (this.ownsEditorSession)
{
// If this is a debug-only session, we need to start
// the command loop manually
this.editorSession.HostInput.StartCommandLoop();
}

if (this.editorSession.DebugService.IsDebuggerStopped)
{
// If this is an interactive session and there's a pending breakpoint,
// send that information along to the debugger client
this.DebugService_DebuggerStopped(
this,
this.editorSession.DebugService.CurrentDebuggerStoppedEventArgs);
}
}
}

Expand Down Expand Up @@ -646,7 +655,7 @@ protected async Task HandleStackTraceRequest(
int startFrameIndex = stackTraceParams.StartFrame ?? 0;
int maxFrameCount = stackFrames.Length;

// If the number of requested levels == 0 (or null), that means get all stack frames
// If the number of requested levels == 0 (or null), that means get all stack frames
// after the specified startFrame index. Otherwise get all the stack frames.
int requestedFrameCount = (stackTraceParams.Levels ?? 0);
if (requestedFrameCount > 0)
Expand Down
3 changes: 3 additions & 0 deletions src/PowerShellEditorServices/Session/EditorSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,17 @@ public void StartSession(
/// for the ConsoleService.
/// </summary>
/// <param name="powerShellContext"></param>
/// <param name="hostInput"></param>
/// <param name="editorOperations">
/// An IEditorOperations implementation used to interact with the editor.
/// </param>
public void StartDebugSession(
PowerShellContext powerShellContext,
IHostInput hostInput,
IEditorOperations editorOperations)
{
this.PowerShellContext = powerShellContext;
this.HostInput = hostInput;

// Initialize all services
this.RemoteFileManager = new RemoteFileManager(this.PowerShellContext, editorOperations, logger);
Expand Down