| | | 1 | | using Microsoft.CodeAnalysis; |
| | | 2 | | |
| | | 3 | | namespace NexusLabs.Needlr.SignalR.Analyzers; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Diagnostic descriptors for SignalR-specific Needlr analyzers. |
| | | 7 | | /// </summary> |
| | | 8 | | public static class DiagnosticDescriptors |
| | | 9 | | { |
| | | 10 | | private const string Category = "NexusLabs.Needlr.SignalR"; |
| | | 11 | | private const string HelpLinkBase = "https://github.com/nexus-labs/needlr/blob/main/docs/analyzers/"; |
| | | 12 | | |
| | | 13 | | /// <summary> |
| | | 14 | | /// NDLRSIG001: HubPath must be a constant expression for AOT compatibility. |
| | | 15 | | /// </summary> |
| | 1 | 16 | | public static readonly DiagnosticDescriptor HubPathMustBeConstant = new( |
| | 1 | 17 | | id: DiagnosticIds.HubPathMustBeConstant, |
| | 1 | 18 | | title: "HubPath must be a constant", |
| | 1 | 19 | | messageFormat: "HubPath '{0}' must be a constant expression for AOT compatibility", |
| | 1 | 20 | | category: Category, |
| | 1 | 21 | | defaultSeverity: DiagnosticSeverity.Warning, |
| | 1 | 22 | | isEnabledByDefault: true, |
| | 1 | 23 | | description: "The HubPath parameter of HubPathAttribute must be a compile-time constant string for AOT compatibi |
| | 1 | 24 | | helpLinkUri: HelpLinkBase + "NDLRSIG001.md"); |
| | | 25 | | |
| | | 26 | | /// <summary> |
| | | 27 | | /// NDLRSIG002: HubType must be a typeof expression for AOT compatibility. |
| | | 28 | | /// </summary> |
| | 1 | 29 | | public static readonly DiagnosticDescriptor HubTypeMustBeTypeOf = new( |
| | 1 | 30 | | id: DiagnosticIds.HubTypeMustBeTypeOf, |
| | 1 | 31 | | title: "HubType must be a typeof expression", |
| | 1 | 32 | | messageFormat: "HubType must be a typeof expression, not '{0}'", |
| | 1 | 33 | | category: Category, |
| | 1 | 34 | | defaultSeverity: DiagnosticSeverity.Warning, |
| | 1 | 35 | | isEnabledByDefault: true, |
| | 1 | 36 | | description: "The HubType parameter of HubPathAttribute must be a typeof expression for AOT compatibility.", |
| | 1 | 37 | | helpLinkUri: HelpLinkBase + "NDLRSIG002.md"); |
| | | 38 | | } |