From a06e856332587a34c27e7a0d5198ba91c856ab5a Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Sun, 17 Nov 2024 00:07:23 +0100 Subject: [PATCH] nvim: python dap wip --- dotfiles/.config/nvim/lua/plugins/dap.lua | 31 +++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/dotfiles/.config/nvim/lua/plugins/dap.lua b/dotfiles/.config/nvim/lua/plugins/dap.lua index 4414638..cf4f022 100644 --- a/dotfiles/.config/nvim/lua/plugins/dap.lua +++ b/dotfiles/.config/nvim/lua/plugins/dap.lua @@ -87,3 +87,34 @@ dap.configurations.rust = { showDisassembly = "never" } } + +-- Set up debugpy via uv +dap.adapters.python = { + type = 'server', + port = "${port}", + host = "127.0.0.1", + executable = { + command = "uvx", + args = { + "debugpy", + "--listen", + "127.0.0.1:${port}", + "--wait-for-client", + }, + }, + options = { + source_filetype = 'python', + }, +} + +dap.configurations.python = { + { + type = 'python'; + request = 'launch'; + name = "Launch file"; + program = "${file}"; + pythonPath = function() + return "${workspaceFolder}/.venv/bin/python" + end; + }, +}