Skip to content

Commit 55be120

Browse files
committed
Rename a couple name for diagnsotics based on new syntax names
1 parent fdb3911 commit 55be120

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

CodeGeneration/Sources/SyntaxSupport/DeclNodes.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ public let DECL_NODES: [Node] = [
280280
Child(
281281
name: "InheritanceClause",
282282
kind: .node(kind: .inheritanceClause),
283-
nameForDiagnostics: "type inheritance clause",
283+
nameForDiagnostics: "inheritance clause",
284284
isOptional: true
285285
),
286286
Child(
@@ -742,7 +742,7 @@ public let DECL_NODES: [Node] = [
742742
name: "DefaultValue",
743743
deprecatedName: "DefaultArgument",
744744
kind: .node(kind: .initializerClause),
745-
nameForDiagnostics: "default argument",
745+
nameForDiagnostics: "default value",
746746
documentation: "If the parameter has a default value, the initializer clause describing the default value.",
747747
isOptional: true
748748
),
@@ -1087,7 +1087,7 @@ public let DECL_NODES: [Node] = [
10871087
name: "DefaultValue",
10881088
deprecatedName: "DefaultArgument",
10891089
kind: .node(kind: .initializerClause),
1090-
nameForDiagnostics: "default argument",
1090+
nameForDiagnostics: "default value",
10911091
isOptional: true
10921092
),
10931093
Child(
@@ -2194,7 +2194,7 @@ public let DECL_NODES: [Node] = [
21942194
Child(
21952195
name: "InheritanceClause",
21962196
kind: .node(kind: .inheritanceClause),
2197-
nameForDiagnostics: "type inheritance clause",
2197+
nameForDiagnostics: "inheritance clause",
21982198
documentation: "The struct declaration inheritance clause describing one or more conformances for this struct declaration.",
21992199
isOptional: true
22002200
),

CodeGeneration/Sources/SyntaxSupport/ExprNodes.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ public let EXPR_NODES: [Node] = [
310310
Node(
311311
kind: .closureCapture,
312312
base: .syntax,
313-
nameForDiagnostics: "closure capture item",
313+
nameForDiagnostics: "closure capture",
314314
traits: [
315315
"WithTrailingComma"
316316
],
@@ -346,7 +346,7 @@ public let EXPR_NODES: [Node] = [
346346
Node(
347347
kind: .closureCaptureClause,
348348
base: .syntax,
349-
nameForDiagnostics: "closure capture signature",
349+
nameForDiagnostics: "closure capture clause",
350350
children: [
351351
Child(
352352
name: "LeftSquare",

Sources/SwiftParserDiagnostics/generated/ChildNameForDiagnostics.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ private func childNameForDiagnostics(_ keyPath: AnyKeyPath) -> String? {
3333
case \ActorDeclSyntax.genericParameterClause:
3434
return "generic parameter clause"
3535
case \ActorDeclSyntax.inheritanceClause:
36-
return "type inheritance clause"
36+
return "inheritance clause"
3737
case \ActorDeclSyntax.genericWhereClause:
3838
return "generic where clause"
3939
case \ArrayElementSyntax.expression:
@@ -117,7 +117,7 @@ private func childNameForDiagnostics(_ keyPath: AnyKeyPath) -> String? {
117117
case \EnumCaseParameterSyntax.type:
118118
return "type"
119119
case \EnumCaseParameterSyntax.defaultValue:
120-
return "default argument"
120+
return "default value"
121121
case \EnumDeclSyntax.attributes:
122122
return "attributes"
123123
case \EnumDeclSyntax.modifiers:
@@ -167,7 +167,7 @@ private func childNameForDiagnostics(_ keyPath: AnyKeyPath) -> String? {
167167
case \FunctionParameterSyntax.type:
168168
return "type"
169169
case \FunctionParameterSyntax.defaultValue:
170-
return "default argument"
170+
return "default value"
171171
case \GenericParameterSyntax.eachKeyword:
172172
return "parameter pack specifier"
173173
case \GenericParameterSyntax.name:
@@ -317,7 +317,7 @@ private func childNameForDiagnostics(_ keyPath: AnyKeyPath) -> String? {
317317
case \StructDeclSyntax.genericParameterClause:
318318
return "generic parameter clause"
319319
case \StructDeclSyntax.inheritanceClause:
320-
return "type inheritance clause"
320+
return "inheritance clause"
321321
case \StructDeclSyntax.genericWhereClause:
322322
return "generic where clause"
323323
case \SubscriptCallExprSyntax.calledExpression:

Sources/SwiftParserDiagnostics/generated/SyntaxKindNameForDiagnostics.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ extension SyntaxKind {
7272
case .classDecl:
7373
return "class"
7474
case .closureCaptureClause:
75-
return "closure capture signature"
75+
return "closure capture clause"
7676
case .closureCaptureSpecifier:
7777
return "closure capture specifier"
7878
case .closureCapture:
79-
return "closure capture item"
79+
return "closure capture"
8080
case .closureExpr:
8181
return "closure"
8282
case .closureParameterClause:

Tests/SwiftParserTest/TypeTests.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ final class TypeTests: XCTestCase {
9999
diagnostics: [
100100
DiagnosticSpec(
101101
locationMarker: "1️⃣",
102-
message: "expected identifier in closure capture item",
102+
message: "expected identifier in closure capture",
103103
fixIts: ["insert identifier"]
104104
),
105105
DiagnosticSpec(
106106
locationMarker: "1️⃣",
107-
message: "unexpected 'class' keyword in closure capture signature"
107+
message: "unexpected 'class' keyword in closure capture clause"
108108
),
109109
DiagnosticSpec(
110110
locationMarker: "2️⃣",
@@ -123,16 +123,16 @@ final class TypeTests: XCTestCase {
123123
"{[n1️⃣`]in}",
124124
{ ExprSyntax.parse(from: &$0) },
125125
diagnostics: [
126-
DiagnosticSpec(message: "unexpected code '`' in closure capture signature")
126+
DiagnosticSpec(message: "unexpected code '`' in closure capture clause")
127127
]
128128
)
129129

130130
assertParse(
131131
"{[weak1️⃣^]in}",
132132
{ ExprSyntax.parse(from: &$0) },
133133
diagnostics: [
134-
DiagnosticSpec(message: "expected identifier in closure capture item", fixIts: ["insert identifier"]),
135-
DiagnosticSpec(message: "unexpected code '^' in closure capture signature"),
134+
DiagnosticSpec(message: "expected identifier in closure capture", fixIts: ["insert identifier"]),
135+
DiagnosticSpec(message: "unexpected code '^' in closure capture clause"),
136136
],
137137
fixedSource: """
138138
{[weak <#identifier#>^]in}

0 commit comments

Comments
 (0)