mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-25 18:28:50 +02:00
fix(neotest): support neotest adapaters that use setup()
for custom setup
This commit is contained in:
parent
98e2ffcf14
commit
2a3bac7690
1 changed files with 7 additions and 1 deletions
|
@ -55,7 +55,13 @@ return {
|
||||||
elseif config ~= false then
|
elseif config ~= false then
|
||||||
local adapter = require(name)
|
local adapter = require(name)
|
||||||
if type(config) == "table" and not vim.tbl_isempty(config) then
|
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
|
end
|
||||||
adapters[#adapters + 1] = adapter
|
adapters[#adapters + 1] = adapter
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue