Fix vim.validate deprecation warnings in telescope.actions.utils #3502
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.
Description
This PR addresses deprecation warnings caused by the old, table-based vim.validate syntax in two functions within telescope.actions.utils. The validation calls are updated to use the new argument-based syntax recommended by Neovim.
While using Telescope (master branch at commit b4da76b), I began seeing repeated deprecation warnings related to calls like vim.validate({}).
At the time I began working on this, there wasn’t an open issue for it, so I decided to start addressing the problem incrementally — beginning with the two usages in telescope.actions.utils.
Since then, issue #3499 has been opened describing the same deprecation warnings. I’ve linked this PR to that issue for tracking purposes.
Example warning:
Motivation and Context
One of my 2025 goals is to contribute meaningfully to an open-source Neovim plugin I use regularly. I’ve been looking for small, self-contained improvements that would let me practice writing and testing Lua code in the Neovim ecosystem — ideally in a way that supports test-driven development approach.
This change gave me an opportunity to explore Neovim plugin internals while also getting some hands-on experience writing tests before modifying behavior, which helped build confidence in the refactor.
Type of change
How Has This Been Tested?
Added unit tests for
map_entries
andmap_selections
Located in
tests/automated/actions/utils_spec.lua
Covers:
nil
, wrong types)vim.validate
syntaxReproduction Instructions:
Clone branch:
git checkout feat/improve-actions-utils-validation
To run only newly added tests use:
(Temporary Makefile helper I added for local dev; happy to remove before merge)
Configuration:
Checklist:
- [ ] I have made corresponding changes to the documentation (lua annotations)