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 {
121121 let ${"%s: %s" % (child.swift_name, param_type)}
122122% end
123123
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
124136 public init(
125137% init_parameters = []
126138% for child in node.children:
@@ -191,6 +203,9 @@ public struct ${node.syntax_kind}: ${node.base_kind}Buildable {
191203public struct ${node.syntax_kind}: SyntaxBuildable {
192204 let elements: [${element_type}]
193205
206+ /// Creates a `${node.syntax_kind}` with the provided list of elements.
207+ /// - Parameters:
208+ /// - elements: A list of `ExpressibleAs${element_type}`
194209 public init(_ elements: [ExpressibleAs${element_type}]) {
195210 self.elements = elements.map { $0.create${element_type}() }
196211 }
You can’t perform that action at this time.
0 commit comments