summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelog.md1
-rw-r--r--script/config/template.lua14
2 files changed, 12 insertions, 3 deletions
diff --git a/changelog.md b/changelog.md
index 2048c043..436370c9 100644
--- a/changelog.md
+++ b/changelog.md
@@ -5,6 +5,7 @@
* `FIX` [#1215](https://github.com/sumneko/lua-language-server/issues/1215)
* `FIX` [#1217](https://github.com/sumneko/lua-language-server/issues/1217)
* `FIX` [#1218](https://github.com/sumneko/lua-language-server/issues/1218)
+* `FIX` [#1220](https://github.com/sumneko/lua-language-server/issues/1220)
## 3.3.0
`2022-6-15`
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