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

'Lift to Let' feature does not create a let..in block if function has no newlines #49

Open mandrolic opened 7 years ago

mandrolic commented 7 years ago

e.g: calling Lift to Let on this selection

image

has no effect. This form works though:

image

halohalospecial commented 7 years ago

Hi! The current implementation is hacky and assumes the code follows elm-format's rules. In the future, an implementation using an AST will be more accurate :-)

mandrolic commented 7 years ago

OK cool. Is there any way to detect when it doesn't work and show that in Atom somehow? Status bar or low-priority notification?

halohalospecial commented 7 years ago

Ok, good point.