mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
refactor(lua): improve type annotations
This commit is contained in:

committed by
Lewis Russell

parent
d8e384b7bf
commit
5e49ef0af3
@@ -421,8 +421,11 @@ local function render_type(ty, generics, default)
|
||||
end
|
||||
|
||||
--- @param p nvim.luacats.parser.param|nvim.luacats.parser.field
|
||||
local function should_render_param(p)
|
||||
return not p.access and not contains(p.name, { '_', 'self' })
|
||||
local function should_render_field_or_param(p)
|
||||
return not p.nodoc
|
||||
and not p.access
|
||||
and not contains(p.name, { '_', 'self' })
|
||||
and not vim.startswith(p.name, '_')
|
||||
end
|
||||
|
||||
--- @param desc? string
|
||||
@@ -524,7 +527,7 @@ end
|
||||
local function render_fields_or_params(xs, generics, classes, exclude_types)
|
||||
local ret = {} --- @type string[]
|
||||
|
||||
xs = vim.tbl_filter(should_render_param, xs)
|
||||
xs = vim.tbl_filter(should_render_field_or_param, xs)
|
||||
|
||||
local indent = 0
|
||||
for _, p in ipairs(xs) do
|
||||
|
Reference in New Issue
Block a user