-
Notifications
You must be signed in to change notification settings - Fork 232
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
Add configuration option for adding )
on a new line
#902
Comments
If it's something that we want to add, I can look into it. |
Synced to Apple’s issue tracker as rdar://141514256 |
I don't remember which exact setting it is, but we definitely have the comment on a new line in the Swift-syntax and SourceKit-LSP repos - it might be |
I think it's because we have max line length I think. So we accept length of 120. And if it exceeds that, we break into newline. So as long as all arguments can be on a single line, all good. |
I received the exact opposite request from someone else recently—an option to always force the closing paren onto the previous line. I'm inclined to say I'm not particularly keen to add this right now; I've stated on previous issues that I don't particularly find it compelling to add finely-grained knobs for every possible preference that users might want. Ensuring that the interactions between every different knob and various syntactic constructs work properly becomes a combinatorially difficult implementation and testing problem, and I'm not sure changes like this (in either direction) necessarily buy their weight when it comes to rationalizing that complexity. |
@allevato I see your point and understand. It's just because with And with the case above I don't believe it is. throw DecodingError.dataCorruptedError(
in: container,
debugDescription: "Unknown date format: \(dateString)"
) |
This means that it will horizontally pack arguments until the line is full and only if/when it reaches that point will it insert a line break before continuing to render arguments. The only other invariant is that if the whole argument list doesn't fit, then a line break is inserted before the first one; it is never allowed for an argument to "hang" off the same line where the function call started. Some examples: someFunction(foo)
someFunction(
foo, bar)
someFunction(
foo, bar, baz,
quux) |
Current if we in out project have the formatter formatting
It results in
But it would be nice if it was possible to configure it to do this
The text was updated successfully, but these errors were encountered: