facebookarchive / ide-flowtype

Flow support for Atom IDE
Other
178 stars 17 forks source link

Autocomplete suggestion priority overrides snippets #65

Closed nfarina closed 6 years ago

nfarina commented 6 years ago

Hi! Loving ide-flowtype.

I've noticed that ide-flowtype is setting a suggestionPriority of 5 here:

https://github.com/flowtype/ide-flowtype/blob/master/lib/main.js#L122

This would be OK except that it overrides the built-in autocomplete-snippets priority of 2. This means that when you're quickly typing code using snippets, your snippets are often "buried" in the list somewhere.

Common example: there is a log snippet where you can type log followed by tab and it expands to console.log(). But, when ide-flowtype is in use, you often get other flow-related completions instead:

screen shot 2018-03-20 at 9 19 17 am

The end result is that typing log+tab almost never results in your desired snippet. It really handicaps the utility of snippets, as evidenced by a few open issues (#88, #946, #157) across various repos.

I'm wondering why the value of 5 was chosen for Flow's completion suggestions? When I change it to, for instance, 1, I get a more correct ordering:

screen shot 2018-03-20 at 10 34 28 am

And Flow's suggestions are still given priority over the "dumb" word-in-file completions provided by Atom out of the box.

Would a PR modifying the priority back to 1 be considered?

saadq commented 6 years ago

There's a pull request open to allow configuration of the autocomplete priority which would be nice.

nfarina commented 6 years ago

Looks like it got merged, closing this, thanks! 🎉