SwiftSyntaxSugar
Helpful extensions for SwiftSyntax.
Install / Use
/learn @fetch-rewards/SwiftSyntaxSugarREADME
SwiftSyntaxSugar
SwiftSyntaxSugar is a library that provides syntactic sugar and helpful extensions for SwiftSyntax.
The purpose of this library is to improve the readability and maintainability of code written using SwiftSyntax.
Example
<table> <tr> <td> With <code>SwiftSyntaxSugar</code> </td> <td> Without <code>SwiftSyntaxSugar</code> </td> </tr> <tr> <td>protocolDeclaration.isActorConstrained
</td>
<td>
let isProtocolActorConstrained = protocolDeclaration.inheritanceClause?.inheritedTypes.contains { inheritedType in
let identifierType = inheritedType.type.as(IdentifierTypeSyntax.self)
return identifierType.name.tokenKind == .identifier("Actor")
} ?? false
</td>
</tr>
</table>
Installation
To add SwiftSyntaxSugar to a Swift package manifest file:
- Add the
SwiftSyntaxSugarpackage to your package'sdependencies:.package( url: "https://github.com/fetch-rewards/SwiftSyntaxSugar.git", from: "<#latest SwiftSyntaxSugar tag#>" ) - Add the
SwiftSyntaxSugarproduct to your target'sdependencies:.product(name: "SwiftSyntaxSugar", package: "SwiftSyntaxSugar")
Usage
- Import
SwiftSyntaxSugar:import SwiftSyntaxSugar - Use
SwiftSyntaxexactly how you normally would!
Contributing
The simplest way to contribute to this project is by opening an issue.
If you would like to contribute code to this project, please read our Contributing Guidelines.
By opening an issue or contributing code to this project, you agree to follow our Code of Conduct.
License
This library is released under the MIT license. See LICENSE for details.
Related Skills
node-connect
337.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
337.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.1kCommit, push, and open a PR
