fix: Fixing the python DAP config as it was just not functioning

correctly with the Mason setup.
This commit is contained in:
Finch 2025-07-26 20:30:10 -05:00
parent 0b14709875
commit c7055d45f9
2 changed files with 10 additions and 12 deletions

View File

@ -1,6 +1,6 @@
return {
'mfussenegger/nvim-dap-python',
config = function()
require('dap-python').setup('~/.virtualenvs/debugpy/bin/python')
require('dap-python').setup('~/.local/share/nvim/mason/packages/debugpy/venv/bin/python')
end,
}

View File

@ -127,19 +127,17 @@ return {
python = {
{
type = 'python',
name = 'Launch current file',
request = 'launch',
name = 'Launch file',
program = '${file}',
pythonPath = function()
local cwd = vim.fn.getcwd()
if vim.fn.executable(cwd .. '/venv/bin/python') == 1 then
return cwd .. '/venv/bin/python'
elseif vim.fn.executable(cwd .. '/.venv/bin/python') == 1 then
return cwd .. '/.venv/bin/python'
else
return '/usr/bin/python'
end
end,
-- pythonPath = function()
-- local cwd = vim.fn.getcwd()
-- if vim.fn.executable(cwd .. '/.venv/bin/python') == 1 then
-- return cwd .. '/.venv/bin/python'
-- else
-- return '/usr/bin/python'
-- end
-- end,
}
}
}