Skip to content

Commit 4a89803

Browse files
committed
Don’t generate doc comments for extensions in BuildalbeCollectionNodesFile.swift
These doc comments served absolutely no purpose. Remove them.
1 parent 4db389e commit 4a89803

File tree

3 files changed

+1
-66
lines changed

3 files changed

+1
-66
lines changed

CodeGeneration/Sources/generate-swiftsyntax/templates/swiftsyntaxbuilder/BuildableCollectionNodesFile.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,8 @@ let buildableCollectionNodesFile = SourceFileSyntax(leadingTrivia: copyrightHead
2222
for node in SYNTAX_NODES.compactMap(\.collectionNode) {
2323
let elementType = node.collectionElementType
2424

25-
let docComment =
26-
node.documentation.isEmpty
27-
? [.docLineComment("/// `\(node.kind.syntaxType)` represents a collection of `\(elementType.syntaxBaseName)`")]
28-
: node.documentation
29-
// Generate collection node struct
3025
try! ExtensionDeclSyntax(
3126
"""
32-
\(docComment)
3327
extension \(raw: node.type.syntaxBaseName): ExpressibleByArrayLiteral
3428
"""
3529
) {

Sources/SwiftSyntax/Documentation.docc/Glossary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ To avoid ongoing repetition of common long terms, SwiftSyntax uses a couple of a
1313

1414
**Expr** Abbreviation for *Expression*
1515

16-
**IfConfig** Abbrevation for *If Configuration*`. Refers to `#if` clauses in the source code.
16+
**IfConfig** Abbrevation for *If Configuration*. Refers to `#if` clauses in the source code.
1717

1818
**Layout Node** A layout node can have an arbitrary number of children and provides structure to the syntax tree. All ``Syntax`` nodes that aren’t ``TokenSyntax`` are layout nodes. For example a ``StructDeclSyntax`` consists of, among others, of the `struct` keyword, the name and the `memberBlock`. The latter is again a layout node that contains multiple children. Layout nodes never represent any source code in the syntax tree by themselves. All source code within the syntax tree is represented by *tokens*.
1919

Sources/SwiftSyntaxBuilder/generated/BuildableCollectionNodes.swift

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -14,165 +14,132 @@
1414

1515
import SwiftSyntax
1616

17-
/// `AccessorDeclListSyntax` represents a collection of `AccessorDeclSyntax`
1817
extension AccessorDeclListSyntax: ExpressibleByArrayLiteral {
1918
public init(arrayLiteral elements: Element...) {
2019
self.init(elements)
2120
}
2221
}
2322

24-
/// `ArrayElementListSyntax` represents a collection of `ArrayElementSyntax`
2523
extension ArrayElementListSyntax: ExpressibleByArrayLiteral {
2624
public init(arrayLiteral elements: Element...) {
2725
self.init(elements)
2826
}
2927
}
3028

31-
/// A list of attributes that can be attached to a declaration.
32-
///
33-
/// An element in this collection can either be an attribute itself or an ``IfConfigDeclSyntax``
34-
/// that contains attributes. This is because attributes can be added conditional on compilcation
35-
/// conditions, for example.
36-
///
37-
/// ```swift
38-
/// #if !DISABLE_DEPRECATIONS
39-
/// @available(*, deprecated)
40-
/// #endif
41-
/// func myFunction() {}
42-
/// ```
4329
extension AttributeListSyntax: ExpressibleByArrayLiteral {
4430
public init(arrayLiteral elements: Element...) {
4531
self.init(elements)
4632
}
4733
}
4834

49-
/// `AvailabilityArgumentListSyntax` represents a collection of `AvailabilityArgumentSyntax`
5035
extension AvailabilityArgumentListSyntax: ExpressibleByArrayLiteral {
5136
public init(arrayLiteral elements: Element...) {
5237
self.init(elements)
5338
}
5439
}
5540

56-
/// `CatchClauseListSyntax` represents a collection of `CatchClauseSyntax`
5741
extension CatchClauseListSyntax: ExpressibleByArrayLiteral {
5842
public init(arrayLiteral elements: Element...) {
5943
self.init(elements)
6044
}
6145
}
6246

63-
/// `CatchItemListSyntax` represents a collection of `CatchItemSyntax`
6447
extension CatchItemListSyntax: ExpressibleByArrayLiteral {
6548
public init(arrayLiteral elements: Element...) {
6649
self.init(elements)
6750
}
6851
}
6952

70-
/// `ClosureCaptureListSyntax` represents a collection of `ClosureCaptureSyntax`
7153
extension ClosureCaptureListSyntax: ExpressibleByArrayLiteral {
7254
public init(arrayLiteral elements: Element...) {
7355
self.init(elements)
7456
}
7557
}
7658

77-
/// `ClosureParameterListSyntax` represents a collection of `ClosureParameterSyntax`
7859
extension ClosureParameterListSyntax: ExpressibleByArrayLiteral {
7960
public init(arrayLiteral elements: Element...) {
8061
self.init(elements)
8162
}
8263
}
8364

84-
/// `ClosureShorthandParameterListSyntax` represents a collection of `ClosureShorthandParameterSyntax`
8565
extension ClosureShorthandParameterListSyntax: ExpressibleByArrayLiteral {
8666
public init(arrayLiteral elements: Element...) {
8767
self.init(elements)
8868
}
8969
}
9070

91-
/// `CodeBlockItemListSyntax` represents a collection of `CodeBlockItemSyntax`
9271
extension CodeBlockItemListSyntax: ExpressibleByArrayLiteral {
9372
public init(arrayLiteral elements: Element...) {
9473
self.init(elements)
9574
}
9675
}
9776

98-
/// `CompositionTypeElementListSyntax` represents a collection of `CompositionTypeElementSyntax`
9977
extension CompositionTypeElementListSyntax: ExpressibleByArrayLiteral {
10078
public init(arrayLiteral elements: Element...) {
10179
self.init(elements)
10280
}
10381
}
10482

105-
/// `ConditionElementListSyntax` represents a collection of `ConditionElementSyntax`
10683
extension ConditionElementListSyntax: ExpressibleByArrayLiteral {
10784
public init(arrayLiteral elements: Element...) {
10885
self.init(elements)
10986
}
11087
}
11188

112-
/// `DeclModifierListSyntax` represents a collection of `DeclModifierSyntax`
11389
extension DeclModifierListSyntax: ExpressibleByArrayLiteral {
11490
public init(arrayLiteral elements: Element...) {
11591
self.init(elements)
11692
}
11793
}
11894

119-
/// `DeclNameArgumentListSyntax` represents a collection of `DeclNameArgumentSyntax`
12095
extension DeclNameArgumentListSyntax: ExpressibleByArrayLiteral {
12196
public init(arrayLiteral elements: Element...) {
12297
self.init(elements)
12398
}
12499
}
125100

126-
/// `DesignatedTypeListSyntax` represents a collection of `DesignatedTypeSyntax`
127101
extension DesignatedTypeListSyntax: ExpressibleByArrayLiteral {
128102
public init(arrayLiteral elements: Element...) {
129103
self.init(elements)
130104
}
131105
}
132106

133-
/// `DictionaryElementListSyntax` represents a collection of `DictionaryElementSyntax`
134107
extension DictionaryElementListSyntax: ExpressibleByArrayLiteral {
135108
public init(arrayLiteral elements: Element...) {
136109
self.init(elements)
137110
}
138111
}
139112

140-
/// `DifferentiabilityArgumentListSyntax` represents a collection of `DifferentiabilityArgumentSyntax`
141113
extension DifferentiabilityArgumentListSyntax: ExpressibleByArrayLiteral {
142114
public init(arrayLiteral elements: Element...) {
143115
self.init(elements)
144116
}
145117
}
146118

147-
/// The arguments of the '@_documentation' attribute
148119
extension DocumentationAttributeArgumentListSyntax: ExpressibleByArrayLiteral {
149120
public init(arrayLiteral elements: Element...) {
150121
self.init(elements)
151122
}
152123
}
153124

154-
/// The arguments of the '@_effects' attribute. These will be parsed during the SIL stage.
155125
extension EffectsAttributeArgumentListSyntax: ExpressibleByArrayLiteral {
156126
public init(arrayLiteral elements: Element...) {
157127
self.init(elements)
158128
}
159129
}
160130

161-
/// A collection of 0 or more `EnumCaseElement`s.
162131
extension EnumCaseElementListSyntax: ExpressibleByArrayLiteral {
163132
public init(arrayLiteral elements: Element...) {
164133
self.init(elements)
165134
}
166135
}
167136

168-
/// `EnumCaseParameterListSyntax` represents a collection of `EnumCaseParameterSyntax`
169137
extension EnumCaseParameterListSyntax: ExpressibleByArrayLiteral {
170138
public init(arrayLiteral elements: Element...) {
171139
self.init(elements)
172140
}
173141
}
174142

175-
/// A list of expressions connected by operators. This list is contained by a ``SequenceExprSyntax``.
176143
extension ExprListSyntax: ExpressibleByArrayLiteral {
177144
public init(_ elements: [ExprSyntaxProtocol]) {
178145
self = ExprListSyntax(elements.map {
@@ -185,168 +152,144 @@ extension ExprListSyntax: ExpressibleByArrayLiteral {
185152
}
186153
}
187154

188-
/// `FunctionParameterListSyntax` represents a collection of `FunctionParameterSyntax`
189155
extension FunctionParameterListSyntax: ExpressibleByArrayLiteral {
190156
public init(arrayLiteral elements: Element...) {
191157
self.init(elements)
192158
}
193159
}
194160

195-
/// `GenericArgumentListSyntax` represents a collection of `GenericArgumentSyntax`
196161
extension GenericArgumentListSyntax: ExpressibleByArrayLiteral {
197162
public init(arrayLiteral elements: Element...) {
198163
self.init(elements)
199164
}
200165
}
201166

202-
/// `GenericParameterListSyntax` represents a collection of `GenericParameterSyntax`
203167
extension GenericParameterListSyntax: ExpressibleByArrayLiteral {
204168
public init(arrayLiteral elements: Element...) {
205169
self.init(elements)
206170
}
207171
}
208172

209-
/// `GenericRequirementListSyntax` represents a collection of `GenericRequirementSyntax`
210173
extension GenericRequirementListSyntax: ExpressibleByArrayLiteral {
211174
public init(arrayLiteral elements: Element...) {
212175
self.init(elements)
213176
}
214177
}
215178

216-
/// `IfConfigClauseListSyntax` represents a collection of `IfConfigClauseSyntax`
217179
extension IfConfigClauseListSyntax: ExpressibleByArrayLiteral {
218180
public init(arrayLiteral elements: Element...) {
219181
self.init(elements)
220182
}
221183
}
222184

223-
/// `ImportPathComponentListSyntax` represents a collection of `ImportPathComponentSyntax`
224185
extension ImportPathComponentListSyntax: ExpressibleByArrayLiteral {
225186
public init(arrayLiteral elements: Element...) {
226187
self.init(elements)
227188
}
228189
}
229190

230-
/// `InheritedTypeListSyntax` represents a collection of `InheritedTypeSyntax`
231191
extension InheritedTypeListSyntax: ExpressibleByArrayLiteral {
232192
public init(arrayLiteral elements: Element...) {
233193
self.init(elements)
234194
}
235195
}
236196

237-
/// `KeyPathComponentListSyntax` represents a collection of `KeyPathComponentSyntax`
238197
extension KeyPathComponentListSyntax: ExpressibleByArrayLiteral {
239198
public init(arrayLiteral elements: Element...) {
240199
self.init(elements)
241200
}
242201
}
243202

244-
/// `LabeledExprListSyntax` represents a collection of `LabeledExprSyntax`
245203
extension LabeledExprListSyntax: ExpressibleByArrayLiteral {
246204
public init(arrayLiteral elements: Element...) {
247205
self.init(elements)
248206
}
249207
}
250208

251-
/// `MemberBlockItemListSyntax` represents a collection of `MemberBlockItemSyntax`
252209
extension MemberBlockItemListSyntax: ExpressibleByArrayLiteral {
253210
public init(arrayLiteral elements: Element...) {
254211
self.init(elements)
255212
}
256213
}
257214

258-
/// `MultipleTrailingClosureElementListSyntax` represents a collection of `MultipleTrailingClosureElementSyntax`
259215
extension MultipleTrailingClosureElementListSyntax: ExpressibleByArrayLiteral {
260216
public init(arrayLiteral elements: Element...) {
261217
self.init(elements)
262218
}
263219
}
264220

265-
/// `ObjCSelectorPieceListSyntax` represents a collection of `ObjCSelectorPieceSyntax`
266221
extension ObjCSelectorPieceListSyntax: ExpressibleByArrayLiteral {
267222
public init(arrayLiteral elements: Element...) {
268223
self.init(elements)
269224
}
270225
}
271226

272-
/// `PatternBindingListSyntax` represents a collection of `PatternBindingSyntax`
273227
extension PatternBindingListSyntax: ExpressibleByArrayLiteral {
274228
public init(arrayLiteral elements: Element...) {
275229
self.init(elements)
276230
}
277231
}
278232

279-
/// `PlatformVersionItemListSyntax` represents a collection of `PlatformVersionItemSyntax`
280233
extension PlatformVersionItemListSyntax: ExpressibleByArrayLiteral {
281234
public init(arrayLiteral elements: Element...) {
282235
self.init(elements)
283236
}
284237
}
285238

286-
/// `PrecedenceGroupAttributeListSyntax` represents a collection of `Syntax`
287239
extension PrecedenceGroupAttributeListSyntax: ExpressibleByArrayLiteral {
288240
public init(arrayLiteral elements: Element...) {
289241
self.init(elements)
290242
}
291243
}
292244

293-
/// `PrecedenceGroupNameListSyntax` represents a collection of `PrecedenceGroupNameSyntax`
294245
extension PrecedenceGroupNameListSyntax: ExpressibleByArrayLiteral {
295246
public init(arrayLiteral elements: Element...) {
296247
self.init(elements)
297248
}
298249
}
299250

300-
/// `PrimaryAssociatedTypeListSyntax` represents a collection of `PrimaryAssociatedTypeSyntax`
301251
extension PrimaryAssociatedTypeListSyntax: ExpressibleByArrayLiteral {
302252
public init(arrayLiteral elements: Element...) {
303253
self.init(elements)
304254
}
305255
}
306256

307-
/// A collection of arguments for the `@_specialize` attribute
308257
extension SpecializeAttributeArgumentListSyntax: ExpressibleByArrayLiteral {
309258
public init(arrayLiteral elements: Element...) {
310259
self.init(elements)
311260
}
312261
}
313262

314-
/// `StringLiteralSegmentListSyntax` represents a collection of `Syntax`
315263
extension StringLiteralSegmentListSyntax: ExpressibleByArrayLiteral {
316264
public init(arrayLiteral elements: Element...) {
317265
self.init(elements)
318266
}
319267
}
320268

321-
/// `SwitchCaseItemListSyntax` represents a collection of `SwitchCaseItemSyntax`
322269
extension SwitchCaseItemListSyntax: ExpressibleByArrayLiteral {
323270
public init(arrayLiteral elements: Element...) {
324271
self.init(elements)
325272
}
326273
}
327274

328-
/// `SwitchCaseListSyntax` represents a collection of `Syntax`
329275
extension SwitchCaseListSyntax: ExpressibleByArrayLiteral {
330276
public init(arrayLiteral elements: Element...) {
331277
self.init(elements)
332278
}
333279
}
334280

335-
/// `TuplePatternElementListSyntax` represents a collection of `TuplePatternElementSyntax`
336281
extension TuplePatternElementListSyntax: ExpressibleByArrayLiteral {
337282
public init(arrayLiteral elements: Element...) {
338283
self.init(elements)
339284
}
340285
}
341286

342-
/// `TupleTypeElementListSyntax` represents a collection of `TupleTypeElementSyntax`
343287
extension TupleTypeElementListSyntax: ExpressibleByArrayLiteral {
344288
public init(arrayLiteral elements: Element...) {
345289
self.init(elements)
346290
}
347291
}
348292

349-
/// A collection of syntax nodes that occurred in the source code but could not be used to form a valid syntax tree.
350293
extension UnexpectedNodesSyntax: ExpressibleByArrayLiteral {
351294
public init(_ elements: [SyntaxProtocol]) {
352295
self = UnexpectedNodesSyntax(elements.map {
@@ -359,14 +302,12 @@ extension UnexpectedNodesSyntax: ExpressibleByArrayLiteral {
359302
}
360303
}
361304

362-
/// `VersionComponentListSyntax` represents a collection of `VersionComponentSyntax`
363305
extension VersionComponentListSyntax: ExpressibleByArrayLiteral {
364306
public init(arrayLiteral elements: Element...) {
365307
self.init(elements)
366308
}
367309
}
368310

369-
/// `YieldedExpressionListSyntax` represents a collection of `YieldedExpressionSyntax`
370311
extension YieldedExpressionListSyntax: ExpressibleByArrayLiteral {
371312
public init(arrayLiteral elements: Element...) {
372313
self.init(elements)

0 commit comments

Comments
 (0)