mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-27 03:09:07 +02:00
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:
parent
0411baab89
commit
02d673d37c
1 changed files with 8 additions and 0 deletions
|
@ -15,6 +15,10 @@ return {
|
||||||
opts = {
|
opts = {
|
||||||
servers = {
|
servers = {
|
||||||
gopls = {
|
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 = {
|
settings = {
|
||||||
gopls = {
|
gopls = {
|
||||||
gofumpt = true,
|
gofumpt = true,
|
||||||
|
@ -103,6 +107,10 @@ return {
|
||||||
vim.list_extend(opts.ensure_installed, { "gomodifytags", "impl", "gofumpt", "goimports-reviser", "delve" })
|
vim.list_extend(opts.ensure_installed, { "gomodifytags", "impl", "gofumpt", "goimports-reviser", "delve" })
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"leoluz/nvim-dap-go",
|
||||||
|
config = true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue