refactor(lua): improve type annotations

This commit is contained in:
Lewis Russell
2024-06-11 12:05:18 +01:00
committed by Lewis Russell
parent d8e384b7bf
commit 5e49ef0af3
20 changed files with 64 additions and 369 deletions

View File

@@ -140,7 +140,7 @@ local client_errors = {
SERVER_RESULT_CALLBACK_ERROR = 7,
}
--- @type table<string|integer, string|integer>
--- @type table<string,integer> | table<integer,string>
--- @nodoc
M.client_errors = vim.deepcopy(client_errors)
for k, v in pairs(client_errors) do
@@ -502,7 +502,7 @@ function Client:handle_body(body)
if decoded.error then
decoded.error = setmetatable(decoded.error, {
__tostring = M.format_rpc_error,
}) --- @type table
})
end
self:try_call(
M.client_errors.SERVER_RESULT_CALLBACK_ERROR,