Skip to content

Emit description for SyntaxCollections as doc comments #176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Sources/SwiftSyntax/SyntaxCollections.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,16 @@ public protocol SyntaxCollection: SyntaxProtocol, Sequence {
% if node.collection_element:
% element_node = NODE_MAP.get(node.collection_element)

% if node.description:
% for line in dedented_lines(node.description):
/// ${line}
% end
% else:
/// `${node.name}` represents a collection of one or more
/// `${node.collection_element_type}` nodes. ${node.name} behaves
/// as a regular Swift collection, and has accessors that return new
/// versions of the collection with different children.
% end
public struct ${node.name}: SyntaxCollection, SyntaxHashable {
public let _syntaxNode: Syntax

Expand Down
20 changes: 8 additions & 12 deletions Sources/SwiftSyntax/gyb_generated/SyntaxCollections.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1488,10 +1488,10 @@ extension DeclNameArgumentListSyntax: BidirectionalCollection {
}
}

/// `ExprListSyntax` represents a collection of one or more
/// `ExprSyntax` nodes. ExprListSyntax behaves
/// as a regular Swift collection, and has accessors that return new
/// versions of the collection with different children.
///
/// A list of expressions connected by operators. This list is contained
/// by a `SequenceExprSyntax`.
///
public struct ExprListSyntax: SyntaxCollection, SyntaxHashable {
public let _syntaxNode: Syntax

Expand Down Expand Up @@ -4428,10 +4428,7 @@ extension PatternBindingListSyntax: BidirectionalCollection {
}
}

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

Expand Down Expand Up @@ -6143,10 +6140,9 @@ extension AttributeListSyntax: BidirectionalCollection {
}
}

/// `SpecializeAttributeSpecListSyntax` represents a collection of one or more
/// `Syntax` nodes. SpecializeAttributeSpecListSyntax behaves
/// as a regular Swift collection, and has accessors that return new
/// versions of the collection with different children.
///
/// A collection of arguments for the `@_specialize` attribute
///
public struct SpecializeAttributeSpecListSyntax: SyntaxCollection, SyntaxHashable {
public let _syntaxNode: Syntax

Expand Down