-
Notifications
You must be signed in to change notification settings - Fork 64
Description
After analyses we have decided that support for trailing comments would be a good idea https://github.com/WhatsApp/erlfmt/blob/master/doc/FormattingDecisionComments.md
a, % trailing commentThis does not include aligning comments, only trailing comments with a single space between the code and the comment.
This does however require a significant amount of work to add this support.
There are no promises on when/if this will be delivered.
We do however believe this will be a big improvement to the project.
Concerns include that this will require a lot of decisions to be make about design of layouts.
For example, when an expression ends in a comment that is too long to fit on one line, the fits function will see this line as breaking and it will break that group. Do you keep the comment on the same line as the last group or do you have a break between it and the last group resulting in it being formatted below the expression. This is just one of the tough decisions that will need to be made on this implementation journey.
Reworking the algorithm to move the comment to the line above, only in the case that it breaks would require inventing a new operator for the fitting algorithm. If we do this, we could probably write a paper for ICFP.