docs(lua): adjust some type annotations

This commit is contained in:
notomo 2023-01-04 20:48:41 +09:00 committed by GitHub
parent ef18c9f9b0
commit e35b9020b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 14 additions and 14 deletions

View File

@ -974,7 +974,7 @@ stop_client({client_id}, {force}) *vim.lsp.stop_client()*
Parameters: ~ Parameters: ~
• {client_id} number|table id or |vim.lsp.client| object, or list • {client_id} number|table id or |vim.lsp.client| object, or list
thereof thereof
• {force} (boolean) (optional) shutdown forcefully • {force} (boolean|nil) shutdown forcefully
tagfunc({...}) *vim.lsp.tagfunc()* tagfunc({...}) *vim.lsp.tagfunc()*
Provides an interface between the built-in client and 'tagfunc'. Provides an interface between the built-in client and 'tagfunc'.
@ -1174,7 +1174,7 @@ references({context}, {options}) *vim.lsp.buf.references()*
window. window.
Parameters: ~ Parameters: ~
• {context} (table) Context for the request • {context} (table|nil) Context for the request
• {options} (table|nil) additional options • {options} (table|nil) additional options
• on_list: (function) handler for list results. See • on_list: (function) handler for list results. See
|lsp-on-list-handler| |lsp-on-list-handler|
@ -1566,7 +1566,7 @@ jump_to_location({location}, {offset_encoding}, {reuse_win})
Parameters: ~ Parameters: ~
• {location} (table) (`Location`|`LocationLink`) • {location} (table) (`Location`|`LocationLink`)
• {offset_encoding} "utf-8" | "utf-16" | "utf-32" • {offset_encoding} "utf-8" | "utf-16" | "utf-32"
• {reuse_win} (boolean) Jump to existing window if buffer is • {reuse_win} (boolean|nil) Jump to existing window if buffer is
already open. already open.
Return: ~ Return: ~
@ -1657,7 +1657,7 @@ make_position_params({window}, {offset_encoding})
Parameters: ~ Parameters: ~
• {window} (number|nil) window handle or 0 for current, • {window} (number|nil) window handle or 0 for current,
defaults to current defaults to current
• {offset_encoding} (string) utf-8|utf-16|utf-32|nil defaults to • {offset_encoding} (string|nil) utf-8|utf-16|utf-32|nil defaults to
`offset_encoding` of first client of buffer of `offset_encoding` of first client of buffer of
`window` `window`
@ -1788,7 +1788,7 @@ show_document({location}, {offset_encoding}, {opts})
Parameters: ~ Parameters: ~
• {location} (table) (`Location`|`LocationLink`) • {location} (table) (`Location`|`LocationLink`)
• {offset_encoding} "utf-8" | "utf-16" | "utf-32" • {offset_encoding} "utf-8" | "utf-16" | "utf-32"
• {opts} (table) options • {opts} (table|nil) options
• reuse_win (boolean) Jump to existing window if • reuse_win (boolean) Jump to existing window if
buffer is already open. buffer is already open.
• focus (boolean) Whether to focus/jump to location • focus (boolean) Whether to focus/jump to location

View File

@ -1678,8 +1678,8 @@ list_slice({list}, {start}, {finish}) *vim.list_slice()*
Parameters: ~ Parameters: ~
• {list} (list) Table • {list} (list) Table
• {start} (number) Start range of slice • {start} (number|nil) Start range of slice
• {finish} (number) End range of slice • {finish} (number|nil) End range of slice
Return: ~ Return: ~
(list) Copy of table sliced from start to finish (inclusive) (list) Copy of table sliced from start to finish (inclusive)

View File

