Skip to content

Commit 3cb79cf

Browse files
committed
Make SyntaxTransformVisitor SPI
We want to remove this API, mark it SPI so the remaining clients can be weaned off.
1 parent 3b727c6 commit 3cb79cf

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CodeGeneration/Sources/generate-swiftsyntax/templates/swiftsyntax/SyntaxTransformFile.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ import SyntaxSupport
1616
import Utils
1717

1818
let syntaxTransformFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
19-
try! ProtocolDeclSyntax("public protocol SyntaxTransformVisitor") {
19+
try! ProtocolDeclSyntax(
20+
"""
21+
@_spi(SyntaxTransformVisitor)
22+
public protocol SyntaxTransformVisitor
23+
"""
24+
) {
2025
DeclSyntax("associatedtype ResultType = Void")
2126

2227
DeclSyntax("func visitAny(_ node: Syntax) -> ResultType")

Tests/SwiftParserTest/SyntaxTransformVisitorTest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import XCTest
1414
import SwiftParser
15-
import SwiftSyntax
15+
@_spi(SyntaxTransformVisitor) import SwiftSyntax
1616

1717
final class SyntaxTransformVisitorTest: XCTestCase {
1818
public func testFunctionCounter() {

0 commit comments

Comments
 (0)