Skip to content

Commit d6cf55b

Browse files
committed
[ASTGen] Update PluginMessage for conformance macro
1 parent 5f93166 commit d6cf55b

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

lib/ASTGen/Sources/ASTGen/Macros.swift

+5-2
Original file line numberDiff line numberDiff line change
@@ -554,12 +554,15 @@ func expandAttachedMacroIPC(
554554

555555
// Map the macro role.
556556
let macroRole: PluginMessage.MacroRole
557-
switch MacroRole(rawValue: rawMacroRole) {
557+
switch MacroRole(rawValue: rawMacroRole)! {
558558
case .Accessor: macroRole = .accessor
559559
case .Member: macroRole = .member
560560
case .MemberAttribute: macroRole = .memberAttribute
561561
case .Peer: macroRole = .peer
562-
default:
562+
case .Conformance: macroRole = .conformance
563+
case
564+
.Expression,
565+
.FreestandingDeclaration:
563566
preconditionFailure("unhandled macro role for attached macro")
564567
}
565568

lib/ASTGen/Sources/ASTGen/PluginMessages.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ internal enum PluginToHostMessage: Codable {
4040
}
4141

4242
/*namespace*/ internal enum PluginMessage {
43-
static var PROTOCOL_VERSION_NUMBER: Int { 1 }
43+
static var PROTOCOL_VERSION_NUMBER: Int { 2 } // Added 'MacroRole.conformance'
4444

4545
struct PluginCapability: Codable {
4646
var protocolVersion: Int
@@ -65,6 +65,7 @@ internal enum PluginToHostMessage: Codable {
6565
case memberAttribute
6666
case member
6767
case peer
68+
case conformance
6869
}
6970

7071
struct SourceLocation: Codable {

0 commit comments

Comments
 (0)