Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

do snippet should have higher priority than dop #130

Closed
elliotcm opened this issue Jan 19, 2016 · 8 comments
Closed

do snippet should have higher priority than dop #130

elliotcm opened this issue Jan 19, 2016 · 8 comments

Comments

@elliotcm
Copy link

Hi all,

I'm happy to fix this myself if you can point me in the right direction, but despite the snippets file listing the do snippet for Ruby blocks first, Atom suggests dop (do with a block variable) first despite being the less common case.

I have other ordering issues with suggestions elsewhere in Atom so understanding this mechanism would be a great help.

Cheers,
Elliot

@lee-dohm
Copy link
Contributor

Have you tried turning on the "Use Alternate Scoring" checkbox in the autocomplete-plus package settings?

@elliotcm
Copy link
Author

Hi @lee-dohm,

I've tried this and it's sorted out the problem. It also fixed the issue where ⌘T was suggesting the test factory for a model ahead of the model itself.

I don't remember turning this on myself and a colleague who was also troubled by the do/dop issue had it checked, despite downloading Atom fresh yesterday. This implies that it's on by default in Atom despite being marked as experimental.

Thanks!

@elliotcm
Copy link
Author

I should clarify, I fixed this by turning off alternate scoring.

@lee-dohm
Copy link
Contributor

a colleague who was also troubled by the do/dop issue had it checked, despite downloading Atom fresh yesterday.

Reinstalling Atom doesn't clear out any saved configurations, only deleting the ~/.atom/config.cson will clear out all saved configurations.

@elliotcm
Copy link
Author

I've checked and he'd never installed Atom on that machine before, since installing the OS fresh last month. I've checked the creation date of the ~/.atom directory and it's showing yesterday.

@axelson
Copy link

axelson commented Jan 21, 2016

A +1 for this being solved without the user needing to manually go into the autocomplete-plus package and uncheck "Use Alternate Scoring". Possibly even removing the dop snippet (if enough other people don't like it as well).

I can also confirm that "Use Alternate Scoring" has been the default since roughly Dec 18, 2015: atom/autocomplete-plus@e498988

@winstliu
Copy link
Contributor

/cc @jeancroy

@jeancroy
Copy link

Ok In autocomplete plus there's this code path provided for provider that don't implement their own filter.

It dilute the fuzzaldrin-plus scoring to mix it with default order information. The theory is that the provider may have external information as to how things should be ordered. If the provider don't, it just give a lower quality score.

What is this default order we speak of ? By default, for snippet it is alphabetical order

However do still happens before dop in alphabetical order. To wich I'd answer the sort comparator is completely broken, alwais returning NaN.


I'll end this by saying i've spent 0 second trying to tune the mixin function, because I don't really have any reference to how valuable initial ordering is. It is however broken.

Personnaly I have a tedency to prefer pure ranking and no external information, but maybe each provider can choose how valuable their initial ranking is. Fixing the sort comparator can probably band-aid fix this issue too.


As to why disabling alternate scoring fix this, the previous scoring give ton of importance to shorter string, it's about the most important signal it use. Also the mixin function has been designed with the previous scoring range.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants