Skip to content

Commit accbc8a

Browse files
committed
style: typing improvements
1 parent 75c0d02 commit accbc8a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lua/null-ls/rpc.lua

+12
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,16 @@ local capabilities = {
5555

5656
M.capabilities = capabilities
5757

58+
---@param dispatchers vim.lsp.rpc.Dispatchers
59+
---@return vim.lsp.rpc.PublicClient
5860
M.start = function(dispatchers)
5961
local message_id = 1
6062
local stopped = false
6163

64+
---@param method vim.lsp.protocol.Method|string LSP method name.
65+
---@param params table? LSP request params.
66+
---@param callback fun(err: lsp.ResponseError|nil, result: any)?
67+
---@param is_notify boolean?
6268
local function handle(method, params, callback, is_notify)
6369
params = params or {}
6470
callback = callback and vim.schedule_wrap(callback)
@@ -102,6 +108,10 @@ M.start = function(dispatchers)
102108
return true, message_id
103109
end
104110

111+
---@param method vim.lsp.protocol.Method|string LSP method name.
112+
---@param params table? LSP request params.
113+
---@param callback fun(err: lsp.ResponseError|nil, result: any)
114+
---@param notify_callback fun(message_id: integer)?
105115
local function request(method, params, callback, notify_callback)
106116
log:trace("received LSP request for method " .. method)
107117

@@ -118,6 +128,8 @@ M.start = function(dispatchers)
118128
return success, message_id
119129
end
120130

131+
---@param method string LSP method name.
132+
---@param params table? LSP request params.
121133
local function notify(method, params)
122134
if should_cache(method) then
123135
set_cache(params)

0 commit comments

Comments
 (0)