Replace vim.tbl_add_reverse_lookup (deprecated in neovim v0.10) #904
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
After rebuilding neovim from from
master
(specifically,06135cc21571b2707121e31176f544a0e0901e1d
), I'm noticing the following deprecation warning on startup:Looking at neovim's deprecation help page, this function was deprecated as of neovim 0.10 and will not be replaced when it's removed.
How does this fix?
By crudely reimplementing
tbl_add_reverse_lookup
and using it in your diagnostics module.Reviewer notes
I didn't take a super close look at the actual use of this reversed table (if you really need to have forward and also reverse mappings in the table). I simply reimplemented what is now missing from the
vim
module. If you don't need the mirrored mappings,utils.tbl_reverse_lookup()
would suffice.Version
neovim/neovim
06135cc21571b2707121e31176f544a0e0901e1d
: