Skip to content

Commit c247962

Browse files
committed
Remove parameter that is not used
1 parent 547a776 commit c247962

File tree

2 files changed

+289
-505
lines changed

2 files changed

+289
-505
lines changed

Sources/SwiftSyntaxBuilder/Buildables.swift.gyb

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ extension ${kind}Buildable {
5959
func build${kind}(format: Format) -> ${build_kind} {
6060
build${kind}(format: format, leadingTrivia: nil)
6161
}
62+
6263
% end
6364
public func buildSyntax(format: Format) -> Syntax {
6465
buildSyntax(format: format, leadingTrivia: nil)
@@ -68,18 +69,13 @@ extension ${kind}Buildable {
6869
Syntax(build${kind}(format: format, leadingTrivia: leadingTrivia))
6970
}
7071

71-
public func build${kind}List(format: Format) -> [${build_kind}] {
72-
build${kind}List(format: format, leadingTrivia: nil)
73-
}
74-
75-
public func build${kind}List(format: Format, leadingTrivia: Trivia?) -> [${build_kind}] {
72+
public func build${kind}List(format: Format, leadingTrivia: Trivia? = nil) -> [${build_kind}] {
7673
[build${kind}(format: format, leadingTrivia: leadingTrivia)]
7774
}
7875
}
7976

8077
% end
8178
% end
82-
8379
// MARK: - Buildables
8480

8581
% for node in SYNTAX_NODES:
@@ -125,8 +121,7 @@ public struct ${node.syntax_kind}: ${node.base_kind}Buildable {
125121
)
126122

127123
if let leadingTrivia = leadingTrivia {
128-
return ${node.swift_syntax_kind}
129-
.withLeadingTrivia(leadingTrivia)
124+
return ${node.swift_syntax_kind}.withLeadingTrivia(leadingTrivia)
130125
}
131126

132127
return ${node.swift_syntax_kind}
@@ -150,7 +145,7 @@ public struct ${node.syntax_kind}: SyntaxBuildable {
150145
self.elements = elements
151146
}
152147

153-
public func build${node.syntax_kind}(format: Format, leadingTrivia: Trivia? = nil) -> ${node.syntax_kind}Syntax {
148+
public func build${node.syntax_kind}(format: Format) -> ${node.syntax_kind}Syntax {
154149
% if not node.is_token():
155150
% leading_trivia = 'nil'
156151
% if node.elements_separated_by_newline:
@@ -165,7 +160,7 @@ public struct ${node.syntax_kind}: SyntaxBuildable {
165160
}
166161

167162
public func buildSyntax(format: Format, leadingTrivia: Trivia? = nil) -> Syntax {
168-
let ${node.swift_syntax_kind} = build${node.syntax_kind}(format: format, leadingTrivia: leadingTrivia)
163+
let ${node.swift_syntax_kind} = build${node.syntax_kind}(format: format)
169164

170165
if let leadingTrivia = leadingTrivia {
171166
return Syntax(${node.swift_syntax_kind}).withLeadingTrivia(leadingTrivia)

0 commit comments

Comments
 (0)