Skip to content

Commit 60e41b0

Browse files
authored
Merge pull request #1957 from ahoppen/ahoppen/no-contained-in-for-unexpected
Don’t generate a “Contained In” section for UnexpectedNodesSyntax
2 parents cca42d0 + 84b6a7c commit 60e41b0

File tree

2 files changed

+5
-987
lines changed

2 files changed

+5
-987
lines changed

CodeGeneration/Sources/SyntaxSupport/Node.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@ public class Node {
151151

152152
/// A doc comment that lists all the nodes in which this node occurs as a child in.
153153
public var containedIn: SwiftSyntax.Trivia {
154+
if kind == .unexpectedNodes {
155+
// We don't want to generate a 'Contained In' section for UnexpectedNodesSyntax
156+
// because all nodes contain an UnexpectedNodesSyntax.
157+
return []
158+
}
154159
var childIn: [(node: SyntaxNodeKind, child: Child?)] = []
155160
for node in SYNTAX_NODES {
156161
if let layout = node.layoutNode {

0 commit comments

Comments
 (0)