Skip to content

Commit 4417ede

Browse files
kdkasadNanoBoom
authored andcommitted
chore(python): use debugpy-adapter executable for nvim-dap-python (#6080)
## Description Uses a less hacky and now officially-supported way of getting the debugpy DAP adapter path for nvim-dap-python. Since mfussenegger/nvim-dap-python#184, nvim-dap-python can start the debugpy adapter using the `debugpy-adapter` executable. Since [Mason](https://github.com/mason-org/mason-registry/blob/f7c1c2fde2d1c79f8892dafc9528da1b78b56b25/packages/debugpy/package.yaml#L17) and [now debugpy itself](microsoft/debugpy#1870) provide this executable, there's no need to get the `python` executable from debugpy's venv. I've gone with just `"debugpy-adapter"` rather than `LazyVim.get_pkg_path("debugpy", "debugpy-adapter")` so that a system-wide installation of debugpy can also be used. ## Related Issue(s) <!-- If this PR fixes any issues, please link to the issue here. - Fixes #<issue_number> --> ## Screenshots <!-- Add screenshots of the changes if applicable. --> ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines.
1 parent 5453bcb commit 4417ede

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lua/lazyvim/plugins/extras/lang/python.lua

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,7 @@ return {
103103
{ "<leader>dPc", function() require('dap-python').test_class() end, desc = "Debug Class", ft = "python" },
104104
},
105105
config = function()
106-
if vim.fn.has("win32") == 1 then
107-
require("dap-python").setup(LazyVim.get_pkg_path("debugpy", "/venv/Scripts/pythonw.exe"))
108-
else
109-
require("dap-python").setup(LazyVim.get_pkg_path("debugpy", "/venv/bin/python"))
110-
end
106+
require("dap-python").setup("debugpy-adapter")
111107
end,
112108
},
113109
},

0 commit comments

Comments
 (0)