File tree Expand file tree Collapse file tree 6 files changed +17
-4
lines changed
SwiftCompilerPluginMessageHandling Expand file tree Collapse file tree 6 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 172
172
- Pull request: https://github.com/apple/swift-syntax/pull/2531
173
173
- Migration steps: Use ` if case .backslash = triviaPiece ` instead
174
174
175
+ - All symbols in ` SwiftCompilerPluginMessageHandling ` are now SPI
176
+ - Description: This module is only intended to be used from some internal components. Any other modules should not use them directly.
177
+ - Pull request: https://github.com/apple/swift-syntax/pull/2489
178
+ - Migration steps: Stop using this module.
179
+
175
180
## Template
176
181
177
182
- * Affected API or two word description*
Original file line number Diff line number Diff line change 15
15
#if swift(>=6.0)
16
16
public import SwiftSyntaxMacros
17
17
private import Foundation
18
- private import SwiftCompilerPluginMessageHandling
18
+ @ _spi ( PluginMessage ) private import SwiftCompilerPluginMessageHandling
19
19
#else
20
20
import SwiftSyntaxMacros
21
21
import Foundation
22
- import SwiftCompilerPluginMessageHandling
22
+ @ _spi ( PluginMessage ) import SwiftCompilerPluginMessageHandling
23
23
#endif
24
24
25
25
#if os(Windows)
Original file line number Diff line number Diff line change @@ -17,11 +17,13 @@ import SwiftSyntaxMacros
17
17
#endif
18
18
19
19
/// Optional features.
20
+ @_spi ( PluginMessage)
20
21
public enum PluginFeature : String {
21
22
case loadPluginLibrary = " load-plugin-library "
22
23
}
23
24
24
25
/// A type that provides the actual plugin functions.
26
+ @_spi ( PluginMessage)
25
27
public protocol PluginProvider {
26
28
/// Resolve macro type by the module name and the type name.
27
29
func resolveMacro( moduleName: String , typeName: String ) throws -> Macro . Type
@@ -37,6 +39,7 @@ public protocol PluginProvider {
37
39
38
40
/// Low level message connection to the plugin host.
39
41
/// This encapsulates the connection and the message serialization.
42
+ @_spi ( PluginMessage)
40
43
public protocol MessageConnection {
41
44
/// Send a message to the peer.
42
45
func sendMessage< TX: Encodable > ( _ message: TX ) throws
@@ -66,6 +69,7 @@ struct HostCapability {
66
69
/// the response.
67
70
///
68
71
/// The low level connection and the provider is injected by the client.
72
+ @_spi ( PluginMessage)
69
73
public class CompilerPluginMessageHandler < Connection: MessageConnection , Provider: PluginProvider > {
70
74
/// Message channel for bidirectional communication with the plugin host.
71
75
let connection : Connection
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import SwiftBasicFormat
14
14
import SwiftDiagnostics
15
15
import SwiftOperators
16
16
import SwiftSyntax
17
- @_spi ( ExperimentalLanguageFeature) import SwiftSyntaxMacroExpansion
17
+ @_spi ( MacroExpansion ) @ _spi ( ExperimentalLanguageFeature) import SwiftSyntaxMacroExpansion
18
18
@_spi ( ExperimentalLanguageFeature) import SwiftSyntaxMacros
19
19
20
20
extension CompilerPluginMessageHandler {
Original file line number Diff line number Diff line change 11
11
//===----------------------------------------------------------------------===//
12
12
13
13
/// Old compiler might send '.declaration' as "freeStandingDeclaration".
14
- @_spi ( PluginMessage) public extension PluginMessage . MacroRole {
14
+ @_spi ( PluginMessage)
15
+ public extension PluginMessage . MacroRole {
15
16
init ( from decoder: Decoder ) throws {
16
17
let stringValue = try decoder. singleValueContainer ( ) . decode ( String . self)
17
18
if let role = Self ( rawValue: stringValue) {
Original file line number Diff line number Diff line change 12
12
13
13
// NOTE: Types in this file should be self-contained and should not depend on any non-stdlib types.
14
14
15
+ @_spi ( PluginMessage)
15
16
public enum HostToPluginMessage : Codable {
16
17
/// Send capability of the host, and get capability of the plugin.
17
18
case getCapability(
@@ -49,6 +50,7 @@ public enum HostToPluginMessage: Codable {
49
50
)
50
51
}
51
52
53
+ @_spi ( PluginMessage)
52
54
public enum PluginToHostMessage : Codable {
53
55
case getCapabilityResult(
54
56
capability: PluginMessage . PluginCapability
@@ -78,6 +80,7 @@ public enum PluginToHostMessage: Codable {
78
80
)
79
81
}
80
82
83
+ @_spi ( PluginMessage)
81
84
public enum PluginMessage {
82
85
public static var PROTOCOL_VERSION_NUMBER : Int { 7 } // Pass extension protocol list
83
86
You can’t perform that action at this time.
0 commit comments