Closed VoreckLukas closed 1 year ago
I'm not sure, I don't use lazy vim.
That config doesn't look right at all.
Just try this:
config = function()
require("neotest").setup({
adapters = {
require("neotest-rust"),
},
})
end,
and get rid of opts
.
That config doesn't look right at all.
Just try this:
config = function() require("neotest").setup({ adapters = { require("neotest-rust"), }, }) end,
and get rid of
opts
.
Okay so this seems to work
return {
{
"nvim-neotest/neotest",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
"rouge8/neotest-rust"
},
keys = {
{ "<leader>ct", function()
require("neotest").run.run()
end, desc = "Closest test" },
{ "<leader>cT", function()
require("neotest").run.run(vim.fn.expand("%"))
end, desc = "All tests" }
},
config = function ()
require("neotest").setup({
adapters = {
require("neotest-rust")
}
})
end
}
}
But im curious why it doesnt work with opts
return {
{
"nvim-neotest/neotest",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
"rouge8/neotest-rust"
},
keys = {
{ "<leader>ct", function()
require("neotest").run.run()
end, desc = "Closest test" },
{ "<leader>cT", function()
require("neotest").run.run(vim.fn.expand("%"))
end, desc = "All tests" }
},
opts = function()
return {
adapers = {
require("neotest-rust")
}
}
end,
}
As far as I understand lazy vim this should call
require("neotest").setup
with the table returned by opts as a parameter
But im curious why it doesnt work with opts
That'd be a question for the https://github.com/folke/lazy.nvim repo. I don't use the opts
key much, so don't know.
With lazy vim my config looks like this
I have tree sitte for rust installed. When I pressct in this file
I get
no Tests found