Files
dots/.config/nvim/lua/plugins/dap.lua
mequidis d8933b4b8a a
2022-02-28 13:42:10 +02:00

58 lines
993 B
Lua

local dap = require('dap')
--
-- python
--
dap.adapters.python = {
type = 'executable';
command = 'python';
args = { '-m', 'debugpy.adapter' };
}
dap.configurations.python = {
{
type = 'python';
request = 'launch';
name = "Launch file";
program = "${file}";
pythonPath = function()
local cwd = vim.fn.getcwd()
if vim.fn.executable(cwd .. '/venv/bin/python') == 1 then
return cwd .. '/venv/bin/python'
elseif vim.fn.executable(cwd .. '/.venv/bin/python') == 1 then
return cwd .. '/.venv/bin/python'
else
return '/usr/bin/python'
end
end;
},
}
--
-- C
--
dap.adapters.lldb = {
type = 'executable',
command = '/usr/bin/lldb-vscode',
name = "lldb"
}
dap.configurations.c = {
{
name = "Launch",
type = "lldb",
request = "launch",
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
cwd = '${workspaceFolder}',
stopOnEntry = false,
args = {},
runInTerminal = false,
},
}