mirror of
https://github.com/neovim/neovim.git
synced 2024-12-23 20:55:18 -07:00
refactor(lsp): use tuple syntax in generated protocol types (#29110)
This commit is contained in:
parent
217828b20c
commit
d62d181ce0
@ -3235,7 +3235,7 @@ error('Cannot require a meta file')
|
|||||||
---
|
---
|
||||||
---*Note*: a label of type string should be a substring of its containing signature label.
|
---*Note*: a label of type string should be a substring of its containing signature label.
|
||||||
---Its intended use case is to highlight the parameter label part in the `SignatureInformation.label`.
|
---Its intended use case is to highlight the parameter label part in the `SignatureInformation.label`.
|
||||||
---@field label string|{ [1]: uinteger, [2]: uinteger }
|
---@field label string|[uinteger, uinteger]
|
||||||
---
|
---
|
||||||
---The human-readable doc-comment of this parameter. Will be shown
|
---The human-readable doc-comment of this parameter. Will be shown
|
||||||
---in the UI but can be omitted.
|
---in the UI but can be omitted.
|
||||||
|
@ -297,13 +297,13 @@ function M.gen(opt)
|
|||||||
|
|
||||||
-- TupleType
|
-- TupleType
|
||||||
elseif type.kind == 'tuple' then
|
elseif type.kind == 'tuple' then
|
||||||
local tuple = '{ '
|
local tuple = '['
|
||||||
for i, value in ipairs(type.items) do
|
for _, value in ipairs(type.items) do
|
||||||
tuple = tuple .. '[' .. i .. ']: ' .. parse_type(value, prefix) .. ', '
|
tuple = tuple .. parse_type(value, prefix) .. ', '
|
||||||
end
|
end
|
||||||
-- remove , at the end
|
-- remove , at the end
|
||||||
tuple = tuple:sub(0, -3)
|
tuple = tuple:sub(0, -3)
|
||||||
return tuple .. ' }'
|
return tuple .. ']'
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.print('WARNING: Unknown type ', type)
|
vim.print('WARNING: Unknown type ', type)
|
||||||
|
Loading…
Reference in New Issue
Block a user