Skip to content

Commit 0d77088

Browse files
committed
Add support for running concurrent debug sessions
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)
1 parent 0e376f0 commit 0d77088

File tree

8 files changed

+286
-77
lines changed

8 files changed

+286
-77
lines changed

doc/dap.txt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ continue() *dap.continue()*
615615
application.
616616

617617

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

628+
If a debug session with the same name is already active, it will
629+
restart the session.
630+
628631
Parameters:
629632
{config} |dap-configuration| to run
633+
{opts} Optional table with:
634+
- `new: boolean` to force running an additional debug session
630635

631636

632637
run_last() *dap.run_last()*
@@ -919,8 +924,12 @@ set_log_level(level) *dap.set_log_level()*
919924

920925

921926
session() *dap.session()*
922-
Returns the current session or nil if no session exists.
927+
Returns the currently focused session or nil if no session exists or
928+
has focus.
923929

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

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

10311040
Available widgets entities:
10321041

1042+
- sessions
10331043
- scopes
10341044
- frames
10351045
- expression

0 commit comments

Comments
 (0)