Skip to content

Commit

Permalink
Add support for running concurrent debug sessions
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
mfussenegger committed Feb 8, 2023
1 parent 0e376f0 commit 0d77088
Show file tree
Hide file tree
Showing 8 changed files with 286 additions and 77 deletions.
14 changes: 12 additions & 2 deletions doc/dap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ continue() *dap.continue()*
application.


run({config}) *dap.run()*
run({config}, {opts}) *dap.run()*
Looks up a debug adapter entry for the given configuration and runs it.
This is implicitly called by |dap.continue()| if no debug session is
active.
Expand All @@ -625,8 +625,13 @@ run({config}) *dap.run()*
create configurations dynamically, for example to debug individual test
cases.

If a debug session with the same name is already active, it will
restart the session.

Parameters:
{config} |dap-configuration| to run
{opts} Optional table with:
- `new: boolean` to force running an additional debug session


run_last() *dap.run_last()*
Expand Down Expand Up @@ -919,8 +924,12 @@ set_log_level(level) *dap.set_log_level()*


session() *dap.session()*
Returns the current session or nil if no session exists.
Returns the currently focused session or nil if no session exists or
has focus.

sessions() *dap.sessions()*
Returns a table with the active top-level debug sessions.
The keys are session ids and the values are the `Session` instances.

status()
Returns the status of the current debug session as text
Expand Down Expand Up @@ -1030,6 +1039,7 @@ The widgets may have the following custom mappings enabled:

Available widgets entities:

- sessions
- scopes
- frames
- expression
Expand Down
Loading

0 comments on commit 0d77088

Please sign in to comment.