From 83da3c578066731bd99e547a139113b5900ee9f7 Mon Sep 17 00:00:00 2001 From: Oscar Wallberg Date: Fri, 16 Aug 2024 21:58:11 +0200 Subject: [PATCH] fix(lsp): fix validation for MasonPackage --- lua/lsp/package.lua | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lua/lsp/package.lua b/lua/lsp/package.lua index 24bc8ad..a20b071 100644 --- a/lua/lsp/package.lua +++ b/lua/lsp/package.lua @@ -33,21 +33,19 @@ function M.validate(config) return true end - if utils.is_list(f, "string") then - return true - elseif not utils.is_list(f) then - return false - end - for _, dep in ipairs(f) do - if not M.validate(dep) then + local t = type(dep) + if + (t ~= "string" and t ~= "table") + or (type(dep) == "table" and not M.validate(dep)) + then return false end end return true end, - "list of dependencies", + "list of string|MasonPackageConfig", }, post_install = { config.post_install,