fix: updated rust/c dap config
i don't really get it yet but eeh kinda works
This commit is contained in:
parent
3f05637482
commit
a9372aa225
1 changed files with 23 additions and 6 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue