Update dap config

This commit is contained in:
Antoine Vaure 2024-08-12 16:53:56 +02:00
parent 97c00fa470
commit 3c0c60de78
2 changed files with 46 additions and 13 deletions

View file

@ -16,7 +16,7 @@ dap.adapters.cppdbg = {
type = "executable",
command = "gdb",
args = { "-i", "dap" },
console = 'externalTerminal',
-- console = 'externalTerminal',
-- terminal_win_cmd = "tabnew",
}
@ -26,9 +26,36 @@ dap.adapters.lldb = {
name = 'lldb'
}
dap.adapters.debugpy = function(cb, config)
if config.request == 'attach' then
---@diagnostic disable-next-line: undefined-field
local port = (config.connect or config).port
---@diagnostic disable-next-line: undefined-field
local host = (config.connect or config).host or '127.0.0.1'
cb({
type = 'server',
port = assert(port, '`connect.port` is required for a python `attach` configuration'),
host = host,
options = {
source_filetype = 'python',
},
})
else
cb({
type = 'executable',
command = 'python',
args = { '-m', 'debugpy.adapter' },
options = {
source_filetype = 'python',
},
})
end
end
require('dap.ext.vscode').load_launchjs("dap_config.json", {
cppdbg = { 'c', 'cpp' },
lldb = { 'c', 'cpp' }
lldb = { 'c', 'cpp' },
debugpy = { 'python' }
})
dap.set_log_level("TRACE")