mirror of
https://github.com/neovim/neovim.git
synced 2025-09-20 18:28:19 +00:00
feat: render tuple types for API methods
This commit is contained in:

committed by
Lewis Russell

parent
019b2050e1
commit
70d7979439
8
runtime/lua/vim/_meta/api.lua
generated
8
runtime/lua/vim/_meta/api.lua
generated
@@ -458,7 +458,7 @@ function vim.api.nvim_buf_get_lines(buffer, start, end_, strict_indexing) end
|
|||||||
--- @see vim.api.nvim_buf_del_mark
|
--- @see vim.api.nvim_buf_del_mark
|
||||||
--- @param buffer integer Buffer id, or 0 for current buffer
|
--- @param buffer integer Buffer id, or 0 for current buffer
|
||||||
--- @param name string Mark name
|
--- @param name string Mark name
|
||||||
--- @return integer[] # (row, col) tuple, (0, 0) if the mark is not set, or is an
|
--- @return [integer, integer] # (row, col) tuple, (0, 0) if the mark is not set, or is an
|
||||||
--- uppercase/file mark set in another buffer.
|
--- uppercase/file mark set in another buffer.
|
||||||
function vim.api.nvim_buf_get_mark(buffer, name) end
|
function vim.api.nvim_buf_get_mark(buffer, name) end
|
||||||
|
|
||||||
@@ -2382,7 +2382,7 @@ function vim.api.nvim_win_get_config(window) end
|
|||||||
---
|
---
|
||||||
--- @see `:help getcurpos()`
|
--- @see `:help getcurpos()`
|
||||||
--- @param window integer `window-ID`, or 0 for current window
|
--- @param window integer `window-ID`, or 0 for current window
|
||||||
--- @return integer[] # (row, col) tuple
|
--- @return [integer, integer] # (row, col) tuple
|
||||||
function vim.api.nvim_win_get_cursor(window) end
|
function vim.api.nvim_win_get_cursor(window) end
|
||||||
|
|
||||||
--- Gets the window height
|
--- Gets the window height
|
||||||
@@ -2406,7 +2406,7 @@ function vim.api.nvim_win_get_option(window, name) end
|
|||||||
--- Gets the window position in display cells. First position is zero.
|
--- Gets the window position in display cells. First position is zero.
|
||||||
---
|
---
|
||||||
--- @param window integer `window-ID`, or 0 for current window
|
--- @param window integer `window-ID`, or 0 for current window
|
||||||
--- @return integer[] # (row, col) tuple with the window position
|
--- @return [integer, integer] # (row, col) tuple with the window position
|
||||||
function vim.api.nvim_win_get_position(window) end
|
function vim.api.nvim_win_get_position(window) end
|
||||||
|
|
||||||
--- Gets the window tabpage
|
--- Gets the window tabpage
|
||||||
@@ -2467,7 +2467,7 @@ function vim.api.nvim_win_set_config(window, config) end
|
|||||||
--- This scrolls the window even if it is not the current one.
|
--- This scrolls the window even if it is not the current one.
|
||||||
---
|
---
|
||||||
--- @param window integer `window-ID`, or 0 for current window
|
--- @param window integer `window-ID`, or 0 for current window
|
||||||
--- @param pos integer[] (row, col) tuple representing the new position
|
--- @param pos [integer, integer] (row, col) tuple representing the new position
|
||||||
function vim.api.nvim_win_set_cursor(window, pos) end
|
function vim.api.nvim_win_set_cursor(window, pos) end
|
||||||
|
|
||||||
--- Sets the window height.
|
--- Sets the window height.
|
||||||
|
@@ -174,7 +174,13 @@ local function api_type(t)
|
|||||||
local as0 = t:match('^ArrayOf%((.*)%)')
|
local as0 = t:match('^ArrayOf%((.*)%)')
|
||||||
if as0 then
|
if as0 then
|
||||||
local as = split(as0, ', ')
|
local as = split(as0, ', ')
|
||||||
return api_type(as[1]) .. '[]'
|
local a = api_type(as[1])
|
||||||
|
local count = tonumber(as[2])
|
||||||
|
if count then
|
||||||
|
return ('[%s]'):format(a:rep(count, ', '))
|
||||||
|
else
|
||||||
|
return a .. '[]'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local d = t:match('^Dict%((.*)%)')
|
local d = t:match('^Dict%((.*)%)')
|
||||||
|
Reference in New Issue
Block a user