-
-
Notifications
You must be signed in to change notification settings - Fork 139
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
[autocomplete-plus] Allow interleaving of results from different providers #1037
Comments
@mauricioszabo, from #994:
To generate the screenshot above, I just scored everything according to our fuzzy-matcher. That way, even providers that opt out of |
The idea is sound, but I'd like to keep that behind a config toggle. In fact, I would go ahead and add a So my idea is: if we add a toggle for it (no idea how that option would be called... something like "sort suggestions with Pulsar's fuzzy finder?") we could solve this issue, and completely ignore the Finally - I would love to see some option in |
Also - suggestions without prefixes are currently not being scored by our fuzzyFinder, so it might be part of the issue; also the fact that we now accept ranges too... and the sorting algorithm is quite weird (there's a |
There's a tension here. I agree that it makes sense not to reorder things from the provider when there's no prefix; but once the user starts typing, I think that they rightly expect that the characters they type will be the main determiner of the ordering of the results. So I'm happy for my free-for-all proposal to be something a user must opt into. But I think that static ordering of providers is basically a bug, so I'd also like to improve on the status quo, since lots of people won't dive into the
Suppose we call the setting Fuzzy-Matching Behavior and make it an enum:
The setting description would explain:
It's wordy and I don't love it, but it's a start.
How would you score results without a prefix?
Agreed. I made an attempt at this for |
Relatedly, I feel more and more like I'm ready to jump into |
@savetheclocktower prefix is not text. Prefix is basically: suppose you have So, supposing a candidate have prefix |
Also:
That might be the case, but the default provider might ask to complete some variable name when the user is typing something like As an example, the default provider gives a "proximity boost" so |
Have you checked for existing feature requests?
Summary
Right now,
autocomplete-plus
is very rigid in how it returns suggestions:suggestionPriority
, with higher values going earlier.autocomplete-plus
should be filtering the suggestions, so filtering happens on a per-provider basis.So if
autocomplete-snippets
were to have a highersuggestionPriority
thanautocomplete-css
, then its least helpful suggestion (as judged by our fuzzy-matcher) is still displayed beforeautocomplete-css
’s most helpful suggestion:Here,
warning
is favored overwidth
simply because of the arbitrary ordering of providers.autocomplete-snippets
doesn't have a highersuggestionPriority
thanautocomplete-css
; they have the same value. I'm not yet sure how ties are broken; maybe it's activation order. But the fact that the user didn't choose to elevateautocomplete-snippets
’s suggestions is all the more proof that we shouldn't be doing this.What we should do instead is this:
0
or less is excluded; everything else is sorted according to its score.* Actually,
autocomplete-plus
stacks the deck a bit and makes it so that something must really score ahead of its peers in order to be elevated. We could keep this algorithm, abandon it, or make it configurable.I was able to get this outcome with just a few minutes of work:
What benefits does this feature provide?
I think most people expect that, after the process of fuzzy-matching, the best suggestion will be at the top. We should behave that way.
Any alternatives?
I'm not seeing any.
There are related features we could look into. For instance, there's hardly any visibility into the
suggestionPriority
property, even though it's the main determiner of suggestion order. (A given provider package may allow itssuggestionPriority
to be configurable, but most don't, and there's no way to control it fromautocomplete-plus
.)We could maybe do something a bit less disruptive and simply alter how we break ties in
suggestionPriority
. Instead of using some arbitrary criterion, we could break ties by ordering according to the score of the best match. That's another way we could guarantee that the best match would be the first one shown, at least whensuggestionPriority
is equal.Other examples:
No response
The text was updated successfully, but these errors were encountered: