fix(lsp): fix some type annotations (#22397)

This commit is contained in:
Mathias Fußenegger
2023-02-25 18:47:05 +01:00
committed by GitHub
parent db32d312ac
commit c1514d7e67
5 changed files with 92 additions and 79 deletions

View File

@ -319,9 +319,9 @@ end
---
---@param method (string) The invoked LSP method
---@param params (table|nil) Parameters for the invoked LSP method
---@param callback (function) Callback to invoke
---@param callback fun(err: lsp.ResponseError|nil, result: any) Callback to invoke
---@param notify_reply_callback (function|nil) Callback to invoke as soon as a request is no longer pending
---@returns (bool, number) `(true, message_id)` if request could be sent, `false` if not
---@return boolean success, integer|nil request_id true, request_id if request could be sent, `false` if not
function Client:request(method, params, callback, notify_reply_callback)
validate({
callback = { callback, 'f' },
@ -538,9 +538,9 @@ local function public_client(client)
---
---@param method (string) The invoked LSP method
---@param params (table|nil) Parameters for the invoked LSP method
---@param callback (function) Callback to invoke
---@param callback fun(err: lsp.ResponseError | nil, result: any) Callback to invoke
---@param notify_reply_callback (function|nil) Callback to invoke as soon as a request is no longer pending
---@returns (bool, number) `(true, message_id)` if request could be sent, `false` if not
---@return boolean success, integer|nil request_id true, message_id if request could be sent, `false` if not
function result.request(method, params, callback, notify_reply_callback)
return client:request(method, params, callback, notify_reply_callback)
end