From 29fa9028a04b84b7cbbafc57c91411dcfebbf70c Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Sun, 27 Jul 2025 00:59:46 +0900 Subject: modified plugins/dap.lua, modified plugins/lsp.lua --- .../TheSiahxyz/lua/TheSiahxyz/plugins/dap.lua | 75 +++++++++++++++------- .../TheSiahxyz/lua/TheSiahxyz/plugins/lsp.lua | 1 + 2 files changed, 52 insertions(+), 24 deletions(-) diff --git a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/dap.lua b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/dap.lua index fac4e5c..6a4118a 100644 --- a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/dap.lua +++ b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/dap.lua @@ -26,8 +26,8 @@ return { local wk = require("which-key") wk.add({ mode = { "n" }, - { "dp", group = "Debug" }, - { "dP", group = "Debug (Python)" }, + { "db", group = "Debug" }, + { "dB", group = "Debug (Python)" }, }) end, config = function() @@ -35,6 +35,21 @@ return { vim.api.nvim_set_hl(0, "DapStoppedLine", { default = true, link = "Visual" }) local dap = require("dap") + + dap.adapters["pwa-node"] = { + type = "server", + host = "localhost", + port = "${port}", + executable = { + command = "node", + -- 💀 Make sure to update this path to point to your installation + args = { + vim.fn.stdpath("data") .. "/mason/packages/js-debug-adapter/js-debug/src/dapDebugServer.js", + "${port}", + }, + }, + } + dap.configurations.java = { { type = "java", @@ -45,6 +60,18 @@ return { }, } + for _, language in ipairs({ "javascript", "typescript" }) do + dap.configurations[language] = { + { + type = "pwa-node", + request = "launch", + name = "Launch file", + program = "${file}", + cwd = "${workspaceFolder}", + }, + } + end + local dap_icons = { Stopped = { "󰁕 ", "DiagnosticWarn", "DapStoppedLine" }, Breakpoint = " ", @@ -70,126 +97,126 @@ return { end, keys = { { - "dpB", + "dbB", function() require("dap").set_breakpoint(vim.fn.input("Breakpoint condition: ")) end, desc = "Dap breakpoint condition", }, { - "dpb", + "dbb", function() require("dap").toggle_breakpoint() end, desc = "Dap toggle breakpoint", }, { - "dpc", + "dbc", function() require("dap").continue() end, desc = "Dap continue", }, { - "dpa", + "dba", function() require("dap").continue({ before = get_args }) end, desc = "Dap run with args", }, { - "dpC", + "dbC", function() require("dap").run_to_cursor() end, desc = "Dap run to cursor", }, { - "dpg", + "dbg", function() require("dap").goto_() end, desc = "Dap go to line (no execute)", }, { - "dpi", + "dbi", function() require("dap").step_into() end, desc = "Dap step into", }, { - "dpj", + "dbj", function() require("dap").down() end, desc = "Dap down", }, { - "dpk", + "dbk", function() require("dap").up() end, desc = "Dap up", }, { - "dpl", + "dbl", function() require("dap").run_last() end, desc = "Dap run last", }, { - "dpo", + "dbo", function() require("dap").step_out() end, desc = "Dap step out", }, { - "dpO", + "dbO", function() require("dap").step_over() end, desc = "Dap step over", }, { - "dpp", + "dbp", function() require("dap").pause() end, desc = "Dap pause", }, { - "dpr", + "dbr", function() require("dap").repl.toggle() end, desc = "Dap toggle repl", }, { - "dps", + "dbs", function() require("dap").session() end, desc = "Dap session", }, { - "dpt", + "dbt", function() require("dap").terminate() end, desc = "Dap terminate", }, { - "dpw", + "dbw", function() require("dap.ui.widgets").hover() end, desc = "Dap widgets", }, { - "dpR", + "dbR", "lua require('dapui').open({ reset = true })", desc = "Dap UI reset", }, @@ -205,7 +232,7 @@ return { end, keys = { { - "dPt", + "dBt", function() require("dap-python").test_method() end, @@ -213,7 +240,7 @@ return { ft = "python", }, { - "dPc", + "dBc", function() require("dap-python").test_class() end, @@ -270,14 +297,14 @@ return { end, keys = { { - "dpu", + "dbu", function() require("dapui").toggle() end, desc = "Dap UI", }, { - "dpe", + "dbe", function() require("dapui").eval() end, diff --git a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/lsp.lua b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/lsp.lua index 819ab1c..8beb058 100644 --- a/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/lsp.lua +++ b/ar/.config/TheSiahxyz/lua/TheSiahxyz/plugins/lsp.lua @@ -246,6 +246,7 @@ return { "isort", -- python formatter "java-debug-adapter", -- java debugger "java-test", -- java test + "js-debug-adapter", -- javascript debugger "markdown-toc", -- markdown toc "prettier", -- prettier formatter "pylint", -- python linter -- cgit v1.2.3