Skip to content

Commit

Permalink
style: typing improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
mochaaP committed Nov 30, 2024
1 parent 75c0d02 commit accbc8a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lua/null-ls/rpc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,16 @@ local capabilities = {

M.capabilities = capabilities

---@param dispatchers vim.lsp.rpc.Dispatchers
---@return vim.lsp.rpc.PublicClient
M.start = function(dispatchers)
local message_id = 1
local stopped = false

---@param method vim.lsp.protocol.Method|string LSP method name.
---@param params table? LSP request params.
---@param callback fun(err: lsp.ResponseError|nil, result: any)?
---@param is_notify boolean?
local function handle(method, params, callback, is_notify)
params = params or {}
callback = callback and vim.schedule_wrap(callback)
Expand Down Expand Up @@ -102,6 +108,10 @@ M.start = function(dispatchers)
return true, message_id
end

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

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

---@param method string LSP method name.
---@param params table? LSP request params.
local function notify(method, params)
if should_cache(method) then
set_cache(params)
Expand Down

0 comments on commit accbc8a

Please sign in to comment.