diff --git a/lua/dotvim/pkgs/base/setup/shared.lua b/lua/dotvim/pkgs/base/setup/shared.lua index 38a91e2d..03e5b853 100644 --- a/lua/dotvim/pkgs/base/setup/shared.lua +++ b/lua/dotvim/pkgs/base/setup/shared.lua @@ -16,6 +16,7 @@ local uncountable_filetypes = { ["neo-tree"] = true, ["neo-tree-popup"] = true, ["NvimSeparator"] = true, + ["neotest-summary"] = true, } function M.is_uncountable(win_id) diff --git a/lua/dotvim/pkgs/coding/plugins/neotest.lua b/lua/dotvim/pkgs/coding/plugins/neotest.lua index 63993cc2..8f69cf9f 100644 --- a/lua/dotvim/pkgs/coding/plugins/neotest.lua +++ b/lua/dotvim/pkgs/coding/plugins/neotest.lua @@ -10,7 +10,16 @@ return { opts = { adapters = {}, icons = { - running_animated = {"⣾", "⣽", "⣻", "⢿", "⡿", "⣟", "⣯", "⣷"}, + running_animated = { + "⣾", + "⣽", + "⣻", + "⢿", + "⡿", + "⣟", + "⣯", + "⣷", + }, passed = "󰄳", running = "󰁪", failed = "󰅙", @@ -27,4 +36,54 @@ return { notify = "", }, }, + actions = function() + ---@type dotvim.core + local Core = require("dotvim.core") + + ---@type dotvim.utils + local Utils = require("dotvim.utils") + + ---@type dotvim.core.action.ActionOption[] + return { + { + id = "neotest.run-suit", + title = "Run test suit", + callback = function() + require("neotest").run.run { suite = true } + end, + keys = { "ts", desc = "run-test-suit" }, + }, + { + id = "neotest.run-current-file", + title = "Run tests in current file", + callback = function() + require("neotest").run.run(vim.fn.expand("%")) + end, + }, + { + id = "neotest.run-nearest", + title = "Run nearest test", + callback = function() + require("neotest").run.run(vim.fn.expand("%")) + end, + keys = { "tn", desc = "run-nearest-test" }, + }, + { + id = "neotest.rerun-last", + title = "Run nearest test", + callback = function() + require("neotest").run.run_last() + end, + keys = { "tr", desc = "rerun-last" }, + }, + { + id = "neotest.toggle-summary", + title = "Toggle neotest summary", + callback = function() + require("neotest").summary.toggle() + end, + keys = { "ts", desc = "neotest-summary" }, + }, + } + end, } diff --git a/lua/dotvim/pkgs/editor/plugins/which-key.lua b/lua/dotvim/pkgs/editor/plugins/which-key.lua index 935c2e00..68688532 100644 --- a/lua/dotvim/pkgs/editor/plugins/which-key.lua +++ b/lua/dotvim/pkgs/editor/plugins/which-key.lua @@ -39,7 +39,7 @@ return { ["n"] = { name = "+no" }, ["p"] = { name = "+preview" }, ["r"] = { name = "+remote" }, - ["t"] = { name = "+toggle" }, + ["t"] = { name = "+test/toggle" }, ["v"] = { name = "+vcs" }, ["w"] = { name = "+window" }, ["x"] = { name = "+xray" }, diff --git a/lua/dotvim/pkgs/extra/languages/rust.lua b/lua/dotvim/pkgs/extra/languages/rust.lua index 3f2bdd76..69f7a75a 100644 --- a/lua/dotvim/pkgs/extra/languages/rust.lua +++ b/lua/dotvim/pkgs/extra/languages/rust.lua @@ -282,11 +282,8 @@ return { }, { "neotest", - dependencies = { - "rouge8/neotest-rust", - }, opts = function(_, opts) - table.insert(opts.adapters, require("neotest-rust")) + table.insert(opts.adapters, require("rustaceanvim.neotest")) end, }, },