Friday, June 29, 2012

EclipseFP: integrating stylish-haskell

Stylish-haskell is a new code formatter for Haskell, and people have asked for it to be integrated in EclipseFP. This will be part of the 2.3.1 release.

You install stylish-haskell and set its path as with any helper executable (if it's your path you don't even need to specify the path in EclipseFP). Then there's a preference page to set preferences for all projects in your workspace, and a property page on each project if you want project-specific settings:

Then it's only a matter of right-clicking on the source, and choose Source-> Format. Or of course Ctrl+Shift+F which is the standard formatting shortcut in Eclipse. EclipseFP handles writing the YAML configuration file for you!

Don't know yet when EclipseFP 2.3.1 will be released, pretty soon I think!


Cetin Sert said...

You should really put some screenshots of how it makes Haskell code look like here! I personally detest and hate and curse to hell java and any application (eclipse) that touches it with an endless, juvenile passion but I am still very much interested in following your work.

lambdor said...

That's awesome. Thanks for implementing my feature request!

JP Moresmau said...

Cetin, the stylish-haskell web site gives an example of how it transforms Haskell code. Note that in EclipseFP the changes are not automatically saved, so you can easily revert if you don't like them.