Replies: 2 comments
-
Thank you for your kind words! As for your question:
I think all of them respect grouping of imports (i.e. you can have bunch of "external imports" grouped together, separated by empty line followed by your local imports grouped together and running formatter only sorts imports within respective group). In our work codebase we do exactly that and fourmolu preserves that grouping. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the comprehensive suggestions and comparisons of the various formatters. I've tended to shy away from formatters in favour of manual formatting, no doubt with various preferences and foibles per my personal aesthetic, and I've always been afraid that formatters would disappoint me one way of the other, but that actually means that I've never tried them, and therefore I may be doing them a huge disservice (especially formulu it seems - given its apparent configurability). So, given that LHS doesn't yet know how to discretely maintain ordered/organized import lists, I'll give these a go and see if I can get comfortable with using one of them. Thanks again. |
Beta Was this translation helpful? Give feedback.
-
I just feel compelled to thank the HLS team for 2.8.0.0 in particular.
I have quite a large project with multiple build products and using HLS up until now has not been a great experience in my case. I still soldiered on and got some value from it, but it would be only minutes before it got 'confused' and most of the valuable features stopped working. Now, with 2.8.0.0 I'm really starting to feel like I have the full intended power at my fingertips and I'm really seeing the value of HLS manifest for me! So... thank you so much HLS team for your perseverance and dedication to the goal of giving us, the Haskell community, a world-class development environment that puts our beloved language up there with the other popular languages in terms of development tooling.
Now, my quick question...
I would love to lean into the automatic import management of HLS, but I have some quibbles with how it seems to work atm.
I'm a bit of a stickler for maintaining my import lines sorted lexicographically, and then also for the explicit symbol list to be similarly sorted. I find this helps me more quickly find where I may or may not have imported something.
At this time, it doesn't appear that there's an option to have HLS do this automatically, so if it does have to add either a new module, or a new symbol, I end up having to revisit the list and tidy things up to my satisfaction. So...
Are there any options to turn on the ordering of imports?
I suppose my perfect world would also be to be able to separate the import list into two blocks - first the imports from external libraries and then the 'local' imports (for any modules in my actual project package). The latter tend to be shorter names, often just a single module name and no 'path') and I also like the convenience of quickly finding those imports concerning my own project code, versus from all the dependences.
Beta Was this translation helpful? Give feedback.
All reactions