Skip to content

Commit 4a52604

Browse files
committed
Improve documentation of AttributeSyntax.arguments
1 parent 301f801 commit 4a52604

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

CodeGeneration/Sources/SyntaxSupport/AttributeNodes.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,12 @@ public let ATTRIBUTE_NODES: [Node] = [
153153
kind: .node(kind: .documentationAttributeArgumentList)
154154
),
155155
]),
156-
documentation: "The arguments of the attribute. In case the attribute takes multiple arguments, they are gather in the appropriate takes first.",
156+
documentation: """
157+
The arguments of the attribute.
158+
159+
In case of user-defined attributes, such as macros, property wrappers or result builders,
160+
this is always either an `argumentList` of type ``LabeledExprListSyntax`` or `nil`.
161+
""",
157162
isOptional: true
158163
),
159164
Child(

Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodes.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ public struct AttributeSyntax: SyntaxProtocol, SyntaxHashable {
913913
/// - atSign: The `@` sign.
914914
/// - attributeName: The name of the attribute.
915915
/// - leftParen: If the attribute takes arguments, the opening parenthesis.
916-
/// - arguments: The arguments of the attribute. In case the attribute takes multiple arguments, they are gather in the appropriate takes first.
916+
/// - arguments: The arguments of the attribute.
917917
/// - rightParen: If the attribute takes arguments, the closing parenthesis.
918918
/// - trailingTrivia: Trivia to be appended to the trailing trivia of the node’s last token. If the node is empty, there is no token to attach the trivia to and the parameter is ignored.
919919
public init(
@@ -1039,7 +1039,10 @@ public struct AttributeSyntax: SyntaxProtocol, SyntaxHashable {
10391039
}
10401040
}
10411041

1042-
/// The arguments of the attribute. In case the attribute takes multiple arguments, they are gather in the appropriate takes first.
1042+
/// The arguments of the attribute.
1043+
///
1044+
/// In case of user-defined attributes, such as macros, property wrappers or result builders,
1045+
/// this is always either an `argumentList` of type ``LabeledExprListSyntax`` or `nil`.
10431046
public var arguments: Arguments? {
10441047
get {
10451048
return data.child(at: 7, parent: Syntax(self)).map(Arguments.init)

0 commit comments

Comments
 (0)