2023-11-22 13:11:41 +00:00
|
|
|
local M = {}
|
|
|
|
|
2023-11-22 17:22:02 +00:00
|
|
|
function M.nvim_dap()
|
2024-03-05 03:10:57 +00:00
|
|
|
local dap = require("dap")
|
|
|
|
local key = "codelldb"
|
2023-11-22 13:11:41 +00:00
|
|
|
|
|
|
|
dap.adapters[key] = {
|
2024-03-05 03:10:57 +00:00
|
|
|
type = "server",
|
|
|
|
port = "${port}",
|
2023-11-22 13:11:41 +00:00
|
|
|
executable = {
|
2024-03-05 03:10:57 +00:00
|
|
|
command = "codelldb",
|
|
|
|
args = { "--port", "${port}" },
|
2023-11-22 13:11:41 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2024-01-03 21:36:56 +00:00
|
|
|
local config = {
|
2024-03-05 03:10:57 +00:00
|
|
|
name = "Launch Executable",
|
2023-11-22 13:11:41 +00:00
|
|
|
type = key,
|
2024-03-05 03:10:57 +00:00
|
|
|
request = "launch",
|
2023-11-22 13:11:41 +00:00
|
|
|
program = function()
|
2024-03-05 03:10:57 +00:00
|
|
|
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
|
2023-11-22 13:11:41 +00:00
|
|
|
end,
|
2024-03-05 03:10:57 +00:00
|
|
|
cwd = "${workspaceFolder}",
|
2024-01-03 21:36:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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)
|
2023-11-22 13:11:41 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
function M.nvim_lspconfig()
|
2024-03-05 03:10:57 +00:00
|
|
|
require("utils.lsp").setup(require("lspconfig").clangd) {}
|
2023-11-22 13:11:41 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
return M
|