Run cleanup on this class, and it'll move the two ImmutableArray
assignments before the DiagnosticDecriptor
, thus breaking the code.
Codepublic static class Diagnostics
{
public static readonly DiagnosticDescriptor InterfaceNameWillBeIgnored = new("APIREPO003", $"{Constants.InterfaceTypePropertyName} will be ignored", "The {0} property is ignored when either {1} or {2} is present", "Analyzer", DiagnosticSeverity.Warning, isEnabledByDefault: true);
public static readonly DiagnosticDescriptor MustSpecifyContextType = new("APIREPO004", $"{Constants.DbContextTypePropertyName} must be specified", "{0} must be specified when using {1}", "Analyzer", DiagnosticSeverity.Error, isEnabledByDefault: true);
public static readonly ImmutableArray<DiagnosticDescriptor> All = [InterfaceNameWillBeIgnored, MustSpecifyContextType];
public static readonly ImmutableArray<string> AllIds = [InterfaceNameWillBeIgnored.Id, MustSpecifyContextType.Id];
}
Scott,
Thank you for the report. I reproduced this issue.