Ah!RBConfigurableFormatter class>>settingsOn: is missing one setting----(aBuilder setting: #retainBlankLinesBetweenStatements)label: 'Retain blank lines between statements'.----As for the comments, I looked at RBConfigurableFormatter>>formatStatementCommentsFor:one idea might be to look at the space between end of the statement and beginning of the comment and if there is newline present then preserve it.something like--------------------------formatStatementCommentsFor: aStatementNodeoriginalSource isNilifTrue: [ ^ self ].FormatCommentWithStatementsifFalse: [ ^ self ].aStatementNode statementCommentsdo: [ :each |��(self newLinesBeforeStartingAt: each first) > 0ifTrue: [ self newLine ]ifFalse: [ codeStream tab ].codeStream nextPutAll: (originalSource copyFrom: each first to: each last) ]---------------------------There should be also an accompanying setting #retainBlankLineBeforeComments.PeterOn Wed, Aug 20, 2014 at 7:45 PM, stepharo <stepharo@free.fr> wrote:Hi peterI do not know :)
Is it possible to configure formatter to preserve empty lines and line comments?But I think that should be customizable.
e.g.--------------myMethodsomeCode.
< empty line that I would like to preserve >
moreCode.
---------------If I recall, the problem is that comments are not a node but an attribute of a node.
the formatter also automatically puts comments on the end of the previous statement.e.g.------someCode."a comment"moreCode.
We should try to fix that. It is not clear where you always want to put them.I use the formatter and I would like to use it much more systemaitcally.
----ends up as----someCode. "a comment"moreCode.-----
Both those behaviors seems odd to me.
I've seen empty newlines and line comments in Pharo code... so either I missed some setting or people just don't use the formatter?
Thanks,Peter