Skip to content

Commit 33687de

Browse files
committed
Remove underscore from SyntaxViewingMode._all
I believe this syntax viewing mode can be useful in general and there’s no need to make it semi-private with an underscore. rdar://98368959
1 parent e5dc525 commit 33687de

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

Sources/SwiftSyntax/Syntax.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ public extension SyntaxProtocol {
540540
target.write(String(describing: syntaxNodeType))
541541
}
542542

543-
let allChildren = children(viewMode: ._all)
543+
let allChildren = children(viewMode: .all)
544544
if includeChildren {
545545
if !allChildren.isEmpty {
546546
target.write(" children=\(allChildren.count)")

Sources/SwiftSyntax/SyntaxTreeViewMode.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public enum SyntaxTreeViewMode {
2727
/// Both missing and garbage nodes will be traversed.
2828
/// Mostly useful for SwiftSyntax internal verifiers that verify the integrity
2929
/// of the entire tree
30-
case _all
30+
case all
3131

3232
/// Returns whether this traversal node should visit `node` or ignore it.
3333
func shouldTraverse(node: RawSyntax) -> Bool {
@@ -36,7 +36,7 @@ public enum SyntaxTreeViewMode {
3636
return node.presence == .present
3737
case .fixedUp:
3838
return node.kind != .garbageNodes
39-
case ._all:
39+
case .all:
4040
return true
4141
}
4242
}

Sources/SwiftSyntax/SyntaxVerifier.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class SyntaxVerifier: SyntaxAnyVisitor {
3131
var unknownNodes: [Syntax] = []
3232

3333
init() {
34-
super.init(viewMode: ._all)
34+
super.init(viewMode: .all)
3535
}
3636

3737
public override func visitAny(_ node: Syntax) -> SyntaxVisitorContinueKind {

Sources/_SwiftSyntaxTestSupport/Syntax+Assertions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ fileprivate class SyntaxTypeFinder: SyntaxAnyVisitor {
237237
self.offset = offset
238238
self.type = type
239239
self.found = nil
240-
super.init(viewMode: ._all)
240+
super.init(viewMode: .all)
241241
}
242242

243243
fileprivate override func visitAny(_ node: Syntax) -> SyntaxVisitorContinueKind {

Sources/_SwiftSyntaxTestSupport/SyntaxComparison.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ public extension SyntaxProtocol {
9494
return TreeDifference(node: self, baseline: baseline, reason: reason)
9595
}
9696

97-
var iterator = children(viewMode: ._all).makeIterator()
98-
var baseIterator = baseline.children(viewMode: ._all).makeIterator()
97+
var iterator = children(viewMode: .all).makeIterator()
98+
var baseIterator = baseline.children(viewMode: .all).makeIterator()
9999
while let child = iterator.next() {
100100
guard let baselineChild = baseIterator.next() else {
101101
return TreeDifference(node: child, baseline: baseline, reason: .additionalNode)

Sources/lit-test-helper/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ func diagnose(args: CommandLineArguments) throws {
505505
init(diagnosticHandler: @escaping ((Diagnostic) -> Void), _ converter: SourceLocationConverter) {
506506
self.diagnosticHandler = diagnosticHandler
507507
self.converter = converter
508-
super.init(viewMode: ._all)
508+
super.init(viewMode: .all)
509509
}
510510
override func visitAny(_ node: Syntax) -> SyntaxVisitorContinueKind {
511511
if node.isUnknown {

0 commit comments

Comments
 (0)