Skip to content

Releases: CheekyGhost-Labs/SyntaxSparrow

6.1.0

04 Mar 07:15

Choose a tag to compare

  • Adds support for throws clauese identifier type to EffectsSpecifiers type.

For example,

func executeOrder66() throws(SpecificErrorType) {}

can be accessed via:

// Function type
function.signature.effectSpecifiers?.throwsSpecifier // String? - "SpecificErrorType"
function.throwsIdentifier // String? - "SpecificErrorType"

6.0.2

03 Mar 13:59

Choose a tag to compare

  • Fixes bug where isOptional was returning incorrect status under certain conditions.

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