@ -1805,7 +1805,7 @@ end
--- already for this client, then force-shutdown is attempted. --- already for this client, then force-shutdown is attempted.
--- ---
---@param client_id number|table id or |vim.lsp.client| object, or list thereof ---@param client_id number|table id or |vim.lsp.client| object, or list thereof
---@param force boolean (optional) shutdown forcefully ---@param force boolean|nil shutdown forcefully
function lsp.stop_client(client_id, force) function lsp.stop_client(client_id, force)
local ids = type(client_id) == 'table' and client_id or { client_id } local ids = type(client_id) == 'table' and client_id or { client_id }
for _, id in ipairs(ids) do for _, id in ipairs(ids) do

View File

@ -383,7 +383,7 @@ end
--- Lists all the references to the symbol under the cursor in the quickfix window. --- Lists all the references to the symbol under the cursor in the quickfix window.
--- ---
---@param context (table) Context for the request ---@param context (table|nil) Context for the request
---@see https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references ---@see https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references
---@param options table|nil additional options ---@param options table|nil additional options
--- - on_list: (function) handler for list results. See |lsp-on-list-handler| --- - on_list: (function) handler for list results. See |lsp-on-list-handler|

View File

@ -1077,7 +1077,7 @@ end
--- ---
---@param location table (`Location`|`LocationLink`) ---@param location table (`Location`|`LocationLink`)
---@param offset_encoding "utf-8" | "utf-16" | "utf-32" ---@param offset_encoding "utf-8" | "utf-16" | "utf-32"
---@param opts table options ---@param opts table|nil options
--- - reuse_win (boolean) Jump to existing window if buffer is already open. --- - reuse_win (boolean) Jump to existing window if buffer is already open.
--- - focus (boolean) Whether to focus/jump to location if possible. Defaults to true. --- - focus (boolean) Whether to focus/jump to location if possible. Defaults to true.
---@return boolean `true` if succeeded ---@return boolean `true` if succeeded
@ -1134,7 +1134,7 @@ end
--- ---
---@param location table (`Location`|`LocationLink`) ---@param location table (`Location`|`LocationLink`)
---@param offset_encoding "utf-8" | "utf-16" | "utf-32" ---@param offset_encoding "utf-8" | "utf-16" | "utf-32"
---@param reuse_win boolean Jump to existing window if buffer is already open. ---@param reuse_win boolean|nil Jump to existing window if buffer is already open.
---@return boolean `true` if the jump succeeded ---@return boolean `true` if the jump succeeded
function M.jump_to_location(location, offset_encoding, reuse_win) function M.jump_to_location(location, offset_encoding, reuse_win)
if offset_encoding == nil then if offset_encoding == nil then
@ -1908,7 +1908,7 @@ end
--- Creates a `TextDocumentPositionParams` object for the current buffer and cursor position. --- Creates a `TextDocumentPositionParams` object for the current buffer and cursor position.
--- ---
---@param window number|nil: window handle or 0 for current, defaults to current ---@param window number|nil: window handle or 0 for current, defaults to current
---@param offset_encoding string utf-8|utf-16|utf-32|nil defaults to `offset_encoding` of first client of buffer of `window` ---@param offset_encoding string|nil utf-8|utf-16|utf-32|nil defaults to `offset_encoding` of first client of buffer of `window`
---@returns `TextDocumentPositionParams` object ---@returns `TextDocumentPositionParams` object
---@see https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocumentPositionParams ---@see https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocumentPositionParams
function M.make_position_params(window, offset_encoding) function M.make_position_params(window, offset_encoding)

View File

@ -516,8 +516,8 @@ end
--- ---
---@generic T ---@generic T
---@param list T[] (list) Table ---@param list T[] (list) Table
---@param start number Start range of slice ---@param start number|nil Start range of slice
---@param finish number End range of slice ---@param finish number|nil End range of slice
---@return T[] (list) Copy of table sliced from start to finish (inclusive) ---@return T[] (list) Copy of table sliced from start to finish (inclusive)
function vim.list_slice(list, start, finish) function vim.list_slice(list, start, finish)
local new_list = {} local new_list = {}