aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/rpc.lua
diff options
context:
space:
mode:
authorMathias Fußenegger <mfussenegger@users.noreply.github.com>2023-02-25 18:47:05 +0100
committerGitHub <noreply@github.com>2023-02-25 18:47:05 +0100
commitc1514d7e6762ed62dee027ecc29bafd4aae2206e (patch)
tree01db147e771a0f11866427c43480f62cdf40e8cd /runtime/lua/vim/lsp/rpc.lua
parentdb32d312acd4bee96b3463ff85a6574b5180502d (diff)
downloadrneovim-c1514d7e6762ed62dee027ecc29bafd4aae2206e.tar.gz
rneovim-c1514d7e6762ed62dee027ecc29bafd4aae2206e.tar.bz2
rneovim-c1514d7e6762ed62dee027ecc29bafd4aae2206e.zip
fix(lsp): fix some type annotations (#22397)
Diffstat (limited to 'runtime/lua/vim/lsp/rpc.lua')
-rw-r--r--runtime/lua/vim/lsp/rpc.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/lua/vim/lsp/rpc.lua b/runtime/lua/vim/lsp/rpc.lua
index f1492601ff..aa833deb99 100644
--- a/runtime/lua/vim/lsp/rpc.lua
+++ b/runtime/lua/vim/lsp/rpc.lua
@@ -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