-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #85 from Matejkob/add-argument-extracting-diagnostic
Improve handling of `behindPreprocessorFlag` argument in `@Spyable` attribute
- Loading branch information
Showing
8 changed files
with
253 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import SwiftDiagnostics | ||
|
||
/// An enumeration defining specific note messages related to diagnostic warnings or errors for the Spyable system. | ||
/// | ||
/// This enumeration conforms to `NoteMessage`, providing supplementary information that can help in resolving | ||
/// the diagnostic issues identified by `SpyableDiagnostic`. Designed to complement error messages with actionable | ||
/// advice or clarifications. | ||
/// | ||
/// - Note: New note messages can be introduced to offer additional guidance for resolving diagnostics encountered in the Spyable system. | ||
enum SpyableNoteMessage: String, NoteMessage { | ||
case behindPreprocessorFlagArgumentRequiresStaticStringLiteral | ||
|
||
/// Provides a detailed note message for each case, offering guidance or clarification. | ||
var message: String { | ||
switch self { | ||
case .behindPreprocessorFlagArgumentRequiresStaticStringLiteral: | ||
"Provide a literal string value without any dynamic expressions or interpolations to meet the static string literal requirement." | ||
} | ||
} | ||
|
||
/// Unique identifier for each note message, aligning with the corresponding diagnostic message for clarity. | ||
var fixItID: MessageID { | ||
MessageID(domain: "SpyableMacro", id: rawValue + "NoteMessage") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.