fix(neotest): support neotest adapaters that use setup() for custom setup

This commit is contained in:
Folke Lemaitre
2023-05-27 09:37:17 +02:00
parent 98e2ffcf14
commit 2a3bac7690

View File

@ -55,7 +55,13 @@ return {
elseif config ~= false then
local adapter = require(name)
if type(config) == "table" and not vim.tbl_isempty(config) then
adapter = adapter(config)
if adapter.setup then
adapter.setup(config)
elseif adapter.__call then
adapter(config)
else
error("Adapter " .. name .. " does not support setup")
end
end
adapters[#adapters + 1] = adapter
end