Skip to content

Commit 910be3a

Browse files
committed
adding support for Swift 6.0
1 parent 2d983f6 commit 910be3a

File tree

118 files changed

+368
-230
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+368
-230
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "Swift",
3+
"image": "swift:6.0",
4+
"features": {
5+
"ghcr.io/devcontainers/features/common-utils:2": {
6+
"installZsh": "false",
7+
"username": "vscode",
8+
"upgradePackages": "false"
9+
},
10+
"ghcr.io/devcontainers/features/git:1": {
11+
"version": "os-provided",
12+
"ppa": "false"
13+
}
14+
},
15+
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
16+
"runArgs": [
17+
"--cap-add=SYS_PTRACE",
18+
"--security-opt",
19+
"seccomp=unconfined"
20+
],
21+
// Configure tool-specific properties.
22+
"customizations": {
23+
// Configure properties specific to VS Code.
24+
"vscode": {
25+
// Set *default* container specific settings.json values on container create.
26+
"settings": {
27+
"lldb.library": "/usr/lib/liblldb.so"
28+
},
29+
// Add the IDs of extensions you want installed when the container is created.
30+
"extensions": [
31+
"sswg.swift-lang"
32+
]
33+
}
34+
},
35+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
36+
// "forwardPorts": [],
37+
38+
// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
39+
"remoteUser": "root"
40+
}

.github/workflows/SyntaxKit.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
matrix:
1616
os: [noble, jammy]
1717
swift:
18+
- version: "6.0"
1819
- version: "6.1"
1920
- version: "6.1"
2021
nightly: true

Package.swift

Lines changed: 79 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,80 @@
1-
// swift-tools-version: 6.1
1+
// swift-tools-version: 6.0
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
55

6+
// MARK: - Swift Settings Configuration
7+
8+
let swiftSettings: [SwiftSetting] = [
9+
// Swift 6.2 Upcoming Features (not yet enabled by default)
10+
// SE-0335: Introduce existential `any`
11+
.enableUpcomingFeature("ExistentialAny"),
12+
// SE-0409: Access-level modifiers on import declarations
13+
.enableUpcomingFeature("InternalImportsByDefault"),
14+
// SE-0444: Member import visibility (Swift 6.1+)
15+
.enableUpcomingFeature("MemberImportVisibility"),
16+
// SE-0413: Typed throws
17+
.enableUpcomingFeature("FullTypedThrows"),
18+
19+
// Experimental Features (stable enough for use)
20+
// SE-0426: BitwiseCopyable protocol
21+
.enableExperimentalFeature("BitwiseCopyable"),
22+
// SE-0432: Borrowing and consuming pattern matching for noncopyable types
23+
.enableExperimentalFeature("BorrowingSwitch"),
24+
// Extension macros
25+
.enableExperimentalFeature("ExtensionMacros"),
26+
// Freestanding expression macros
27+
.enableExperimentalFeature("FreestandingExpressionMacros"),
28+
// Init accessors
29+
.enableExperimentalFeature("InitAccessors"),
30+
// Isolated any types
31+
.enableExperimentalFeature("IsolatedAny"),
32+
// Move-only classes
33+
.enableExperimentalFeature("MoveOnlyClasses"),
34+
// Move-only enum deinits
35+
.enableExperimentalFeature("MoveOnlyEnumDeinits"),
36+
// SE-0429: Partial consumption of noncopyable values
37+
.enableExperimentalFeature("MoveOnlyPartialConsumption"),
38+
// Move-only resilient types
39+
.enableExperimentalFeature("MoveOnlyResilientTypes"),
40+
// Move-only tuples
41+
.enableExperimentalFeature("MoveOnlyTuples"),
42+
// SE-0427: Noncopyable generics
43+
.enableExperimentalFeature("NoncopyableGenerics"),
44+
// One-way closure parameters
45+
// .enableExperimentalFeature("OneWayClosureParameters"),
46+
// Raw layout types
47+
.enableExperimentalFeature("RawLayout"),
48+
// Reference bindings
49+
.enableExperimentalFeature("ReferenceBindings"),
50+
// SE-0430: sending parameter and result values
51+
.enableExperimentalFeature("SendingArgsAndResults"),
52+
// Symbol linkage markers
53+
.enableExperimentalFeature("SymbolLinkageMarkers"),
54+
// Transferring args and results
55+
.enableExperimentalFeature("TransferringArgsAndResults"),
56+
// SE-0393: Value and Type Parameter Packs
57+
.enableExperimentalFeature("VariadicGenerics"),
58+
// Warn unsafe reflection
59+
.enableExperimentalFeature("WarnUnsafeReflection"),
60+
61+
// Enhanced compiler checking
62+
.unsafeFlags([
63+
// Enable concurrency warnings
64+
"-warn-concurrency",
65+
// Enable actor data race checks
66+
"-enable-actor-data-race-checks",
67+
// Complete strict concurrency checking
68+
"-strict-concurrency=complete",
69+
// Enable testing support
70+
"-enable-testing",
71+
// Warn about functions with >100 lines
72+
"-Xfrontend", "-warn-long-function-bodies=100",
73+
// Warn about slow type checking expressions
74+
"-Xfrontend", "-warn-long-expression-type-checking=100"
75+
])
76+
]
77+
678
// swiftlint:disable:next explicit_top_level_acl explicit_acl
779
let package = Package(
880
name: "SyntaxKit",
@@ -34,15 +106,18 @@ let package = Package(
34106
.product(name: "SwiftSyntax", package: "swift-syntax"),
35107
.product(name: "SwiftOperators", package: "swift-syntax"),
36108
.product(name: "SwiftParser", package: "swift-syntax")
37-
]
109+
],
110+
swiftSettings: swiftSettings
38111
),
39112
.executableTarget(
40113
name: "skit",
41-
dependencies: ["SyntaxKit"]
114+
dependencies: ["SyntaxKit"],
115+
swiftSettings: swiftSettings
42116
),
43117
.testTarget(
44118
name: "SyntaxKitTests",
45-
dependencies: ["SyntaxKit"]
119+
dependencies: ["SyntaxKit"],
120+
swiftSettings: swiftSettings
46121
),
47122
]
48123
)

