Skip to content

Shorten getters and setters of syntax nodes #1270

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

Merged
merged 1 commit into from
Jan 27, 2023

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Jan 25, 2023

This makes the Syntax*Nodes.swift more succinct and easier to read

@ahoppen ahoppen requested a review from DougGregor as a code owner January 25, 2023 19:29
@ahoppen ahoppen changed the title Shorten getters and setters of syntax nodes 🚥 #1253 Shorten getters and setters of syntax nodes Jan 26, 2023
This makes the `Syntax*Nodes.swift` more succinct and easier to read
@ahoppen ahoppen force-pushed the ahoppen/shorten-getter-and-setters branch from 4b46c2e to 355588e Compare January 27, 2023 06:53
@ahoppen
Copy link
Member Author

ahoppen commented Jan 27, 2023

@swift-ci Please test

@ahoppen ahoppen requested a review from bnbarham January 27, 2023 06:54
Copy link
Contributor

@bnbarham bnbarham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 🤩

@@ -187,21 +187,14 @@ public struct ${node.name}: ${base_type}Protocol, SyntaxHashable {
% end
public var ${child.swift_name}: ${child_type}${optional_mark} {
get {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could go even furtherrrr if you wanted to, ie. get/set on the same line as the body. Or does swift-format not like that?

@ahoppen ahoppen merged commit e9e0b24 into swiftlang:main Jan 27, 2023
@ahoppen ahoppen deleted the ahoppen/shorten-getter-and-setters branch January 27, 2023 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants