Skip to content

Commit eedcf8f

Browse files
committed
Add SyntaxBuildableType.listBuildable
1 parent e8edeca commit eedcf8f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Sources/SwiftSyntaxBuilderGeneration/SyntaxBuildableType.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,12 @@ struct SyntaxBuildableType: Hashable {
133133
}
134134
}
135135

136+
/// Assuming that this is a base kind, return the corresponding `*ListBuildable` type.
137+
var listBuildable: String {
138+
assert(SYNTAX_BASE_KINDS.contains(syntaxKind), "ListBuildable types only exist for syntax base kinds")
139+
return "\(syntaxKind)ListBuildable\(optionalQuestionMark)"
140+
}
141+
136142
/// Assuming that this is a collection type, the type of the result builder
137143
/// that can be used to build the collection.
138144
var resultBuilder: String {

0 commit comments

Comments
 (0)