Skip to content

Commit e2353f8

Browse files
committed
chore(deps): upgrade swift-syntax
1 parent fc60a28 commit e2353f8

File tree

6 files changed

+9
-22
lines changed

6 files changed

+9
-22
lines changed

Package.resolved

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"kind" : "remoteSourceControl",
1515
"location" : "https://github.com/apple/swift-syntax.git",
1616
"state" : {
17-
"revision" : "cb53fa1bd3219b0b23ded7dfdd3b2baff266fd25",
18-
"version" : "600.0.0"
17+
"revision" : "0687f71944021d616d34d922343dcef086855920",
18+
"version" : "600.0.1"
1919
}
2020
}
2121
],

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ let package = Package(
2020
],
2121
dependencies: [
2222
// Depend on the Swift 5.9 release of SwiftSyntax
23-
.package(url: "https://github.com/apple/swift-syntax.git", from: "600.0.0"),
23+
.package(url: "https://github.com/apple/swift-syntax.git", from: "600.0.1"),
2424
.package(url: "https://github.com/vadymmarkov/Fakery", from: "5.1.0")
2525
],
2626
targets: [

Sources/LoremSwiftifyMacros/LoremSwiftifyMacro.swift

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@ public enum LoremSwiftifyMacro: ExtensionMacro {
2424
if !declaration.is(StructDeclSyntax.self)
2525
&& !declaration.is(ClassDeclSyntax.self)
2626
&& !declaration.is(EnumDeclSyntax.self) {
27-
28-
context.diagnose(.init(node: declaration, message: LoremSwiftifyMacroDiagnostic.unsupportedType))
29-
30-
return []
27+
throw LoremSwiftifyMacroDiagnostic.unsupportedType
3128
}
3229

3330
let extensionDecl = try ExtensionDeclSyntax(
@@ -45,18 +42,14 @@ public enum LoremSwiftifyMacro: ExtensionMacro {
4542
in: context,
4643
type: type
4744
)
48-
}
49-
50-
if let structDecl = declaration.as(StructDeclSyntax.self) {
45+
} else if let structDecl = declaration.as(StructDeclSyntax.self) {
5146
try LoremSwiftifyStruct.expansion(
5247
of: node,
5348
providingMembersOf: structDecl,
5449
in: context,
5550
type: type
5651
)
57-
}
58-
59-
if let enumDecl = declaration.as(EnumDeclSyntax.self) {
52+
} else if let enumDecl = declaration.as(EnumDeclSyntax.self) {
6053
try LoremSwiftifyEnum.expansion(
6154
of: node,
6255
providingMembersOf: enumDecl,

Sources/LoremSwiftifyMacros/SupportedTypes/LoremSwiftifyClass.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ class LoremSwiftifyClass {
1919
type: some SwiftSyntax.TypeSyntaxProtocol
2020
) throws -> DeclSyntax {
2121
if declaration.memberBlock.members.isEmpty {
22-
context.diagnose(.init(node: declaration, message: LoremSwiftifyMacroDiagnostic.noMemberToMock))
23-
24-
return ""
22+
throw LoremSwiftifyMacroDiagnostic.noMemberToMock
2523
}
2624

2725
return try LoremSwiftifyMacroParsingShared.handleClassOrStructDeclSyntax(

Sources/LoremSwiftifyMacros/SupportedTypes/LoremSwiftifyEnum.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ class LoremSwiftifyEnum {
2323
}
2424

2525
if cases.isEmpty {
26-
context.diagnose(.init(node: declaration, message: LoremSwiftifyMacroDiagnostic.noEnumCase))
27-
28-
return ""
26+
throw LoremSwiftifyMacroDiagnostic.noEnumCase
2927
}
3028

3129
let caseExpr = generateEnumCreationFunctionBody(for: cases)

Sources/LoremSwiftifyMacros/SupportedTypes/LoremSwiftifyStruct.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ class LoremSwiftifyStruct {
1919
type: some SwiftSyntax.TypeSyntaxProtocol
2020
) throws -> DeclSyntax {
2121
if declaration.memberBlock.members.isEmpty {
22-
context.diagnose(.init(node: declaration, message: LoremSwiftifyMacroDiagnostic.noMemberToMock))
23-
24-
return ""
22+
throw LoremSwiftifyMacroDiagnostic.noMemberToMock
2523
}
2624

2725
return try LoremSwiftifyMacroParsingShared.handleClassOrStructDeclSyntax(

0 commit comments

Comments
 (0)