From 6c3f7e7e27a0ffcf6d58dc1f5ad2fce7e59a2d88 Mon Sep 17 00:00:00 2001 From: TheLeoP Date: Fri, 21 Jun 2024 14:44:40 -0500 Subject: [PATCH] fix(gen_vimdoc): correctly generate function fields --- scripts/luacats_parser.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/luacats_parser.lua b/scripts/luacats_parser.lua index e73a42111d..9a763e4d7b 100644 --- a/scripts/luacats_parser.lua +++ b/scripts/luacats_parser.lua @@ -253,9 +253,12 @@ end --- @return nvim.luacats.parser.field local function fun2field(fun) local parts = { 'fun(' } + + local params = {} ---@type string[] for _, p in ipairs(fun.params or {}) do - parts[#parts + 1] = string.format('%s: %s', p.name, p.type) + params[#params + 1] = string.format('%s: %s', p.name, p.type) end + parts[#parts + 1] = table.concat(params, ', ') parts[#parts + 1] = ')' if fun.returns then parts[#parts + 1] = ': '