mfussenegger / nvim-dap-python

An extension for nvim-dap, providing default configurations for python and methods to debug individual test methods or classes.
GNU General Public License v3.0
492 stars 46 forks source link

Help needed for compatibility with nvim-lua/kickstart #123

Closed lobneroO closed 5 months ago

lobneroO commented 5 months ago

I am not 100% sure this bug belongs here, but issue someone suggested posting it here on the kickstarter issue

I am in the process of setting up my own version of nvim-lua/kickstart. I wanted to test the debugging capabilities and tried debugging one of my python projects. After enabling the debugging in the kickstart project and installing the debugpy DAP throug Mason, I hit "F5" to toggle the debugger, getting the following error:

...tare/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1418: adapter.command must not be empty. Got: {
  command = "",
  type = "executable"
}
stack traceback:
^I[C]: in function 'error'
^I...tare/.local/share/nvim/lazy/nvim-dap/lua/dap/session.lua:1418: in function 'spawn'
^I/home/tare/.local/share/nvim/lazy/nvim-dap/lua/dap.lua:1041: in function 'launch'
^I/home/tare/.local/share/nvim/lazy/nvim-dap/lua/dap.lua:373: in function 'run_adapter'
^I/home/tare/.local/share/nvim/lazy/nvim-dap/lua/dap.lua:408: in function 'maybe_enrich_config_and_run'
^I/home/tare/.local/share/nvim/lazy/nvim-dap/lua/dap.lua:504: in function </home/tare/.local/share/nvim/lazy/nvim-dap/lua/dap.lua:488>
^I[C]: in function 'xpcall'
^I...e/tare/.local/share/nvim/lazy/nvim-dap/lua/dap/async.lua:12: in function <...e/tare/.local/share/nvim/lazy/nvim-dap/lua/dap/async.lua:11>

Since I am really new to this, I have no idea what to look for / how to fix this. I had a look at the stack trace and couldn't see any empty command. I have added the file, if it helps in any way. dap.zip

mfussenegger commented 5 months ago
return {
    type = 'executable',
    command = vim.fn.exepath('debugpy-adapter'),
}

vim.fn.exepath('debugpy-adapter') probably returns nothing, that's why your command is empty in the stacktrace.

You can verify with :lua print(vim.fn.exepath('debugpy-adapter'))

Make sure debugpy-adapter is in your $PATH or follow the README's instruction.