-
-
Notifications
You must be signed in to change notification settings - Fork 917
Fix vim.validate deprecation warnings in telescope.actions.utils #3502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Trishthedish
wants to merge
10
commits into
nvim-telescope:master
Choose a base branch
from
Trishthedish:feat/improve-actions-utils-validation
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fix vim.validate deprecation warnings in telescope.actions.utils #3502
Trishthedish
wants to merge
10
commits into
nvim-telescope:master
from
Trishthedish:feat/improve-actions-utils-validation
Conversation
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
- 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") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_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)