2023-11-22 13:11:41 +00:00
|
|
|
local M = {}
|
|
|
|
|
2023-11-22 17:22:02 +00:00
|
|
|
function M.nvim_dap()
|
2023-11-22 13:11:41 +00:00
|
|
|
local dap = require('dap')
|
|
|
|
local key = 'codelldb'
|
|
|
|
|
|
|
|
dap.adapters[key] = {
|
|
|
|
type = 'server',
|
|
|
|
port = '${port}',
|
|
|
|
executable = {
|
2023-11-22 17:22:02 +00:00
|
|
|
command = 'codelldb',
|
2023-11-22 13:11:41 +00:00
|
|
|
args = {'--port', '${port}'},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
dap.configurations.c = dap.configurations.c or {}
|
|
|
|
table.insert(dap.configurations.c, {
|
|
|
|
name = 'Launch Executable',
|
|
|
|
type = key,
|
|
|
|
request = 'launch',
|
|
|
|
program = function()
|
|
|
|
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
|
|
|
end,
|
|
|
|
cwd = '${workspaceFolder}',
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
|
|
|
function M.nvim_lspconfig()
|
|
|
|
require('init.lsp').setup(require('lspconfig').clangd) {}
|
|
|
|
end
|
|
|
|
|
|
|
|
return M
|