Skip to content

[Macros] Update for SwiftSyntaxMacroExpansion module #65882

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
May 12, 2023

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented May 12, 2023

Share the same expansion logic between ASTGen and SwiftCompilerMessageHandling

Share the same expansion logic between ASTGen and
SwiftCompilerMessageHandling
@rintaro rintaro marked this pull request as ready for review May 12, 2023 02:58
@rintaro rintaro requested review from zoecarver and CodaFi as code owners May 12, 2023 02:58
@rintaro rintaro requested review from DougGregor and bnbarham and removed request for CodaFi and zoecarver May 12, 2023 02:59
@rintaro
Copy link
Member Author

rintaro commented May 12, 2023

swiftlang/swift-syntax#1654
@swift-ci Please smoke test

@rintaro rintaro changed the title [Madros] Update for SwiftSyntaxMacroExpansion module [Macros] Update for SwiftSyntaxMacroExpansion module May 12, 2023
@rintaro
Copy link
Member Author

rintaro commented May 12, 2023

swiftlang/swift-syntax#1654
@swift-ci Please smoke test

1 similar comment
@rintaro
Copy link
Member Author

rintaro commented May 12, 2023

swiftlang/swift-syntax#1654
@swift-ci Please smoke test

guard let expansion = macroSyntax.asProtocol(
FreestandingMacroExpansionSyntax.self
) else {
print("not on a macro expansion node: \(macroSyntax.debugDescription)")
Copy link
Contributor

Choose a reason for hiding this comment

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

I realize this was already here, but is there something else we could do here instead? We have the diagnostics engine, could we just output a diagnostic? Same with the NULL source location above. Also sometimes we return 1 and other times -1, is that on purpose? Not that it's actually used by the caller...

Happy for this to be a separate PR though, or at least an issue so we're tracking it.

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