atom-haskell-archive / autocomplete-haskell

Atom autocomplete-plus provider for haskell
https://atom.io/packages/autocomplete-haskell
MIT License
23 stars 1 forks source link

Completion is sometimes too eager / zealous #7

Closed dpercy closed 8 years ago

dpercy commented 8 years ago

When a local variable name is a substring of a top-level variable, the completion menu pops up and tries to complete the local variable (which I wanted to type) into the global variable (which I didn't).

Example: I'm defining a very small function, so the argument name is one letter: screen shot 2015-11-12 at 1 14 54 am

I want to type x <Enter> to insert the local variable and go to a new line. Instead, when I type x the completion menu pops up: screen shot 2015-11-12 at 1 15 08 am

and then pressing <Enter> accepts the completion: screen shot 2015-11-12 at 1 15 18 am

Usually when this happens it's because the local variable is one letter, but it can also happen with multi-letter variable names: screen shot 2015-11-12 at 1 18 18 am

It's possible to work around this by hitting <Esc> before <Enter>, but it's still frustrating because my muscle memory is expecting behavior closer to ghci or a plain text editor.

Some ideas for a solution:

  1. Don't allow pressing <Enter> to accept a completion, since you can still use <Tab>.
  2. Don't automatically pop up the menu, since you can still use <Ctrl-Space>.
  3. Make idea 1 or idea 2 (or both) available as a configuration option.
lierdakil commented 8 years ago

autocomplete-haskell uses autocomplete-plus as a frontend. You can configure autocomplete-plus for both (1) and (2), so please see its settings.

dpercy commented 8 years ago

Oh, perfect. Thank you!