Add filtering to the function coder#45
Open
mariari wants to merge 3 commits into
Open
Conversation
The Functions tab listed every def/type/macro with no way to narrow it.
GT's coder filter bars ("Category [All methods v]", "Methods up to v") use a
model-backed filter system: a filter answers filterDescriptor2For: with a
GtFilter*Model, and GtFilterItemsModel asFiltersElement renders native dropdown
widgets (proper box, alt-clickable). We reuse that rather than hand-rolling tags.
ElixirFunctionsFilter is a GtSearchFilter base matching one function entry
(matches:); =/hash are value-aware so GtFilteredCodersModel>>additionalFilters:,
which early-returns on an equal collection, re-applies on every change.
ElixirKindFilter answers a GtFilterShortListModel (All/Functions/Types, shown by
default); ElixirNameSubstringFilter a GtFilterTextModel (added via +).
ElixirFunctionFiltersBuilder enumerates ElixirFunctionsFilter subclasses into the
+ menu (GT's GtFilterMethodsCoderAvailableFiltersBuilder scans GtSearchMethodsFilter,
which we aren't). buildFunctionsFilterBar: assembles GtFilterItemsModel + that
builder + GT's GtFilterMethodCodersAdditionalFiltersUpdater (which only needs
additionalFilters: and model asSearchFilter), the updater kept alive in the
element userData. newItemsStream narrows functionEntries by additionalFilters.
Subclassing ElixirFunctionsFilter with a filterDescriptor2For: model is the whole
extension story: a new filter auto-registers in the bar.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
5f4840b to
ac6ae07
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.
No description provided.