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