mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
refactor(lsp): use tuple syntax in generated protocol types (#29110)
This commit is contained in:
@ -297,13 +297,13 @@ function M.gen(opt)
|
||||
|
||||
-- TupleType
|
||||
elseif type.kind == 'tuple' then
|
||||
local tuple = '{ '
|
||||
for i, value in ipairs(type.items) do
|
||||
tuple = tuple .. '[' .. i .. ']: ' .. parse_type(value, prefix) .. ', '
|
||||
local tuple = '['
|
||||
for _, value in ipairs(type.items) do
|
||||
tuple = tuple .. parse_type(value, prefix) .. ', '
|
||||
end
|
||||
-- remove , at the end
|
||||
tuple = tuple:sub(0, -3)
|
||||
return tuple .. ' }'
|
||||
return tuple .. ']'
|
||||
end
|
||||
|
||||
vim.print('WARNING: Unknown type ', type)
|
||||
|
Reference in New Issue
Block a user