Swiftly Swift manipulation... with Swift
summary
Builds a small command‑line tool that parses Swift source with SwiftSyntax, collects method declarations via a visitor, sorts them by access level and kind, and uses a rewriter to replace nodes so function bodies and spacing remain intact. Optionally queries the project IndexStoreDB to find the class file instead of requiring a path. Claims full source round‑trip so trivia preserved (comments/whitespace survive). Publishes source on GitHub and lists limitations and homework for sorting properties and extensions.
AI-written summary · about
chapters (12)
- 0:00Start
- 0:17Agenda
- 1:02PROBLEM
- 4:08HOW? HOW?
- 4:31The Internet
- 9:11SwiftSyntax
- 10:37PLAN
- 11:19Indexer
- 13:13Processor
- 15:30ONE MORE THING
- 19:01ONE MISSING THING
- 21:43THANK YOU
related talks
33mMaking Your Own Tools Using SwiftSyntax
22mImproving Swift Tools with libSyntax
06mFundamentals for Building Convenience with SwiftSyntax
27mSwiftSyntax: for good and evil
27mAST Meta-programming
31mMake your own code formatter in Swift
21mUnlock the Potential of Swift Code Generation
38mType-safe meta programming in Swift? Lets talk about Sourcery.
