Skip to content

Handle macro expansion args in placeholder expansion #3092

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
Jun 5, 2025

Conversation

hamishknight
Copy link
Contributor

Update ExpandEditorPlaceholdersToLiteralClosures and CallToTrailingClosures such that they can handle macro expansion exprs and decls. This unfortunately requires changing them such that they take a Syntax input and output to satisfy the conformance to SyntaxRefactoringProvider, but that seems preferable to making the refactoring types themselves generic.

If in the future we decide to expose CallLikeSyntax as a public protocol, we could decide to expose additional generic refactor overloads here. However it's not clear there's enough clients of these APIs to motivate doing that in this PR.

Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

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

Looks good to me, just two improvement suggestions on CallLikeSyntax.

Update `ExpandEditorPlaceholdersToLiteralClosures` and
`CallToTrailingClosures` such that they can handle macro expansion
exprs and decls. This unfortunately requires changing them such that
they take a `Syntax` input and output to satisfy the conformance to
`SyntaxRefactoringProvider`, but that seems preferable to making the
refactoring types themselves generic.

If in the future we decide to expose `CallLikeSyntax` as a public
protocol, we could decide to expose additional generic `refactor`
overloads here. However it's not clear there's enough clients of
these APIs to motivate doing that in this PR.
@hamishknight
Copy link
Contributor Author

@swift-ci please test

Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM

@ahoppen
Copy link
Member

ahoppen commented Jun 5, 2025

@swift-ci Please test Windows

@hamishknight hamishknight merged commit 98f6feb into swiftlang:main Jun 5, 2025
28 checks passed
@hamishknight hamishknight deleted the place-mac branch June 5, 2025 12:00
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