Skip to content

MacroSystem should handle fully qualified macro name #2874

Open
@ApolloZhu

Description

@ApolloZhu

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,
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions