From 7770fc76fa76fe5e36a6cc8780e61810763467ca Mon Sep 17 00:00:00 2001 From: dbger <3982742+dbger@users.noreply.github.com> Date: Tue, 18 Jun 2024 14:13:40 +0800 Subject: [PATCH] fix(dap): get the correct debugpy pkg path on windows --- lua/lazyvim/plugins/extras/lang/python.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/python.lua b/lua/lazyvim/plugins/extras/lang/python.lua index e328a51f..9aeca2a4 100644 --- a/lua/lazyvim/plugins/extras/lang/python.lua +++ b/lua/lazyvim/plugins/extras/lang/python.lua @@ -92,7 +92,11 @@ return { { "dPc", function() require('dap-python').test_class() end, desc = "Debug Class", ft = "python" }, }, config = function() - require("dap-python").setup(LazyVim.get_pkg_path("debugpy", "/venv/bin/python")) + if vim.fn.has("win32") == 1 then + require("dap-python").setup(LazyVim.get_pkg_path("debugpy", "/venv/Scripts/python.exe")) + else + require("dap-python").setup(LazyVim.get_pkg_path("debugpy", "/venv/bin/python")) + end end, }, },