@@ -24,6 +24,7 @@ public let ATTRIBUTE_NODES: [Node] = [
24
24
description: " The `@` sign. " ) ,
25
25
Child ( name: " AttributeName " ,
26
26
kind: . node( kind: " Type " ) ,
27
+ nameForDiagnostics: " name " ,
27
28
description: " The name of the attribute. " ,
28
29
classification: " Attribute " ) ,
29
30
Child ( name: " LeftParen " ,
@@ -104,6 +105,7 @@ public let ATTRIBUTE_NODES: [Node] = [
104
105
children: [
105
106
Child ( name: " Label " ,
106
107
kind: . token( choices: [ . keyword( text: " availability " ) ] ) ,
108
+ nameForDiagnostics: " label " ,
107
109
description: " The label of the argument " ) ,
108
110
Child ( name: " Colon " ,
109
111
kind: . token( choices: [ . token( tokenKind: " ColonToken " ) ] ) ,
@@ -124,12 +126,14 @@ public let ATTRIBUTE_NODES: [Node] = [
124
126
children: [
125
127
Child ( name: " Label " ,
126
128
kind: . token( choices: [ . token( tokenKind: " IdentifierToken " ) , . keyword( text: " available " ) , . keyword( text: " exported " ) , . keyword( text: " kind " ) , . keyword( text: " spi " ) , . keyword( text: " spiModule " ) ] ) ,
129
+ nameForDiagnostics: " label " ,
127
130
description: " The label of the argument " ) ,
128
131
Child ( name: " Colon " ,
129
132
kind: . token( choices: [ . token( tokenKind: " ColonToken " ) ] ) ,
130
133
description: " The colon separating the label and the value " ) ,
131
134
Child ( name: " Value " ,
132
135
kind: . node( kind: " Token " ) ,
136
+ nameForDiagnostics: " value " ,
133
137
description: " The value for this argument " ) ,
134
138
Child ( name: " TrailingComma " ,
135
139
kind: . token( choices: [ . token( tokenKind: " CommaToken " ) ] ) ,
@@ -147,12 +151,14 @@ public let ATTRIBUTE_NODES: [Node] = [
147
151
children: [
148
152
Child ( name: " Label " ,
149
153
kind: . token( choices: [ . keyword( text: " target " ) ] ) ,
154
+ nameForDiagnostics: " label " ,
150
155
description: " The label of the argument " ) ,
151
156
Child ( name: " Colon " ,
152
157
kind: . token( choices: [ . token( tokenKind: " ColonToken " ) ] ) ,
153
158
description: " The colon separating the label and the value " ) ,
154
159
Child ( name: " Declname " ,
155
160
kind: . node( kind: " DeclName " ) ,
161
+ nameForDiagnostics: " declaration name " ,
156
162
description: " The value for this argument " ) ,
157
163
Child ( name: " TrailingComma " ,
158
164
kind: . token( choices: [ . token( tokenKind: " CommaToken " ) ] ) ,
@@ -166,9 +172,11 @@ public let ATTRIBUTE_NODES: [Node] = [
166
172
children: [
167
173
Child ( name: " DeclBaseName " ,
168
174
kind: . token( choices: [ . token( tokenKind: " IdentifierToken " ) , . token( tokenKind: " PrefixOperatorToken " ) , . keyword( text: " init " ) ] ) ,
175
+ nameForDiagnostics: " base name " ,
169
176
description: " The base name of the protocol's requirement. " ) ,
170
177
Child ( name: " DeclNameArguments " ,
171
178
kind: . node( kind: " DeclNameArguments " ) ,
179
+ nameForDiagnostics: " arguments " ,
172
180
description: " The argument labels of the protocol's requirement if it is a function requirement. " ,
173
181
isOptional: true )
174
182
] ) ,
@@ -180,15 +188,18 @@ public let ATTRIBUTE_NODES: [Node] = [
180
188
children: [
181
189
Child ( name: " Type " ,
182
190
kind: . node( kind: " Type " ) ,
191
+ nameForDiagnostics: " type " ,
183
192
description: " The type for which the method with this attribute implements a requirement. " ) ,
184
193
Child ( name: " Comma " ,
185
194
kind: . token( choices: [ . token( tokenKind: " CommaToken " ) ] ) ,
186
195
description: " The comma separating the type and method name " ) ,
187
196
Child ( name: " DeclBaseName " ,
188
197
kind: . node( kind: " Token " ) ,
198
+ nameForDiagnostics: " declaration base name " ,
189
199
description: " The base name of the protocol's requirement. " ) ,
190
200
Child ( name: " DeclNameArguments " ,
191
201
kind: . node( kind: " DeclNameArguments " ) ,
202
+ nameForDiagnostics: " declaration name arguments " ,
192
203
description: " The argument labels of the protocol's requirement if it is a function requirement. " ,
193
204
isOptional: true )
194
205
] ) ,
@@ -200,6 +211,7 @@ public let ATTRIBUTE_NODES: [Node] = [
200
211
children: [
201
212
Child ( name: " Name " ,
202
213
kind: . token( choices: [ . token( tokenKind: " IdentifierToken " ) ] ) ,
214
+ nameForDiagnostics: " name " ,
203
215
isOptional: true ) ,
204
216
Child ( name: " Colon " ,
205
217
kind: . token( choices: [ . token( tokenKind: " ColonToken " ) ] ) ,
@@ -252,7 +264,8 @@ public let ATTRIBUTE_NODES: [Node] = [
252
264
kind: . node( kind: " DifferentiabilityParam " ) ) ,
253
265
Child ( name: " ParameterList " ,
254
266
kind: . node( kind: " DifferentiabilityParams " ) )
255
- ] ) )
267
+ ] ) ,
268
+ nameForDiagnostics: " parameters " )
256
269
] ) ,
257
270
258
271
Node ( name: " DifferentiabilityParams " ,
@@ -326,16 +339,19 @@ public let ATTRIBUTE_NODES: [Node] = [
326
339
children: [
327
340
Child ( name: " BaseType " ,
328
341
kind: . node( kind: " Type " ) ,
342
+ nameForDiagnostics: " base type " ,
329
343
description: " The base type of the qualified name, optionally specified. " ,
330
344
isOptional: true ) ,
331
345
Child ( name: " Dot " ,
332
346
kind: . token( choices: [ . token( tokenKind: " PeriodToken " ) ] ) ,
333
347
isOptional: true ) ,
334
348
Child ( name: " Name " ,
335
349
kind: . token( choices: [ . token( tokenKind: " IdentifierToken " ) , . token( tokenKind: " BinaryOperatorToken " ) , . token( tokenKind: " PrefixOperatorToken " ) , . token( tokenKind: " PostfixOperatorToken " ) ] ) ,
350
+ nameForDiagnostics: " base name " ,
336
351
description: " The base name of the referenced function. " ) ,
337
352
Child ( name: " Arguments " ,
338
353
kind: . node( kind: " DeclNameArguments " ) ,
354
+ nameForDiagnostics: " arguments " ,
339
355
description: " The argument labels of the referenced function, optionally specified. " ,
340
356
isOptional: true )
341
357
] ) ,
@@ -510,7 +526,8 @@ public let ATTRIBUTE_NODES: [Node] = [
510
526
] ,
511
527
children: [
512
528
Child ( name: " Label " ,
513
- kind: . token( choices: [ . keyword( text: " visibility " ) , . keyword( text: " metadata " ) ] ) ) ,
529
+ kind: . token( choices: [ . keyword( text: " visibility " ) , . keyword( text: " metadata " ) ] ) ,
530
+ nameForDiagnostics: " label " ) ,
514
531
Child ( name: " Colon " ,
515
532
kind: . token( choices: [ . token( tokenKind: " ColonToken " ) ] ) ) ,
516
533
Child ( name: " Value " ,
0 commit comments