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 @@ -122,6 +122,18 @@ public struct ${node.syntax_kind}: ${node.base_kind}Buildable {
122
122
let ${"%s: %s" % (child.swift_name, param_type)}
123
123
% end
124
124
125
+ /// Creates a `${node.syntax_kind}` using the provided parameters.
126
+ /// - Parameters:
127
+ % for child in node.children:
128
+ % description = ""
129
+ % if child.description:
130
+ % for line in dedented_lines(child.description):
131
+ % description += line
132
+ % end
133
+ % end
134
+ % description = description.replace("\n", " ").strip()
135
+ /// - ${lowercase_first_word(child.name)}: ${description}
136
+ % end
125
137
public init(
126
138
% init_parameters = []
127
139
% for child in node.children:
@@ -192,6 +204,9 @@ public struct ${node.syntax_kind}: ${node.base_kind}Buildable {
192
204
public struct ${node.syntax_kind}: SyntaxBuildable {
193
205
let elements: [${element_type}]
194
206
207
+ /// Creates a `${node.syntax_kind}` with the provided list of elements.
208
+ /// - Parameters:
209
+ /// - elements: A list of `ExpressibleAs${element_type}`
195
210
public init(_ elements: [ExpressibleAs${element_type}]) {
196
211
self.elements = elements.map { $0.create${element_type}() }
197
212
}
You can’t perform that action at this time.
0 commit comments