Skip to content

Commit 0696fd6

Browse files
Sped0nmehalter
andauthored
refactor(python): make mason optional during dap-python setup (#1565)
* refactor(python): make mason optional during dap-python setup - Change Python debugger adapter path to first check for `debugpy-adapter` before falling back to `python` - Only attempt to get `debugpy` package if Mason registry is available Signed-off-by: Sped0n <hi@sped0n.com> * refactor(python): clean up `nvim-dap-python` implementation * refactor(python): remove unnecessary logic in `nvim-dap-python` implementation --------- Signed-off-by: Sped0n <hi@sped0n.com> Co-authored-by: Micah Halter <micah.halter@gtri.gatech.edu>
1 parent f75b23e commit 0696fd6

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

lua/astrocommunity/pack/python/init.lua

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,8 @@ return {
101101
dependencies = "mfussenegger/nvim-dap",
102102
ft = "python", -- NOTE: ft: lazy-load on filetype
103103
config = function(_, opts)
104-
local path = vim.fn.exepath "python"
105-
local debugpy = require("mason-registry").get_package "debugpy"
106-
if debugpy:is_installed() then
107-
path = vim.fn.expand "$MASON/packages/debugpy"
108-
if vim.fn.has "win32" == 1 then
109-
path = path .. "/venv/Scripts/python"
110-
else
111-
path = path .. "/venv/bin/python"
112-
end
113-
end
104+
local path = vim.fn.exepath "debugpy-adapter"
105+
if path == "" then path = vim.fn.exepath "python" end
114106
require("dap-python").setup(path, opts)
115107
end,
116108
},

0 commit comments

Comments
 (0)