aboutsummaryrefslogtreecommitdiff
path: root/scripts/gen_lsp.lua
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/gen_lsp.lua')
-rw-r--r--scripts/gen_lsp.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/gen_lsp.lua b/scripts/gen_lsp.lua
index b332a17fdc..19fad7bab4 100644
--- a/scripts/gen_lsp.lua
+++ b/scripts/gen_lsp.lua
@@ -224,7 +224,11 @@ function M.gen(opt)
-- ArrayType
elseif type.kind == 'array' then
- return parse_type(type.element, prefix) .. '[]'
+ local parsed_items = parse_type(type.element, prefix)
+ if type.element.items and #type.element.items > 1 then
+ parsed_items = '(' .. parsed_items .. ')'
+ end
+ return parsed_items .. '[]'
-- OrType
elseif type.kind == 'or' then