feat(neotest): allow adapter names as a list
This commit is contained in:
@ -12,6 +12,7 @@ return {
|
|||||||
"nvim-neotest/neotest",
|
"nvim-neotest/neotest",
|
||||||
opts = {
|
opts = {
|
||||||
-- Can be a list of adapters like what neotest expects,
|
-- Can be a list of adapters like what neotest expects,
|
||||||
|
-- or a list of adapter names,
|
||||||
-- or a table of adapter names, mapped to adapter configs.
|
-- or a table of adapter names, mapped to adapter configs.
|
||||||
-- The adapter will then be automatically loaded with the config.
|
-- The adapter will then be automatically loaded with the config.
|
||||||
adapters = {},
|
adapters = {},
|
||||||
@ -47,6 +48,9 @@ return {
|
|||||||
local adapters = {}
|
local adapters = {}
|
||||||
for name, config in pairs(opts.adapters or {}) do
|
for name, config in pairs(opts.adapters or {}) do
|
||||||
if type(name) == "number" then
|
if type(name) == "number" then
|
||||||
|
if type(config) == "string" then
|
||||||
|
config = require(config)
|
||||||
|
end
|
||||||
adapters[#adapters + 1] = config
|
adapters[#adapters + 1] = config
|
||||||
elseif config ~= false then
|
elseif config ~= false then
|
||||||
local adapter = require(name)
|
local adapter = require(name)
|
||||||
|
Reference in New Issue
Block a user