Skip to content
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

MacroSystem should handle fully qualified macro name #2874

Open
ApolloZhu opened this issue Oct 6, 2024 · 1 comment
Open

MacroSystem should handle fully qualified macro name #2874

ApolloZhu opened this issue Oct 6, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ApolloZhu
Copy link
Contributor

Description

When unit testing macro expansions using SwiftSyntaxMacroExpansion, there's no way for it to expand fully qualified attached macro

let attributeName = attribute.attributeName.as(IdentifierTypeSyntax.self)?.name.text,

Steps to Reproduce

Try to write a unit test that expands a fully qualified attached macro:

@MyModule.MyMacro var hello = "world"

Neither of the following in the dictionary works with the SyntaxProtocol.expand function

[
    "MyMacro": MyMacro.self,
    "MyModule.MyMacro": MyMacro.self,
]
@ApolloZhu ApolloZhu added the bug Something isn't working label Oct 6, 2024
@ApolloZhu
Copy link
Contributor Author

Tracked in Apple’s issue tracker as rdar://137364509

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant