Skip to content

Commit 68c3fa9

Browse files
committed
Adding Sendable
1 parent e09ec8d commit 68c3fa9

38 files changed

+55
-57
lines changed

Sources/SyntaxKit/CodeBlocks/CodeBlockBuilder.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import Foundation
3131

3232
/// A protocol for types that can build a ``CodeBlock``.
33-
public protocol CodeBlockBuilder {
33+
public protocol CodeBlockBuilder: Sendable, Equatable {
3434
/// The type of ``CodeBlock`` that this builder creates.
3535
associatedtype Result: CodeBlock
3636
/// Builds the ``CodeBlock``.

Sources/SyntaxKit/CodeBlocks/CodeBlockBuilderResult.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import Foundation
3131

3232
/// A result builder for creating arrays of ``CodeBlock``s.
3333
@resultBuilder
34-
public enum CodeBlockBuilderResult {
34+
public enum CodeBlockBuilderResult: Sendable {
3535
/// Builds a block of ``CodeBlock``s.
3636
public static func buildBlock(_ components: CodeBlock...) -> [CodeBlock] {
3737
components

Sources/SyntaxKit/CodeBlocks/EmptyCodeBlock.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
import Foundation
3131
import SwiftSyntax
3232

33-
/// An empty ``CodeBlock``.
34-
public struct EmptyCodeBlock: CodeBlock {
33+
/// An empty code block that generates no syntax.
34+
internal struct EmptyCodeBlock: CodeBlock, Sendable, Equatable {
3535
/// The syntax for an empty code block.
36-
public var syntax: SyntaxProtocol {
36+
internal var syntax: SyntaxProtocol {
3737
StringSegmentSyntax(content: .unknown(""))
3838
}
3939
}

Sources/SyntaxKit/CodeBlocks/ExprCodeBlock.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import SwiftSyntax
3131

3232
/// A protocol for types that can be represented as an ExprSyntax node.
33-
public protocol ExprCodeBlock {
33+
public protocol ExprCodeBlock: Sendable {
3434
/// The SwiftSyntax expression representation of the code block.
3535
var exprSyntax: ExprSyntax { get }
3636
}

Sources/SyntaxKit/Collections/DictionaryValue.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@
2929

3030
import SwiftSyntax
3131

32-
/// A protocol for types that can be used as dictionary keys or values.
33-
/// This includes both Literal types and CodeBlock types that can be converted to expressions.
34-
public protocol DictionaryValue {
32+
/// A protocol for types that can be used as dictionary values.
33+
public protocol DictionaryValue: Sendable {
3534
/// The expression syntax representation of this dictionary value.
3635
var exprSyntax: ExprSyntax { get }
3736
}

Sources/SyntaxKit/ControlFlow/For.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import SwiftSyntax
3131

3232
/// A `for-in` loop statement.
33-
public struct For: CodeBlock {
33+
public struct For: CodeBlock, Sendable {
3434
private let pattern: any CodeBlock & PatternConvertible
3535
private let sequence: CodeBlock
3636
private let whereClause: CodeBlock?

Sources/SyntaxKit/ControlFlow/Guard.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import SwiftSyntax
3131

3232
/// A `guard … else { … }` statement.
33-
public struct Guard: CodeBlock {
33+
public struct Guard: CodeBlock, Sendable {
3434
private let conditions: [CodeBlock]
3535
private let elseBody: [CodeBlock]
3636

Sources/SyntaxKit/ControlFlow/If.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929

3030
import SwiftSyntax
3131

32-
/// An `if` statement.
33-
public struct If: CodeBlock {
32+
/// A Swift `if` statement.
33+
public struct If: CodeBlock, Sendable {
3434
internal let conditions: [CodeBlock]
3535
internal let body: [CodeBlock]
3636
internal let elseBody: [CodeBlock]?

Sources/SyntaxKit/ControlFlow/Switch.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929

3030
import SwiftSyntax
3131

32-
/// A `switch` statement.
33-
public struct Switch: CodeBlock {
32+
/// A Swift `switch` statement.
33+
public struct Switch: CodeBlock, Sendable {
3434
private let expression: CodeBlock
3535
private let cases: [CodeBlock]
3636

Sources/SyntaxKit/ControlFlow/While.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929

3030
import SwiftSyntax
3131

32-
/// A `while` loop statement.
33-
public struct While: CodeBlock {
34-
public enum Kind {
32+
/// A Swift `while` loop.
33+
public struct While: CodeBlock, Sendable {
34+
public enum Kind: Sendable {
3535
case `while`
3636
case repeatWhile
3737
}

0 commit comments

Comments
 (0)