mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-09 17:04:36 +02:00
fix(neotest): properly detect __call. Fixes #847
This commit is contained in:
parent
b68311eb6d
commit
0e671ad7fa
1 changed files with 2 additions and 1 deletions
|
@ -57,9 +57,10 @@ 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
|
||||||
|
local meta = getmetatable(adapter)
|
||||||
if adapter.setup then
|
if adapter.setup then
|
||||||
adapter.setup(config)
|
adapter.setup(config)
|
||||||
elseif adapter.__call then
|
elseif meta and meta.__call then
|
||||||
adapter(config)
|
adapter(config)
|
||||||
else
|
else
|
||||||
error("Adapter " .. name .. " does not support setup")
|
error("Adapter " .. name .. " does not support setup")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue