feat(lang): add debug adapter plugin for go (#1115)

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 https://github.com/nvim-neotest/neotest-go/issues/12 but this seems to have stalled.
You can find the background to this change discussed here: https://github.com/LazyVim/LazyVim/discussions/1107
This commit is contained in:
Fredrik Averpil
2023-07-22 09:13:54 +02:00
committed by GitHub
parent 0411baab89
commit 02d673d37c

View File

@ -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,
@ -103,6 +107,10 @@ return {
vim.list_extend(opts.ensure_installed, { "gomodifytags", "impl", "gofumpt", "goimports-reviser", "delve" })
end,
},
{
"leoluz/nvim-dap-go",
config = true,
},
},
},
{