Use same DAP configuration for C with C++.

main
Joshua Potter 2024-01-03 14:36:56 -07:00
parent ff774da4a8
commit a97fddb3b3
1 changed files with 8 additions and 3 deletions

View File

@ -13,8 +13,7 @@ function M.nvim_dap()
}, },
} }
dap.configurations.c = dap.configurations.c or {} local config = {
table.insert(dap.configurations.c, {
name = 'Launch Executable', name = 'Launch Executable',
type = key, type = key,
request = 'launch', request = 'launch',
@ -22,7 +21,13 @@ function M.nvim_dap()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end, end,
cwd = '${workspaceFolder}', cwd = '${workspaceFolder}',
}) }
dap.configurations.c = dap.configurations.c or {}
table.insert(dap.configurations.c, config)
dap.configurations.cpp = dap.configurations.cpp or {}
table.insert(dap.configurations.cpp, config)
end end
function M.nvim_lspconfig() function M.nvim_lspconfig()