fredrikaverpil / neotest-golang

Reliable Neotest adapter for running Go tests in Neovim.
MIT License
139 stars 17 forks source link

feat: using DAP without nvim-dap-go #216

Open HeavyPunk opened 1 week ago

HeavyPunk commented 1 week ago

Hello! I have a nvim config that contains a many of DAP configurations for some languages, also for golang. I don't want to install additional plugin special for debugging go apps or tests (this breaks a consistency of my config). I setup own DAP configuration for this and wanna use it to debug tests with your plugin.

fredrikaverpil commented 1 week ago

Hey @HeavyPunk and many thanks for your contribution!

I think this is great and I actually have a colleague at work who wants to avoid depending on dap-go as well.

I'm a little busy at the moment but let me take the time to review properly and then let's definitively allow manual DAP config. 👍

HeavyPunk commented 1 week ago

Great! Also I give you example how this feature used in my config:

require("neotest-golang") {
          dap_manual_enabled = true,
          dap_manual_configuration = {
            name = "Debug go tests",
            type = "go", -- preconfigured DAP adapter name
            request = "launch",
            mode = "test",
          }
        }
HeavyPunk commented 2 days ago

Hey @fredrikaverpil ! I fixed a strategy selector to prevent loading dap-go and manual-dap modules before executing a logic. At now all of them are lazy-loaded. This also fixed all tests

HeavyPunk commented 3 hours ago

Thank you for your review, @fredrikaverpil ! I implement your suggestions by myself. I call you here a bit later after fixing of code