Fix vim.validate deprecation warnings in telescope.actions.utils#3502
Closed
Trishthedish wants to merge 10 commits intonvim-telescope:masterfrom
Closed
Fix vim.validate deprecation warnings in telescope.actions.utils#3502Trishthedish wants to merge 10 commits intonvim-telescope:masterfrom
Trishthedish wants to merge 10 commits intonvim-telescope:masterfrom
Conversation
- Add helper functions for creating mock pickers with entries/selections - Add comprehensive edge case testing for map_entries and map_selections - Add performance testing for large datasets - Improve test comments and documentation for clarity - Add TDD tests for vim.validate syntax migration verification
4 tasks
DrKJeff16
suggested changes
Oct 6, 2025
| vim.validate { | ||
| f = { f, "function" }, | ||
| } | ||
| vim.validate("f", f, "function") |
Contributor
Contributor
|
Superseded by #3540 (what's with people including massive unrelated and undocumented changes in simple "fix" PRs?!) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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_entriesandmap_selectionsLocated in
tests/automated/actions/utils_spec.luaCovers:
nil, wrong types)vim.validatesyntaxReproduction Instructions:
Clone branch:
git checkout feat/improve-actions-utils-validationTo 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)