X-Git-Url: https://git.r.bdr.sh/rbdr/dotfiles/blobdiff_plain/cf43e2c226f3d28ffd15abef733fdf06de253e40..66b09f6c9388eedff178645956c97aaeae8d3b27:/config/nvim/lua/dap_config.lua?ds=sidebyside diff --git a/config/nvim/lua/dap_config.lua b/config/nvim/lua/dap_config.lua index 446315a..b84af74 100644 --- a/config/nvim/lua/dap_config.lua +++ b/config/nvim/lua/dap_config.lua @@ -1,28 +1,30 @@ local dap = require('dap') +require("dapui").setup() + +vim.keymap.set('n', 'd', function() + require("dapui").toggle() +end) + +require("dap-vscode-js").setup({ + debugger_path = os.getenv('HOME') .. '/projects/tools/vscode-js-debug/out/adapter.bundle.js', + adapters = { 'pwa-node', 'node-terminal' }, +}) -dap.adapters.node2 = { - type = 'executable', - command = 'node', - args = {os.getenv('HOME') .. '/projects/tools/vscode-node-debug2/out/src/nodeDebug.js'}, -} dap.configurations.javascript = { { - name = 'Launch', - type = 'node2', - request = 'launch', - program = '${file}', - cwd = vim.fn.getcwd(), - sourceMaps = true, - protocol = 'inspector', - console = 'integratedTerminal', + type = "pwa-node", + request = "launch", + name = "Launch file", + program = "${file}", + cwd = "${workspaceFolder}", }, { - -- For this to work you need to make sure the node process is started with the `--inspect` flag. - name = 'Attach to process', - type = 'node2', - request = 'attach', + type = "pwa-node", + request = "attach", + name = "Attach", processId = require'dap.utils'.pick_process, - }, + cwd = "${workspaceFolder}", + } } dap.adapters.firefox = { @@ -32,14 +34,14 @@ dap.adapters.firefox = { } dap.configurations.typescript = { - { - name = 'Debug with Firefox', - type = 'firefox', - request = 'launch', - reAttach = true, - url = 'http://localhost:3000', - webRoot = '${workspaceFolder}', - firefoxExecutable = '/Applications/Firefox Developer Edition.app/Contents/MacOS/firefox' + { + name = 'Debug with Firefox', + type = 'firefox', + request = 'launch', + reAttach = true, + url = 'http://localhost:3000', + webRoot = '${workspaceFolder}', + firefoxExecutable = '/Applications/Firefox Developer Edition.app/Contents/MacOS/firefox' } }