From 66ecdab54ad77b5ec9d04e407b7ae625f131bd63 Mon Sep 17 00:00:00 2001 From: Taken Date: Wed, 6 Sep 2023 21:41:59 +0200 Subject: [PATCH] Adding dap nvim Signed-off-by: Taken --- lua/taken/plugins/dap.lua | 42 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 lua/taken/plugins/dap.lua diff --git a/lua/taken/plugins/dap.lua b/lua/taken/plugins/dap.lua new file mode 100644 index 0000000..44e503d --- /dev/null +++ b/lua/taken/plugins/dap.lua @@ -0,0 +1,42 @@ +return { + "rcarriga/nvim-dap-ui", + dependencies = "mfussenegger/nvim-dap", + config = function() + local dap = require("dap") + local dapui = require("dapui") + + dap.adapters["pwa-node"] = { + type = "server", + host = "127.0.0.1", + port = "8123", + executable = { + command = "js-debug-adapter", + }, + } + + for _, lang in ipairs({ "javascript", "typescript" }) do + dap.configurations[lang] = { + { + type = "pwa-node", + request = "launch", + name = "Launch file", + program = "${file}", + cwd = "${workspaceFolder}", + runtimeExecutable = "node", + }, + } + end + + dap.listeners.after.event_initialized["dapui_config"] = function() + dapui.open() + end + dap.listeners.before.event_terminated["dapui_config"] = function() + dapui.close() + end + dap.listeners.before.event_exited["dapui_config"] = function() + dapui.close() + end + + dapui.setup() + end, +}