docs(lsp): change type annotations from number → integer (#22510)

This commit is contained in:
Jaehwang Jung
2023-03-07 15:17:52 +09:00
committed by GitHub
parent 7a44231832
commit 706bcab75e
10 changed files with 207 additions and 205 deletions

View File

@@ -186,7 +186,7 @@ end
--- Creates an RPC response object/table.
---
---@param code number RPC error code defined in `vim.lsp.protocol.ErrorCodes`
---@param code integer RPC error code defined in `vim.lsp.protocol.ErrorCodes`
---@param message string|nil arbitrary message to send to server
---@param data any|nil arbitrary data to send to server
local function rpc_response_error(code, message, data)
@@ -224,8 +224,8 @@ end
---@private
--- Default dispatcher for when a client exits.
---
---@param code (number): Exit code
---@param signal (number): Number describing the signal used to terminate (if
---@param code (integer): Exit code
---@param signal (integer): Number describing the signal used to terminate (if
---any)
function default_dispatchers.on_exit(code, signal)
local _ = log.info() and log.info('client_exit', { code = code, signal = signal })
@@ -233,7 +233,7 @@ end
---@private
--- Default dispatcher for client errors.
---
---@param code (number): Error code
---@param code (integer): Error code
---@param err (any): Details about the error
---any)
function default_dispatchers.on_error(code, err)
@@ -270,7 +270,7 @@ local function create_read_loop(handle_body, on_no_chunk, on_error)
end
---@class RpcClient
---@field message_index number
---@field message_index integer
---@field message_callbacks table
---@field notify_reply_callbacks table
---@field transport table
@@ -588,7 +588,7 @@ end
--- and port
---
---@param host string
---@param port number
---@param port integer
---@return function
local function connect(host, port)
return function(dispatchers)
@@ -692,8 +692,8 @@ local function start(cmd, cmd_args, dispatchers, extra_spawn_params)
---@private
--- Callback for |vim.loop.spawn()| Closes all streams and runs the `on_exit` dispatcher.
---@param code (number) Exit code
---@param signal (number) Signal that was used to terminate (if any)
---@param code (integer) Exit code
---@param signal (integer) Signal that was used to terminate (if any)
local function onexit(code, signal)
stdin:close()
stdout:close()