use debugpy from mason
This commit is contained in:
parent
652a1c2aa7
commit
41ce8f2063
@ -8,11 +8,20 @@ vim.keymap.set('n', '<F11>', ":lua require('dap').step_into()<CR>", opts)
|
|||||||
vim.keymap.set('n', '<S-F11>', ":lua require('dap').step_out()<CR>", opts)
|
vim.keymap.set('n', '<S-F11>', ":lua require('dap').step_out()<CR>", opts)
|
||||||
|
|
||||||
local initDir = vim.api.nvim_list_runtime_paths()[1]
|
local initDir = vim.api.nvim_list_runtime_paths()[1]
|
||||||
|
local masonpath = vim.fn.stdpath('data') .. '/mason'
|
||||||
|
|
||||||
-- PYTHON
|
-- PYTHON
|
||||||
|
local function getVenvSuffix()
|
||||||
|
if vim.loop.os_uname().sysname == 'Linux' then
|
||||||
|
return 'bin/python'
|
||||||
|
elseif vim.loop.os_uname().sysname == 'Windows_NT' then
|
||||||
|
return 'Scripts/python.exe'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
dap.adapters.python = {
|
dap.adapters.python = {
|
||||||
type = 'executable';
|
type = 'executable';
|
||||||
command = initDir .. '/venv_debugpy/Scripts/python';
|
command = masonpath .. '/packages/debugpy/venv/' .. getVenvSuffix();
|
||||||
args = { '-m', 'debugpy.adapter' };
|
args = { '-m', 'debugpy.adapter' };
|
||||||
options = {
|
options = {
|
||||||
detached = true;
|
detached = true;
|
||||||
@ -30,14 +39,6 @@ dap.listeners.before.event_exited["dapui_config"] = function()
|
|||||||
dapui.close()
|
dapui.close()
|
||||||
end
|
end
|
||||||
|
|
||||||
local function getVenvSuffix()
|
|
||||||
if vim.loop.os_uname().sysname == 'Linux' then
|
|
||||||
return 'bin/python'
|
|
||||||
elseif vim.loop.os_uname().sysname == 'Windows_NT' then
|
|
||||||
return 'Scripts/python.exe'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function getPythonEnv()
|
local function getPythonEnv()
|
||||||
local venv = os.getenv("VIRTUAL_ENV")
|
local venv = os.getenv("VIRTUAL_ENV")
|
||||||
if venv ~= nil then
|
if venv ~= nil then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user