public Analyzer(string diagnosticId, bool throughAdditionalLocations)
 {
     _throughAdditionalLocations = throughAdditionalLocations;
     _rule = new(
         diagnosticId, "test", "test", "test", DiagnosticSeverity.Error, true,
         customTags : DiagnosticCustomTags.Create(isUnnecessary : true, isConfigurable : false, EnforceOnBuild.Never));
 }
 protected static DiagnosticDescriptor CreateDescriptorWithId(
     string id,
     LocalizableString title,
     LocalizableString messageFormat,
     bool isUnneccessary = false,
     bool isConfigurable = true,
     params string[] customTags)
 => new DiagnosticDescriptor(
     id, title, messageFormat,
     DiagnosticCategory.Style,
     DiagnosticSeverity.Hidden,
     isEnabledByDefault: true,
     customTags: DiagnosticCustomTags.Create(isUnneccessary, isConfigurable, customTags));
Example #3
0
 protected static DiagnosticDescriptor CreateDescriptor(
     string id,
     LocalizableString title,
     LocalizableString messageFormat,
     bool isUnneccessary,
     bool isEnabledByDefault = true,
     bool isConfigurable     = true,
     params string[] customTags)
 => new DiagnosticDescriptor(
     id, title, messageFormat,
     DiagnosticCategory.CodeQuality,
     DiagnosticSeverity.Info,
     isEnabledByDefault,
     customTags: DiagnosticCustomTags.Create(isUnneccessary, isConfigurable, customTags));