Here’s a very early attempt at a new sclang
auto-formatter, based on @lnihlen’s Sparkler parser.
It’s very rough, but as it stands it does significantly better than the current sc-ide indenter. Please feel free to try it out, and propose pull requests, etc.
I’ll have only occasional time to work on this - there are two big ways to move this project forward:
-
Put together a simple unit testing setup, where we can provide a folder of “before” and “after” test cases to validate that the formatting is done as expected.
These would also give the community a place to discuss questions of “canonical” formatting, best-practices etc. If anyone want to work on this, it would be incredibly valuable and I’d be happy to provide guidance. -
Add an option to the current sc-ide to specify a command-line formatter rather than the built-in formatting.
This would make it easier for users to test formatting in their own projects, and provide an escape hatch for people (like me…) who are frustrated with the current auto-formatting.