1 local dap = require('dap')
6 args = {os.getenv('HOME') .. '/projects/tools/vscode-node-debug2/out/src/nodeDebug.js'},
8 dap.configurations.javascript = {
14 cwd = vim.fn.getcwd(),
16 protocol = 'inspector',
17 console = 'integratedTerminal',
20 -- For this to work you need to make sure the node process is started with the `--inspect` flag.
21 name = 'Attach to process',
24 processId = require'dap.utils'.pick_process,
28 dap.adapters.firefox = {
31 args = {os.getenv('HOME') .. '/projects/tools/vscode-firefox-debug/dist/adapter.bundle.js'},
34 dap.configurations.typescript = {
36 name = 'Debug with Firefox',
40 url = 'http://localhost:3000',
41 webRoot = '${workspaceFolder}',
42 firefoxExecutable = '/Applications/Firefox Developer Edition.app/Contents/MacOS/firefox'
46 dap.configurations.typescriptreact = {
48 name = 'Debug with Firefox',
52 url = 'http://localhost:3000',
53 webRoot = '${workspaceFolder}',
54 firefoxExecutable = '/Applications/Firefox Developer Edition.app/Contents/MacOS/firefox'
58 dap.adapters.python = function(cb, config)
59 if config.request == 'attach' then
60 ---@diagnostic disable-next-line: undefined-field
61 local port = (config.connect or config).port
62 ---@diagnostic disable-next-line: undefined-field
63 local host = (config.connect or config).host or '127.0.0.1'
66 port = assert(port, '`connect.port` is required for a python `attach` configuration'),
69 source_filetype = 'python',
75 command = os.getenv('HOME') .. '/.asdf/shims/python',
76 args = { '-m', 'debugpy.adapter' },
78 source_filetype = 'python',
84 dap.configurations.python = {
86 -- The first three options are required by nvim-dap
87 type = 'python'; -- the type here established the link to the adapter definition: `dap.adapters.python`
91 -- Options below are for debugpy, see https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings for supported options
93 program = "${file}"; -- This configuration will launch the current file if used.
94 pythonPath = function()
95 -- debugpy supports launching an application with a different interpreter then the one used to launch debugpy itself.
96 -- The code below looks for a `venv` or `.venv` folder in the current directly and uses the python within.
97 -- You could adapt this - to for example use the `VIRTUAL_ENV` environment variable.
98 local cwd = vim.fn.getcwd()
99 if vim.fn.executable(cwd .. '/venv/bin/python') == 1 then
100 return cwd .. '/venv/bin/python'
101 elseif vim.fn.executable(cwd .. '/.venv/bin/python') == 1 then
102 return cwd .. '/.venv/bin/python'
104 return os.getenv('HOME') .. '/.asdf/shims/python'
110 require('neodev').setup({
111 library = { plugins = { "nvim-dap-ui" }, types = true }