mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-04 09:44:31 +00:00 
			
		
		
		
	fix(gen_vimdoc): correctly generate function fields
This commit is contained in:
		@@ -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] = ': '
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user