-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
Support custom QuickPick filter logic #90521
Comments
(Experimental duplicate detection) |
@brunnerh if we could disable |
I agree with @brunnerh, about disable match at all, so we could handle the filter ourseves |
@chrmarti the Because of this, i have to do an workaround here:
|
Another option, simpler but less flexible, would be to add another prop, like The rationale here, is that I often don't want to overload the quickpick item with visual noise just to match against. Although if something more custom was implemented, I would love it if it was a post-process on top of the existing matching (if enabled -- and it would be great to be able to opt-out of label matching), so that way if something matched because of the existing behavior the item would still be there (unless removed as part of this callback) and highlighting would still be intact on those items. |
Currently the
QuickPick
filter logic supports wild cards and which parts of the item to search in but not things like switched up word order or regex. An issue was opened for one of my extensions asking for a more lenient search, which does not seem possible with the current API.Rather than adding a lot of options specifying exactly how the filtering behaves it might be easier and more sensible to provide a custom filter callback and maybe a filter delay option. The delay would trigger the filter logic only
n
milliseconds after the user has last typed, in case the filter logic is complex or there are many items (- i have 33k -) causing long filter times.Suggested interface for the options:
I had a look at handling a quick pick "manually" by using
createQuickPick
but it also filters completely automatically.Maybe
QuickPickOptions
could also be made generic. It already has theonDidSelectItem
property which uses a union for the item type instead of a generic. Then functions likeshowQuickPick<T extends QuickPickItem>
could propagate their generic type to the options argument.The text was updated successfully, but these errors were encountered: