public static DiagnosticDescriptor GetDiagnosticDescriptor(DiagnosticId diagnosticId, LocalizableResourceString?lrsTitle = null, LocalizableResourceString?lrsMessage = null, string?diagnosticCategory = null, DiagnosticSeverity diagnosticSeverity = DiagnosticSeverity.Warning, bool isEnabledByDefault = true, string?helpLinkUri = null) { if (lrsTitle == null || lrsMessage == null) { var diagnosticString = new DiagnosticString(diagnosticId); return(new DiagnosticDescriptor(diagnosticId.AsString(), diagnosticString.GetTitleFormat(), diagnosticString.GetMessageFormat(), diagnosticCategory ?? GetDiagnosticCategory(diagnosticId), diagnosticSeverity, isEnabledByDefault, helpLinkUri)); } return(new DiagnosticDescriptor(diagnosticId.AsString(), lrsTitle !, lrsMessage !, diagnosticCategory ?? GetDiagnosticCategory(diagnosticId), diagnosticSeverity, isEnabledByDefault, helpLinkUri)); }
public static DiagnosticDescriptor GetDiagnosticDescriptor(DiagnosticId diagnosticId, DiagnosticString diagnosticString) => new DiagnosticDescriptor(diagnosticId.AsString(), diagnosticString.GetTitle(), diagnosticString.GetMessage(), GetDiagnosticCategory(diagnosticId), DiagnosticSeverity.Warning, true);
public static DiagnosticDescriptor GetDiagnosticDescriptor(DiagnosticId diagnosticId) { var diagnosticString = new DiagnosticString(diagnosticId); return(new DiagnosticDescriptor(diagnosticId.AsString(), diagnosticString.GetTitleFormat(), diagnosticString.GetMessageFormat(), GetDiagnosticCategory(diagnosticId), DiagnosticSeverity.Warning, true)); }