Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new AutoRoutable macro that automatically generates an id property for enum cases, replacing the previous stringify macro functionality. The macro simplifies routing by providing string identifiers for each enum case.
- Replaces StringifyMacro with AutoRoutableMacro for enum route identification
- Adds comprehensive test coverage including macro expansion and runtime behavior tests
- Updates package configuration and adds CI workflow for automated testing
Reviewed Changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Sources/OversizeMacroMacros/AutoRoutableMacro.swift | Implements the AutoRoutable macro that generates id property for enum cases |
| Sources/OversizeMacro/OversizeMacro.swift | Defines the public AutoRoutable macro interface |
| Sources/OversizeMacroMacros/OversizeMacroPlugin.swift | Updates compiler plugin to provide AutoRoutableMacro |
| Sources/OversizeMacroMacros/OversizeMacroMacro.swift | Removes old StringifyMacro implementation |
| Tests/OversizeMacroTests/AutoRoutableTests.swift | Adds comprehensive test coverage for macro expansion and runtime behavior |
| Sources/OversizeMacroClient/main.swift | Updates client example to demonstrate AutoRoutable usage |
| Package.swift | Updates dependencies and adds test target configuration |
| .swiftformat | Adds SwiftFormat configuration for code formatting |
| .github/workflows/ci.yml | Adds CI workflow for automated testing and building |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| public static func expansion<Declaration: DeclGroupSyntax, Context: MacroExpansionContext>( | ||
| of node: AttributeSyntax, | ||
| providingMembersOf declaration: Declaration, | ||
| conformingTo _: [TypeSyntax], | ||
| in context: Context | ||
| ) throws -> [DeclSyntax] { | ||
| try expansion(of: node, providingMembersOf: declaration, in: context) | ||
| } |
There was a problem hiding this comment.
This method simply delegates to another expansion method but discards the conformingTo and context parameters. Consider removing this wrapper method and using the simpler expansion method directly, or document why this delegation is necessary.
No description provided.