|
| 1 | +// swift-interface-format-version: 1.0 |
| 2 | +// swift-compiler-version: Apple Swift version 6.0 effective-5.10 (swiftlang-6.0.0.3.300 clang-1600.0.20.10) |
| 3 | +// swift-module-flags: -target arm64-apple-ios13.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -Onone -enable-experimental-feature DebugDescriptionMacro -module-name SwiftCompilerPluginMessageHandling |
| 4 | +import Swift |
| 5 | +import SwiftBasicFormat |
| 6 | +import SwiftDiagnostics |
| 7 | +import SwiftOperators |
| 8 | +import SwiftParser |
| 9 | +import SwiftSyntax |
| 10 | +import SwiftSyntaxMacroExpansion |
| 11 | +import SwiftSyntaxMacros |
| 12 | +import _Concurrency |
| 13 | +import _StringProcessing |
| 14 | +import _SwiftConcurrencyShims |
| 15 | +public enum PluginFeature : Swift.String { |
| 16 | + case loadPluginLibrary |
| 17 | + #if compiler(>=5.3) && $NoncopyableGenerics |
| 18 | + public init?(rawValue: Swift.String) |
| 19 | + #else |
| 20 | + public init?(rawValue: Swift.String) |
| 21 | + #endif |
| 22 | + public typealias RawValue = Swift.String |
| 23 | + public var rawValue: Swift.String { |
| 24 | + get |
| 25 | + } |
| 26 | +} |
| 27 | +public protocol PluginProvider { |
| 28 | + #if compiler(>=5.3) && $NoncopyableGenerics |
| 29 | + func resolveMacro(moduleName: Swift.String, typeName: Swift.String) -> (any SwiftSyntaxMacros.Macro.Type)? |
| 30 | + #else |
| 31 | + func resolveMacro(moduleName: Swift.String, typeName: Swift.String) -> (any SwiftSyntaxMacros.Macro.Type)? |
| 32 | + #endif |
| 33 | + func loadPluginLibrary(libraryPath: Swift.String, moduleName: Swift.String) throws |
| 34 | + var features: [SwiftCompilerPluginMessageHandling.PluginFeature] { get } |
| 35 | +} |
| 36 | +public protocol MessageConnection { |
| 37 | + func sendMessage<TX>(_ message: TX) throws where TX : Swift.Encodable |
| 38 | + #if compiler(>=5.3) && $NoncopyableGenerics |
| 39 | + func waitForNextMessage<RX>(_ type: RX.Type) throws -> RX? where RX : Swift.Decodable |
| 40 | + #else |
| 41 | + func waitForNextMessage<RX>(_ type: RX.Type) throws -> RX? where RX : Swift.Decodable |
| 42 | + #endif |
| 43 | +} |
| 44 | +public class CompilerPluginMessageHandler<Connection, Provider> where Connection : SwiftCompilerPluginMessageHandling.MessageConnection, Provider : SwiftCompilerPluginMessageHandling.PluginProvider { |
| 45 | + public init(connection: Connection, provider: Provider) |
| 46 | + @objc deinit |
| 47 | +} |
| 48 | +extension SwiftCompilerPluginMessageHandling.CompilerPluginMessageHandler { |
| 49 | + public func main() throws |
| 50 | +} |
| 51 | +extension SwiftCompilerPluginMessageHandling.PluginProvider { |
| 52 | + public var features: [SwiftCompilerPluginMessageHandling.PluginFeature] { |
| 53 | + get |
| 54 | + } |
| 55 | + public func loadPluginLibrary(libraryPath: Swift.String, moduleName: Swift.String) throws |
| 56 | +} |
| 57 | +public enum HostToPluginMessage : Swift.Codable { |
| 58 | + case getCapability(capability: SwiftCompilerPluginMessageHandling.PluginMessage.HostCapability?) |
| 59 | + case expandFreestandingMacro(macro: SwiftCompilerPluginMessageHandling.PluginMessage.MacroReference, macroRole: SwiftCompilerPluginMessageHandling.PluginMessage.MacroRole? = nil, discriminator: Swift.String, syntax: SwiftCompilerPluginMessageHandling.PluginMessage.Syntax) |
| 60 | + case expandAttachedMacro(macro: SwiftCompilerPluginMessageHandling.PluginMessage.MacroReference, macroRole: SwiftCompilerPluginMessageHandling.PluginMessage.MacroRole, discriminator: Swift.String, attributeSyntax: SwiftCompilerPluginMessageHandling.PluginMessage.Syntax, declSyntax: SwiftCompilerPluginMessageHandling.PluginMessage.Syntax, parentDeclSyntax: SwiftCompilerPluginMessageHandling.PluginMessage.Syntax?, extendedTypeSyntax: SwiftCompilerPluginMessageHandling.PluginMessage.Syntax?, conformanceListSyntax: SwiftCompilerPluginMessageHandling.PluginMessage.Syntax?) |
| 61 | + case loadPluginLibrary(libraryPath: Swift.String, moduleName: Swift.String) |
| 62 | + public func encode(to encoder: any Swift.Encoder) throws |
| 63 | + public init(from decoder: any Swift.Decoder) throws |
| 64 | +} |
| 65 | +public enum PluginToHostMessage : Swift.Codable { |
| 66 | + case getCapabilityResult(capability: SwiftCompilerPluginMessageHandling.PluginMessage.PluginCapability) |
| 67 | + case expandMacroResult(expandedSource: Swift.String?, diagnostics: [SwiftCompilerPluginMessageHandling.PluginMessage.Diagnostic]) |
| 68 | + case expandFreestandingMacroResult(expandedSource: Swift.String?, diagnostics: [SwiftCompilerPluginMessageHandling.PluginMessage.Diagnostic]) |
| 69 | + case expandAttachedMacroResult(expandedSources: [Swift.String]?, diagnostics: [SwiftCompilerPluginMessageHandling.PluginMessage.Diagnostic]) |
| 70 | + case loadPluginLibraryResult(loaded: Swift.Bool, diagnostics: [SwiftCompilerPluginMessageHandling.PluginMessage.Diagnostic]) |
| 71 | + public func encode(to encoder: any Swift.Encoder) throws |
| 72 | + public init(from decoder: any Swift.Decoder) throws |
| 73 | +} |
| 74 | +public enum PluginMessage { |
| 75 | + public static var PROTOCOL_VERSION_NUMBER: Swift.Int { |
| 76 | + get |
| 77 | + } |
| 78 | + public struct HostCapability : Swift.Codable { |
| 79 | + public init(protocolVersion: Swift.Int) |
| 80 | + public func encode(to encoder: any Swift.Encoder) throws |
| 81 | + public init(from decoder: any Swift.Decoder) throws |
| 82 | + } |
| 83 | + public struct PluginCapability : Swift.Codable { |
| 84 | + public var protocolVersion: Swift.Int |
| 85 | + public var features: [Swift.String]? |
| 86 | + #if compiler(>=5.3) && $NoncopyableGenerics |
| 87 | + public init(protocolVersion: Swift.Int, features: [Swift.String]? = nil) |
| 88 | + #else |
| 89 | + public init(protocolVersion: Swift.Int, features: [Swift.String]? = nil) |
| 90 | + #endif |
| 91 | + public func encode(to encoder: any Swift.Encoder) throws |
| 92 | + public init(from decoder: any Swift.Decoder) throws |
| 93 | + } |
| 94 | + public struct MacroReference : Swift.Codable { |
| 95 | + public var moduleName: Swift.String |
| 96 | + public var typeName: Swift.String |
| 97 | + public var name: Swift.String |
| 98 | + public init(moduleName: Swift.String, typeName: Swift.String, name: Swift.String) |
| 99 | + public func encode(to encoder: any Swift.Encoder) throws |
| 100 | + public init(from decoder: any Swift.Decoder) throws |
| 101 | + } |
| 102 | + public enum MacroRole : Swift.String, Swift.Codable { |
| 103 | + case expression |
| 104 | + case declaration |
| 105 | + case accessor |
| 106 | + case memberAttribute |
| 107 | + case member |
| 108 | + case peer |
| 109 | + case conformance |
| 110 | + case codeItem |
| 111 | + case `extension` |
| 112 | + #if compiler(>=5.3) && $NoncopyableGenerics |
| 113 | + public init?(rawValue: Swift.String) |
| 114 | + #else |
| 115 | + public init?(rawValue: Swift.String) |
| 116 | + #endif |
| 117 | + public typealias RawValue = Swift.String |
| 118 | + public var rawValue: Swift.String { |
| 119 | + get |
| 120 | + } |
| 121 | + } |
| 122 | + public struct SourceLocation : Swift.Codable { |
| 123 | + public var fileID: Swift.String |
| 124 | + public var fileName: Swift.String |
| 125 | + public var offset: Swift.Int |
| 126 | + public var line: Swift.Int |
| 127 | + public var column: Swift.Int |
| 128 | + public init(fileID: Swift.String, fileName: Swift.String, offset: Swift.Int, line: Swift.Int, column: Swift.Int) |
| 129 | + public func encode(to encoder: any Swift.Encoder) throws |
| 130 | + public init(from decoder: any Swift.Decoder) throws |
| 131 | + } |
| 132 | + public struct Diagnostic : Swift.Codable { |
| 133 | + public enum Severity : Swift.String, Swift.Codable { |
| 134 | + case error |
| 135 | + case warning |
| 136 | + case note |
| 137 | + case remark |
| 138 | + #if compiler(>=5.3) && $NoncopyableGenerics |
| 139 | + public init?(rawValue: Swift.String) |
| 140 | + #else |
| 141 | + public init?(rawValue: Swift.String) |
| 142 | + #endif |
| 143 | + public typealias RawValue = Swift.String |
| 144 | + public var rawValue: Swift.String { |
| 145 | + get |
| 146 | + } |
| 147 | + } |
| 148 | + public struct Position : Swift.Codable { |
| 149 | + public var fileName: Swift.String |
| 150 | + public var offset: Swift.Int |
| 151 | + public init(fileName: Swift.String, offset: Swift.Int) |
| 152 | + public static var invalid: SwiftCompilerPluginMessageHandling.PluginMessage.Diagnostic.Position { |
| 153 | + get |
| 154 | + } |
| 155 | + public func encode(to encoder: any Swift.Encoder) throws |
| 156 | + public init(from decoder: any Swift.Decoder) throws |
| 157 | + } |
| 158 | + public struct PositionRange : Swift.Codable { |
| 159 | + public var fileName: Swift.String |
| 160 | + public var startOffset: Swift.Int |
| 161 | + public var endOffset: Swift.Int |
| 162 | + public init(fileName: Swift.String, startOffset: Swift.Int, endOffset: Swift.Int) |
| 163 | + public static var invalid: SwiftCompilerPluginMessageHandling.PluginMessage.Diagnostic.PositionRange { |
| 164 | + get |
| 165 | + } |
| 166 | + public func encode(to encoder: any Swift.Encoder) throws |
| 167 | + public init(from decoder: any Swift.Decoder) throws |
| 168 | + } |
| 169 | + public struct Note : Swift.Codable { |
| 170 | + public var position: SwiftCompilerPluginMessageHandling.PluginMessage.Diagnostic.Position |
| 171 | + public var message: Swift.String |
| 172 | + public init(position: SwiftCompilerPluginMessageHandling.PluginMessage.Diagnostic.Position, message: Swift.String) |
| 173 | + public func encode(to encoder: any Swift.Encoder) throws |
| 174 | + public init(from decoder: any Swift.Decoder) throws |
| 175 | + } |
| 176 | + public struct FixIt : Swift.Codable { |
| 177 | + public struct Change : Swift.Codable { |
| 178 | + public var range: SwiftCompilerPluginMessageHandling.PluginMessage.Diagnostic.PositionRange |
| 179 | + public var newText: Swift.String |
| 180 | + public func encode(to encoder: any Swift.Encoder) throws |
| 181 | + public init(from decoder: any Swift.Decoder) throws |
| 182 | + } |
| 183 | + public var message: Swift.String |
| 184 | + public var changes: [SwiftCompilerPluginMessageHandling.PluginMessage.Diagnostic.FixIt.Change] |
| 185 | + public func encode(to encoder: any Swift.Encoder) throws |
| 186 | + public init(from decoder: any Swift.Decoder) throws |
| 187 | + } |
| 188 | + public var message: Swift.String |
| 189 | + public var severity: SwiftCompilerPluginMessageHandling.PluginMessage.Diagnostic.Severity |
| 190 | + public var position: SwiftCompilerPluginMessageHandling.PluginMessage.Diagnostic.Position |
| 191 | + public var highlights: [SwiftCompilerPluginMessageHandling.PluginMessage.Diagnostic.PositionRange] |
| 192 | + public var notes: [SwiftCompilerPluginMessageHandling.PluginMessage.Diagnostic.Note] |
| 193 | + public var fixIts: [SwiftCompilerPluginMessageHandling.PluginMessage.Diagnostic.FixIt] |
| 194 | + public func encode(to encoder: any Swift.Encoder) throws |
| 195 | + public init(from decoder: any Swift.Decoder) throws |
| 196 | + } |
| 197 | + public struct Syntax : Swift.Codable { |
| 198 | + public enum Kind : Swift.String, Swift.Codable { |
| 199 | + case declaration |
| 200 | + case statement |
| 201 | + case expression |
| 202 | + case type |
| 203 | + case pattern |
| 204 | + case attribute |
| 205 | + #if compiler(>=5.3) && $NoncopyableGenerics |
| 206 | + public init?(rawValue: Swift.String) |
| 207 | + #else |
| 208 | + public init?(rawValue: Swift.String) |
| 209 | + #endif |
| 210 | + public typealias RawValue = Swift.String |
| 211 | + public var rawValue: Swift.String { |
| 212 | + get |
| 213 | + } |
| 214 | + } |
| 215 | + public var kind: SwiftCompilerPluginMessageHandling.PluginMessage.Syntax.Kind |
| 216 | + public var source: Swift.String |
| 217 | + public var location: SwiftCompilerPluginMessageHandling.PluginMessage.SourceLocation |
| 218 | + public init(kind: SwiftCompilerPluginMessageHandling.PluginMessage.Syntax.Kind, source: Swift.String, location: SwiftCompilerPluginMessageHandling.PluginMessage.SourceLocation) |
| 219 | + public func encode(to encoder: any Swift.Encoder) throws |
| 220 | + public init(from decoder: any Swift.Decoder) throws |
| 221 | + } |
| 222 | +} |
| 223 | +extension SwiftCompilerPluginMessageHandling.PluginFeature : Swift.Equatable {} |
| 224 | +extension SwiftCompilerPluginMessageHandling.PluginFeature : Swift.Hashable {} |
| 225 | +extension SwiftCompilerPluginMessageHandling.PluginFeature : Swift.RawRepresentable {} |
| 226 | +extension SwiftCompilerPluginMessageHandling.PluginMessage.Diagnostic.Severity : Swift.Equatable {} |
| 227 | +extension SwiftCompilerPluginMessageHandling.PluginMessage.Diagnostic.Severity : Swift.Hashable {} |
| 228 | +extension SwiftCompilerPluginMessageHandling.PluginMessage.Diagnostic.Severity : Swift.RawRepresentable {} |
| 229 | +extension SwiftCompilerPluginMessageHandling.PluginMessage.MacroRole : Swift.Equatable {} |
| 230 | +extension SwiftCompilerPluginMessageHandling.PluginMessage.MacroRole : Swift.Hashable {} |
| 231 | +extension SwiftCompilerPluginMessageHandling.PluginMessage.MacroRole : Swift.RawRepresentable {} |
| 232 | +extension SwiftCompilerPluginMessageHandling.PluginMessage.Syntax.Kind : Swift.Equatable {} |
| 233 | +extension SwiftCompilerPluginMessageHandling.PluginMessage.Syntax.Kind : Swift.Hashable {} |
| 234 | +extension SwiftCompilerPluginMessageHandling.PluginMessage.Syntax.Kind : Swift.RawRepresentable {} |
0 commit comments