Commit 7389e85
committed
Pass parent session to adapter factory
For the `startDebugging` implementation of `vscode-js-debug` the client
needs to connect to the parent adapter instance.
This change enables an adapter configuration like this:
```lua
require("dap").adapters["pwa-node"] = function(on_config, config, parent)
local target = config["__pendingTargetId"]
if target and parent then
local adapter = parent.adapter --[[@as ServerAdapter]]
on_config({
type = "server",
host = "localhost",
port = adapter.port
})
else
on_config({
type = "server",
host = "localhost",
port = "${port}",
executable = {
command = "node",
args = {"/path/to/js-debug/src/dapDebugServer.js", "${port}"},
}
})
end
end
```1 parent 7e81998 commit 7389e85
3 files changed
+12
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
147 | | - | |
148 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
149 | 153 | | |
150 | 154 | | |
151 | 155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
| 200 | + | |
| 201 | + | |
200 | 202 | | |
201 | 203 | | |
202 | 204 | | |
| |||
210 | 212 | | |
211 | 213 | | |
212 | 214 | | |
213 | | - | |
| 215 | + | |
214 | 216 | | |
215 | 217 | | |
216 | 218 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
871 | 871 | | |
872 | 872 | | |
873 | 873 | | |
874 | | - | |
875 | | - | |
876 | | - | |
877 | 874 | | |
878 | 875 | | |
879 | 876 | | |
| |||
1014 | 1011 | | |
1015 | 1012 | | |
1016 | 1013 | | |
1017 | | - | |
| 1014 | + | |
1018 | 1015 | | |
1019 | 1016 | | |
1020 | 1017 | | |
| |||
1200 | 1197 | | |
1201 | 1198 | | |
1202 | 1199 | | |
| 1200 | + | |
1203 | 1201 | | |
1204 | 1202 | | |
1205 | 1203 | | |
| |||
0 commit comments