sebdah/vim-delve

Command Line arguments at start of debug

Closed this issue · 2 comments

Thanks for the plugin, working great when I am testing unit tests. Had a question about full debug starting from a main that takes command line arguments.

I am switching over from Visual Studio Code, and I am able to set command line args when starting the go debugging.

I was wondering if there is something similar to below or a way to set my arguments to the start of the go application that I am debugging?

Thanks,
Jim

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [

        {
            "name": "Launch",
            "type": "go",
            "request": "launch",
            "mode": "debug",
            "remotePath": "",
            "port": 2345,
            "host": "127.0.0.1",
            "program": "${fileDirname}",
            "env": {"STATELOCATION": "/home/tmp"},
            "args": ["server", "-listen", ":8888", "-cluster", "dev"],
            "showLog": true
        }
    ]
}

I think I found a way:

https://github.com/derekparker/delve/blob/master/Documentation/usage/dlv.md

Can execute in nvim

:DlvDebug -- server -listen :8888 -cluster dev

@JC1738 Cool! I'm closing this since it looks like you found a way. Please reopen in case it's needed.