Skip to content

Commit 9aa3d0a

Browse files
committed
Improve documentation of AttributeSyntax.arguments
1 parent 301f801 commit 9aa3d0a

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
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(

CodeGeneration/Sources/SyntaxSupport/DeclNodes.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2326,7 +2326,7 @@ public let DECL_NODES: [Node] = [
23262326
documentation: """
23272327
Declaration of one or more variables
23282328
2329-
The core of a variable declaration consists of a binding specifier (`let` or `var),
2329+
The core of a variable declaration consists of a binding specifier (`let` or `var`),
23302330
followed by any number of pattern bindings, which define the variables.
23312331
""",
23322332
traits: [
@@ -2364,7 +2364,7 @@ public let DECL_NODES: [Node] = [
23642364
initializers and accessors.
23652365
23662366
A variable declaration can contain multiple pattern bindings, because it’s possible
2367-
to define multiple variables after a single `let` keyword as follows.
2367+
to define multiple variables after a single `let` keyword, for example
23682368
23692369
```swift
23702370
let x: Int = 1, y: Int = 2

Sources/SwiftSyntax/generated/syntaxNodes/SyntaxDeclNodes.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6971,7 +6971,7 @@ public struct TypeAliasDeclSyntax: DeclSyntaxProtocol, SyntaxHashable {
69716971

69726972
/// Declaration of one or more variables
69736973
///
6974-
/// The core of a variable declaration consists of a binding specifier (`let` or `var),
6974+
/// The core of a variable declaration consists of a binding specifier (`let` or `var`),
69756975
/// followed by any number of pattern bindings, which define the variables.
69766976
///
69776977
/// ### Children
@@ -7174,7 +7174,7 @@ public struct VariableDeclSyntax: DeclSyntaxProtocol, SyntaxHashable {
71747174
/// initializers and accessors.
71757175
///
71767176
/// A variable declaration can contain multiple pattern bindings, because it’s possible
7177-
/// to define multiple variables after a single `let` keyword as follows.
7177+
/// to define multiple variables after a single `let` keyword, for example
71787178
///
71797179
/// ```swift
71807180
/// let x: Int = 1, y: Int = 2

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)