feat(lua): deprecate vim.tbl_add_reverse_lookup

This commit is contained in:
Maria José Solano
2024-03-02 13:11:23 -08:00
committed by Christian Clason
parent 6525832a8c
commit e52c25b761
9 changed files with 66 additions and 68 deletions

View File

@ -130,7 +130,7 @@ local M = {}
--- Mapping of error codes used by the client
--- @nodoc
M.client_errors = {
local client_errors = {
INVALID_SERVER_MESSAGE = 1,
INVALID_SERVER_JSON = 2,
NO_RESULT_CALLBACK_FOUND = 3,
@ -140,7 +140,12 @@ M.client_errors = {
SERVER_RESULT_CALLBACK_ERROR = 7,
}
M.client_errors = vim.tbl_add_reverse_lookup(M.client_errors)
--- @type table<string|integer, string|integer>
--- @nodoc
M.client_errors = vim.deepcopy(client_errors)
for k, v in pairs(client_errors) do
M.client_errors[v] = k
end
--- Constructs an error message from an LSP error object.
---