local dap = require('dap') require("dapui").setup() dap.set_log_level('ERROR') -- ---------------------------------------------------------------------------- -- Keymaps -- ---------------------------------------------------------------------------- vim.keymap.set('n', 'd', function() require('dapui').toggle() end) vim.keymap.set('n', 'b', function() require('dap').toggle_breakpoint() end) vim.keymap.set('n', 'd', function() require'dap'.continue() end) -- ---------------------------------------------------------------------------- -- LLDB (Rust / C++ / C) -- ---------------------------------------------------------------------------- dap.adapters.lldb = { type = 'executable', command = '/Applications/Xcode.app/Contents/Developer/usr/bin/lldb-dap', -- adjust as needed, must be absolute path name = 'lldb' } dap.configurations.rust = { { 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 = {}, } } -- ---------------------------------------------------------------------------- -- Javascript -- ---------------------------------------------------------------------------- dap.adapters.firefox = { type = 'executable', command = 'node', args = {os.getenv('HOME') .. '/projects/vendor/vscode-firefox-debug/dist/adapter.bundle.js'}, } dap.adapters['pwa-node'] = { type = 'server', host = 'localhost', port = '${port}', executable = { command = 'node', args = { os.getenv('HOME') .. '/projects/vendor/js-debug/src/dapDebugServer.js', '${port}' }, } } dap.configurations.typescript = { { name = 'Debug with Firefox', type = 'firefox', request = 'launch', reAttach = true, url = function() return vim.fn.input('URL to open: ', 'http://127.0.0.1') end, webRoot = '${workspaceFolder}', firefoxExecutable = '/Applications/Firefox.app/Contents/MacOS/firefox' } } dap.configurations.typescriptreact = { { name = 'Debug with Firefox', type = 'firefox', request = 'launch', reAttach = true, url = function() return vim.fn.input('URL to open: ', 'http://127.0.0.1') end, webRoot = '${workspaceFolder}', firefoxExecutable = '/Applications/Firefox.app/Contents/MacOS/firefox' } } dap.configurations.javascript = { { name = 'Debug with Firefox', type = 'firefox', request = 'launch', reAttach = true, url = function() return vim.fn.input('URL to open: ', 'http://127.0.0.1') end, webRoot = '${workspaceFolder}', firefoxExecutable = '/Applications/Firefox.app/Contents/MacOS/firefox', pathMappings = { -- Zola { url = 'http://127.0.0.1:1111', path = '${workspaceFolder}/static' }, -- Static pages or pages built with `page` should work out of the box. } }, { type = "pwa-node", request = "launch", name = "Launch (node)", program = function() return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') end, cwd = "${workspaceFolder}", console = "integratedTerminal", }, { type = "pwa-node", request = "attach", name = "Attach (node)", cwd = "${workspaceFolder}", console = "integratedTerminal", }, { type = "pwa-node", request = "attach", address = "localhost", port = 9229, name = "Attach (docker/node)", cwd = "${workspaceFolder}", remoteRoot = "/app", sourceMaps = true, console = "integratedTerminal", } }