|
19 | 19 | namespace codeql { |
20 | 20 |
|
21 | 21 | extern const std::string_view programName; |
| 22 | +extern const std::string_view extractorName; |
22 | 23 |
|
23 | 24 | struct DiagnosticsLocation { |
24 | 25 | std::string_view file; |
@@ -52,15 +53,6 @@ class Diagnostic { |
52 | 53 | error, |
53 | 54 | }; |
54 | 55 |
|
55 | | - constexpr Diagnostic(std::string_view extractorName, |
56 | | - std::string_view id, |
57 | | - std::string_view name, |
58 | | - std::string_view action, |
59 | | - Severity severity) |
60 | | - : extractorName(extractorName), id(id), name(name), action(action), severity(severity) {} |
61 | | - |
62 | | - std::string_view extractorName; |
63 | | - |
64 | 56 | std::string_view id; |
65 | 57 | std::string_view name; |
66 | 58 | std::string_view action; |
@@ -105,20 +97,13 @@ inline constexpr Diagnostic::Visibility operator&(Diagnostic::Visibility lhs, |
105 | 97 | static_cast<unsigned char>(rhs)); |
106 | 98 | } |
107 | 99 |
|
108 | | -constexpr Diagnostic swiftDiagnostic(std::string_view id, |
109 | | - std::string_view name, |
110 | | - std::string_view action, |
111 | | - Diagnostic::Severity severity = Diagnostic::Severity::error) { |
112 | | - return Diagnostic("swift", id, name, action, severity); |
113 | | -} |
114 | | - |
115 | | -constexpr Diagnostic internalError = swiftDiagnostic( |
116 | | - "internal-error", "Internal error", |
117 | | - "Some or all of the Swift analysis may have failed.\n" |
| 100 | +constexpr Diagnostic internalError = Diagnostic{ |
| 101 | + .id="internal-error", .name="Internal error", |
| 102 | + .action="Some or all of the Swift analysis may have failed.\n" |
118 | 103 | "\n" |
119 | 104 | "If the error persists, contact support, quoting the error message and describing what " |
120 | 105 | "happened, or [open an issue in our open source repository][1].\n" |
121 | 106 | "\n" |
122 | 107 | "[1]: https://github.com/github/codeql/issues/new?labels=bug&template=ql---general.md", |
123 | | - Diagnostic::Severity::warning); |
| 108 | + .severity=Diagnostic::Severity::warning}; |
124 | 109 | } // namespace codeql |
0 commit comments