|
10 | 10 | // |
11 | 11 | //===----------------------------------------------------------------------===// |
12 | 12 |
|
13 | | -import SwiftDiagnostics |
| 13 | +import SwiftSyntaxMacros |
14 | 14 |
|
15 | | -/// An error during macro expansion that is described by its message. |
16 | | -/// |
17 | | -/// This type allows macro authors to quickly generate error messages based on a |
18 | | -/// string. For any non-trivial error messages, it is encouraged to define a |
19 | | -/// custom type that conforms to `DiagnosticMessage`. |
20 | | -public struct MacroExpansionErrorMessage: Error, DiagnosticMessage { |
21 | | - public let message: String |
| 15 | +@available(*, deprecated, message: "MacroExpansionErrorMessage has been moved to the SwiftSyntaxMacros module") |
| 16 | +public typealias MacroExpansionErrorMessage = SwiftSyntaxMacros.MacroExpansionErrorMessage |
22 | 17 |
|
23 | | - public var severity: SwiftDiagnostics.DiagnosticSeverity { .error } |
| 18 | +@available(*, deprecated, message: "MacroExpansionWarningMessage has been moved to the SwiftSyntaxMacros module") |
| 19 | +public typealias MacroExpansionWarningMessage = SwiftSyntaxMacros.MacroExpansionWarningMessage |
24 | 20 |
|
25 | | - public var diagnosticID: SwiftDiagnostics.MessageID { |
26 | | - .init(domain: diagnosticDomain, id: "\(Self.self)") |
27 | | - } |
28 | | - |
29 | | - public init(_ message: String) { |
30 | | - self.message = message |
31 | | - } |
32 | | -} |
33 | | - |
34 | | -/// An warning during macro expansion that is described by its message. |
35 | | -/// |
36 | | -/// This type allows macro authors to quickly generate warning messages based on |
37 | | -/// a string. For any non-trivial warning messages, it is encouraged to define a |
38 | | -/// custom type that conforms to `DiagnosticMessage`. |
39 | | -public struct MacroExpansionWarningMessage: DiagnosticMessage { |
40 | | - public let message: String |
41 | | - |
42 | | - public var severity: SwiftDiagnostics.DiagnosticSeverity { .warning } |
43 | | - |
44 | | - public var diagnosticID: SwiftDiagnostics.MessageID { |
45 | | - .init(domain: diagnosticDomain, id: "\(Self.self)") |
46 | | - } |
47 | | - |
48 | | - public init(_ message: String) { |
49 | | - self.message = message |
50 | | - } |
51 | | -} |
52 | | - |
53 | | -/// The message of a Fix-It that is specified by a string literal |
54 | | -/// |
55 | | -/// This type allows macro authors to quickly generate Fix-It messages based on |
56 | | -/// a string. For any non-trivial Fix-It messages, it is encouraged to define a |
57 | | -/// custom type that conforms to `FixItMessage`. |
58 | | -public struct MacroExpansionFixItMessage: FixItMessage { |
59 | | - public var message: String |
60 | | - |
61 | | - public var fixItID: SwiftDiagnostics.MessageID { |
62 | | - .init(domain: diagnosticDomain, id: "\(Self.self)") |
63 | | - } |
64 | | - |
65 | | - public init(_ message: String) { |
66 | | - self.message = message |
67 | | - } |
68 | | -} |
| 21 | +@available(*, deprecated, message: "MacroExpansionFixItMessage has been moved to the SwiftSyntaxMacros module") |
| 22 | +public typealias MacroExpansionFixItMessage = SwiftSyntaxMacros.MacroExpansionFixItMessage |
0 commit comments