-
Notifications
You must be signed in to change notification settings - Fork 506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ktlint_function_signature_body_expression_wrapping=always
behavior question
#2872
Comments
If I recall correctly it is a deliberate exception to not wrap in case the closing parenthesis starts on a newline and has no return type. Reasoning was that the body expression looks a bit "lost" as its indentation is equal to the start position when lines are merged (of course given the widely accepted standard of 4 spaces for indentation):
vs
I do understand that this exception feels weird when |
Thanks - all of our code is consistently formatted with wrapped expression function bodies and this forces us to be inconsistent in the majority of cases (where we omit the return type). |
…ction_signature_body_expression_wrapping` is set to `always` Closes #2872
@paul-dingemans Thanks for the quick fix! Do you know the release schedule for this change? |
If all goes well, this week. |
Expected Behavior
I'd like to format my multiline expression functions like so:
Observed Behavior
Instead the second declaration is formatted as:
Steps to Reproduce
My editorconfig has
ktlint_function_signature_body_expression_wrapping = always
and a max line length to force this parameter list to wrap. The expression wrapping works when the function declaration is a single line (the first function declaration) but not when the function declaration spans lines (the second). Is it possible to achieve what I'm looking for? Thanks!Your Environment
.editorconfig
settings:The text was updated successfully, but these errors were encountered: