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

Add support for running concurrent debug sessions #844

Merged
merged 1 commit into from
Feb 8, 2023

Conversation

mfussenegger
Copy link
Owner

@mfussenegger mfussenegger commented Jan 29, 2023

Still needs some work

New API:

  • dap.sessions() to return active debug sessions
  • dap.ui.widgets.sessions to show active debug sessions

Step functions will change the focus automatically if the currently
focused session is not stopped.
This should make common scenarios like debugging client + server where
you step from making requests on the client to receiving request on the
server convenient.

Note that this is unrelated to startDebugging support. The PR here is
about concurrent top-level sessions. startDebugging support will
introduce hierarchical sessions. (Probably including something like
children in the Session object)

Open questions

  • If there is an active session, should run_last / run default to restart (terminate, run new), or should they default to run an additional session? Will restart if config name matches, otherwise start additional session
recording.mp4

@mfussenegger mfussenegger force-pushed the multi-session branch 2 times, most recently from df1c234 to 89595ec Compare January 29, 2023 07:37
@mfussenegger mfussenegger marked this pull request as ready for review February 4, 2023 14:30
New API:

- `dap.sessions()` to return active debug sessions
- `dap.ui.widgets.sessions` to show active debug sessions

Step functions will change the focus automatically if the currently
focused session is not stopped.
This should make common scenarios like debugging client + server where
you step from making requests on the client to receiving request on the
server convenient.

Note that this is unrelated to `startDebugging` support. The PR here is
about concurrent top-level sessions. `startDebugging` support will
introduce hierarchical sessions. (Probably including something like
`children` in the `Session` object)
@mfussenegger
Copy link
Owner Author

@rcarriga heads up so you can check nvim-dap-ui with these changes as I'm probably going to merge this soonish. Overall for most users nothing should really change about their existing workflows. But you may want to create a sessions widget and one important difference is that if users do spawn multiple sessions, there can still be active sessions after receiving a terminated event (so closing the dapui on it would be wrong, one would have to check via dap.sessions() if it was the last)

@rcarriga
Copy link
Contributor

rcarriga commented Feb 7, 2023

Thanks for tagging! So there's no breaking change here, just as you say it'd be useful for users to be able to choose a session?

@mfussenegger mfussenegger merged commit 0d77088 into master Feb 8, 2023
@mfussenegger mfussenegger deleted the multi-session branch February 8, 2023 12:45
@mfussenegger
Copy link
Owner Author

just as you say it'd be useful for users to be able to choose a session?

Yes and that in general there could now be more than one active session. That affects listener triggers and so on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants