eclipse-archived / ceylon.formatter

A formatter for the Ceylon programming language, written in Ceylon.
Apache License 2.0
14 stars 11 forks source link

Allow linebreaks before closing parentheses? #36

Closed lucaswerkmeister closed 10 years ago

lucaswerkmeister commented 10 years ago

I wrote the following code a while back:

variable Integer offset = options.indentMode.indent(
    tokenStack.fold(0, (Integer partial, FormattingContext elem) => partial + elem.postIndent)
).size;

(source, linked to the commit that introduced the code). The formatter turns this into:

variable Integer offset = options.indentMode.indent(
    tokenStack.fold(0, (Integer partial, FormattingContext elem) => partial + elem.postIndent)).size;

because a PositionalArgumentList doesn’t allow linebreaks before the closing parenthesis.

I’m not sure if that’s right.

lucaswerkmeister commented 10 years ago

After a bit more considering, I think that linebreaks should be allowed before a ).