Skip to content

Commit 84b6a7c

Browse files
committed
Don’t generate a “Contained In” section for UnexpectedNodesSyntax
All nodes contain an UnexpectedNodesSyntax and thus the section isn’t really helpful.
1 parent be8dc65 commit 84b6a7c

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)