Sources/SyntaxKit/Attributes/Attribute.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
// OTHER DEALINGS IN THE SOFTWARE.
2828
//
2929

30-
import SwiftSyntax
30+
public import SwiftSyntax
3131

3232
/// Internal representation of a Swift attribute with its arguments.
3333
internal struct AttributeInfo {

Sources/SyntaxKit/Attributes/Trivia+Comments.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
// OTHER DEALINGS IN THE SOFTWARE.
2828
//
2929

30-
import SwiftSyntax
30+
public import SwiftSyntax
3131

3232
extension Trivia {
3333
/// Extracts comment strings from the trivia collection.

Sources/SyntaxKit/CodeBlocks/CodeBlock+ExprSyntax.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
// OTHER DEALINGS IN THE SOFTWARE.
2828
//
2929

30-
import SwiftSyntax
30+
public import SwiftSyntax
3131

3232
extension CodeBlock {
3333
/// Attempts to treat this `CodeBlock` as an expression and return its `ExprSyntax` form.

Sources/SyntaxKit/CodeBlocks/CodeBlock+Generate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
//
2929

3030
import Foundation
31-
import SwiftSyntax
31+
public import SwiftSyntax
3232

3333
extension CodeBlock {
3434
/// Generates the Swift code for the ``CodeBlock``.

Sources/SyntaxKit/CodeBlocks/CodeBlockItemSyntax.Item.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
// OTHER DEALINGS IN THE SOFTWARE.
2828
//
2929

30-
import SwiftSyntax
30+
public import SwiftSyntax
3131

3232
extension CodeBlockItemSyntax.Item {
3333
/// Creates a `CodeBlockItemSyntax.Item` from a `SyntaxProtocol`.

Sources/SyntaxKit/CodeBlocks/CommentedCodeBlock.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
//
2929

3030
import Foundation
31-
import SwiftSyntax
31+
public import SwiftSyntax
3232

3333
// MARK: - Wrapper `CodeBlock` that injects leading trivia
3434

Sources/SyntaxKit/CodeBlocks/EmptyCodeBlock.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
//
2929

3030
import Foundation
31-
import SwiftSyntax
31+
public import SwiftSyntax
3232

3333
/// An empty code block that generates no syntax.
3434
internal struct EmptyCodeBlock: CodeBlock, Sendable, Equatable {

0 commit comments

Comments
 (0)