fix: updated rust/c dap config

i don't really get it yet but eeh kinda works
This commit is contained in:
əlemi 2023-01-23 22:01:35 +01:00
parent 3f05637482
commit a9372aa225
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -77,17 +77,34 @@ local init_fn = function(use)
type = 'lldb',
request = 'launch',
program = function()
local program = ""
for i in string.gmatch(vim.fn.getcwd(), "([^/]+)") do
program = i
end
return vim.fn.getcwd() .. "/target/debug/" .. program -- TODO can I put startup file somewhere?
vim.fn.input("run: ", vim.fn.getcwd() .. "/", "command")
end,
cwd = '${workspaceFolder}',
},
}
dap.configurations.c = dap.configurations.cpp
dap.configurations.rust = dap.configurations.cpp
dap.configurations.rust = {
{
name = 'Launch',
type = 'lldb',
request = 'launch',
program = function()
local program = ""
for i in string.gmatch(vim.fn.getcwd(), "([^/]+)") do -- TODO jank! assumes folder is called just like executable
program = i
end
return vim.fn.getcwd() .. "/target/debug/" .. program -- TODO can I put startup file somewhere?
end,
cwd = '${workspaceFolder}',
args = function()
local args = {}
for str in string.gmatch(vim.fn.input("args: "), "([^,]+)") do
table.insert(args, str)
end
return args
end,
},
}
require('keybinds'):set_dap_keys({})
require('dapui').setup()
end,