Skip to content

Commit

Permalink
feat(lang): add debug adapter plugin for go (#1115)
Browse files Browse the repository at this point in the history
neotest-go does not provide a DAP strategy, and thus you cannot invoke the debugger with require('neotest').run.run({strategy=dap}).

There have been efforts to implement this in nvim-neotest/neotest-go#12 but this seems to have stalled.
You can find the background to this change discussed here: #1107
  • Loading branch information
fredrikaverpil committed Jul 22, 2023
1 parent 0411baa commit 02d673d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lua/lazyvim/plugins/extras/lang/go.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ return {
opts = {
servers = {
gopls = {
keys = {
-- Workaround for the lack of a DAP strategy in neotest-go: https://github.com/nvim-neotest/neotest-go/issues/12
{ "<leader>td", "<cmd>lua require('dap-go').debug_test()<CR>", desc = "Debug Nearest (Go)" },
},
settings = {
gopls = {
gofumpt = true,
Expand Down Expand Up @@ -103,6 +107,10 @@ return {
vim.list_extend(opts.ensure_installed, { "gomodifytags", "impl", "gofumpt", "goimports-reviser", "delve" })
end,
},
{
"leoluz/nvim-dap-go",
config = true,
},
},
},
{
Expand Down

0 comments on commit 02d673d

Please sign in to comment.