From ea0f4bf8ffade657b1d45152dbc183d4679e75c4 Mon Sep 17 00:00:00 2001 From: Elvis Claros Castro Date: Fri, 12 Jul 2024 11:18:14 -0300 Subject: Feat: PI --- lua/pi/dap/configs/javascript.lua | 62 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 lua/pi/dap/configs/javascript.lua (limited to 'lua/pi/dap/configs/javascript.lua') diff --git a/lua/pi/dap/configs/javascript.lua b/lua/pi/dap/configs/javascript.lua new file mode 100644 index 0000000..03173ba --- /dev/null +++ b/lua/pi/dap/configs/javascript.lua @@ -0,0 +1,62 @@ +local dap = require('dap') +dap.adapters.firefox = { + type = 'executable', + command = 'firefox-debug-adapter', +} + +dap.configurations.typescript = { + { + name = 'Debug with Firefox', + type = 'firefox', + request = 'launch', + reAttach = true, + url = 'http://localhost:3010', + webRoot = '${workspaceFolder}', + firefoxExecutable = '/home/elvis/.local/bin/firefox' + }, +} +-- require("dap-vscode-js").setup { +-- debugger_cmd = { "js-debug-adapter" }, +-- adapters = { "pwa-node", "pwa-chrome", "node-terminal" }, +-- } +-- +-- for _, language in ipairs { "typescript", "javascript" } do +-- require("dap").configurations[language] = { +-- { +-- type = "pwa-node", +-- request = "launch", +-- name = "Launch file", +-- program = "${file}", +-- cwd = "${workspaceFolder}", +-- }, +-- { +-- type = "pwa-node", +-- request = "attach", +-- name = "Attach", +-- processId = require("dap.utils").pick_process, +-- cwd = "${workspaceFolder}", +-- }, +-- } +-- end +-- +-- for _, language in ipairs { "typescriptreact", "javascriptreact" } do +-- require("dap").configurations[language] = { +-- { +-- type = "pwa-chrome", +-- name = "Attach - Remote Debugging", +-- request = "attach", +-- program = "${file}", +-- cwd = vim.fn.getcwd(), +-- sourceMaps = true, +-- protocol = "inspector", +-- port = 9222, +-- webRoot = "${workspaceFolder}", +-- }, +-- { +-- type = "pwa-chrome", +-- name = "Launch Chrome", +-- request = "launch", +-- url = "http://localhost:3000", +-- }, +-- } +-- end -- cgit v1.2.3