Skip to content

Generate ExpressibleAsProtocols with SwiftSyntaxBuilderGeneration #495

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
Jul 14, 2022

Conversation

fwcd
Copy link
Member

@fwcd fwcd commented Jul 10, 2022

This PR ports the currently gyb-generated ExpressibleAsProtocols to SwiftSyntaxBuilder's DSL as part of the ongoing effort to bootstrap SwiftSyntaxBuilder with SwiftSyntaxBuilderGeneration.

@fwcd fwcd force-pushed the expressible-as-protocols-swift-syntax-gen branch from c8e8ec2 to dd88ae4 Compare July 11, 2022 12:27
@fwcd fwcd marked this pull request as ready for review July 11, 2022 12:28
@fwcd fwcd requested a review from ahoppen as a code owner July 11, 2022 12:28
@fwcd
Copy link
Member Author

fwcd commented Jul 11, 2022

@swift-ci please test

@fwcd fwcd force-pushed the expressible-as-protocols-swift-syntax-gen branch from dd88ae4 to 5966e6a Compare July 14, 2022 09:49
@fwcd
Copy link
Member Author

fwcd commented Jul 14, 2022

@swift-ci please test

- Stub out ExpressibleAsProtocolsFile
- Declare protocols
- Add conformance extensions
- Remove `ExpressibleAsProtocols.swift.gyb`
@fwcd fwcd force-pushed the expressible-as-protocols-swift-syntax-gen branch from 5966e6a to 4076458 Compare July 14, 2022 09:59
let expressibleAsTypes =
SYNTAX_BASE_KINDS
.filter { $0 != "SyntaxCollection" }
.sorted() // Make sure that the order is deterministic
Copy link
Member Author

Choose a reason for hiding this comment

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

I have added a sort here to make the order deterministic (see also #498 (comment)).

@fwcd
Copy link
Member Author

fwcd commented Jul 14, 2022

@swift-ci please test

@fwcd fwcd merged commit 6df9642 into swiftlang:main Jul 14, 2022
@fwcd fwcd deleted the expressible-as-protocols-swift-syntax-gen branch July 14, 2022 11:25
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.

2 participants