100 lines
2.4 KiB
Lua
100 lines
2.4 KiB
Lua
|
local dap = require('dap')
|
||
|
|
||
|
require("dap-vscode-js").setup({
|
||
|
debugger_path = "/.local/share/lunarvim/site/pack/lazy/opt/vscode-js-debug",
|
||
|
debugger_cmd = { "js-debug-adapter" },
|
||
|
adapters = { 'node-terminal' },
|
||
|
})
|
||
|
|
||
|
dap.configurations.cpp = {
|
||
|
{
|
||
|
name = "Launch file",
|
||
|
type = "codelldb",
|
||
|
request = "launch",
|
||
|
program = function()
|
||
|
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||
|
end,
|
||
|
cwd = '${workspaceFolder}',
|
||
|
stopOnEntry = false,
|
||
|
},
|
||
|
}
|
||
|
|
||
|
dap.configurations.c = dap.configurations.cpp
|
||
|
dap.configurations.rust = dap.configurations.cpp
|
||
|
|
||
|
dap.adapters["pwa-node"] = {
|
||
|
type = "server",
|
||
|
host = "localhost",
|
||
|
port = "${port}",
|
||
|
executable = {
|
||
|
command = "node",
|
||
|
args = {os.getenv("HOME") .. "/.local/share/lvim/mason/packages/js-debug-adapter/js-debug/src/dapDebugServer.js", "${port}"},
|
||
|
}
|
||
|
}
|
||
|
|
||
|
dap.configurations.javascript = {
|
||
|
{
|
||
|
type = "pwa-node",
|
||
|
request = "launch",
|
||
|
name = "Launch file",
|
||
|
program = "${file}",
|
||
|
cwd = "${workspaceFolder}",
|
||
|
},
|
||
|
}
|
||
|
|
||
|
dap.adapters.chrome = {
|
||
|
type = "executable",
|
||
|
command = "node",
|
||
|
args = {os.getenv("HOME") .. "/.local/share/lvim/mason/packages/chrome-debug-adapter/out/src/chromeDebug.js"},
|
||
|
}
|
||
|
|
||
|
dap.adapters.firefox = {
|
||
|
type = 'executable',
|
||
|
command = 'node',
|
||
|
args = {os.getenv('HOME') .. '/.local/share/lvim/mason/packages/firefox-debug-adapter/dist/adapter.bundle.js'},
|
||
|
}
|
||
|
|
||
|
dap.configurations.typescriptreact = {
|
||
|
{
|
||
|
name = 'Next.js: debug server-side',
|
||
|
type = "pwa-node",
|
||
|
request = "launch",
|
||
|
runtimeExecutable = "npm",
|
||
|
runtimeArgs = { "run", "dev" },
|
||
|
cwd = "${workspaceFolder}",
|
||
|
},
|
||
|
{
|
||
|
name = "Next.js: debug client-side with chrome",
|
||
|
type = "chrome",
|
||
|
request = "launch",
|
||
|
url = "http://localhost:3000"
|
||
|
},
|
||
|
{
|
||
|
name = "Next.js: debug client-side with firefox",
|
||
|
type = "firefox",
|
||
|
request = "launch",
|
||
|
url = 'http://localhost:3000',
|
||
|
webRoot = '${workspaceFolder}',
|
||
|
firefoxExecutable = '/usr/bin/waterfox',
|
||
|
pathMappings = {
|
||
|
{
|
||
|
url = "webpack://_n_e/",
|
||
|
path = "${workspaceFolder}/"
|
||
|
}
|
||
|
},
|
||
|
},
|
||
|
}
|
||
|
|
||
|
dap.configurations.javascriptreact = dap.configurations.typescriptreact;
|
||
|
|
||
|
require("dapui").setup()
|
||
|
|
||
|
local dap, dapui = require("dap"), require("dapui")
|
||
|
|
||
|
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||
|
dapui.open({})
|
||
|
end
|
||
|
|
||
|
vim.keymap.set('n', '<leader>ui', require 'dapui'.toggle)
|
||
|
|