Skip to content

Commit 77a3456

Browse files
committed
Support debugpy-adapter executable in setup
1 parent 3428282 commit 77a3456

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ To install the python tree-sitter parser you can either:
7979
-- must work in the shell
8080
```
8181

82+
Newer versions of `debugpy` also include a `debugpy-adapter` executable
83+
which you can use in place of the `python` executable.
84+
85+
8286
If using [uv][uv]:
8387

8488
```lua

lua/dap-python.lua

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,8 @@ function M.setup(python_path, opts)
236236
else
237237
---@type dap.ExecutableAdapter
238238
local adapter
239-
if python_path == "uv" then
239+
local basename = vim.fn.fnamemodify(python_path, ":t")
240+
if basename == "uv" then
240241
adapter = {
241242
type = "executable",
242243
command = "uv",
@@ -246,6 +247,16 @@ function M.setup(python_path, opts)
246247
source_filetype = "python"
247248
}
248249
}
250+
elseif basename == "debugpy-adapter" then
251+
adapter = {
252+
type = "executable",
253+
command = python_path,
254+
args = {},
255+
enrich_config = enrich_config,
256+
options = {
257+
source_filetype = "python"
258+
}
259+
}
249260
else
250261
adapter = {
251262
type = "executable",

0 commit comments

Comments
 (0)