File tree 2 files changed +12
-4
lines changed
CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax
Sources/SwiftSyntax/generated 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -109,10 +109,14 @@ let syntaxRewriterFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
109
109
/// Override point to choose custom visitation dispatch instead of the
110
110
/// specialized `visit(_:)` methods. Use this instead of those methods if
111
111
/// you intend to dynamically dispatch rewriting behavior.
112
- /// - note: If this method returns a non-nil result, the specialized
113
- /// `visit(_:)` methods will not be called for this node and the
112
+ /// - note: If this method returns a non-nil result, the subsequent
113
+ /// `visitAny(_:)` methods and the specialized `visit(_:)`
114
+ /// methods will not be called for this node and the
114
115
/// visited node will be replaced by the returned node in the
115
116
/// rewritten tree.
117
+ /// You can call the ``SyntaxRewriter/rewrite(_:detach:)``
118
+ /// method recursively when returning a non-nil result
119
+ /// if you want to visit the node's children anyway.
116
120
open func visitAny(_ node: Syntax) -> Syntax? {
117
121
return nil
118
122
}
Original file line number Diff line number Diff line change @@ -73,10 +73,14 @@ open class SyntaxRewriter {
73
73
/// Override point to choose custom visitation dispatch instead of the
74
74
/// specialized `visit(_:)` methods. Use this instead of those methods if
75
75
/// you intend to dynamically dispatch rewriting behavior.
76
- /// - note: If this method returns a non-nil result, the specialized
77
- /// `visit(_:)` methods will not be called for this node and the
76
+ /// - note: If this method returns a non-nil result, the subsequent
77
+ /// `visitAny(_:)` methods and the specialized `visit(_:)`
78
+ /// methods will not be called for this node and the
78
79
/// visited node will be replaced by the returned node in the
79
80
/// rewritten tree.
81
+ /// You can call the ``SyntaxRewriter/rewrite(_:detach:)``
82
+ /// method recursively when returning a non-nil result
83
+ /// if you want to visit the node's children anyway.
80
84
open func visitAny( _ node: Syntax ) -> Syntax ? {
81
85
return nil
82
86
}
You can’t perform that action at this time.
0 commit comments