public static DiagnosticIds FromDiagnosticId(string ruleId) { var id = ruleId.Replace("SCQC", string.Empty); DiagnosticIds diagnosticIds = (DiagnosticIds)Enum.Parse(typeof(DiagnosticIds), id, true); return(diagnosticIds); }
public static DiagnosticResult[] CreateArray(DiagnosticIds diagnosticId, Regex message = null) { return(new DiagnosticResult[] { Create(diagnosticId, message), }); }
public static DiagnosticResult Create(DiagnosticIds diagnosticId, Regex message = null) { return(new DiagnosticResult() { Id = Helper.ToDiagnosticId(diagnosticId), Location = new DiagnosticResultLocation(null), Message = message ?? new Regex(".*"), Severity = DiagnosticSeverity.Error, }); }
public AttributeModel(string name, string fullName, string title, string messageFormat, string description, DiagnosticIds diagnosticId, bool canBeSuppressed, bool isEnabledByDefault) { Name = name; FullName = fullName; Title = title; MessageFormat = messageFormat; Description = description; DiagnosticId = diagnosticId; Rule = CreateRule(isEnabledByDefault); CanBeSuppressed = canBeSuppressed; }
internal BaseDesignAnalyzer(DiagnosticIds diagnosticId) { DiagnosticId = diagnosticId; Rule = new DiagnosticDescriptor(Helper.ToDiagnosticId(diagnosticId), Title, MessageFormat, nameof(Categories.Design), DiagnosticSeverity.Warning, isEnabledByDefault: true, description: Description); }
private DiagnosticResult GetExpectedDiagnostic(DiagnosticIds id) { return(new DiagnosticResult { Id = Helper.ToDiagnosticId(id), Message = new Regex(".*"), Severity = DiagnosticSeverity.Error, Locations = new[] { new DiagnosticResultLocation("Test0.cs", 6, 16) } }); }
internal HelixLayerAnalyzer(DiagnosticIds diagnosticId, string baseNamespace, string parentNamespace) { DiagnosticId = diagnosticId; Rule = new DiagnosticDescriptor(Helper.ToDiagnosticId(diagnosticId), Title, MessageFormat, nameof(Categories.Design), DiagnosticSeverity.Warning, isEnabledByDefault: true, description: Description); BaseNamespace = baseNamespace; ParentNamespace = parentNamespace; }
public AttributeModel(AttributeDefinition attribute, string title, string messageFormat, string description, DiagnosticIds diagnosticId, bool canBeSuppressed, bool isEnabledByDefault) : this(attribute.Name, attribute.FullName, title, messageFormat, description, diagnosticId, canBeSuppressed, isEnabledByDefault) { }
public static string ToDiagnosticId(DiagnosticIds id) { return(@"PH" + ((int)id).ToString()); }
public static string ToDiagnosticId(DiagnosticIds id) { return($"SCQC" + ((int)id).ToString("0000")); }