diff options
| -rw-r--r-- | lua/config/conform.lua | 1 | ||||
| -rw-r--r-- | lua/config/lint.lua | 1 | ||||
| -rw-r--r-- | lua/config/mason.lua | 18 | ||||
| -rw-r--r-- | lua/config/neotest.lua | 13 | ||||
| -rw-r--r-- | nvim-pack-lock.json | 4 |
5 files changed, 37 insertions, 0 deletions
diff --git a/lua/config/conform.lua b/lua/config/conform.lua index 75467d9..1ed3745 100644 --- a/lua/config/conform.lua +++ b/lua/config/conform.lua @@ -23,6 +23,7 @@ require("conform").setup({ svelte = { "prettierd", "prettier" }, astro = { "prettierd", "prettier" }, rust = { "rustfmt", lsp_format = "fallbackk" }, + go = { "goimports", "gofmt" }, }, format_on_save = { timeout_ms = 1001, diff --git a/lua/config/lint.lua b/lua/config/lint.lua index d092852..74af6dd 100644 --- a/lua/config/lint.lua +++ b/lua/config/lint.lua @@ -3,6 +3,7 @@ vim.pack.add({ "https://codeberg.org/mfussenegger/nvim-lint" }) require("lint").linters_by_ft = { markdown = { "vale" }, rust = { "clippy" }, + go = { "golangcilint" }, } local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true }) diff --git a/lua/config/mason.lua b/lua/config/mason.lua index 22f5d2c..4e89a26 100644 --- a/lua/config/mason.lua +++ b/lua/config/mason.lua @@ -64,5 +64,23 @@ require("mason-tool-installer").setup({ return vim.fn.executable("rustc") == 1 end, }, + { + "golangci-lint", + condition = function() + return vim.fn.executable("go") == 1 + end, + }, + { + "goimports", + condition = function() + return vim.fn.executable("go") == 1 + end, + }, + { + "delve", + condition = function() + return vim.fn.executable("go") == 1 + end, + }, }, }) diff --git a/lua/config/neotest.lua b/lua/config/neotest.lua index 2df2409..edd8426 100644 --- a/lua/config/neotest.lua +++ b/lua/config/neotest.lua @@ -4,12 +4,25 @@ vim.pack.add({ "https://github.com/rcasia/neotest-java", "https://github.com/marilari88/neotest-vitest", + "https://github.com/nvim-neotest/neotest-go", }) +local neotest_ns = vim.api.nvim_create_namespace("neotest") + +vim.diagnostic.config({ + virtual_text = { + format = function(diagnostic) + local message = diagnostic.message:gsub("\n", " "):gsub("\t", " "):gsub("%s+", " "):gsub("^%s+", "") + return message + end, + }, +}, neotest_ns) + require("neotest").setup({ adapters = { require("neotest-vitest"), require("neotest-java"), + require("neotest-go"), }, }) diff --git a/nvim-pack-lock.json b/nvim-pack-lock.json index 560c393..e648464 100644 --- a/nvim-pack-lock.json +++ b/nvim-pack-lock.json @@ -49,6 +49,10 @@ "rev": "deadfb1af5ce458742671ad3a013acb9a6b41178", "src": "https://github.com/nvim-neotest/neotest" }, + "neotest-go": { + "rev": "59b50505053f9c45a9febb79e11a56206c3e3901", + "src": "https://github.com/nvim-neotest/neotest-go" + }, "neotest-java": { "rev": "9f5cf2ecef2375044103c7d3487abeada637a5cc", "src": "https://github.com/rcasia/neotest-java" |
