Skip to content

Releases: CheekyGhost-Labs/SyntaxSparrow

6.0.0

11 Nov 12:11

Choose a tag to compare

What's Changed

  • Adding successTypeIsOptional to Result type
  • Adding existential and opaque support to EntityType

Full Changelog: 5.1.1...6.0.0

5.1.1

29 Jun 04:05
a6f5fda

Choose a tag to compare

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

04 Apr 01:58
60c0896

Choose a tag to compare

What's Changed

  • [CHORE] Adding Equatable conformance to SyntaxSourceDetails
  • [CHORE] Exposing auto-conformance of AssociatedType to ModifierAssessing

Full Changelog: 5.0.0...5.1.0

5.0.0

23 Oct 11:09

Choose a tag to compare

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

27 Sep 14:31
442fa1b

Choose a tag to compare

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

29 Jul 22:37
30d9b4a

Choose a tag to compare

Patch release that migrates from the Apple swift-syntax repo to the SwiftLang repo

Such Convenience: 4.2.0 Minor Release

09 May 17:17

Choose a tag to compare

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 isPublic and isFinal etc)
  • Adds convenience extension for searching collections of modifiers for keywords
  • Adds isComputed, isStored, isThrowing, and isAsync convenience getters to Variable type
  • Adds rawOutputType convenience getter to Function.Signature type
  • Adds isThrowing and isAsync convenience getter to Function type
  • Adds isThrowing and isAsync convenience to Subscript type
  • Adds isThrowing and isAsync convenience to Initializer type
  • Adds isThrowing and isAsync convenience to Closure type
  • Adds isThrowing and isAsync convenience 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:

  • isPublic
  • isOpen
  • isPrivate
  • isFilePrivate
  • isFinal
  • isInternal

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.isRequired

Types with conformance are:

  • Actor
  • Class
  • Enumeration
  • Extension
  • Function
  • ProtocolDecl
  • Structure
  • Subscript
  • Typealias
  • Variable
  • Initializer
  • 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.isAsync

Variable Conveniences:

The Variable type now also supports assessing if it is a computed or stored property:

variable.isComputed
variable.isStored

Such Convenience: 4.1.0 Minor Release

09 May 16:31
f902113

Choose a tag to compare

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 isPublic and isFinal etc)
  • Adds convenience extension for searching collections of modifiers for keywords
  • Adds isComputed, isStored, isThrowing, and isAsync convenience getters to Variable type
  • Adds rawOutputType convenience getter to Function.Signature type
  • Adds isThrowing and isAsync convenience getter to Function type
  • Adds isThrowing and isAsync convenience 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:

  • isPublic
  • isOpen
  • isPrivate
  • isFilePrivate
  • isFinal
  • isInternal

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.isRequired

Types with conformance are:

  • Actor
  • Class
  • Enumeration
  • Extension
  • Function
  • ProtocolDecl
  • Structure
  • Subscript
  • Typealias
  • Variable
  • Initializer
  • 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.isAsync

Variable Conveniences:

The Variable type now also supports assessing if it is a computed or stored property:

variable.isComputed
variable.isStored

4.0.0

28 Apr 14:57
d12a352

Choose a tag to compare

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.