@@ -175,7 +175,7 @@ local validate = vim.validate
175
175
---
176
176
--- Response from the server sent on `initialize` describing the server's
177
177
--- capabilities.
178
- --- @field server_capabilities lsp.ServerCapabilities ?
178
+ --- @field server_capabilities lsp.ServerCapabilities
179
179
---
180
180
--- Response from the server sent on `initialize` describing information about
181
181
--- the server.
@@ -229,13 +229,13 @@ local validate = vim.validate
229
229
--- @field private _before_init_cb ? vim.lsp.client.before_init_cb
230
230
--- @field private _on_attach_cbs vim.lsp.client.on_attach_cb[]
231
231
--- @field private _on_init_cbs vim.lsp.client.on_init_cb[]
232
- --- @field private _on_exit_cbs vim.lsp.client.on_exit_cb[]
232
+ --- @field package _on_exit_cbs vim.lsp.client.on_exit_cb[]
233
233
--- @field private _on_error_cb ? fun ( code : integer , err : string )
234
234
local Client = {}
235
235
Client .__index = Client
236
236
237
237
--- @param obj table<string,any>
238
- --- @param cls table<string,function>
238
+ --- @param cls table<string,function ? >
239
239
--- @param name string
240
240
local function method_wrapper (obj , cls , name )
241
241
local meth = assert (cls [name ])
@@ -339,7 +339,7 @@ local function validate_config(config)
339
339
)
340
340
end
341
341
342
- --- @param trace string
342
+ --- @param trace string ?
343
343
--- @return ' off' | ' messages' | ' verbose'
344
344
local function get_trace (trace )
345
345
local valid_traces = {
@@ -445,16 +445,16 @@ function Client.create(config)
445
445
--- @type vim.lsp.rpc.Dispatchers
446
446
local dispatchers = {
447
447
notification = function (...)
448
- return self :_notification (... )
448
+ self :_notification (... )
449
449
end ,
450
450
server_request = function (...)
451
451
return self :_server_request (... )
452
452
end ,
453
453
on_error = function (...)
454
- return self :_on_error (... )
454
+ self :_on_error (... )
455
455
end ,
456
456
on_exit = function (...)
457
- return self :_on_exit (... )
457
+ self :_on_exit (... )
458
458
end ,
459
459
}
460
460
602
602
603
603
--- @private
604
604
--- @param id integer
605
- --- @param req_type ' pending' | ' complete' | ' cancel' |
605
+ --- @param req_type ' pending' | ' complete' | ' cancel'
606
606
--- @param bufnr ? integer (only required for req_type =' pending' )
607
607
--- @param method ? string (only required for req_type =' pending' )
608
608
function Client :_process_request (id , req_type , bufnr , method )
838
838
--- @param registrations lsp.Registration[]
839
839
function Client :_register_dynamic (registrations )
840
840
-- remove duplicates
841
- self :_unregister_dynamic (registrations )
841
+ self :_unregister_dynamic (registrations --[[ @as lsp.Unregistration[] ]] )
842
842
for _ , reg in ipairs (registrations ) do
843
843
local method = reg .method
844
844
if not self .registrations [method ] then
0 commit comments