Add dap support
This commit is contained in:
parent
e5f3edd8c8
commit
c56438c44b
5 changed files with 70 additions and 6 deletions
60
lua/plugins/dap.lua
Normal file
60
lua/plugins/dap.lua
Normal file
|
@ -0,0 +1,60 @@
|
|||
return {
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
config = function()
|
||||
local dap = require("dap")
|
||||
dap.adapters["pwa-node"] = {
|
||||
type = "server",
|
||||
host = "localhost",
|
||||
port = "${port}",
|
||||
executable = {
|
||||
command = "js-debug-adapter",
|
||||
args = { "${port}" },
|
||||
}
|
||||
}
|
||||
dap.configurations.javascript = {
|
||||
{
|
||||
type = "pwa-node",
|
||||
request = "launch",
|
||||
name = "Launch file",
|
||||
program = "${file}",
|
||||
cwd = "${workspaceFolder}",
|
||||
},
|
||||
{
|
||||
type = 'pwa-node',
|
||||
request = 'attach',
|
||||
name = 'Attach to Node app',
|
||||
address = 'localhost',
|
||||
port = 9229,
|
||||
cwd = '${workspaceFolder}',
|
||||
restart = true,
|
||||
},
|
||||
}
|
||||
end
|
||||
},
|
||||
{
|
||||
"rcarriga/nvim-dap-ui",
|
||||
dependencies = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" },
|
||||
config = function(opts)
|
||||
local dap, dapui = require("dap"), require("dapui")
|
||||
dapui.setup(opts)
|
||||
dap.listeners.before.attach.dapui_config = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.launch.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
|
||||
end,
|
||||
},
|
||||
{
|
||||
"theHamsta/nvim-dap-virtual-text",
|
||||
dependencies = { "mfussenegger/nvim-dap", "nvim-treesitter/nvim-treesitter" }
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue