✨ feat(nvim): js/ts debugging
This commit is contained in:
parent
d27b06709c
commit
f60979981c
3 changed files with 63 additions and 0 deletions
|
@ -32,6 +32,7 @@ return {
|
||||||
"gomodifytags",
|
"gomodifytags",
|
||||||
"isort",
|
"isort",
|
||||||
"stylelint",
|
"stylelint",
|
||||||
|
"js-debug-adapter",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
9
.config/nvim/lua/plugins/treesj.lua
Normal file
9
.config/nvim/lua/plugins/treesj.lua
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"Wansmer/treesj",
|
||||||
|
keys = {
|
||||||
|
{ "J", "<cmd>TSJToggle<cr>", desc = "Join Toggle" },
|
||||||
|
},
|
||||||
|
opts = { use_default_keymaps = false, max_join_length = 150 },
|
||||||
|
},
|
||||||
|
}
|
53
.config/nvim/lua/plugins/vs-code-debug.lua
Normal file
53
.config/nvim/lua/plugins/vs-code-debug.lua
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"mfussenegger/nvim-dap",
|
||||||
|
dependencies = {
|
||||||
|
{
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
opts = function(_, opts)
|
||||||
|
opts.ensure_installed = opts.ensure_installed or {}
|
||||||
|
table.insert(opts.ensure_installed, "js-debug-adapter")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
opts = function()
|
||||||
|
local dap = require("dap")
|
||||||
|
if not dap.adapters["pwa-node"] then
|
||||||
|
require("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 = {
|
||||||
|
require("mason-registry").get_package("js-debug-adapter"):get_install_path()
|
||||||
|
.. "/js-debug/src/dapDebugServer.js",
|
||||||
|
"${port}",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end
|
||||||
|
for _, language in ipairs({ "typescript", "javascript", "typescriptreact", "javascriptreact" }) do
|
||||||
|
if not dap.configurations[language] then
|
||||||
|
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
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue