diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-06-17 14:38:25 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-06-17 14:38:25 +0800 |
commit | dc8bf9d26b7da407d11c6b82bc27fe667cb36c8b (patch) | |
tree | 3c80bd60c1db7d33d62c4df08d20a67fac49d87e /script/config/template.lua | |
parent | ea1c5197c469779ba7cd18f1a8da5da9908f2149 (diff) | |
download | lua-language-server-dc8bf9d26b7da407d11c6b82bc27fe667cb36c8b.zip |
fix #1220 keep settings compatible
`table<string, any>` -> `string[]`
Diffstat (limited to 'script/config/template.lua')
-rw-r--r-- | script/config/template.lua | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/script/config/template.lua b/script/config/template.lua index 41913991..b1aee3fb 100644 --- a/script/config/template.lua +++ b/script/config/template.lua @@ -87,9 +87,17 @@ register('Array', {}, function (self, value) return type(value) == 'table' end, function (self, value) local t = {} - for _, v in ipairs(value) do - if self.sub:checker(v) then - t[#t+1] = self.sub:loader(v) + if #value == 0 then + for k in pairs(value) do + if self.sub:checker(k) then + t[#t+1] = self.sub:loader(k) + end + end + else + for _, v in ipairs(value) do + if self.sub:checker(v) then + t[#t+1] = self.sub:loader(v) + end end end return t |