Skip to content

Commit 911284b

Browse files
authored
Merge pull request #2429 from ahoppen/ahoppen/implementation-only
Remove `@_implementationOnly` annotations
2 parents 4265ac0 + 28d9403 commit 911284b

File tree

3 files changed

+34
-9
lines changed

3 files changed

+34
-9
lines changed

Sources/SwiftCompilerPlugin/CompilerPlugin.swift

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,22 @@
1212
// NOTE: This basic plugin mechanism is mostly copied from
1313
// https://github.com/apple/swift-package-manager/blob/main/Sources/PackagePlugin/Plugin.swift
1414

15-
@_implementationOnly import Foundation
16-
@_implementationOnly import SwiftCompilerPluginMessageHandling
1715
import SwiftSyntaxMacros
1816

17+
#if swift(>=5.11)
18+
private import Foundation
19+
private import SwiftCompilerPluginMessageHandling
20+
#else
21+
import Foundation
22+
import SwiftCompilerPluginMessageHandling
23+
#endif
24+
1925
#if os(Windows)
20-
@_implementationOnly import ucrt
26+
#if swift(>=5.11)
27+
private import ucrt
28+
#else
29+
import ucrt
30+
#endif
2131
#endif
2232

2333
//
@@ -167,8 +177,8 @@ extension CompilerPlugin {
167177
}
168178

169179
internal struct PluginHostConnection: MessageConnection {
170-
let inputStream: FileHandle
171-
let outputStream: FileHandle
180+
fileprivate let inputStream: FileHandle
181+
fileprivate let outputStream: FileHandle
172182

173183
func sendMessage<TX: Encodable>(_ message: TX) throws {
174184
// Encode the message as JSON.

Sources/SwiftSyntax/SyntaxText.swift

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,22 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
#if swift(>=5.11)
1314
#if canImport(Darwin)
14-
@_implementationOnly import Darwin
15+
private import Darwin
1516
#elseif canImport(Glibc)
16-
@_implementationOnly import Glibc
17+
private import Glibc
1718
#elseif canImport(Musl)
18-
@_implementationOnly import Musl
19+
private import Musl
20+
#endif
21+
#else
22+
#if canImport(Darwin)
23+
import Darwin
24+
#elseif canImport(Glibc)
25+
import Glibc
26+
#elseif canImport(Musl)
27+
import Musl
28+
#endif
1929
#endif
2030

2131
/// Represent a string.

Sources/SwiftSyntaxMacrosTestSupport/Assertions.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,14 @@ import SwiftParserDiagnostics
1717
import SwiftSyntax
1818
import SwiftSyntaxMacroExpansion
1919
import SwiftSyntaxMacros
20-
import XCTest
2120
import _SwiftSyntaxTestSupport
2221

22+
#if swift(>=5.11)
23+
private import XCTest
24+
#else
25+
import XCTest
26+
#endif
27+
2328
// MARK: - Note
2429

2530
/// Describes a diagnostic note that tests expect to be created by a macro expansion.

0 commit comments

Comments
 (0)