halohalospecial / atom-elmjutsu

A bag of tricks for developing with Elm. (Atom package)
https://atom.io/packages/elmjutsu
MIT License
192 stars 24 forks source link

Insert case/of completion not working #72

Open sentience opened 7 years ago

sentience commented 7 years ago

The ‘Insert case/of’ special completion is not being offered to me, even though it is enabled in my preferences. Other special completions are working fine.

Atom 1.15.0 stable

halohalospecial commented 7 years ago

Hi! Do you have a sample scenario where it's not working? Note that there should be a space at the end of the line for it to offer case/of completion :-) You can try this example (type space after "case bool"):

module Main exposing (..)

foo : Bool -> Int
foo bool =
    case bool

case-of-example

Oh, and it only works if there are type signatures (for now) :-)

sentience commented 7 years ago

Tried it with the exact code above, and the completion is not offered. I made sure to type the space after bool.

Not sure what you mean by “only works if there are type signatures”. There is a type signature for the foo function in the example above; is that all you mean? Or is this some other feature of Elmjutsu that must be enabled (such as the type tooltips)?

halohalospecial commented 7 years ago

Yep. Your case sure is weird hmm. That should work if the other special completions are working fine. Can you check if there are errors in the Atom console?

sentience commented 7 years ago

Nothing in the console, I’m afraid.

Aha! I disabled the case/of special completion option, closed Preferences, reopened preferences, enabled the case/of special completion option, and it’s working now! ¯\_(ツ)_/¯

halohalospecial commented 7 years ago

Haha! Software :grinning: Glad you got it working!

jacoporicare commented 7 years ago

Hello, I'm experiencing the same issue and I'm not able to fix it 🙁. No errors in console, nothing. I'm on MacBook Pro, late 2015, macOS Sierra 10.12.6, Atom 1.19.5.

halohalospecial commented 7 years ago

Hi @jacoporicare, can you provide a screenshot? Thanks!

jacoporicare commented 7 years ago

case-of

jacoporicare commented 7 years ago

BTW I know it's a different topic but I have to press Enter twice when I type = because I have to "confirm" the autocomplete. Is there a way to not pre-select the first item or even better not to offer an item which is exactly the same like I typed? E.g. if I type = then it's not necessary to offer =.

halohalospecial commented 7 years ago

@jacoporicare, I tried your example and it's working. Settings view also looks fine. Maybe another Atom package has a bad interaction with that feature?

Regarding the issue with =, the hack discussed here doesn't work anymore with the recent version of autocomplete-plus. :cry: As a workaround, you can set Autocomplete Min Chars to 2 or higher if you don't want to autocomplete 1-character symbols.

jacoporicare commented 7 years ago

Thank you, I'll investigate it further. Thanks for the tip with Min Chars settings, that should help.