Skip to content

Commit 71d8385

Browse files
committed
chore(nvim): remove neotest
1 parent 1096ee4 commit 71d8385

File tree

2 files changed

+7
-179
lines changed

2 files changed

+7
-179
lines changed

nvim/lazy-lock.json

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
11
{
22
"blink.cmp": { "branch": "main", "commit": "dcda20d3aa345025699a920c45b0a0603551f41d" },
3-
"conform.nvim": { "branch": "master", "commit": "374aaf384e2e841607b8e2fe63fa3ad01d111c91" },
3+
"conform.nvim": { "branch": "master", "commit": "6feb2f28f9a9385e401857b21eeac3c1b66dd628" },
44
"edgy.nvim": { "branch": "main", "commit": "7e8dedc39abebe40c289b8012cc89b11c69aa7a0" },
55
"flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" },
66
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
77
"gitsigns.nvim": { "branch": "main", "commit": "ee7e50dfbdf49e3acfa416fd3ad3abbdb658582c" },
88
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
9-
"lualine.nvim": { "branch": "master", "commit": "15884cee63a8c205334ab13ab1c891cd4d27101a" },
9+
"lualine.nvim": { "branch": "master", "commit": "0c6cca9f2c63dadeb9225c45bc92bb95a151d4af" },
1010
"lush.nvim": { "branch": "main", "commit": "45a79ec4acb5af783a6a29673a999ce37f00497e" },
1111
"mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" },
1212
"mason-nvim-dap.nvim": { "branch": "main", "commit": "4c2cdc69d69fe00c15ae8648f7e954d99e5de3ea" },
1313
"mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" },
1414
"mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" },
1515
"mini.pairs": { "branch": "main", "commit": "69864a2efb36c030877421634487fd90db1e4298" },
16-
"mini.surround": { "branch": "main", "commit": "5aab42fcdcf31fa010f012771eda5631c077840a" },
17-
"neo-tree.nvim": { "branch": "main", "commit": "56f383aa157f1ff20a59154907cc5f9fe26e4db9" },
18-
"neotest": { "branch": "master", "commit": "862afb2a2219d9ca565f67416fb7003cc0f22c4f" },
19-
"neotest-elixir": { "branch": "master", "commit": "a242aebeaa6997c1c149138ff77f6cacbe33b6fc" },
20-
"neotest-vitest": { "branch": "main", "commit": "a6099e1fb55a2c2851da3dd0f4d510af9a234c92" },
16+
"mini.surround": { "branch": "main", "commit": "f4307f935ad87cfe3e570dbaae485b35cce4e5ec" },
17+
"neo-tree.nvim": { "branch": "main", "commit": "3f1dd2de5045659e00bfbe27c8aca3b52c1fdbde" },
2118
"noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" },
22-
"nui.nvim": { "branch": "main", "commit": "f535005e6ad1016383f24e39559833759453564e" },
23-
"nvim-dap": { "branch": "master", "commit": "8df427aeba0a06c6577dc3ab82de3076964e3b8d" },
19+
"nui.nvim": { "branch": "main", "commit": "7cd18e73cfbd70e1546931b7268b3eebaeff9391" },
20+
"nvim-dap": { "branch": "master", "commit": "b0f983507e3702f073bfe1516846e58b56d4e42f" },
2421
"nvim-dap-ui": { "branch": "master", "commit": "73a26abf4941aa27da59820fd6b028ebcdbcf932" },
25-
"nvim-dap-virtual-text": { "branch": "master", "commit": "df66808cd78b5a97576bbaeee95ed5ca385a9750" },
22+
"nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" },
2623
"nvim-lspconfig": { "branch": "master", "commit": "8a1529e46eef5efc86c34c8d9bdd313abc2ecba0" },
2724
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
2825
"nvim-treesitter": { "branch": "master", "commit": "066fd6505377e3fd4aa219e61ce94c2b8bdb0b79" },

nvim/lua/plugins.lua

