atom / autocomplete-plus

View and insert possible completions in the editor while typing
MIT License
960 stars 263 forks source link

Provider initial ordering #653

Open jeancroy opened 8 years ago

jeancroy commented 8 years ago

This issue is about that comment, and the code that follow.

sortScore mostly preserves in the original sorting. The function is

chosen such that suggestions with a very high match score can break out.

Basically this assume provider has some external knowledge about how things should be sorted, independent of fuzzaldrin-score. For example provider might have detected the user prefers a method to a property.

Sometime however provider have no, or low quality external information. This is the case of the snippet provider. In this particular case, the idea to 'preserves the original sorting' only leeds to lower quality ranking. In the end this materialize on my side as alternate scoring being broken.

ref this and that


Note that I can fiddle with the score mix function to make reported use case pass. However something in the design is broken wrt assumption being made. Ideally I'd like the initial ordering preservation part to be opt-in, with possibly some strength setting to denote confidence level in the a-priori sorting.

tofof commented 7 years ago
In https://github.com/atom/autocomplete-plus/issues/653#issue-128184951, @jeancroy wrote:

[...] something in the design is broken wrt assumption being made. [...] the initial ordering preservation [should be] opt-in, with possibly some strength setting to denote confidence level in the a-priori sorting.

Yes. This. A thousand times this. Please allow 'providers' to pass a flag along indicating that it claims to provide an intelligently pre-sorted list of suggestions, and in the absence of such a claim, assume a naive/alphabetical/useless sort and place literally zero emphasis on it. Aggressively push the 'strength' of the provider ordering down unless there is very very good reason to assume otherwise.

See http://imgur.com/a/OI4N8 for what usability looks like with the default provider and fuzzaldrin-plus's scoring being unused for sort in the current implementation.