Skip to content

Commit a0539e3

Browse files
committed
Emit description for SyntaxCollections as doc comments
1 parent 3d9b9d5 commit a0539e3

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

Sources/SwiftSyntax/SyntaxCollections.swift.gyb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ public protocol SyntaxCollection: SyntaxProtocol, Sequence {
3131
/// `${node.collection_element_type}` nodes. ${node.name} behaves
3232
/// as a regular Swift collection, and has accessors that return new
3333
/// versions of the collection with different children.
34+
% if node.description:
35+
% for line in dedented_lines(node.description):
36+
/// ${line}
37+
% end
38+
% end
3439
public struct ${node.name}: SyntaxCollection, SyntaxHashable {
3540
public let _syntaxNode: Syntax
3641

Sources/SwiftSyntax/gyb_generated/SyntaxCollections.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,6 +1492,10 @@ extension DeclNameArgumentListSyntax: BidirectionalCollection {
14921492
/// `ExprSyntax` nodes. ExprListSyntax behaves
14931493
/// as a regular Swift collection, and has accessors that return new
14941494
/// versions of the collection with different children.
1495+
///
1496+
/// A list of expressions connected by operators. This list is contained
1497+
/// by a `SequenceExprSyntax`.
1498+
///
14951499
public struct ExprListSyntax: SyntaxCollection, SyntaxHashable {
14961500
public let _syntaxNode: Syntax
14971501

@@ -4432,6 +4436,7 @@ extension PatternBindingListSyntax: BidirectionalCollection {
44324436
/// `EnumCaseElementSyntax` nodes. EnumCaseElementListSyntax behaves
44334437
/// as a regular Swift collection, and has accessors that return new
44344438
/// versions of the collection with different children.
4439+
/// A collection of 0 or more `EnumCaseElement`s.
44354440
public struct EnumCaseElementListSyntax: SyntaxCollection, SyntaxHashable {
44364441
public let _syntaxNode: Syntax
44374442

@@ -6147,6 +6152,9 @@ extension AttributeListSyntax: BidirectionalCollection {
61476152
/// `Syntax` nodes. SpecializeAttributeSpecListSyntax behaves
61486153
/// as a regular Swift collection, and has accessors that return new
61496154
/// versions of the collection with different children.
6155+
///
6156+
/// A collection of arguments for the `@_specialize` attribute
6157+
///
61506158
public struct SpecializeAttributeSpecListSyntax: SyntaxCollection, SyntaxHashable {
61516159
public let _syntaxNode: Syntax
61526160

0 commit comments

Comments
 (0)