Lines changed: 0 additions & 169 deletions
Original file line numberDiff line numberDiff line change
@@ -237,11 +237,9 @@ return {
237237
return vim.bo[buf].buftype == "help"
238238
end,
239239
},
240-
{ title = "Neotest Output", ft = "neotest-output-panel", size = { height = 15 } },
241240
},
242241
left = {},
243242
right = {
244-
{ title = "Neotest Summary", ft = "neotest-summary", size = { width = 0.25 } },
245243
-- { title = "Grug Far", ft = "grug-far", size = { width = 0.4 } },
246244
},
247245
keys = {
@@ -415,8 +413,6 @@ return {
415413
disabled_filetypes = {
416414
"gitsigns-blame",
417415
"neo-tree",
418-
"neotest-output-panel",
419-
"neotest-summary",
420416
},
421417
globalstatus = false,
422418
icons_enabled = true,
@@ -611,171 +607,6 @@ return {
611607
},
612608
},
613609

614-
-- neotest (https://github.com/nvim-neotest/neotest)
615-
{
616-
"nvim-neotest/neotest",
617-
dependencies = {
618-
"nvim-neotest/nvim-nio",
619-
-- adapters
620-
"jfpedroza/neotest-elixir",
621-
"marilari88/neotest-vitest",
622-
},
623-
-- stylua: ignore
624-
keys = {
625-
{"<leader>t", "", desc = "+test"},
626-
{ "<leader>tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" },
627-
{ "<leader>td", function() require("neotest").run.run({ strategy = "dap" }) end, desc = "Debug Nearest" },
628-
{ "<leader>tT", function() require("neotest").run.run(vim.uv.cwd()) end, desc = "Run All Test Files" },
629-
{ "<leader>tr", function() require("neotest").run.run() end, desc = "Run Nearest" },
630-
{ "<leader>tl", function() require("neotest").run.run_last() end, desc = "Run Last" },
631-
{ "<leader>ts", function() require("neotest").summary.toggle() end, desc = "Toggle Summary" },
632-
{ "<leader>to", function() require("neotest").output.open({ enter = true, auto_close = true }) end, desc = "Show Output" },
633-
{ "<leader>tO", function() require("neotest").output_panel.toggle() end, desc = "Toggle Output Panel" },
634-
{ "<leader>tS", function() require("neotest").run.stop() end, desc = "Stop" },
635-
{ "<leader>tw", function() require("neotest").watch.toggle(vim.fn.expand("%")) end, desc = "Toggle Watch" },
636-
},
637-
opts = {
638-
adapters = {
639-
["neotest-elixir"] = {},
640-
["neotest-vitest"] = {
641-
vitestCommand = function(file)
642-
local util = require("neotest-vitest.util")
643-
644-
local function search_vitest_recursively(path)
645-
if path == "/" then
646-
return nil
647-
end
648-
649-
local rootPath = util.find_node_modules_ancestor(path)
650-
local vitestBinary = util.path.join(rootPath, "node_modules", ".bin", "vitest")
651-
if util.path.exists(vitestBinary) then
652-
return vitestBinary
653-
end
654-
655-
return search_vitest_recursively(util.path.dirname(path))
656-
end
657-
658-
return search_vitest_recursively(util.path.dirname(file))
659-
end,
660-
vitestConfigFile = function(file)
661-
local util = require("neotest-vitest.util")
662-
local filenamePattern = "{vite,vitest}.config.{js,ts}"
663-
local rootPath = util.root_pattern(filenamePattern)(file)
664-
or util.root_pattern("test/" .. filenamePattern)(file)
665-
666-
if not rootPath then
667-
return nil
668-
end
669-
670-
-- Ordered by config precedence (https://vitest.dev/config/#configuration)
671-
local possibleVitestConfigNames = {
672-
"vitest.config.ts",
673-
"vitest.config.js",
674-
"vite.config.ts",
675-
"vite.config.js",
676-
}
677-
678-
-- stylua: ignore
679-
for _, configName in ipairs(possibleVitestConfigNames) do
680-
local configPath = util.path.join(rootPath, configName)
681-
if util.path.exists(configPath) then return configPath end
682-
configPath = util.path.join(rootPath, "test", configName)
683-
if util.path.exists(configPath) then return configPath end
684-
end
685-
686-
return nil
687-
end,
688-
},
689-
},
690-
output = { open_on_run = true },
691-
quickfix = {
692-
open = function()
693-
if require("util.init").has("trouble.nvim") then
694-
require("trouble").open({ mode = "quickfix", focus = false })
695-
else
696-
vim.cmd("copen")
697-
end
698-
end,
699-
},
700-
status = {
701-
signs = false,
702-
virtual_text = true,
703-
},
704-
},
705-
config = function(_, opts)
706-
local neotest_ns = vim.api.nvim_create_namespace("neotest")
707-
vim.diagnostic.config({
708-
virtual_text = {
709-
format = function(diagnostic)
710-
-- Replace newline and tab characters with space for more compact diagnostics
711-
local message = diagnostic.message:gsub("\n", " "):gsub("\t", " "):gsub("%s+", " "):gsub("^%s+", "")
712-
return message
713-
end,
714-
},
715-
}, neotest_ns)
716-
717-
if require("util.init").has("trouble.nvim") then
718-
opts.consumers = opts.consumers or {}
719-
opts.consumers.trouble = function(client)
720-
client.listeners.results = function(adapter_id, results, partial)
721-
if partial then
722-
return
723-
end
724-
local tree = assert(client:get_position(nil, { adapter = adapter_id }))
725-
726-
local failed = 0
727-
for pos_id, result in pairs(results) do
728-
if result.status == "failed" and tree:get_key(pos_id) then
729-
failed = failed + 1
730-
end
731-
end
732-
vim.schedule(function()
733-
local trouble = require("trouble")
734-
if trouble.is_open() then
735-
trouble.refresh()
736-
if failed == 0 then
737-
trouble.close()
738-
end
739-
end
740-
end)
741-
return {}
742-
end
743-
end
744-
end
745-
746-
if opts.adapters then
747-
local adapters = {}
748-
for name, config in pairs(opts.adapters or {}) do
749-
if type(name) == "number" then
750-
if type(config) == "string" then
751-
config = require(config)
752-
end
753-
adapters[#adapters + 1] = config
754-
elseif config ~= false then
755-
local adapter = require(name)
756-
if type(config) == "table" and not vim.tbl_isempty(config) then
757-
local meta = getmetatable(adapter)
758-
if adapter.setup then
759-
adapter.setup(config)
760-
elseif adapter.adapter then
761-
adapter.adapter(config)
762-
adapter = adapter.adapter
763-
elseif meta and meta.__call then
764-
adapter(config)
765-
else
766-
error("Adapter " .. name .. " does not support setup")
767-
end
768-
end
769-
adapters[#adapters + 1] = adapter
770-
end
771-
end
772-
opts.adapters = adapters
773-
end
774-
775-
require("neotest").setup(opts)
776-
end,
777-
},
778-
779610
-- neo-tree.nvim (https://github.com/nvim-neo-tree/neo-tree.nvim)
780611
{
781612
"nvim-neo-tree/neo-tree.nvim",

0 commit comments

Comments
 (0)