mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
add dap debug with codelldb
This commit is contained in:
parent
3aa2edc389
commit
25110f511b
1 changed files with 34 additions and 0 deletions
|
|
@ -54,4 +54,38 @@ return {
|
|||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
optional = true,
|
||||
opts = function()
|
||||
local dap = require("dap")
|
||||
dap.configurations.zig = {
|
||||
{
|
||||
name = "Zig Run",
|
||||
type = "codelldb",
|
||||
request = "launch",
|
||||
program = function()
|
||||
os.execute("zig build")
|
||||
local command = "find ! -type d -path './zig-out/bin/*' | grep -v 'Test' | sed 's#.*/##'"
|
||||
local bin_location = io.popen(command, "r")
|
||||
if bin_location ~= nil then
|
||||
return "zig-out/bin/" .. bin_location:read("*a"):gsub("[\n\r]", "")
|
||||
else
|
||||
return ""
|
||||
end
|
||||
end,
|
||||
cwd = "${workspaceFolder}",
|
||||
stopOnEntry = false,
|
||||
args = function()
|
||||
local argv = {}
|
||||
arg = vim.fn.input(string.format("Arguments: "))
|
||||
for a in string.gmatch(arg, "%S+") do
|
||||
table.insert(argv, a)
|
||||
end
|
||||
return argv
|
||||
end,
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue