File tree Expand file tree Collapse file tree 2 files changed +1167
-0
lines changed
Sources/SwiftSyntaxBuilder Expand file tree Collapse file tree 2 files changed +1167
-0
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,18 @@ public struct ${node.syntax_kind}: ${node.base_kind}Buildable {
121
121
let ${"%s: %s" % (child.swift_name, param_type)}
122
122
% end
123
123
124
+ /// Creates a `${node.syntax_kind}` using the provided parameters.
125
+ /// - Parameters:
126
+ % for child in node.children:
127
+ % description = ""
128
+ % if child.description:
129
+ % for line in dedented_lines(child.description):
130
+ % description += line
131
+ % end
132
+ % end
133
+ % description = description.replace("\n", " ").strip()
134
+ /// - ${lowercase_first_word(child.name)}: ${description}
135
+ % end
124
136
public init(
125
137
% init_parameters = []
126
138
% for child in node.children:
@@ -191,6 +203,9 @@ public struct ${node.syntax_kind}: ${node.base_kind}Buildable {
191
203
public struct ${node.syntax_kind}: SyntaxBuildable {
192
204
let elements: [${element_type}]
193
205
206
+ /// Creates a `${node.syntax_kind}` with the provided list of elements.
207
+ /// - Parameters:
208
+ /// - elements: A list of `ExpressibleAs${element_type}`
194
209
public init(_ elements: [ExpressibleAs${element_type}]) {
195
210
self.elements = elements.map { $0.create${element_type}() }
196
211
}
You can’t perform that action at this time.
0 commit comments