-
Notifications
You must be signed in to change notification settings - Fork 441
Add custom format to code gen for TupleExprElementListSyntax
, FunctionParameterListSyntax
, ArrayElementListSyntax
and DictionaryElementListSyntax
#1323
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
Conversation
7d5b5de
to
09d60b3
Compare
TupleExprElementListSyntax
, FunctionParameterListSyntax
, ArrayElementListSyntax
and DictionaryElementListSyntax
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
09d60b3
to
a94c34c
Compare
public override func visit(_ node: ArrayElementListSyntax) -> ArrayElementListSyntax { | ||
let children = node.children(viewMode: .all) | ||
// Short array literals are presented on one line, list each element on a different line. | ||
if children.count > 2 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last question: Why did you choose 2 for arrays and dictionaries but 3 for function parameters? If there’s a reason, I’m totally fine with it, if it’s arbitrary I think it would be nice to keep them the same so the next person who looks at this doesn’t wonder why there’s a difference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it reads better. But I don't have strong options here.
I actually rather would make a newline for all arrays + dictionaries
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed all to 3 for now.
We can change later if we think it will improve the readability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m not saying I want 2 or 3. It’s totally fine to mix and match. I just wanted to make sure you deliberately chose those values if they are different.
@swift-ci please test |
a94c34c
to
59801d4
Compare
@swift-ci please test |
@swift-ci please test macOS |
1 similar comment
@swift-ci please test macOS |
No description provided.