stackotter / swift-macro-toolkit

A powerful toolkit for creating concise and expressive Swift macros
Apache License 2.0
246 stars 15 forks source link

Add some examples #13

Closed Mx-Iris closed 9 months ago

Mx-Iris commented 10 months ago

Hey buddy, thanks to your framework for making it easier for me to write macro code, I've now added some macros I'm using as examples, and I've changed the version control tag exact to from to be compatible with newer versions of swift-syntax

stackotter commented 10 months ago

Thanks for the PR, I'm glad that you're finding the library useful! Changing the tag from exact to from is definitely a good idea now that Swift Syntax is stabilising.

In regards to the new example macros, I think these are great use-cases, however the macros are all very similar so they don't individually provide too much use as separate examples. I think the AddAsyncInterface and AddAsyncImplementation macros should be able to be merged into a single macro, and the AllMembers versions should be able to be merged into a single macro too. Happy to give more pointers on condensing the macros if needed!

Mx-Iris commented 10 months ago

@stackotter Yes, I just need to check whether the function definition contains the body to distinguish between interface and implementation. I have changed it according to what you said