mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-22 17:03:39 +02:00
feat(neotest): allow adapter names as a list
This commit is contained in:
parent
2c89770504
commit
98e2ffcf14
1 changed files with 4 additions and 0 deletions
|
@ -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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue