aboutsummaryrefslogtreecommitdiff
path: root/scripts/luacats_parser.lua
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/luacats_parser.lua')
-rw-r--r--scripts/luacats_parser.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/luacats_parser.lua b/scripts/luacats_parser.lua
index cb301b32e4..9a763e4d7b 100644
--- a/scripts/luacats_parser.lua
+++ b/scripts/luacats_parser.lua
@@ -46,6 +46,7 @@ local luacats_grammar = require('scripts.luacats_grammar')
--- @field type string
--- @field desc string
--- @field access? 'private'|'package'|'protected'
+--- @field nodoc? true
--- @class nvim.luacats.parser.class
--- @field kind 'class'
@@ -252,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] = ': '
@@ -270,6 +274,7 @@ local function fun2field(fun)
type = table.concat(parts, ''),
access = fun.access,
desc = fun.desc,
+ nodoc = fun.nodoc,
}
end
@@ -458,7 +463,7 @@ local function dump_uncommitted(filename, uncommitted)
local out_path = 'luacats-uncommited/' .. filename:gsub('/', '%%') .. '.txt'
if #uncommitted > 0 then
print(string.format('Could not commit %d objects in %s', #uncommitted, filename))
- vim.fn.mkdir(assert(vim.fs.dirname(out_path)), 'p')
+ vim.fn.mkdir(vim.fs.dirname(out_path), 'p')
local f = assert(io.open(out_path, 'w'))
for i, x in ipairs(uncommitted) do
f:write(i)