From 06f13daf7261377ecfa6b4ac845d742f446df719 Mon Sep 17 00:00:00 2001 From: dbger <3982742+dbger@users.noreply.github.com> Date: Wed, 19 Jun 2024 01:02:41 +0800 Subject: [PATCH] fix(dap): get the correct debugpy pkg path on windows (#3716) ## What is this PR for? fix(dap): get the correct debugpy pkg path on windows. ## Does this PR fix an existing issue? ## Checklist - [ ] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- 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, }, },