Skip to content

Commit

Permalink
feat(dap-dlv): add custom args support (ayamir#545)
Browse files Browse the repository at this point in the history
* feat(dap-dlv): add args support

* style(dap-dlv): use vim builtin to split args
  • Loading branch information
fioncat authored Mar 1, 2023
1 parent 3d029f3 commit 71c5a24
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lua/modules/configs/tool/dap/dap-dlv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ end
-- https://github.com/go-delve/delve/blob/master/Documentation/usage/dlv_dap.md
dap.configurations.go = {
{ type = "go", name = "Debug", request = "launch", program = "${file}" },
{
type = "go",
name = "Debug with args",
request = "launch",
program = "${file}",
args = function()
local argument_string = vim.fn.input("Program arg(s): ")
return vim.fn.split(argument_string, " ", true)
end,
},
{
type = "go",
name = "Debug test", -- configuration for debugging test files
Expand Down

0 comments on commit 71c5a24

Please sign in to comment.