8000 Add MacroExpansionNoteMessage by stephencelis · Pull Request #2330 · swiftlang/swift-syntax · GitHub
[go: up one dir, main page]

Skip to content

Add MacroExpansionNoteMessage #2330

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4A31
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,20 @@ public struct MacroExpansionFixItMessage: FixItMessage {
self.message = message
}
}

/// The message of a note that is specified by a string literal
///
/// This type allows macro authors to quickly generate note messages based on
/// a string. For any non-trivial note messages, it is encouraged to define a
/// custom type that conforms to `NoteMessage`.
public struct MacroExpansionNoteMessage: NoteMessage {
public var message: String

public var noteID: SwiftDiagnostics.MessageID {
.init(domain: diagnosticDomain, id: "\(Self.self)")
}

public init(_ message: String) {
self.message = message
}
}
0