Skip to content

fix(picker): warn before falling back when a provider errors#6

Merged
binbandit merged 1 commit into
mainfrom
fix/picker-fallback-warning
Jun 10, 2026
Merged

fix(picker): warn before falling back when a provider errors#6
binbandit merged 1 commit into
mainfrom
fix/picker-fallback-warning

Conversation

@binbandit

@binbandit binbandit commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Summary

M.pick() wrapped every provider call in pcall and walked the fallback chain on any failure, which conflated two very different cases:

  • Capability gap — the provider doesn't implement the kind (fff has no buffers, so it falls through to snacks). This is by design, matches the documented fallback chain, and stays silent.
  • Real error — the provider implements the kind but the call blew up. Previously this was swallowed and the next provider quietly took over, hiding a broken configuration behind a picker that merely looked slightly different. The manifesto's "we do not hide configuration behind magic" says this should be visible.

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.lua already 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 validate passes. Neovim isn't available here for make smoke; manual check: with the default fff provider, :BlakPick buffers should 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.

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.
@binbandit binbandit force-pushed the fix/picker-fallback-warning branch from 53b78eb to 5f439ab Compare June 10, 2026 01:25
@binbandit binbandit merged commit d7acda8 into main Jun 10, 2026
4 checks passed
@binbandit binbandit deleted the fix/picker-fallback-warning branch June 10, 2026 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant