Skip to content

Commit 04d632f

Browse files
Update SwiftSyntax. (#190)
* Update SwiftSyntax. * wip * re-record snapshots * wip * fix * disable wasm for now * wip * wip * wip * Disable Wasm CI for now --------- Co-authored-by: Stephen Celis <[email protected]>
1 parent f5f64da commit 04d632f

File tree

8 files changed

+116
-109
lines changed

8 files changed

+116
-109
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
config: ['debug', 'release']
2323
xcode: ['14.3.1', '15.0.1']
2424
steps:
25-
- uses: actions/checkout@v3
25+
- uses: actions/checkout@v4
2626
- name: Select Xcode ${{ matrix.xcode }}
2727
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
2828
- name: Skip macro validation
@@ -38,7 +38,7 @@ jobs:
3838
# name: Integration (UI Tests)
3939
# runs-on: macos-13
4040
# steps:
41-
# - uses: actions/checkout@v3
41+
# - uses: actions/checkout@v4
4242
# - name: Select Xcode 14.3.1
4343
# run: sudo xcode-select -s /Applications/Xcode_14.3.1.app
4444
# - name: Run tests
@@ -48,23 +48,18 @@ jobs:
4848
name: Linux
4949
runs-on: ubuntu-latest
5050
steps:
51-
- uses: actions/checkout@v3
51+
- uses: actions/checkout@v4
5252
- name: Run tests
5353
run: make test-swift
5454

55-
wasm:
56-
name: Wasm
57-
runs-on: ubuntu-latest
58-
strategy:
59-
matrix:
60-
include:
61-
- { toolchain: wasm-5.7.1-RELEASE }
62-
steps:
63-
- uses: actions/checkout@v3
64-
- run: echo "${{ matrix.toolchain }}" > .swift-version
65-
- uses: swiftwasm/[email protected]
66-
with:
67-
shell-action: carton test --environment node
55+
# wasm:
56+
# name: Wasm
57+
# runs-on: ubuntu-latest
58+
# steps:
59+
# - uses: actions/checkout@v4
60+
# - uses: swiftwasm/[email protected]
61+
# with:
62+
# shell-action: carton test
6863

6964
# windows:
7065
# name: Windows
@@ -75,7 +70,7 @@ jobs:
7570
# branch: swift-5.8-release
7671
# tag: 5.8-RELEASE
7772

78-
# - uses: actions/checkout@v3
73+
# - uses: actions/checkout@v4
7974
# - name: Run tests
8075
# run: swift test
8176
# - name: Run tests (release)
@@ -89,7 +84,7 @@ jobs:
8984
container:
9085
image: ${{ matrix.image }}
9186
steps:
92-
- uses: actions/checkout@v3
87+
- uses: actions/checkout@v4
9388
- name: Build for static-stdlib (debug)
9489
run: swift build -c debug --static-swift-stdlib
9590
- name: Build for static-stdlib (release)

Package.resolved

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ let package = Package(
2121
.package(url: "https://github.com/pointfreeco/combine-schedulers", from: "1.0.0"),
2222
.package(url: "https://github.com/pointfreeco/swift-clocks", from: "1.0.0"),
2323
.package(url: "https://github.com/pointfreeco/swift-concurrency-extras", from: "1.0.0"),
24-
.package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", from: "1.0.0"),
24+
.package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", branch: "main"),
2525
],
2626
targets: [
2727
.target(

[email protected]

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@ let package = Package(
2222
),
2323
],
2424
dependencies: [
25-
.package(url: "https://github.com/apple/swift-syntax", from: "509.0.0"),
25+
.package(url: "https://github.com/apple/swift-syntax", "509.0.0"..<"511.0.0"),
2626
.package(url: "https://github.com/google/swift-benchmark", from: "0.1.0"),
2727
.package(url: "https://github.com/pointfreeco/combine-schedulers", from: "1.0.0"),
2828
.package(url: "https://github.com/pointfreeco/swift-clocks", from: "1.0.0"),
2929
.package(url: "https://github.com/pointfreeco/swift-concurrency-extras", from: "1.0.0"),
30-
.package(url: "https://github.com/pointfreeco/swift-macro-testing", from: "0.2.0"),
31-
.package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", from: "1.0.0"),
30+
.package(url: "https://github.com/pointfreeco/xctest-dynamic-overlay", branch: "main"),
3231
],
3332
targets: [
3433
.target(
@@ -67,13 +66,6 @@ let package = Package(
6766
.product(name: "SwiftCompilerPlugin", package: "swift-syntax"),
6867
]
6968
),
70-
.testTarget(
71-
name: "DependenciesMacrosPluginTests",
72-
dependencies: [
73-
"DependenciesMacrosPlugin",
74-
.product(name: "MacroTesting", package: "swift-macro-testing"),
75-
]
76-
),
7769
.executableTarget(
7870
name: "swift-dependencies-benchmark",
7971
dependencies: [
@@ -84,21 +76,36 @@ let package = Package(
8476
]
8577
)
8678

87-
#if !os(Windows)
88-
// Add the documentation compiler plugin if possible
79+
#if !os(macOS) && !os(WASI)
80+
package.products.append(
81+
.library(
82+
name: "DependenciesTestObserver",
83+
type: .dynamic,
84+
targets: ["DependenciesTestObserver"]
85+
)
86+
)
87+
#endif
88+
89+
#if !os(WASI)
8990
package.dependencies.append(
90-
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0")
91+
.package(url: "https://github.com/pointfreeco/swift-macro-testing", from: "0.2.0")
9192
)
93+
package.targets.append(contentsOf: [
94+
.testTarget(
95+
name: "DependenciesMacrosPluginTests",
96+
dependencies: [
97+
"DependenciesMacrosPlugin",
98+
.product(name: "MacroTesting", package: "swift-macro-testing"),
99+
]
100+
),
101+
])
92102
#endif
93103

94-
#if !os(macOS) && !os(WASI)
95-
package.products.append(
96-
.library(
97-
name: "DependenciesTestObserver",
98-
type: .dynamic,
99-
targets: ["DependenciesTestObserver"]
104+
#if !os(Windows)
105+
// Add the documentation compiler plugin if possible
106+
package.dependencies.append(
107+
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0")
100108
)
101-
)
102109
#endif
103110

104111
//for target in package.targets {

Sources/DependenciesMacrosPlugin/DependencyClientMacro.swift

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,14 @@ public enum DependencyClientMacro: MemberAttributeMacro, MemberMacro {
158158
attributedTypeSyntax.attributes.append(
159159
.attribute("@escaping").with(\.trailingTrivia, .space)
160160
)
161-
binding.typeAnnotation?.type = attributedTypeSyntax.cast(TypeSyntax.self)
161+
binding.typeAnnotation?.type = TypeSyntax(attributedTypeSyntax)
162162
} else if let typeSyntax = type.as(FunctionTypeSyntax.self) {
163-
binding.typeAnnotation?.type = AttributedTypeSyntax(
164-
attributes: [.attribute("@escaping").with(\.trailingTrivia, .space)],
165-
baseType: typeSyntax
163+
binding.typeAnnotation?.type = TypeSyntax(
164+
AttributedTypeSyntax(
165+
attributes: [.attribute("@escaping").with(\.trailingTrivia, .space)],
166+
baseType: typeSyntax
167+
)
166168
)
167-
.cast(TypeSyntax.self)
168169
} else if binding.typeAnnotation == nil {
169170
binding.pattern.trailingTrivia = ""
170171
binding.typeAnnotation = TypeAnnotationSyntax(

Sources/DependenciesMacrosPlugin/DependencyEndpointMacro.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public enum DependencyEndpointMacro: AccessorMacro, PeerMacro {
190190

191191
let privateProperty = property.privatePrefixed("_", unimplementedDefault: unimplementedDefault)
192192

193-
return decls + [privateProperty.cast(DeclSyntax.self)]
193+
return decls + [DeclSyntax(privateProperty)]
194194
}
195195
}
196196

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"configurations" : [
3+
{
4+
"id" : "53C60DBA-2CDB-4A5C-9411-7C681BEAAEF4",
5+
"name" : "Test Scheme Action",
6+
"options" : {
7+
8+
}
9+
}
10+
],
11+
"defaultOptions" : {
12+
"codeCoverage" : false
13+
},
14+
"testTargets" : [
15+
{
16+
"target" : {
17+
"containerPath" : "container:",
18+
"identifier" : "DependenciesMacrosPluginTests",
19+
"name" : "DependenciesMacrosPluginTests"
20+
}
21+
}
22+
],
23+
"version" : 1
24+
}

0 commit comments

Comments
 (0)