idea-handlebars
idea-handlebars copied to clipboard
Add alignment and spacing rules to the formatter
It would be nice if the formatter implemented in #27 also provided alignment and spacing formatting.
For alignment, we should stack mustache content analogously to how HTML attributes stack, like so:
{{#view App.ContactListView
contentBinding="this"}}
For spacing, it should be possible to enforce once space between elements in mustache content, and allow people to configure spaces before and after braces. So the formatter could automatically ensure that all your mustaches looked like this if you liked:
{{# view App.ContactListView
contentBinding="this" }}
Adding these capabilities means we'll have a dedicated "Settings -> Code Style" page for Handlebars/Mustache, and the indent formatter should be adjusted to respect the indent setting on this new page.
Any chance that this issue is going to be fixed anytime soon ?
Hey @ThomasRuiz, it's not on my radar right now to look at this, but knowing someone wants it is a good step towards changing that...
You should post an issue to the JetBrains tracker asking for this. They may get to it before I do.
Alternatively, this should be a pretty fun feature to implement (non-trivial, but not overwhelming), so if you feel like trying your hand at it, I'd be glad to help out where I can.
Thanks for your vote on this... hope the plugin's treating you well otherwise.
Hm, I think I'll post an issue as you said, on the JetBrains tracker.
The plugin is fine, and seems to work well (yet!). I just started an ember.js application, so it helps through some things and others.
If I had any skill in java and/or in plugin development, i would potentially implement it myself, yes. But sadly it is not the case... Yet! :)