Skip to content

Commit e899242

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

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

Sources/SwiftSyntax/SyntaxCollections.swift.gyb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,16 @@ public protocol SyntaxCollection: SyntaxProtocol, Sequence {
2727
% if node.collection_element:
2828
% element_node = NODE_MAP.get(node.collection_element)
2929

30+
% if node.description:
31+
% for line in dedented_lines(node.description):
32+
/// ${line}
33+
% end
34+
% else:
3035
/// `${node.name}` represents a collection of one or more
3136
/// `${node.collection_element_type}` nodes. ${node.name} behaves
3237
/// as a regular Swift collection, and has accessors that return new
3338
/// versions of the collection with different children.
39+
% end
3440
public struct ${node.name}: SyntaxCollection, SyntaxHashable {
3541
public let _syntaxNode: Syntax
3642

Sources/SwiftSyntax/gyb_generated/SyntaxCollections.swift

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4428,10 +4428,7 @@ extension PatternBindingListSyntax: BidirectionalCollection {
44284428
}
44294429
}
44304430

4431-
/// `EnumCaseElementListSyntax` represents a collection of one or more
4432-
/// `EnumCaseElementSyntax` nodes. EnumCaseElementListSyntax behaves
4433-
/// as a regular Swift collection, and has accessors that return new
4434-
/// versions of the collection with different children.
4431+
/// A collection of 0 or more `EnumCaseElement`s.
44354432
public struct EnumCaseElementListSyntax: SyntaxCollection, SyntaxHashable {
44364433
public let _syntaxNode: Syntax
44374434

@@ -6143,10 +6140,9 @@ extension AttributeListSyntax: BidirectionalCollection {
61436140
}
61446141
}
61456142

6146-
/// `SpecializeAttributeSpecListSyntax` represents a collection of one or more
6147-
/// `Syntax` nodes. SpecializeAttributeSpecListSyntax behaves
6148-
/// as a regular Swift collection, and has accessors that return new
6149-
/// versions of the collection with different children.
6143+
///
6144+
/// A collection of arguments for the `@_specialize` attribute
6145+
///
61506146
public struct SpecializeAttributeSpecListSyntax: SyntaxCollection, SyntaxHashable {
61516147
public let _syntaxNode: Syntax
61526148

0 commit comments

Comments
 (0)