/// <summary> /// Check the solution for compiler errors and warnings, uses: /// DiagnosticSettings.AllowedErrorIds() /// DiagnosticSettings.AllowedDiagnostics(). /// </summary> /// <param name="metadataReferences">A collection of <see cref="MetadataReference"/> to use when compiling. Default is <see langword="null" /> meaning <see cref="MetadataReferences"/> are used.</param> /// <param name="code">The code to analyze.</param> public static void NoCompilerErrors(IEnumerable <MetadataReference> metadataReferences, params string[] code) { #pragma warning disable CS0618 // Suppress until removed. Will be replaced with Metadatareferences.FromAttributes() var solution = CodeFactory.CreateSolution(code, metadataReferences); NoCompilerErrors(solution, SuppressedDiagnostics, DiagnosticSettings.AllowedDiagnostics()); #pragma warning restore CS0618 // Suppress until removed. Will be replaced with Metadatareferences.FromAttributes() }
private static void NoDiagnosticsOrErrors(Analyze.DiagnosticsAndErrors diagnosticsAndErrors) { NoDiagnostics(diagnosticsAndErrors.AnalyzerDiagnostics); #pragma warning disable CS0618 // Suppress until removed. Will be replaced with Metadatareferences.FromAttributes() NoCompilerErrors(diagnosticsAndErrors.Errors, SuppressedDiagnostics, DiagnosticSettings.AllowedDiagnostics()); #pragma warning restore CS0618 // Suppress until removed. Will be replaced with Metadatareferences.FromAttributes() }
private static bool IsIncluded(Diagnostic diagnostic) { return(IsIncluded(diagnostic, DiagnosticSettings.AllowedDiagnostics())); }
/// <summary> /// Check the solution for compiler errors and warnings, uses: /// DiagnosticSettings.AllowedErrorIds() /// DiagnosticSettings.AllowedDiagnostics(). /// </summary> public static void NoCompilerErrors(Solution solution) { NoCompilerErrors(solution, DiagnosticSettings.AllowedErrorIds(), DiagnosticSettings.AllowedDiagnostics()); }
/// <summary> /// Check the solution for compiler errors and warnings, uses: /// DiagnosticSettings.AllowedErrorIds() /// DiagnosticSettings.AllowedDiagnostics(). /// </summary> public static void NoCompilerErrors(IEnumerable <MetadataReference> metadataReferences, params string[] code) { var solution = CodeFactory.CreateSolution(code, metadataReferences); NoCompilerErrors(solution, DiagnosticSettings.AllowedErrorIds(), DiagnosticSettings.AllowedDiagnostics()); }
/// <summary> /// Check the solution for compiler errors and warnings, uses: /// DiagnosticSettings.AllowedErrorIds() /// DiagnosticSettings.AllowedDiagnostics(). /// </summary> public static void NoCompilerErrors(Solution solution) { #pragma warning disable CS0618 // Suppress until removed. Will be replaced with Metadatareferences.FromAttributes() NoCompilerErrors(solution, SuppressedDiagnostics, DiagnosticSettings.AllowedDiagnostics()); #pragma warning restore CS0618 // Suppress until removed. Will be replaced with Metadatareferences.FromAttributes() }
/// <summary> /// Check the solution for compiler errors and warnings, uses: /// DiagnosticSettings.AllowedErrorIds() /// DiagnosticSettings.AllowedDiagnostics() /// </summary> public static Task NoCompilerErrorsAsync(Solution solution) { return(NoCompilerErrorsAsync(solution, DiagnosticSettings.AllowedErrorIds(), DiagnosticSettings.AllowedDiagnostics())); }
/// <summary> /// Check the solution for compiler errors and warnings, uses: /// DiagnosticSettings.AllowedErrorIds() /// DiagnosticSettings.AllowedDiagnostics() /// </summary> public static void NoCompilerErrors(Solution solution) { NoCompilerErrorsAsync(solution, DiagnosticSettings.AllowedErrorIds(), DiagnosticSettings.AllowedDiagnostics()).GetAwaiter().GetResult(); }
/// <summary> /// Check the solution for compiler errors and warnings, uses: /// DiagnosticSettings.AllowedErrorIds() /// DiagnosticSettings.AllowedDiagnostics() /// </summary> public static void NoCompilerErrors(IReadOnlyList <MetadataReference> metadataReferences, params string[] code) { var solution = CodeFactory.CreateSolution(code, metadataReferences); NoCompilerErrorsAsync(solution, DiagnosticSettings.AllowedErrorIds(), DiagnosticSettings.AllowedDiagnostics()).GetAwaiter().GetResult(); }
private static void NoDiagnosticsOrErrors(Analyze.DiagnosticsAndErrors diagnosticsAndErrors) { NoDiagnostics(diagnosticsAndErrors.AnalyzerDiagnostics); NoCompilerErrors(diagnosticsAndErrors.Errors, DiagnosticSettings.AllowedErrorIds(), DiagnosticSettings.AllowedDiagnostics()); }