Skip to content

Commit 5ee3144

Browse files
committed
Add missing documentation to nodes and children of kinds GenericParameterClause and GenericWhereClause
1 parent acf1484 commit 5ee3144

File tree

9 files changed

+76
-11
lines changed

9 files changed

+76
-11
lines changed

CodeGeneration/Sources/SyntaxSupport/AttributeNodes.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,7 @@ public let ATTRIBUTE_NODES: [Node] = [
510510
name: "GenericWhereClause",
511511
deprecatedName: "WhereClause",
512512
kind: .node(kind: .genericWhereClause),
513+
documentation: "A `where` clause that places additional constraints on generic parameters like `where T: Differentiable`.",
513514
isOptional: true
514515
),
515516
]

CodeGeneration/Sources/SyntaxSupport/DeclNodes.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ public let DECL_NODES: [Node] = [
271271
name: "GenericParameterClause",
272272
kind: .node(kind: .genericParameterClause),
273273
nameForDiagnostics: "generic parameter clause",
274+
documentation: "The parameter clause that defines the generic parameters.",
274275
isOptional: true
275276
),
276277
Child(
@@ -283,6 +284,7 @@ public let DECL_NODES: [Node] = [
283284
name: "GenericWhereClause",
284285
kind: .node(kind: .genericWhereClause),
285286
nameForDiagnostics: "generic where clause",
287+
documentation: "A `where` clause that places additional constraints on generic parameters like `where Element: Hashable`.",
286288
isOptional: true
287289
),
288290
Child(
@@ -944,6 +946,7 @@ public let DECL_NODES: [Node] = [
944946
name: "GenericWhereClause",
945947
kind: .node(kind: .genericWhereClause),
946948
nameForDiagnostics: "generic where clause",
949+
documentation: "A `where` clause that places additional constraints on generic parameters like `where Element: Hashable`.",
947950
isOptional: true
948951
),
949952
Child(
@@ -993,6 +996,7 @@ public let DECL_NODES: [Node] = [
993996
name: "GenericParameterClause",
994997
kind: .node(kind: .genericParameterClause),
995998
nameForDiagnostics: "generic parameter clause",
999+
documentation: "The parameter clause that defines the generic parameters.",
9961000
isOptional: true
9971001
),
9981002
Child(
@@ -1004,6 +1008,7 @@ public let DECL_NODES: [Node] = [
10041008
name: "GenericWhereClause",
10051009
kind: .node(kind: .genericWhereClause),
10061010
nameForDiagnostics: "generic where clause",
1011+
documentation: "A `where` clause that places additional constraints on generic parameters like `where Element: Hashable`.",
10071012
isOptional: true
10081013
),
10091014
Child(
@@ -1401,6 +1406,7 @@ public let DECL_NODES: [Node] = [
14011406
name: "GenericParameterClause",
14021407
kind: .node(kind: .genericParameterClause),
14031408
nameForDiagnostics: "generic parameter clause",
1409+
documentation: "The parameter clause that defines the generic parameters.",
14041410
isOptional: true
14051411
),
14061412
Child(
@@ -1418,6 +1424,7 @@ public let DECL_NODES: [Node] = [
14181424
name: "GenericWhereClause",
14191425
kind: .node(kind: .genericWhereClause),
14201426
nameForDiagnostics: "generic where clause",
1427+
documentation: "A `where` clause that places additional constraints on generic parameters like `where Element: Hashable`.",
14211428
isOptional: true
14221429
),
14231430
]
@@ -2222,6 +2229,7 @@ public let DECL_NODES: [Node] = [
22222229
name: "GenericParameterClause",
22232230
kind: .node(kind: .genericParameterClause),
22242231
nameForDiagnostics: "generic parameter clause",
2232+
documentation: "The parameter clause that defines the generic parameters.",
22252233
isOptional: true
22262234
),
22272235
Child(
@@ -2238,6 +2246,7 @@ public let DECL_NODES: [Node] = [
22382246
name: "GenericWhereClause",
22392247
kind: .node(kind: .genericWhereClause),
22402248
nameForDiagnostics: "generic where clause",
2249+
documentation: "A `where` clause that places additional constraints on generic parameters like `where Element: Hashable`.",
22412250
isOptional: true
22422251
),
22432252
Child(
@@ -2331,6 +2340,7 @@ public let DECL_NODES: [Node] = [
23312340
name: "GenericParameterClause",
23322341
kind: .node(kind: .genericParameterClause),
23332342
nameForDiagnostics: "generic parameter clause",
2343+
documentation: "The parameter clause that defines the generic parameters.",
23342344
isOptional: true
23352345
),
23362346
Child(
@@ -2341,6 +2351,7 @@ public let DECL_NODES: [Node] = [
23412351
name: "GenericWhereClause",
23422352
kind: .node(kind: .genericWhereClause),
23432353
nameForDiagnostics: "generic where clause",
2354+
documentation: "A `where` clause that places additional constraints on generic parameters like `where Element: Hashable`.",
23442355
isOptional: true
23452356
),
23462357
]

CodeGeneration/Sources/SyntaxSupport/GenericNodes.swift

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,27 +37,32 @@ public let GENERIC_NODES: [Node] = [
3737
kind: .genericParameterClause,
3838
base: .syntax,
3939
nameForDiagnostics: "generic parameter clause",
40+
documentation: "The parameter clause that defines the generic parameters.",
4041
parserFunction: "parseGenericParameters",
4142
children: [
4243
Child(
4344
name: "LeftAngle",
4445
deprecatedName: "LeftAngleBracket",
45-
kind: .token(choices: [.token(tokenKind: "LeftAngleToken")])
46+
kind: .token(choices: [.token(tokenKind: "LeftAngleToken")]),
47+
documentation: "The opening angle bracket (`<`) of the generic parameter clause."
4648
),
4749
Child(
4850
name: "Parameters",
4951
deprecatedName: "GenericParameterList",
50-
kind: .collection(kind: .genericParameterList, collectionElementName: "Parameter", deprecatedCollectionElementName: "GenericParameter")
52+
kind: .collection(kind: .genericParameterList, collectionElementName: "Parameter", deprecatedCollectionElementName: "GenericParameter"),
53+
documentation: "The list of generic parameters in the clause."
5154
),
5255
Child(
5356
name: "GenericWhereClause",
5457
kind: .node(kind: .genericWhereClause),
58+
documentation: "A `where` clause that places additional constraints on generic parameters like `where Element: Hashable`.",
5559
isOptional: true
5660
),
5761
Child(
5862
name: "RightAngle",
5963
deprecatedName: "RightAngleBracket",
60-
kind: .token(choices: [.token(tokenKind: "RightAngleToken")])
64+
kind: .token(choices: [.token(tokenKind: "RightAngleToken")]),
65+
documentation: "The closing angle bracket (`>`) of the generic parameter clause."
6166
),
6267
]
6368
),
@@ -164,14 +169,17 @@ public let GENERIC_NODES: [Node] = [
164169
kind: .genericWhereClause,
165170
base: .syntax,
166171
nameForDiagnostics: "'where' clause",
172+
documentation: "A `where` clause that places additional constraints on generic parameters like `where Element: Hashable`.",
167173
children: [
168174
Child(
169175
name: "WhereKeyword",
170-
kind: .token(choices: [.keyword(text: "where")])
176+
kind: .token(choices: [.keyword(text: "where")]),
177+
documentation: "The `where` keyword in the clause."
171178
),
172179
Child(
173180
name: "RequirementList",
174-
kind: .collection(kind: .genericRequirementList, collectionElementName: "Requirement")
181+
kind: .collection(kind: .genericRequirementList, collectionElementName: "Requirement"),
182+
documentation: "The list of requirements in the clause."
175183
),
176184
]
177185
),

CodeGeneration/Sources/SyntaxSupport/Traits.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ public let TRAITS: [Trait] = [
4040
Child(name: "Attributes", kind: .node(kind: .attributeList), isOptional: true),
4141
Child(name: "Modifiers", kind: .node(kind: .modifierList), isOptional: true),
4242
Child(name: "InheritanceClause", kind: .node(kind: .typeInheritanceClause), isOptional: true),
43-
Child(name: "GenericWhereClause", kind: .node(kind: .genericWhereClause), isOptional: true),
43+
Child(
44+
name: "GenericWhereClause",
45+
kind: .node(kind: .genericWhereClause),
46+
documentation: "A `where` clause that places additional constraints on generic parameters like `where Element: Hashable`.",
47+
isOptional: true
48+
),
4449
Child(name: "MemberBlock", kind: .node(kind: .memberDeclBlock)),
4550
]
4651
),

CodeGeneration/Sources/SyntaxSupport/TypeNodes.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,8 @@ public let TYPE_NODES: [Node] = [
341341
Child(
342342
name: "GenericParameterClause",
343343
deprecatedName: "GenericParameters",
344-
kind: .node(kind: .genericParameterClause)
344+
kind: .node(kind: .genericParameterClause),
345+
documentation: "The parameter clause that defines the generic parameters."
345346
),
346347
Child(
347348
name: "BaseType",

Sources/SwiftSyntax/generated/SyntaxTraits.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public protocol DeclGroupSyntax: SyntaxProtocol {
7373
set
7474
}
7575

76+
/// A `where` clause that places additional constraints on generic parameters like `where Element: Hashable`.
7677
var genericWhereClause: GenericWhereClauseSyntax? {
7778
get
7879
set

Sources/SwiftSyntax/generated/syntaxNodes/SyntaxDeclNodes.swift

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,8 @@ public struct ActorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable {
329329

330330
/// - Parameters:
331331
/// - leadingTrivia: Trivia to be prepended to the leading trivia of the node’s first token. If the node is empty, there is no token to attach the trivia to and the parameter is ignored.
332+
/// - genericParameterClause: The parameter clause that defines the generic parameters.
333+
/// - genericWhereClause: A `where` clause that places additional constraints on generic parameters like `where Element: Hashable`.
332334
/// - 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.
333335
public init(
334336
leadingTrivia: Trivia? = nil,
@@ -534,6 +536,7 @@ public struct ActorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable {
534536
}
535537
}
536538

539+
/// The parameter clause that defines the generic parameters.
537540
public var genericParameterClause: GenericParameterClauseSyntax? {
538541
get {
539542
return data.child(at: 9, parent: Syntax(self)).map(GenericParameterClauseSyntax.init)
@@ -570,6 +573,7 @@ public struct ActorDeclSyntax: DeclSyntaxProtocol, SyntaxHashable {
570573
}
571574
}
572575

576+
/// A `where` clause that places additional constraints on generic parameters like `where Element: Hashable`.
573577
public var genericWhereClause: GenericWhereClauseSyntax? {
574578
get {
575579
return data.child(at: 13, parent: Syntax(self)).map(GenericWhereClauseSyntax.init)
@@ -2454,6 +2458,7 @@ public struct ExtensionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable {
24542458

24552459
/// - Parameters:
24562460
/// - leadingTrivia: Trivia to be prepended to the leading trivia of the node’s first token. If the node is empty, there is no token to attach the trivia to and the parameter is ignored.
2461+
/// - genericWhereClause: A `where` clause that places additional constraints on generic parameters like `where Element: Hashable`.
24572462
/// - 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.
24582463
public init(
24592464
leadingTrivia: Trivia? = nil,
@@ -2671,6 +2676,7 @@ public struct ExtensionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable {
26712676
}
26722677
}
26732678

2679+
/// A `where` clause that places additional constraints on generic parameters like `where Element: Hashable`.
26742680
public var genericWhereClause: GenericWhereClauseSyntax? {
26752681
get {
26762682
return data.child(at: 11, parent: Syntax(self)).map(GenericWhereClauseSyntax.init)
@@ -2762,6 +2768,8 @@ public struct FunctionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable {
27622768

27632769
/// - Parameters:
27642770
/// - leadingTrivia: Trivia to be prepended to the leading trivia of the node’s first token. If the node is empty, there is no token to attach the trivia to and the parameter is ignored.
2771+
/// - genericParameterClause: The parameter clause that defines the generic parameters.
2772+
/// - genericWhereClause: A `where` clause that places additional constraints on generic parameters like `where Element: Hashable`.
27652773
/// - 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.
27662774
public init(
27672775
leadingTrivia: Trivia? = nil,
@@ -2967,6 +2975,7 @@ public struct FunctionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable {
29672975
}
29682976
}
29692977

2978+
/// The parameter clause that defines the generic parameters.
29702979
public var genericParameterClause: GenericParameterClauseSyntax? {
29712980
get {
29722981
return data.child(at: 9, parent: Syntax(self)).map(GenericParameterClauseSyntax.init)
@@ -3003,6 +3012,7 @@ public struct FunctionDeclSyntax: DeclSyntaxProtocol, SyntaxHashable {
30033012
}
30043013
}
30053014

3015+
/// A `where` clause that places additional constraints on generic parameters like `where Element: Hashable`.
30063016
public var genericWhereClause: GenericWhereClauseSyntax? {
30073017
get {
30083018
return data.child(at: 13, parent: Syntax(self)).map(GenericWhereClauseSyntax.init)
@@ -3892,6 +3902,8 @@ public struct MacroDeclSyntax: DeclSyntaxProtocol, SyntaxHashable {
38923902

38933903
/// - Parameters:
38943904
/// - leadingTrivia: Trivia to be prepended to the leading trivia of the node’s first token. If the node is empty, there is no token to attach the trivia to and the parameter is ignored.
3905+
/// - genericParameterClause: The parameter clause that defines the generic parameters.
3906+
/// - genericWhereClause: A `where` clause that places additional constraints on generic parameters like `where Element: Hashable`.
38953907
/// - 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.
38963908
public init(
38973909
leadingTrivia: Trivia? = nil,
@@ -4097,6 +4109,7 @@ public struct MacroDeclSyntax: DeclSyntaxProtocol, SyntaxHashable {
40974109
}
40984110
}
40994111

4112+
/// The parameter clause that defines the generic parameters.
41004113
public var genericParameterClause: GenericParameterClauseSyntax? {
41014114
get {
41024115
return data.child(at: 9, parent: Syntax(self)).map(GenericParameterClauseSyntax.init)
@@ -4151,6 +4164,7 @@ public struct MacroDeclSyntax: DeclSyntaxProtocol, SyntaxHashable {
41514164
}
41524165
}
41534166

4167+
/// A `where` clause that places additional constraints on generic parameters like `where Element: Hashable`.
41544168
public var genericWhereClause: GenericWhereClauseSyntax? {
41554169
get {
41564170
return data.child(at: 15, parent: Syntax(self)).map(GenericWhereClauseSyntax.init)
@@ -6370,6 +6384,8 @@ public struct SubscriptDeclSyntax: DeclSyntaxProtocol, SyntaxHashable {
63706384

63716385
/// - Parameters:
63726386
/// - leadingTrivia: Trivia to be prepended to the leading trivia of the node’s first token. If the node is empty, there is no token to attach the trivia to and the parameter is ignored.
6387+
/// - genericParameterClause: The parameter clause that defines the generic parameters.
6388+
/// - genericWhereClause: A `where` clause that places additional constraints on generic parameters like `where Element: Hashable`.
63736389
/// - 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.
63746390
public init(
63756391
leadingTrivia: Trivia? = nil,
@@ -6557,6 +6573,7 @@ public struct SubscriptDeclSyntax: DeclSyntaxProtocol, SyntaxHashable {
65576573
}
65586574
}
65596575

6576+
/// The parameter clause that defines the generic parameters.
65606577
public var genericParameterClause: GenericParameterClauseSyntax? {
65616578
get {
65626579
return data.child(at: 7, parent: Syntax(self)).map(GenericParameterClauseSyntax.init)
@@ -6611,6 +6628,7 @@ public struct SubscriptDeclSyntax: DeclSyntaxProtocol, SyntaxHashable {
66116628
}
66126629
}
66136630

6631+
/// A `where` clause that places additional constraints on generic parameters like `where Element: Hashable`.
66146632
public var genericWhereClause: GenericWhereClauseSyntax? {
66156633
get {
66166634
return data.child(at: 13, parent: Syntax(self)).map(GenericWhereClauseSyntax.init)
@@ -6703,6 +6721,8 @@ public struct TypealiasDeclSyntax: DeclSyntaxProtocol, SyntaxHashable {
67036721

67046722
/// - Parameters:
67056723
/// - leadingTrivia: Trivia to be prepended to the leading trivia of the node’s first token. If the node is empty, there is no token to attach the trivia to and the parameter is ignored.
6724+
/// - genericParameterClause: The parameter clause that defines the generic parameters.
6725+
/// - genericWhereClause: A `where` clause that places additional constraints on generic parameters like `where Element: Hashable`.
67066726
/// - 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.
67076727
public init(
67086728
leadingTrivia: Trivia? = nil,
@@ -6902,6 +6922,7 @@ public struct TypealiasDeclSyntax: DeclSyntaxProtocol, SyntaxHashable {
69026922
}
69036923
}
69046924

6925+
/// The parameter clause that defines the generic parameters.
69056926
public var genericParameterClause: GenericParameterClauseSyntax? {
69066927
get {
69076928
return data.child(at: 9, parent: Syntax(self)).map(GenericParameterClauseSyntax.init)
@@ -6938,6 +6959,7 @@ public struct TypealiasDeclSyntax: DeclSyntaxProtocol, SyntaxHashable {
69386959
}
69396960
}
69406961

6962+
/// A `where` clause that places additional constraints on generic parameters like `where Element: Hashable`.
69416963
public var genericWhereClause: GenericWhereClauseSyntax? {
69426964
get {
69436965
return data.child(at: 13, parent: Syntax(self)).map(GenericWhereClauseSyntax.init)

0 commit comments

Comments
 (0)