JakeBecker/ide-elixir

Don't show suggestions on space or comma

rzane opened this issue · 4 comments

rzane commented

Whenever I type a comma and press enter, I end up with a do/end. It's incredibly frustrating.

Apparently autocomplete-css had the same issue, so this seem relevant:
atom/autocomplete-plus#513

output

That looks super annoying :/

I don't know why it's happening. The server only indicates [".", "@"] as trigger characters for autocompletion.

In the VS Code ElixirLS extension, I've recently begun making tab instead of enter the default key for accepting a suggestion. Looks like you can do the same with Atom: atom/autocomplete-plus#24 . I recommend this, since you'll often end lines with an identifier (such as :error) and you probably don't want to autocomplete them (into :error_handler, for example) every time you hit enter.

rzane commented

That's a really good suggestion. I'm going to start doing that.

A shortcoming in the Atom client, though, is that it doesn't support the document/onTypeFormatting request, which allows ElixirLS to automatically close do or fn -> with an end without relying on autocomplete snippets: atom/atom-languageclient#12 . Still, I think having tab do autocomplete is still the better option.

Gonna leave this issue open till I figure out why it's autocompleting on spaces and commas, which it really shouldn't do.

Updating the atom-languageclient dependency seemed to fix it. I just published v0.2.17 with the fix. I still recommend changing the accept key to tab though.