mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
Merge branch 'python-path-neoconf'
This commit is contained in:
commit
81b1f01d4d
1 changed files with 15 additions and 1 deletions
|
|
@ -103,7 +103,21 @@ return {
|
||||||
{ "<leader>dPc", function() require('dap-python').test_class() end, desc = "Debug Class", ft = "python" },
|
{ "<leader>dPc", function() require('dap-python').test_class() end, desc = "Debug Class", ft = "python" },
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
|
if vim.fn.has("win32") == 1 then
|
||||||
require("dap-python").setup("debugpy-adapter")
|
require("dap-python").setup("debugpy-adapter")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
-- try loading python path configured in neoconf (pyright)
|
||||||
|
if LazyVim.has("neoconf.nvim") and LazyVim.is_loaded("neoconf.nvim") then
|
||||||
|
local ncf = require("neoconf").get()
|
||||||
|
local pypath = ((ncf.lspconfig or {}).pyright or {})["python.pythonPath"]
|
||||||
|
if pypath ~= nil then
|
||||||
|
pypath = vim.fn.expand(pypath)
|
||||||
|
require("dap-python").setup(nil, { pythonPath = pypath })
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
require("dap-python").setup(LazyVim.get_pkg_path("debugpy", "/venv/bin/python"))
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue