2024-02-03 15:22:54 +00:00
|
|
|
local neotest_ns = vim.api.nvim_create_namespace("neotest")
|
2024-02-04 16:55:49 +00:00
|
|
|
|
2024-02-03 15:22:54 +00:00
|
|
|
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)
|
2024-02-04 16:55:49 +00:00
|
|
|
|
|
|
|
vim.api.nvim_create_user_command("CopyDirectoryPath", function()
|
|
|
|
local path = vim.fn.expand("%:p:h")
|
|
|
|
vim.fn.setreg("+", path)
|
|
|
|
vim.notify('Copied "' .. path .. '" to the clipboard!')
|
|
|
|
end, {})
|
|
|
|
|
|
|
|
local neotest = require("neotest")
|
|
|
|
|
|
|
|
neotest.setup({
|
2024-02-03 15:22:54 +00:00
|
|
|
adapters = {
|
2024-02-04 16:55:49 +00:00
|
|
|
require("neotest-go")({
|
|
|
|
recursive_run = true,
|
|
|
|
experimental = {
|
|
|
|
test_table = true,
|
|
|
|
},
|
|
|
|
args = { "-count=1" },
|
|
|
|
}),
|
2024-03-17 17:25:34 +00:00
|
|
|
require("neotest-python")({}),
|
2024-02-03 15:22:54 +00:00
|
|
|
},
|
|
|
|
})
|
2024-02-04 16:55:49 +00:00
|
|
|
|
|
|
|
vim.api.nvim_create_user_command("RunTest", function()
|
2024-02-12 19:46:40 +00:00
|
|
|
neotest.run.run()
|
2024-02-04 16:55:49 +00:00
|
|
|
end, {})
|
|
|
|
|
2024-06-08 14:43:07 +00:00
|
|
|
vim.api.nvim_create_user_command("DebugTest", function()
|
|
|
|
neotest.run.run({ strategy = "dap" })
|
|
|
|
end, {})
|
|
|
|
|
2024-02-04 16:55:49 +00:00
|
|
|
vim.api.nvim_create_user_command("RunTestFile", function()
|
2024-02-12 19:46:40 +00:00
|
|
|
neotest.run.run(vim.fn.expand("%"))
|
2024-02-04 16:55:49 +00:00
|
|
|
end, {})
|