Skip to content

Commit 089cad0

Browse files
committed
Update for review
1 parent 9f40b5c commit 089cad0

File tree

6 files changed

+217
-182
lines changed

6 files changed

+217
-182
lines changed

Sources/SwiftCompilerPlugin/CompilerPlugin.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,12 @@ extension CompilerPlugin {
152152
expandingSyntax: expandingSyntax
153153
)
154154

155-
case .expandAttachedMacro(let macro, let macroRole, let discriminator, let customAttributeSyntax, let declSyntax, let parentDeclSyntax):
155+
case .expandAttachedMacro(let macro, let macroRole, let discriminator, let attributeSyntax, let declSyntax, let parentDeclSyntax):
156156
try expandAttachedMacro(
157157
macro: macro,
158158
macroRole: macroRole,
159159
discriminator: discriminator,
160-
customAttributeSyntax: customAttributeSyntax,
160+
attributeSyntax: attributeSyntax,
161161
declSyntax: declSyntax,
162162
parentDeclSyntax: parentDeclSyntax
163163
)

Sources/SwiftCompilerPlugin/Diagnostics.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ import SwiftSyntax
1616
/// Errors in macro handing.
1717
enum MacroExpansionError: String {
1818
case macroTypeNotFound = "macro expanding type not found"
19+
case unmathedMacroRole = "macro doesn't conform to required macro role"
1920
case freestandingMacroSyntaxIsNotMacro = "macro syntax couldn't be parsed"
21+
case invalidExpansionMessage = ""
2022
}
2123

2224
extension MacroExpansionError: DiagnosticMessage {
@@ -31,6 +33,8 @@ extension MacroExpansionError: DiagnosticMessage {
3133
}
3234
}
3335

36+
extension MacroExpansionError: Error {}
37+
3438
extension PluginMessage.Diagnostic.Severity {
3539
init(from syntaxDiagSeverity: SwiftDiagnostics.DiagnosticSeverity) {
3640
switch syntaxDiagSeverity {

0 commit comments

Comments
 (0)