vim.tbl_add_reverse_lookup is deprecated. Feature will be removed in Nvim 0.12
jiangyinzuo opened this issue · comments
Yinzuo Jiang commented
vim.tbl_add_reverse_lookup in NVIM v0.11.0-dev is deprecated.
vim.tbl_add_reverse_lookup is deprecated. :help deprecated
Feature will be removed in Nvim 0.12
stack traceback:
vim/shared.lua: in function 'tbl_add_reverse_lookup'
/root/plugged/sg.nvim/lua/sg/vendored/vim-lsp-rpc.lua:123: in main chunk
[C]: in function 'require'
/root/plugged/sg.nvim/lua/sg/request.lua:2: in main chunk
[C]: in function 'require'
/root/plugged/sg.nvim/lua/sg/rpc.lua:4: in main chunk
[C]: in function 'require'
/root/plugged/sg.nvim/lua/sg/bufread.lua:4: in main chunk
[C]: in function 'require'
/root/plugged/sg.nvim/plugin/sg.lua:7: in main chunk
marcel commented
The problem is that it does not have an alternative:
LUA
• vim.loop Use vim.uv instead.
• vim.tbl_add_reverse_lookup()
• vim.tbl_flatten() Use Iter:flatten() instead.
• vim.tbl_islist() Use vim.islist() instead.
Maybe it is something like this?
function tbl_add_reverse_lookup(t)
for key, value in pairs(t) do
t[value] = key
t[key] = value
end
end
ulisses-cruz commented
Thanks to @tjdevries, the deprecation warning was fixed by #237
Yinzuo Jiang commented
Thanks to @tjdevries, the deprecation warning was fixed by #237
It works well for me now, thanks!
TJ DeVries commented
Great! Thanks everyone :)