Skip to content

Commit 01c125d

Browse files
committed
Update for review
1 parent 306eb51 commit 01c125d

File tree

6 files changed

+218
-183
lines changed

6 files changed

+218
-183
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: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,25 @@ 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 {
2325
var message: String {
2426
self.rawValue
2527
}
2628
var diagnosticID: SwiftDiagnostics.MessageID {
27-
.init(domain: "\(type(of: self))", id: "\(self)")
29+
.init(domain: "SwiftCompilerPlugin", id: "\(type(of: self)).\(self)")
2830
}
2931
var severity: SwiftDiagnostics.DiagnosticSeverity {
3032
.error
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)