vim-go icon indicating copy to clipboard operation
vim-go copied to clipboard

Delve options

Open rikard-acst opened this issue 3 years ago • 2 comments

  • Allowing delve to use the current working directory Currently, I am working on a code base where executables are defined inside of a /cmd/{exename}/ folder and share code, including a configuration file from the parent folder. This can be accomplished with VSCode in the launch.json file using the property cwd.

  • max string length, max array, and max recursion Reading variables, especially strings, with a max length of 20 is limiting. I decided not to change the defaults here, but allow the end user to expand them.

rikard-acst avatar Jul 28 '22 20:07 rikard-acst

I'd rather not introduce specific support or delve's --wd flag. Vim isn't VSCode and has a very different model ... open one of the go files there and execute :GoDebugStart

It's a bit more work to pass in variables each time I need to debug. That being said, I know that maintaining any open source project requires commitment against scope creep, so I understand.

:GoDebugPrint is a good alternative to see more complete information. Can you give me some more information about the actual problem you're encountering that motivated the change to set the cfg options?

So, apparently I have worked using vim-go for over a year now and completely missed GoDebugPrint 🤦

rikard-acst avatar Jul 29 '22 13:07 rikard-acst

It's a bit more work to pass in variables each time I need to debug. That being said, I know that maintaining any open source project requires commitment against scope creep, so I understand.

The working directory that vim-go uses for delve will be the directory that contains the active file when a user executes :GoDebugStart. So let's say you have a file directory structure like this:

github.com/rikard-acst
    cmd/
        tool1/
            main.go
        tool2/
            main.go
    internal/
        config/
            config.go

You can debug the command github.com/rikard-acst/cmd/tool1 with the working directory set to github.com/rikard-acst/internal/config by editing github.com/rikard-acst/internal/config/config.go and running :GoDebugStart github.com/rikard-acst/cmd/tool1

bhcleek avatar Jul 30 '22 04:07 bhcleek