adapters: javascript/typescript via js-debug-adapter

This commit is contained in:
swaits committed 2026-04-11 16:42:11 -06:00
1 parent 38580100fe
commit 11c4509fb0
1 file changed
+43 -1
+43 -1
View File
@@ -1 +1,43 @@
return {}
local loader = require("tiny-debugger.adapters.init")
local M = {}
function M.register(dap)
local js_debug = loader.find_executable({ "js-debug-adapter" })
if not js_debug then return end
local adapter = {
type = "server",
host = "localhost",
port = "${port}",
executable = {
command = js_debug,
args = { "${port}" },
},
}
local configurations = {
{
type = "pwa-node",
request = "launch",
name = "Launch file",
program = "${file}",
cwd = "${workspaceFolder}",
},
{
type = "pwa-node",
request = "attach",
name = "Attach",
processId = function()
return require("dap.utils").pick_process()
end,
cwd = "${workspaceFolder}",
},
}
loader.register(dap, "pwa-node", adapter, configurations, {
"javascript", "typescript", "javascriptreact", "typescriptreact",
})
end
return M