Skip to content

Add convenience initializer for CustomAttribute #650

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 2 commits into from
Aug 30, 2022

Conversation

fwcd
Copy link
Member

@fwcd fwcd commented Aug 29, 2022

This makes CustomAttributes constructible in a way similar to FunctionCallExprs:

// @Test
CustomAttribute("Test")

// @Test()
CustomAttribute("Test") {}

// @Test(a, label: b)
CustomAttribute("Test") {
  TupleExprElement(expression: "a")
  TupleExprElement(label: "label", expression: "b")
}

I have placed the convenience initializer under Sources/SwiftSyntaxBuilder/ConvenienceInitializers already to be consistent with #647.

@fwcd fwcd requested a review from ahoppen as a code owner August 29, 2022 11:05
@fwcd
Copy link
Member Author

fwcd commented Aug 29, 2022

@swift-ci please test

@fwcd fwcd force-pushed the fwcd/attribute-convenience-init branch from afd2538 to b3e14ad Compare August 29, 2022 15:15
@fwcd
Copy link
Member Author

fwcd commented Aug 29, 2022

@swift-ci please test

Copy link
Contributor

@kimdv kimdv left a comment

Choose a reason for hiding this comment

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

🚀

@fwcd fwcd merged commit b04d774 into swiftlang:main Aug 30, 2022
@fwcd fwcd deleted the fwcd/attribute-convenience-init branch August 30, 2022 15:41
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