Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 6 commits into from
Dec 4, 2024

Conversation

HeavyPunk
Copy link
Contributor

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.

@HeavyPunk HeavyPunk marked this pull request as ready for review November 9, 2024 18:14
@fredrikaverpil
Copy link
Owner

fredrikaverpil commented Nov 9, 2024

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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

Copy link
Owner

@fredrikaverpil fredrikaverpil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @HeavyPunk!

I had some minor comments. I can implement these changes myself and get this merged if you like.

README.md Outdated Show resolved Hide resolved
@@ -13,6 +13,8 @@ describe("Options are set up", function()
go_list_args = {},
gotestsum_args = { "--format=standard-verbose" },
dap_go_opts = {},
dap_manual_enabled = false,
dap_manual_configuration = {},
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's shorten dap_manual_configuration to dap_manual_config.

tests/unit/options_spec.lua Outdated Show resolved Hide resolved
lua/neotest-golang/features/dap/dap_manual.lua Outdated Show resolved Hide resolved
lua/neotest-golang/features/dap/dap_manual.lua Outdated Show resolved Hide resolved
@HeavyPunk
Copy link
Contributor Author

HeavyPunk commented Nov 22, 2024

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

@HeavyPunk
Copy link
Contributor Author

Hey @fredrikaverpil ! It's ready for your review 😀

@fredrikaverpil
Copy link
Owner

Many thanks @HeavyPunk, I'll have a look and make any additional touch-ups to e.g. README but then I'll merge it in. Looks great, overall!

@HeavyPunk
Copy link
Contributor Author

Thanks! I will be waiting for merge 🎉

Copy link
Owner

@fredrikaverpil fredrikaverpil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 super nice, thank you @HeavyPunk ❤️

@fredrikaverpil fredrikaverpil merged commit 219ac82 into fredrikaverpil:main Dec 4, 2024
9 checks passed
This was referenced Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants