add firefox adapter and config; fix tables

This commit is contained in:
vladstojna 2023-04-27 16:54:44 +01:00 committed by vladstojna
parent ee05de7d29
commit 0f18e541c6
5 changed files with 30 additions and 4 deletions

View File

@ -0,0 +1,10 @@
local dap = require("dap")
dap.adapters.firefox = {
type = "executable",
command = "node",
args = {
vim.fn.stdpath("data") ..
"/mason/packages/firefox-debug-adapter" ..
"/dist/adapter.bundle.js" },
}

View File

@ -2,3 +2,4 @@ require('custom.dap.adapters.cpptools')
require('custom.dap.adapters.codelldb') require('custom.dap.adapters.codelldb')
require('custom.dap.adapters.lldb-vscode') require('custom.dap.adapters.lldb-vscode')
require('custom.dap.adapters.pwa-node') require('custom.dap.adapters.pwa-node')
require('custom.dap.adapters.firefox')

View File

@ -0,0 +1,12 @@
local dap = require("dap")
local launch = {
name = 'Debug index.html with Firefox',
type = 'firefox',
request = 'launch',
reAttach = true,
file = "${workspaceFolder}/index.html",
}
table.insert(dap.configurations.javascript, launch)
table.insert(dap.configurations.typescript, launch)

View File

@ -7,3 +7,4 @@ dap_vscode.load_launchjs(nil, {
}) })
require('custom.dap.config.pwa-node') require('custom.dap.config.pwa-node')
require('custom.dap.config.firefox')

View File

@ -4,17 +4,19 @@ local dap_utils = require("dap.utils")
local launch = { local launch = {
type = "pwa-node", type = "pwa-node",
request = "launch", request = "launch",
name = "Launch file", name = "(pwa-node) Launch file",
program = "${file}", program = "${file}",
cwd = "${workspaceFolder}", cwd = "${workspaceFolder}",
} }
local attach = { local attach = {
type = "pwa-node", type = "pwa-node",
request = "attach", request = "attach",
name = "Attach", name = "(pwa-node) Attach",
processId = dap_utils.pick_process, processId = dap_utils.pick_process,
cwd = "${workspaceFolder}", cwd = "${workspaceFolder}",
} }
dap.configurations.javascript = { launch, attach } table.insert(dap.configurations.javascript, launch)
dap.configurations.typescript = { launch, attach } table.insert(dap.configurations.javascript, attach)
table.insert(dap.configurations.typescript, launch)
table.insert(dap.configurations.typescript, attach)