fix(picker): warn before falling back when a provider errors#6
Merged
Conversation
The dispatcher pcall-wrapped every provider call and walked the fallback chain on failure, so a configured provider that errored was silently replaced by the next one. Capability gaps (a provider that does not implement the kind) still fall through silently by design; real errors now warn with the provider name and message so a broken picker configuration stays visible.
53b78eb to
5f439ab
Compare
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.
Summary
M.pick()wrapped every provider call inpcalland walked the fallback chain on any failure, which conflated two very different cases:buffers, so it falls through to snacks). This is by design, matches the documented fallback chain, and stays silent.Now an erroring provider produces a warning with the provider name, the kind, and the error message before the dispatcher tries the next one — same pattern
core/terminal.luaalready uses for its snacks→native fallback. Fallback order and behavior are otherwise unchanged.Also documents the distinction in the Fallback chain section of
docs/src/content/docs/guide/pickers.md.Validation
make validatepasses. Neovim isn't available here formake smoke; manual check: with the default fff provider,:BlakPick buffersshould open snacks with no warning (capability fallback), and breaking a provider (e.g. a bad fff install) should produce one warning per failed pick rather than silence.