From 9c7a8f5b27324c974bda5e05062de7cdbd50dcc5 Mon Sep 17 00:00:00 2001 From: Fredrik Averpil Date: Thu, 20 Jun 2024 20:40:33 +0200 Subject: [PATCH] feat(go): switch to neotest-golang --- lua/lazyvim/plugins/extras/lang/go.lua | 14 +++++--------- lua/lazyvim/plugins/extras/test/core.lua | 7 ++++--- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/go.lua b/lua/lazyvim/plugins/extras/lang/go.lua index 58c48643..931f8df4 100644 --- a/lua/lazyvim/plugins/extras/lang/go.lua +++ b/lua/lazyvim/plugins/extras/lang/go.lua @@ -14,10 +14,6 @@ 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 - { "td", "lua require('dap-go').debug_test()", desc = "Debug Nearest (Go)" }, - }, settings = { gopls = { gofumpt = true, @@ -129,14 +125,14 @@ return { "nvim-neotest/neotest", optional = true, dependencies = { - "nvim-neotest/neotest-go", + "fredrikaverpil/neotest-golang", }, opts = { adapters = { - ["neotest-go"] = { - -- Here we can set options for neotest-go, e.g. - -- args = { "-tags=integration" } - recursive_run = true, + ["neotest-golang"] = { + -- Here we can set options for neotest-golang, e.g. + -- go_test_args = { "-v", "-race", "-count=1", "-timeout=60s" }, + dap_go_enabled = true, -- requires leoluz/nvim-dap-go }, }, }, diff --git a/lua/lazyvim/plugins/extras/test/core.lua b/lua/lazyvim/plugins/extras/test/core.lua index dd7c7640..cab47ee9 100644 --- a/lua/lazyvim/plugins/extras/test/core.lua +++ b/lua/lazyvim/plugins/extras/test/core.lua @@ -10,10 +10,11 @@ return { -- or a table of adapter names, mapped to adapter configs. -- The adapter will then be automatically loaded with the config. adapters = {}, - -- Example for loading neotest-go with a custom config + -- Example for loading neotest-golang with a custom config -- adapters = { - -- ["neotest-go"] = { - -- args = { "-tags=integration" }, + -- ["neotest-golang"] = { + -- go_test_args = { "-v", "-race", "-count=1", "-timeout=60s" }, + -- dap_go_enabled = true, -- }, -- }, status = { virtual_text = true },