71 lines
1.8 KiB
Lua
71 lines
1.8 KiB
Lua
vim.fn.sign_define('DapBreakpoint', {text='🟥', texthl='', linehl='', numhl=''})
|
|
vim.fn.sign_define('DapStopped', {text='⭐️', texthl='', linehl='', numhl=''})
|
|
local dap = require('dap')
|
|
|
|
local M ={}
|
|
|
|
local DEBUGGER_PATH = {os.getenv('HOME')..'/.local/share/nvim/mason/packages/js-debug-adapter'}
|
|
|
|
function M.setup()
|
|
dap.adapters.lldb = {
|
|
type = 'executable',
|
|
command = '/usr/bin/lldb-vscode',
|
|
name = 'lldb'
|
|
}
|
|
|
|
dap.configurations.cpp = {
|
|
{
|
|
name = 'Launch',
|
|
type = 'lldb',
|
|
request = 'launch',
|
|
program = function()
|
|
return vim.fn.input('Path to executable: ',vim.fn.getcwd() .. '/', 'file')
|
|
end,
|
|
cwd = '${workspaceFolder}',
|
|
stopOnEntry = false,
|
|
args = {}
|
|
}
|
|
}
|
|
dap.configurations.c = dap.configurations.cpp
|
|
dap.configurations.rust = dap.configurations.cpp
|
|
require('dap-vscode-js').setup {
|
|
node_path = "node",
|
|
debugger_path = DEBUGGER_PATH,
|
|
adapters = {"pwa-node","pwa-chrome","pwa-msedge","node-terminal", "pwa-extensionHost"}
|
|
}
|
|
for _, language in ipairs {"typescript", "javascript"} do
|
|
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}"
|
|
},
|
|
{
|
|
type = "pwa-node",
|
|
request = "launch",
|
|
name = "Debug Jest Tests",
|
|
runtimeExecutable = "node",
|
|
runtimeArgs = {
|
|
"./node_modules/jest/bin/jestj",
|
|
"--runInBand",
|
|
},
|
|
rootPath = "${workspaceFolder}",
|
|
console = "integratedTerminal",
|
|
internalConsoleOptions = "neverOpen",
|
|
cwd = "${workspacefolder}"
|
|
}}
|
|
end
|
|
end
|
|
|
|
M.setup()
|
|
return M
|
|
|