Releases: CheekyGhost-Labs/SyntaxSparrow
6.0.0
What's Changed
- Adding
successTypeIsOptionalto Result type - Adding
existentialandopaquesupport to EntityType
Full Changelog: 5.1.1...6.0.0
5.1.1
What's Changed
- Added explicit Swift 6.0.x support with default now being 6.1.x
- Fixed bug where Variable.hasSetter would return true for a comptued property with an explicit get keyword.
- Fixed bug where Variable.isComputed would return false for a comptued property with an explicit get keyword.
Full Changelog: 5.1.0...5.1.1
5.1.0
What's Changed
- [CHORE] Adding
Equatableconformance toSyntaxSourceDetails - [CHORE] Exposing auto-conformance of
AssociatedTypetoModifierAssessing
Full Changelog: 5.0.0...5.1.0
5.0.0
What's Changed
- Actively supporting Swift 6
- Actively supporting Swift 6 language mode
- Updated to latest SwiftSyntax (version 600.0.1)
- via initial [PR from manuelkunzdmde] (#55)
Full Changelog: 4.3.0...5.0.0
4.3.0 - Adding switch statement support
What's Changed
- Adding switch statement support
Basic Usage:
A switch has one or more cases, and a case can have one or more items. For example:
switch thing {
case is SomeType: // one item
case .example(let name), .otherExample(let name): // two items
}currently supported types are:
for item in switchCaseTwo.items {
switch item {
case let literal(value):
case let member(name):
case let isTypePattern(type):
case let valueBindingMember(keyWord, name, elements):
case let innerValueBindingMember(name, elements):
case let valueBinding(keyWord, elements):
case let tuple(elements):
case let unsupported(syntax):
case .unsupported(let syntax):
}
}Full Changelog: 4.2.1...4.3.0
Migrating from Apple swift-syntax to SiftLang
Patch release that migrates from the Apple swift-syntax repo to the SwiftLang repo
Such Convenience: 4.2.0 Minor Release
What's Changed
Primarily this release adds multiple convenience methods to different types based on feedback and usage within projects.
TLDR; List
- Adds conveniences for assessing modifiers on types (such as
isPublicandisFinaletc) - Adds convenience extension for searching collections of modifiers for keywords
- Adds
isComputed,isStored,isThrowing, andisAsyncconvenience getters toVariabletype - Adds
rawOutputTypeconvenience getter toFunction.Signaturetype - Adds
isThrowingandisAsyncconvenience getter toFunctiontype - Adds
isThrowingandisAsyncconvenience to Subscript type - Adds
isThrowingandisAsyncconvenience to Initializer type - Adds
isThrowingandisAsyncconvenience to Closure type - Adds
isThrowingandisAsyncconvenience to Accessor type
Modifier Assessing Conveniences
A protocol named ModifierAssessing was added, which a set of types now conform to. This protocol adds two main conveniences:
Firstly, the conforming type (or any collection where the element type is Modifier) can assess what modifiers are present based on a SwiftSyntax.Keyword value and optional detail value.
For example:
// Collection of `Modifier` types
collection.containsKeyword(.public)
collection.containsKeyword(.private)
collection.containsKeyword(.private, detail: "set")
// ModifierAssessing conforming instance
instance.containsModifierWithKeyword(.public)
instance.containsModifierWithKeyword(.private)
collection.containsKeyword(.private, detail: "set")The protocol also provides some common convenience getters for some modifiers:
isPublicisOpenisPrivateisFilePrivateisFinalisInternal
Where applicable, additional conveniences for types exist. For example on the Variable and Initializer types:
// Variable type
variable.isPrivateSetter
variable.isFilePrivateSetter
// Initializer type
initializer.isConvenience
initializer.isRequiredTypes with conformance are:
ActorClassEnumerationExtensionFunctionProtocolDeclStructureSubscriptTypealiasVariableInitializer- Any collection where the type is
Modifier
Effect Specifier Conveniences:
The Variable, Function, and Subscript types can now ask if they are throwing or async:
instance.isThrowing
instance.isAsyncVariable Conveniences:
The Variable type now also supports assessing if it is a computed or stored property:
variable.isComputed
variable.isStoredSuch Convenience: 4.1.0 Minor Release
What's Changed
Primarily this release adds multiple convenience methods to different types based on feedback and usage within projects.
TLDR; List
- Adds conveniences for assessing modifiers on types (such as
isPublicandisFinaletc) - Adds convenience extension for searching collections of modifiers for keywords
- Adds
isComputed,isStored,isThrowing, andisAsyncconvenience getters toVariabletype - Adds
rawOutputTypeconvenience getter toFunction.Signaturetype - Adds
isThrowingandisAsyncconvenience getter toFunctiontype - Adds
isThrowingandisAsyncconvenience to Subscript type
Modifier Assessing Conveniences
A protocol named ModifierAssessing was added, which a set of types now conform to. This protocol adds two main conveniences:
Firstly, the conforming type (or any collection where the element type is Modifier) can assess what modifiers are present based on a SwiftSyntax.Keyword value and optional detail value.
For example:
// Collection of `Modifier` types
collection.containsKeyword(.public)
collection.containsKeyword(.private)
collection.containsKeyword(.private, detail: "set")
// ModifierAssessing conforming instance
instance.containsModifierWithKeyword(.public)
instance.containsModifierWithKeyword(.private)
collection.containsKeyword(.private, detail: "set")The protocol also provides some common convenience getters for some modifiers:
isPublicisOpenisPrivateisFilePrivateisFinalisInternal
Where applicable, additional conveniences for types exist. For example on the Variable and Initializer types:
// Variable type
variable.isPrivateSetter
variable.isFilePrivateSetter
// Initializer type
initializer.isConvenience
initializer.isRequiredTypes with conformance are:
ActorClassEnumerationExtensionFunctionProtocolDeclStructureSubscriptTypealiasVariableInitializer- Any collection where the type is
Modifier
Effect Specifier Conveniences:
The Variable, Function, and Subscript types can now ask if they are throwing or async:
instance.isThrowing
instance.isAsyncVariable Conveniences:
The Variable type now also supports assessing if it is a computed or stored property:
variable.isComputed
variable.isStored4.0.0
What's Changed
- [CHANGE] Updating closure input to always be tuple or void by @mobrien-ghost in #45
Full Changelog: 3.3.3...4.0.0
Details
Updates the Closure.input type to always be either an EntityType.tuple with one or more elements, or an EntityType.void when empty.
This is due to some confusion when working with closure inputs within function parameter constructs. Because some things like the inout keyword can really only exist on a parameter, and seeing as a closure syntax input is a list of tuple elements, extracting a single element to an EntityType would not provide all the parameter information required while inspecting (inout, isOptional, etc). While the EntityType could have support added for looking up its parent context and resolving things like inout, it felt like it did not belong there as context within a constituent type felt more important.
As this only popped up for the Closure context, it made more sense to assign the element EntityType.tuple when one or more elements are present, rather than extracting the element type from a single input closure. This will ensure that various parameter-based properties are available.
Felt this required a major version bump as consumers may be working with the previous behaviour.