feat(lsp): more annotations

This commit is contained in:
Lewis Russell
2023-12-13 12:00:11 +00:00
committed by Lewis Russell
parent 320e9c1c21
commit 97bea3163a
16 changed files with 364 additions and 228 deletions

View File

@@ -49,7 +49,7 @@ local function request_with_options(name, params, options)
local req_handler
if options then
req_handler = function(err, result, ctx, config)
local client = vim.lsp.get_client_by_id(ctx.client_id)
local client = assert(vim.lsp.get_client_by_id(ctx.client_id))
local handler = client.handlers[name] or vim.lsp.handlers[name]
handler(err, result, ctx, vim.tbl_extend('force', config or {}, options))
end
@@ -299,12 +299,12 @@ function M.rename(new_name, options)
)[1]
end
local try_use_client
try_use_client = function(idx, client)
local function try_use_client(idx, client)
if not client then
return
end
--- @param name string
local function rename(name)
local params = util.make_position_params(win, client.offset_encoding)
params.newName = name