mirror of
https://github.com/neovim/neovim.git
synced 2024-09-17 20:58:20 -04:00
fix(gen_vimdoc): correctly generate function fields
This commit is contained in:
parent
5a8a34dafa
commit
6c3f7e7e27
@ -253,9 +253,12 @@ end
|
|||||||
--- @return nvim.luacats.parser.field
|
--- @return nvim.luacats.parser.field
|
||||||
local function fun2field(fun)
|
local function fun2field(fun)
|
||||||
local parts = { 'fun(' }
|
local parts = { 'fun(' }
|
||||||
|
|
||||||
|
local params = {} ---@type string[]
|
||||||
for _, p in ipairs(fun.params or {}) do
|
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
|
end
|
||||||
|
parts[#parts + 1] = table.concat(params, ', ')
|
||||||
parts[#parts + 1] = ')'
|
parts[#parts + 1] = ')'
|
||||||
if fun.returns then
|
if fun.returns then
|
||||||
parts[#parts + 1] = ': '
|
parts[#parts + 1] = ': '
|
||||||
|
Loading…
Reference in New Issue
Block a user