fix(picker): Make custom picker backends selectable and persistent - #46
Merged
Conversation
register_picker() was documented as a public API, but picker.backend validation only accepted the four bundled names and setup() cleared the whole registry, so a registered picker could never be selected and was dropped on every setup() call. - Accept any non-empty string for picker.backend; unregistered names fall back to builtin at pick time. - Split the registry into builtin and user layers. setup() resets only the builtin layer, so register_picker()/register_provider() entries survive re-runs and take precedence over builtin entries. - Report registered custom backends in :checkhealth and warn when the configured backend is not registered.
… health - Validate picker.backend for every populated value, so false and empty strings fall back to builtin with a warning instead of being kept as-is. - Report a user-registered picker as ok in :checkhealth even when it shares a bundled backend name, matching runtime precedence. - Widen the PeekstackConfigPicker.backend type to string.
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
register_picker()was documented as a public API but could never be used:picker.backendvalidation only accepted the four bundled names andsetup()wiped the whole registry.picker.backendnow accepts any registered picker name, and user-registered pickers/providers survivesetup()re-runs.:checkhealth peekstackreports custom backends and warns when the configured backend is not registered.Changes
picker.backend; unregistered names fall back tobuiltinat pick timesetup()resets only builtin entries andregister_picker()/register_provider()registrations are kept and take precedence over same-named builtin entriesdoc/peekstack.txt, and add tests for config acceptance, registration before/aftersetup(), and dispatch to the custom pickerbuiltinforfalseor emptypicker.backendvalues instead of keeping themtelescope) as ok in:checkhealth, matching runtime precedencePeekstackConfigPicker.backendtype annotation tostring