2255 references to DiagnosticSeverity
AnalyzerRunner (1)
Program.cs (1)
147var diagnosticStatistics = new Dictionary<string, (string description, DiagnosticSeverity severity, int count)>();
Aspire.Hosting.Analyzers (1)
AppHostAnalyzer.Diagnostics.cs (1)
19DiagnosticSeverity.Error,
CodeStyleConfigFileGenerator (16)
Program.cs (3)
154(bool isEnabledByDefault, DiagnosticSeverity effectiveSeverity) GetEnabledByDefaultAndSeverity(DiagnosticDescriptor rule, AnalysisMode analysisMode) 164return (isEnabledByDefault: false, DiagnosticSeverity.Warning); 191effectiveSeverity: isEnabledInNonDefaultMode ? DiagnosticSeverity.Warning : rule.DefaultSeverity);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticSeverityExtensions_Shared.cs (13)
13/// Returns the equivalent <see cref="ReportDiagnostic"/> for a <see cref="DiagnosticSeverity"/> value. 15/// <param name="diagnosticSeverity">The <see cref="DiagnosticSeverity"/> value.</param> 17/// The equivalent <see cref="ReportDiagnostic"/> for the <see cref="DiagnosticSeverity"/> value. 22public static ReportDiagnostic ToReportDiagnostic(this DiagnosticSeverity diagnosticSeverity) 25DiagnosticSeverity.Hidden => ReportDiagnostic.Hidden, 26DiagnosticSeverity.Info => ReportDiagnostic.Info, 27DiagnosticSeverity.Warning => ReportDiagnostic.Warn, 28DiagnosticSeverity.Error => ReportDiagnostic.Error, 32public static string ToEditorConfigString(this DiagnosticSeverity diagnosticSeverity) 36DiagnosticSeverity.Hidden => EditorConfigSeverityStrings.Silent, 37DiagnosticSeverity.Info => EditorConfigSeverityStrings.Suggestion, 38DiagnosticSeverity.Warning => EditorConfigSeverityStrings.Warning, 39DiagnosticSeverity.Error => EditorConfigSeverityStrings.Error,
ConfigurationSchemaGenerator (6)
DiagnosticDescriptors.cs (5)
33defaultSeverity: DiagnosticSeverity.Warning, 41defaultSeverity: DiagnosticSeverity.Error, 49defaultSeverity: DiagnosticSeverity.Warning, 57defaultSeverity: DiagnosticSeverity.Warning, 66defaultSeverity: DiagnosticSeverity.Warning,
RuntimeSource\Roslyn\DiagnosticDescriptorHelper.cs (1)
15DiagnosticSeverity defaultSeverity,
ConfigurationSchemaGenerator.Tests (1)
GeneratorTests.cs (1)
1564Assert.Empty(compilation.GetDiagnostics().Where(diagnostic => diagnostic.Severity > DiagnosticSeverity.Hidden));
CSharpSyntaxGenerator (3)
SourceGenerator.cs (3)
31defaultSeverity: DiagnosticSeverity.Warning, 39defaultSeverity: DiagnosticSeverity.Error, 47defaultSeverity: DiagnosticSeverity.Error,
ILLink.RoslynAnalyzer (4)
DiagnosticDescriptors.cs (4)
18 DiagnosticSeverity.Warning, 28 DiagnosticSeverity.Warning, 36 DiagnosticSeverity diagnosticSeverity = DiagnosticSeverity.Warning,
Microsoft.Analyzers.Extra (15)
DiagDescriptors.cs (15)
25defaultSeverity: DiagnosticSeverity.Warning); 33defaultSeverity: DiagnosticSeverity.Warning); 41defaultSeverity: DiagnosticSeverity.Warning); 49defaultSeverity: DiagnosticSeverity.Warning); 57defaultSeverity: DiagnosticSeverity.Warning); 65defaultSeverity: DiagnosticSeverity.Warning); 73defaultSeverity: DiagnosticSeverity.Warning); 81defaultSeverity: DiagnosticSeverity.Warning); 89defaultSeverity: DiagnosticSeverity.Warning); 97defaultSeverity: DiagnosticSeverity.Warning); 105defaultSeverity: DiagnosticSeverity.Warning); 113defaultSeverity: DiagnosticSeverity.Warning); 121defaultSeverity: DiagnosticSeverity.Warning); 129defaultSeverity: DiagnosticSeverity.Warning); 131private static DiagnosticDescriptor Make(string id, string title, string description, string messageFormat, string category, DiagnosticSeverity defaultSeverity)
Microsoft.Analyzers.Local (10)
DiagDescriptors.cs (10)
49defaultSeverity: DiagnosticSeverity.Warning); 57defaultSeverity: DiagnosticSeverity.Warning); 65defaultSeverity: DiagnosticSeverity.Warning); 73defaultSeverity: DiagnosticSeverity.Warning); 81defaultSeverity: DiagnosticSeverity.Warning); 89defaultSeverity: DiagnosticSeverity.Warning); 97defaultSeverity: DiagnosticSeverity.Warning); 105defaultSeverity: DiagnosticSeverity.Warning); 113defaultSeverity: DiagnosticSeverity.Warning); 115private static DiagnosticDescriptor Make(string id, string title, string description, string messageFormat, string category, DiagnosticSeverity defaultSeverity)
Microsoft.AspNetCore.Analyzer.Testing (2)
DiagnosticAnalyzerRunner.cs (1)
86diags = diags.Where(d => d.Severity == DiagnosticSeverity.Error || analyzer.SupportedDiagnostics.Any(s => s.Id.Equals(d.Id))).ToImmutableArray();
DiagnosticVerifier.cs (1)
109diags = diags.Where(d => d.Severity == DiagnosticSeverity.Error || analyzer.SupportedDiagnostics.Any(s => s.Id.Equals(d.Id))).ToImmutableArray();
Microsoft.AspNetCore.Analyzers (3)
StartupAnalyzer.Diagnostics.cs (3)
20DiagnosticSeverity.Warning, 29DiagnosticSeverity.Warning, 38DiagnosticSeverity.Warning,
Microsoft.AspNetCore.App.Analyzers (27)
DiagnosticDescriptors.cs (26)
16DiagnosticSeverity.Warning, 25DiagnosticSeverity.Warning, 34DiagnosticSeverity.Warning, 43DiagnosticSeverity.Warning, 52DiagnosticSeverity.Warning, 61DiagnosticSeverity.Error, 70DiagnosticSeverity.Error, 79DiagnosticSeverity.Error, 88DiagnosticSeverity.Warning, 97DiagnosticSeverity.Warning, 106DiagnosticSeverity.Warning, 115DiagnosticSeverity.Warning, 124DiagnosticSeverity.Info, 133DiagnosticSeverity.Warning, 142DiagnosticSeverity.Warning, 151DiagnosticSeverity.Info, 160DiagnosticSeverity.Warning, 169DiagnosticSeverity.Error, 178DiagnosticSeverity.Error, 187DiagnosticSeverity.Warning, 196DiagnosticSeverity.Warning, 205DiagnosticSeverity.Error, 214DiagnosticSeverity.Info, 223DiagnosticSeverity.Warning, 232DiagnosticSeverity.Info, 242DiagnosticSeverity.Info,
Infrastructure\VirtualChars\CSharpVirtualCharService.cs (1)
193if (parentExpression.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
Microsoft.AspNetCore.App.Analyzers.Test (1)
Infrastructure\WellKnownTypesTests.cs (1)
95DiagnosticSeverity.Info,
Microsoft.AspNetCore.Components.Analyzers (7)
DiagnosticDescriptors.cs (7)
16DiagnosticSeverity.Error, 25DiagnosticSeverity.Warning, 34DiagnosticSeverity.Warning, 43DiagnosticSeverity.Error, 52DiagnosticSeverity.Warning, 61DiagnosticSeverity.Warning, 70DiagnosticSeverity.Warning,
Microsoft.AspNetCore.Components.Analyzers.Tests (21)
ComponentParameterCaptureUnmatchedValuesHasWrongTypeTest.cs (1)
66Severity = DiagnosticSeverity.Warning,
ComponentParameterCaptureUnmatchedValuesMustBeUniqueTest.cs (1)
54Severity = DiagnosticSeverity.Warning,
ComponentParameterSettersShouldBePublicTest.cs (3)
80Severity = DiagnosticSeverity.Error, 90Severity = DiagnosticSeverity.Error, 100Severity = DiagnosticSeverity.Error,
ComponentParameterShouldBeAutoPropertiesTest.cs (2)
108Severity = CodeAnalysis.DiagnosticSeverity.Warning, 147Severity = CodeAnalysis.DiagnosticSeverity.Warning,
ComponentParametersShouldBePublicCodeFixProviderTest.cs (4)
47Severity = DiagnosticSeverity.Error, 87Severity = DiagnosticSeverity.Error, 97Severity = DiagnosticSeverity.Error, 107Severity = DiagnosticSeverity.Error,
ComponentParametersShouldBePublicTest.cs (4)
65Severity = DiagnosticSeverity.Error, 75Severity = DiagnosticSeverity.Error, 85Severity = DiagnosticSeverity.Error, 95Severity = DiagnosticSeverity.Error,
ComponentParameterUsageAnalyzerTest.cs (5)
52Severity = DiagnosticSeverity.Warning, 83Severity = DiagnosticSeverity.Warning, 114Severity = DiagnosticSeverity.Warning, 145Severity = DiagnosticSeverity.Warning, 176Severity = DiagnosticSeverity.Warning,
Helpers\DiagnosticResult.cs (1)
61public DiagnosticSeverity Severity { get; set; }
Microsoft.AspNetCore.Components.SdkAnalyzers (6)
DiagnosticDescriptors.cs (6)
20DiagnosticSeverity.Error, 29DiagnosticSeverity.Warning, 38DiagnosticSeverity.Warning, 47DiagnosticSeverity.Error, 56DiagnosticSeverity.Warning, 65DiagnosticSeverity.Warning,
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (19)
ComponentParameterCaptureUnmatchedValuesHasWrongTypeTest.cs (1)
66Severity = DiagnosticSeverity.Warning,
ComponentParameterCaptureUnmatchedValuesMustBeUniqueTest.cs (1)
54Severity = DiagnosticSeverity.Warning,
ComponentParameterSettersShouldBePublicTest.cs (3)
80Severity = DiagnosticSeverity.Error, 90Severity = DiagnosticSeverity.Error, 100Severity = DiagnosticSeverity.Error,
ComponentParametersShouldBePublicCodeFixProviderTest.cs (4)
47Severity = DiagnosticSeverity.Error, 87Severity = DiagnosticSeverity.Error, 97Severity = DiagnosticSeverity.Error, 107Severity = DiagnosticSeverity.Error,
ComponentParametersShouldBePublicTest.cs (4)
65Severity = DiagnosticSeverity.Error, 75Severity = DiagnosticSeverity.Error, 85Severity = DiagnosticSeverity.Error, 95Severity = DiagnosticSeverity.Error,
ComponentParameterUsageAnalyzerTest.cs (5)
52Severity = DiagnosticSeverity.Warning, 83Severity = DiagnosticSeverity.Warning, 114Severity = DiagnosticSeverity.Warning, 145Severity = DiagnosticSeverity.Warning, 176Severity = DiagnosticSeverity.Warning,
Helpers\DiagnosticResult.cs (1)
61public DiagnosticSeverity Severity { get; set; }
Microsoft.AspNetCore.Http.Extensions.Tests (11)
RequestDelegateGenerator\CompileTimeCreationTests.cs (9)
71Assert.Empty(diagnostics.Where(d => d.Severity >= DiagnosticSeverity.Warning)); 97Assert.Empty(diagnostics.Where(d => d.Severity >= DiagnosticSeverity.Warning)); 179Assert.Empty(diagnostics.Where(d => d.Severity >= DiagnosticSeverity.Warning)); 202Assert.Equal(DiagnosticSeverity.Warning, diagnostic.Severity); 252Assert.Equal(DiagnosticSeverity.Warning, diagnostic.Severity); 306Assert.Equal(DiagnosticSeverity.Warning, diagnostic.Severity); 352Assert.Equal(DiagnosticSeverity.Warning, diagnostic.Severity); 740Assert.Empty(diagnostics.Where(d => d.Severity >= DiagnosticSeverity.Warning)); 759Assert.Equal(DiagnosticSeverity.Warning, diagnostic.Severity);
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (2)
75Assert.Empty(diagnostics.Where(d => d.Severity >= DiagnosticSeverity.Warning)); 151Assert.Empty(result.Diagnostics.Where(d => d.Severity > DiagnosticSeverity.Warning));
Microsoft.AspNetCore.Http.Microbenchmarks (2)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (2)
75Assert.Empty(diagnostics.Where(d => d.Severity >= DiagnosticSeverity.Warning)); 151Assert.Empty(result.Diagnostics.Where(d => d.Severity > DiagnosticSeverity.Warning));
Microsoft.AspNetCore.Http.RequestDelegateGenerator (13)
DiagnosticDescriptors.cs (13)
17DiagnosticSeverity.Warning, 26DiagnosticSeverity.Warning, 35DiagnosticSeverity.Warning, 44DiagnosticSeverity.Warning, 53DiagnosticSeverity.Warning, 62DiagnosticSeverity.Warning, 71DiagnosticSeverity.Warning, 80DiagnosticSeverity.Warning, 89DiagnosticSeverity.Warning, 98DiagnosticSeverity.Warning, 107DiagnosticSeverity.Warning, 116DiagnosticSeverity.Warning, 125DiagnosticSeverity.Warning,
Microsoft.AspNetCore.Mvc.Analyzers (6)
DiagnosticDescriptors.cs (6)
17DiagnosticSeverity.Warning, 26DiagnosticSeverity.Warning, 35DiagnosticSeverity.Warning, 44DiagnosticSeverity.Warning, 54DiagnosticSeverity.Warning, 66DiagnosticSeverity.Error,
Microsoft.AspNetCore.Mvc.Api.Analyzers (4)
ApiDiagnosticDescriptors.cs (4)
17DiagnosticSeverity.Warning, 26DiagnosticSeverity.Warning, 35DiagnosticSeverity.Info, 44DiagnosticSeverity.Info,
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (1)
CompilationFailedExceptionFactory.cs (1)
54.Where(diagnostic => diagnostic.IsWarningAsError || diagnostic.Severity == DiagnosticSeverity.Error)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (1)
CompilerFailedExceptionFactoryTest.cs (1)
329defaultSeverity: DiagnosticSeverity.Error,
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (20)
DiagnosticDescriptors.cs (20)
19defaultSeverity: DiagnosticSeverity.Error, 27defaultSeverity: DiagnosticSeverity.Warning, 35defaultSeverity: DiagnosticSeverity.Error, 43defaultSeverity: DiagnosticSeverity.Error, 51defaultSeverity: DiagnosticSeverity.Error, 59defaultSeverity: DiagnosticSeverity.Error, 67defaultSeverity: DiagnosticSeverity.Error, 75defaultSeverity: DiagnosticSeverity.Error, 83defaultSeverity: DiagnosticSeverity.Error, 91defaultSeverity: DiagnosticSeverity.Error, 101defaultSeverity: DiagnosticSeverity.Warning, 109defaultSeverity: DiagnosticSeverity.Error, 117defaultSeverity: DiagnosticSeverity.Error, 125defaultSeverity: DiagnosticSeverity.Error, 133defaultSeverity: DiagnosticSeverity.Error, 141defaultSeverity: DiagnosticSeverity.Error, 149defaultSeverity: DiagnosticSeverity.Error, 157defaultSeverity: DiagnosticSeverity.Error, 165defaultSeverity: DiagnosticSeverity.Error, 173defaultSeverity: DiagnosticSeverity.Error,
Microsoft.CodeAnalysis (147)
Binding\BindingDiagnosticBag.cs (3)
249if (info.Severity == DiagnosticSeverity.Error) 308return info.Severity == DiagnosticSeverity.Error; 361if ((diagnostic as DiagnosticWithInfo)?.HasLazyInfo != true && diagnostic.Severity == DiagnosticSeverity.Error)
Binding\UseSiteInfo.cs (9)
60Debug.Assert(diagnosticInfo?.Severity != DiagnosticSeverity.Error || (primaryDependency is null && secondaryDependencies?.IsEmpty != false)); 75if (diagnosticInfo?.Severity == DiagnosticSeverity.Error) 81Debug.Assert(DiagnosticInfo?.Severity != DiagnosticSeverity.Error); 211Debug.Assert(_hasErrors == (_diagnostics?.Any(d => d.Severity == DiagnosticSeverity.Error) ?? false)); 245info.DiagnosticInfo?.Severity == DiagnosticSeverity.Error) 282if (_diagnostics.Add(diagnosticInfo) && diagnosticInfo?.Severity == DiagnosticSeverity.Error) 474Debug.Assert(diagnosticInfo is null || diagnosticInfo.Severity == DiagnosticSeverity.Error); 487Debug.Assert(primaryDependency == useSiteInfo.PrimaryDependency || useSiteInfo.DiagnosticInfo?.Severity == DiagnosticSeverity.Error); 500if (diagnosticInfo?.Severity == DiagnosticSeverity.Error)
CommandLine\AnalyzerConfigSet.cs (3)
100DiagnosticSeverity.Warning, 109DiagnosticSeverity.Warning, 118DiagnosticSeverity.Warning,
CommandLine\CommonCompiler.cs (2)
551else if (diag.Severity == DiagnosticSeverity.Hidden) 585if (diag.Severity == DiagnosticSeverity.Error)
CommandLine\CommonCompiler.SuppressionDiagnostic.cs (5)
25DiagnosticSeverity.Info, 63public override DiagnosticSeverity Severity => DiagnosticSeverity.Info; 65public override int WarningLevel => GetDefaultWarningLevel(DiagnosticSeverity.Info); 99internal override Diagnostic WithSeverity(DiagnosticSeverity severity)
CommandLine\SarifErrorLogger.cs (7)
57protected static string GetLevel(DiagnosticSeverity severity) 61case DiagnosticSeverity.Info: 64case DiagnosticSeverity.Error: 67case DiagnosticSeverity.Warning: 70case DiagnosticSeverity.Hidden: 75goto case DiagnosticSeverity.Info; 79goto case DiagnosticSeverity.Warning;
Compilation\Compilation.cs (1)
253if (previousScriptCompilation.GetDiagnostics().Any(static d => d.Severity == DiagnosticSeverity.Error))
Compilation\LoadDirective.cs (1)
22RoslynDebug.Assert(diagnostics.IsEmpty || diagnostics.All(d => d.Severity == DiagnosticSeverity.Error));
Diagnostic\CommonMessageProvider.cs (6)
26public abstract DiagnosticSeverity GetSeverity(int code); 99public abstract string GetMessagePrefix(string id, DiagnosticSeverity severity, bool isWarningAsError, CultureInfo? culture); 139return diagnosticInfo.GetInstanceWithSeverity(DiagnosticSeverity.Error); 141return diagnosticInfo.GetInstanceWithSeverity(DiagnosticSeverity.Warning); 143return diagnosticInfo.GetInstanceWithSeverity(DiagnosticSeverity.Info); 145return diagnosticInfo.GetInstanceWithSeverity(DiagnosticSeverity.Hidden);
Diagnostic\CustomObsoleteDiagnosticInfo.cs (2)
21private CustomObsoleteDiagnosticInfo(CustomObsoleteDiagnosticInfo baseInfo, DiagnosticSeverity effectiveSeverity) 54protected override DiagnosticInfo GetInstanceWithSeverityCore(DiagnosticSeverity severity)
Diagnostic\Diagnostic.cs (29)
144DiagnosticSeverity effectiveSeverity, 174/// <param name="warningLevel">The warning level, greater than 0 if severity is <see cref="DiagnosticSeverity.Warning"/>; otherwise 0.</param> 198DiagnosticSeverity severity, 199DiagnosticSeverity defaultSeverity, 223/// <param name="warningLevel">The warning level, greater than 0 if severity is <see cref="DiagnosticSeverity.Warning"/>; otherwise 0.</param> 248DiagnosticSeverity severity, 249DiagnosticSeverity defaultSeverity, 316/// Gets the default <see cref="DiagnosticSeverity"/> of the diagnostic's <see cref="DiagnosticDescriptor"/>. 321public virtual DiagnosticSeverity DefaultSeverity { get { return this.Descriptor.DefaultSeverity; } } 324/// Gets the effective <see cref="DiagnosticSeverity"/> of the diagnostic. 330public abstract DiagnosticSeverity Severity { get; } 333/// Gets the warning level. This is 0 for diagnostics with severity <see cref="DiagnosticSeverity.Error"/>, 377/// True implies <see cref="DefaultSeverity"/> = <see cref="DiagnosticSeverity.Warning"/> 378/// and <see cref="Severity"/> = <see cref="DiagnosticSeverity.Error"/>. 384return this.DefaultSeverity == DiagnosticSeverity.Warning && 385this.Severity == DiagnosticSeverity.Error; 458internal abstract Diagnostic WithSeverity(DiagnosticSeverity severity); 535return this.WithSeverity(DiagnosticSeverity.Error); 539return this.WithSeverity(DiagnosticSeverity.Warning); 541return this.WithSeverity(DiagnosticSeverity.Info); 543return this.WithSeverity(DiagnosticSeverity.Hidden); 556/// <see cref="DiagnosticSeverity.Info"/> and <see cref="DiagnosticSeverity.Hidden"/> are treated as warning 560/// <param name="severity">A <see cref="DiagnosticSeverity"/> value.</param> 562internal static int GetDefaultWarningLevel(DiagnosticSeverity severity) 566case DiagnosticSeverity.Error: 569case DiagnosticSeverity.Warning: 590=> DefaultSeverity == DiagnosticSeverity.Error && IsNotConfigurable(); 596=> Severity == DiagnosticSeverity.Error && !IsSuppressed;
Diagnostic\Diagnostic.DiagnosticWithProgrammaticSuppression.cs (2)
51public override DiagnosticSeverity Severity 123internal override Diagnostic WithSeverity(DiagnosticSeverity severity)
Diagnostic\Diagnostic_SimpleDiagnostic.cs (9)
22private readonly DiagnosticSeverity _severity; 32DiagnosticSeverity severity, 40if ((warningLevel == 0 && severity != DiagnosticSeverity.Error) || 41(warningLevel != 0 && severity == DiagnosticSeverity.Error)) 58DiagnosticSeverity severity, 70DiagnosticSeverity severity, DiagnosticSeverity defaultSeverity, 115public override DiagnosticSeverity Severity 194internal override Diagnostic WithSeverity(DiagnosticSeverity severity)
Diagnostic\DiagnosticArrayExtensions.cs (1)
15if (diagnostic.Severity == DiagnosticSeverity.Error)
Diagnostic\DiagnosticBag.cs (2)
74if (diagnostic.DefaultSeverity == DiagnosticSeverity.Error) 102if ((diagnostic as DiagnosticWithInfo)?.HasLazyInfo != true && diagnostic.DefaultSeverity == DiagnosticSeverity.Error)
Diagnostic\DiagnosticDescriptor.cs (15)
57public DiagnosticSeverity DefaultSeverity { get; } 81/// use constructor overload <see cref="DiagnosticDescriptor(string, LocalizableString, LocalizableString, string, DiagnosticSeverity, bool, LocalizableString, string, string[])"/>. 101DiagnosticSeverity defaultSeverity, 142DiagnosticSeverity defaultSeverity, 156DiagnosticSeverity defaultSeverity, 249internal static ReportDiagnostic MapSeverityToReport(DiagnosticSeverity severity) 253case DiagnosticSeverity.Hidden: 255case DiagnosticSeverity.Info: 257case DiagnosticSeverity.Warning: 259case DiagnosticSeverity.Error: 266internal static DiagnosticSeverity? MapReportToSeverity(ReportDiagnostic severity) 271return DiagnosticSeverity.Error; 273return DiagnosticSeverity.Warning; 275return DiagnosticSeverity.Info; 277return DiagnosticSeverity.Hidden;
Diagnostic\DiagnosticFormatter.cs (4)
87case DiagnosticSeverity.Hidden: 90case DiagnosticSeverity.Info: 93case DiagnosticSeverity.Warning: 96case DiagnosticSeverity.Error:
Diagnostic\DiagnosticInfo.cs (22)
29private readonly DiagnosticSeverity _defaultSeverity; 30private readonly DiagnosticSeverity _effectiveSeverity; 58protected DiagnosticInfo(DiagnosticInfo original, DiagnosticSeverity overriddenSeverity) 70var defaultSeverity = messageProvider.GetSeverity(errorCode); 74private static DiagnosticDescriptor GetOrCreateDescriptor(int errorCode, DiagnosticSeverity defaultSeverity, CommonMessageProvider messageProvider) 83private static DiagnosticDescriptor CreateDescriptor(int errorCode, DiagnosticSeverity defaultSeverity, CommonMessageProvider messageProvider) 154Debug.Assert(!isWarningAsError || _defaultSeverity == DiagnosticSeverity.Warning); 158_effectiveSeverity = DiagnosticSeverity.Error; 163internal DiagnosticInfo GetInstanceWithSeverity(DiagnosticSeverity severity) 177protected virtual DiagnosticInfo GetInstanceWithSeverityCore(DiagnosticSeverity severity) 197/// If IsWarningsAsError is true, then this returns <see cref="DiagnosticSeverity.Error"/>, while <see cref="DefaultSeverity"/> returns <see cref="DiagnosticSeverity.Warning"/>. 199public DiagnosticSeverity Severity 211public DiagnosticSeverity DefaultSeverity 220/// Gets the warning level. This is 0 for diagnostics with severity <see cref="DiagnosticSeverity.Error"/>, 240/// True implies <see cref="Severity"/> = <see cref="DiagnosticSeverity.Error"/> and 241/// <see cref="DefaultSeverity"/> = <see cref="DiagnosticSeverity.Warning"/>. 247return this.DefaultSeverity == DiagnosticSeverity.Warning && 248this.Severity == DiagnosticSeverity.Error; 272private static ImmutableArray<string> GetCustomTags(DiagnosticSeverity defaultSeverity) 274return defaultSeverity == DiagnosticSeverity.Error ? 282return _defaultSeverity == DiagnosticSeverity.Error;
Diagnostic\DiagnosticSeverity.cs (4)
43public const DiagnosticSeverity Unknown = (DiagnosticSeverity)InternalErrorCode.Unknown; 49public const DiagnosticSeverity Void = (DiagnosticSeverity)InternalErrorCode.Void;
Diagnostic\DiagnosticWithInfo.cs (3)
74public sealed override DiagnosticSeverity Severity 79public sealed override DiagnosticSeverity DefaultSeverity 210internal override Diagnostic WithSeverity(DiagnosticSeverity severity)
Diagnostic\SeverityFilter.cs (4)
33internal static DiagnosticSeverity GetMinimumUnfilteredSeverity(this SeverityFilter severityFilter) 37return DiagnosticSeverity.Hidden; 41return DiagnosticSeverity.Info; 44return DiagnosticSeverity.Warning;
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
1051d.DefaultSeverity != DiagnosticSeverity.Error &&
DiagnosticAnalyzer\AnalyzerExecutor.cs (1)
1317defaultSeverity: DiagnosticSeverity.Warning,
DiagnosticAnalyzer\CompilerDiagnosticAnalyzer.CompilationAnalyzer.cs (3)
68diagnostic.Severity != DiagnosticSeverity.Hidden) 95public override DiagnosticSeverity Severity => _original.Severity; 127internal override Diagnostic WithSeverity(DiagnosticSeverity severity)
DiagnosticAnalyzer\DiagnosticAnalysisContext.cs (3)
229public virtual DiagnosticSeverity MinimumReportedSeverity => DiagnosticSeverity.Hidden; 1894/// 2. Diagnostic's <see cref="Diagnostic.DefaultSeverity"/> is not <see cref="DiagnosticSeverity.Error"/>.
DiagnosticAnalyzer\DiagnosticStartAnalysisScope.cs (1)
118public override DiagnosticSeverity MinimumReportedSeverity { get; }
DiagnosticAnalyzer\DiagnosticSuppressor.cs (1)
35/// 2. Diagnostic's <see cref="Diagnostic.DefaultSeverity"/> is not <see cref="DiagnosticSeverity.Error"/>.
Operations\OperationExtensions.cs (1)
63return model.GetDiagnostics(operation.Syntax.Span, cancellationToken).Any(static d => d.DefaultSeverity == DiagnosticSeverity.Error);
SourceGeneration\GeneratorDriver.cs (1)
412defaultSeverity: DiagnosticSeverity.Warning,
Syntax\SyntaxNode.cs (1)
1643info => info.Severity == DiagnosticSeverity.Error);
Microsoft.CodeAnalysis.CodeStyle (65)
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (3)
17private DiagnosticSeverity? _minimumReportedSeverity; 62DiagnosticSeverity.Hidden, 167if (_minimumReportedSeverity!.Value == DiagnosticSeverity.Hidden)
src\Analyzers\Core\Analyzers\AbstractCodeQualityDiagnosticAnalyzer.cs (1)
53DiagnosticSeverity.Info,
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (1)
115?.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)
src\Analyzers\Core\Analyzers\NewLines\ConsecutiveStatementPlacement\AbstractConsecutiveStatementPlacementDiagnosticAnalyzer.cs (1)
52if (node.ContainsDiagnostics && node.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
src\Analyzers\Core\Analyzers\OrderModifiers\AbstractOrderModifiersDiagnosticAnalyzer.cs (1)
75if (notificationOption.Severity.WithDefaultSeverity(DiagnosticSeverity.Hidden) == ReportDiagnostic.Hidden)
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (1)
39defaultSeverity: DiagnosticSeverity.Warning,
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (4)
130if (root.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)) 613DiagnosticSeverity severity, 633DiagnosticSeverity severity) 664DiagnosticSeverity severity)
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
620if (tree.GetDiagnostics(cancellationToken).Any(d => d.Severity == DiagnosticSeverity.Error))
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (1)
81if (syntax.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (1)
124if (context.Operation.Syntax.GetDiagnostics().Any(diagnostic => diagnostic.Severity == DiagnosticSeverity.Error))
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
39DiagnosticSeverity.Info,
src\Compilers\Core\Portable\Diagnostic\DiagnosticArrayExtensions.cs (1)
15if (diagnostic.Severity == DiagnosticSeverity.Error)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOption2`1.cs (8)
120new XAttribute(XmlAttribute_DiagnosticSeverity, Notification.Severity.ToDiagnosticSeverity() ?? DiagnosticSeverity.Hidden)); 188var severity = (DiagnosticSeverity)Enum.Parse(typeof(DiagnosticSeverity), severityAttribute.Value); 192DiagnosticSeverity.Hidden => NotificationOption2.Silent, 193DiagnosticSeverity.Info => NotificationOption2.Suggestion, 194DiagnosticSeverity.Warning => NotificationOption2.Warning, 195DiagnosticSeverity.Error => NotificationOption2.Error,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\NotificationOption2.cs (6)
12/// a code style. Under the hood, it simply maps to <see cref="DiagnosticSeverity"/> 58public static NotificationOption2 ForSeverity(DiagnosticSeverity severity) 61DiagnosticSeverity.Error => Error, 62DiagnosticSeverity.Warning => Warning, 63DiagnosticSeverity.Info => Suggestion, 64DiagnosticSeverity.Hidden => Silent,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticSeverityExtensions.cs (5)
12public static NotificationOption2 ToNotificationOption(this DiagnosticSeverity severity, bool isOverridenSeverity) 16DiagnosticSeverity.Error => NotificationOption2.Error, 17DiagnosticSeverity.Warning => NotificationOption2.Warning, 18DiagnosticSeverity.Info => NotificationOption2.Suggestion, 19DiagnosticSeverity.Hidden => NotificationOption2.Silent,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticSeverityExtensions_Shared.cs (13)
13/// Returns the equivalent <see cref="ReportDiagnostic"/> for a <see cref="DiagnosticSeverity"/> value. 15/// <param name="diagnosticSeverity">The <see cref="DiagnosticSeverity"/> value.</param> 17/// The equivalent <see cref="ReportDiagnostic"/> for the <see cref="DiagnosticSeverity"/> value. 22public static ReportDiagnostic ToReportDiagnostic(this DiagnosticSeverity diagnosticSeverity) 25DiagnosticSeverity.Hidden => ReportDiagnostic.Hidden, 26DiagnosticSeverity.Info => ReportDiagnostic.Info, 27DiagnosticSeverity.Warning => ReportDiagnostic.Warn, 28DiagnosticSeverity.Error => ReportDiagnostic.Error, 32public static string ToEditorConfigString(this DiagnosticSeverity diagnosticSeverity) 36DiagnosticSeverity.Hidden => EditorConfigSeverityStrings.Silent, 37DiagnosticSeverity.Info => EditorConfigSeverityStrings.Suggestion, 38DiagnosticSeverity.Warning => EditorConfigSeverityStrings.Warning, 39DiagnosticSeverity.Error => EditorConfigSeverityStrings.Error,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ReportDiagnosticExtensions.cs (10)
14/// Returns the equivalent <see cref="DiagnosticSeverity"/> for a <see cref="ReportDiagnostic"/> value. 18/// The equivalent <see cref="DiagnosticSeverity"/> for a <see cref="ReportDiagnostic"/> value; otherwise, 19/// <see langword="null"/> if <see cref="DiagnosticSeverity"/> does not contain a direct equivalent for 25public static DiagnosticSeverity? ToDiagnosticSeverity(this ReportDiagnostic reportDiagnostic) 30return DiagnosticSeverity.Error; 33return DiagnosticSeverity.Warning; 36return DiagnosticSeverity.Info; 39return DiagnosticSeverity.Hidden; 61public static ReportDiagnostic WithDefaultSeverity(this ReportDiagnostic reportDiagnostic, DiagnosticSeverity defaultSeverity) 84public static NotificationOption2 ToNotificationOption(this ReportDiagnostic reportDiagnostic, DiagnosticSeverity defaultSeverity)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (1)
78entryWriter($"dotnet_naming_rule.{ruleName}.severity", namingRule.EnforcementLevel.ToNotificationOption(defaultSeverity: DiagnosticSeverity.Hidden).ToEditorConfigString());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SerializableNamingRule.cs (5)
37new XAttribute(nameof(EnforcementLevel), EnforcementLevel.ToDiagnosticSeverity() ?? DiagnosticSeverity.Hidden)); 46EnforcementLevel = ((DiagnosticSeverity)Enum.Parse(typeof(DiagnosticSeverity), namingRuleElement.Attribute(nameof(EnforcementLevel))!.Value)).ToReportDiagnostic(), 56writer.WriteInt32((int)(EnforcementLevel.ToDiagnosticSeverity() ?? DiagnosticSeverity.Hidden)); 65EnforcementLevel = ((DiagnosticSeverity)reader.ReadInt32()).ToReportDiagnostic(),
Microsoft.CodeAnalysis.CodeStyle.Fixes (2)
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersCodeFixProvider.cs (1)
30var priority = diagnostic.Severity == DiagnosticSeverity.Hidden
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
185diag => diag.Severity == DiagnosticSeverity.Error && !ignoreErrorCode.Contains(diag.Id));
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (3)
src\Features\DiagnosticsTestUtilities\CodeActions\CodeFixVerifierHelper.cs (1)
74if (!descriptor.IsEnabledByDefault || descriptor.DefaultSeverity == DiagnosticSeverity.Hidden)
src\Features\DiagnosticsTestUtilities\CodeActions\CSharpVerifierHelper.cs (2)
17/// <see cref="DiagnosticSeverity.Warning"/>, and the analyzer test framework defaults to only validating 18/// diagnostics at <see cref="DiagnosticSeverity.Error"/>. This map contains all compiler diagnostic IDs
Microsoft.CodeAnalysis.CSharp (69)
Binder\Binder_Crefs.cs (1)
1015if (diag.Severity == DiagnosticSeverity.Error)
Binder\Binder_Expressions.cs (1)
8919wasError = (result.Error.Severity == DiagnosticSeverity.Error);
Binder\Binder_InterpolatedString.cs (1)
73!interpolation.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error) &&
Binder\Binder_Lookup.cs (1)
725if (info.Severity == DiagnosticSeverity.Error)
Binder\Binder_Symbols.cs (2)
1711if (severity == DiagnosticSeverity.Error) 1852if (severity == DiagnosticSeverity.Error)
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (2)
584Debug.Assert(diagInfo.Severity == DiagnosticSeverity.Error); 612Debug.Assert(bad.Member.GetUseSiteInfo().DiagnosticInfo.Severity == DiagnosticSeverity.Error,
Compilation\CSharpCompilation.cs (1)
4687return (diagnostic == null) || (diagnostic.Severity != DiagnosticSeverity.Error);
Compilation\CSharpDiagnosticFilter.cs (5)
136DiagnosticSeverity severity, 233!(specifiedWarnAsErrorMinus && severity == DiagnosticSeverity.Warning && reportFromSyntaxTreeOptions == ReportDiagnostic.Error)) 313if (severity == DiagnosticSeverity.Warning || severity == DiagnosticSeverity.Info) 338return severity == DiagnosticSeverity.Warning &&
Compilation\SyntaxAndDeclarationManager.cs (1)
211Debug.Assert(!directive.IsActive || tree.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error));
Emitter\Model\PEModuleBuilder.cs (1)
1099if (diagnosticInfo != null && diagnosticInfo.Severity == DiagnosticSeverity.Error)
Emitter\NoPia\EmbeddedTypesManager.cs (1)
100if (info.DiagnosticInfo?.Severity == DiagnosticSeverity.Error)
Errors\CSDiagnostic.cs (1)
41internal override Diagnostic WithSeverity(DiagnosticSeverity severity)
Errors\CSDiagnosticInfo.cs (2)
45private CSDiagnosticInfo(CSDiagnosticInfo original, DiagnosticSeverity severity) : base(original, severity) 50protected override DiagnosticInfo GetInstanceWithSeverityCore(DiagnosticSeverity severity)
Errors\DiagnosticBagExtensions.cs (1)
95if (info.Severity == DiagnosticSeverity.Error)
Errors\DiagnosticInfoWithSymbols.cs (2)
28protected DiagnosticInfoWithSymbols(DiagnosticInfoWithSymbols original, DiagnosticSeverity severity) : base(original, severity) 33protected override DiagnosticInfo GetInstanceWithSeverityCore(DiagnosticSeverity severity)
Errors\ErrorFacts.cs (5)
106internal static DiagnosticSeverity GetSeverity(ErrorCode code) 118return DiagnosticSeverity.Warning; 122return DiagnosticSeverity.Info; 126return DiagnosticSeverity.Hidden; 130return DiagnosticSeverity.Error;
Errors\LazyArrayElementCantBeRefAnyDiagnosticInfo.cs (2)
22private LazyArrayElementCantBeRefAnyDiagnosticInfo(LazyArrayElementCantBeRefAnyDiagnosticInfo original, DiagnosticSeverity severity) : base(original, severity) 27protected override DiagnosticInfo GetInstanceWithSeverityCore(DiagnosticSeverity severity)
Errors\LazyDiagnosticInfo.cs (2)
28protected LazyDiagnosticInfo(LazyDiagnosticInfo original, DiagnosticSeverity severity) : base(original, severity) 33protected abstract override DiagnosticInfo GetInstanceWithSeverityCore(DiagnosticSeverity severity);
Errors\LazyMissingNonNullTypesContextDiagnosticInfo.cs (3)
29private LazyMissingNonNullTypesContextDiagnosticInfo(LazyMissingNonNullTypesContextDiagnosticInfo original, DiagnosticSeverity severity) : base(original, severity) 35protected override DiagnosticInfo GetInstanceWithSeverityCore(DiagnosticSeverity severity) 73if (info?.Severity != DiagnosticSeverity.Error && !binder.AreNullableAnnotationsEnabled(questionToken))
Errors\LazyObsoleteDiagnosticInfo.cs (2)
26private LazyObsoleteDiagnosticInfo(LazyObsoleteDiagnosticInfo original, DiagnosticSeverity severity) : base(original, severity) 33protected override DiagnosticInfo GetInstanceWithSeverityCore(DiagnosticSeverity severity)
Errors\LazyUnmanagedCallersOnlyMethodCalledDiagnosticInfo.cs (2)
22private LazyUnmanagedCallersOnlyMethodCalledDiagnosticInfo(LazyUnmanagedCallersOnlyMethodCalledDiagnosticInfo original, DiagnosticSeverity severity) : base(original, severity) 28protected override DiagnosticInfo GetInstanceWithSeverityCore(DiagnosticSeverity severity)
Errors\LazyUseSiteDiagnosticsInfoForNullableType.cs (2)
20private LazyUseSiteDiagnosticsInfoForNullableType(LazyUseSiteDiagnosticsInfoForNullableType original, DiagnosticSeverity severity) : base(original, severity) 26protected override DiagnosticInfo GetInstanceWithSeverityCore(DiagnosticSeverity severity)
Errors\MessageProvider.cs (3)
25public override DiagnosticSeverity GetSeverity(int code) 70public override string GetMessagePrefix(string id, DiagnosticSeverity severity, bool isWarningAsError, CultureInfo culture) 73severity == DiagnosticSeverity.Error || isWarningAsError ? "error" : "warning",
Errors\SyntaxDiagnosticInfo.cs (2)
44protected SyntaxDiagnosticInfo(SyntaxDiagnosticInfo original, DiagnosticSeverity severity) : base(original, severity) 50protected override DiagnosticInfo GetInstanceWithSeverityCore(DiagnosticSeverity severity)
Errors\XmlSyntaxDiagnosticInfo.cs (2)
26private XmlSyntaxDiagnosticInfo(XmlSyntaxDiagnosticInfo original, DiagnosticSeverity severity) : base(original, severity) 31protected override DiagnosticInfo GetInstanceWithSeverityCore(DiagnosticSeverity severity)
FlowAnalysis\DefiniteAssignment.cs (1)
589if (diagnostic.Severity != DiagnosticSeverity.Error || compatDiagnosticSet.Contains(diagnostic))
FlowAnalysis\FlowAnalysisPass.cs (1)
90IEnumerable<Diagnostic> getErrorsOnly(IEnumerable<Diagnostic> diags) => diags.Where(d => d.Severity == DiagnosticSeverity.Error);
Lowering\LocalRewriter\LocalRewriter_Field.cs (1)
105if (useSiteInfo.DiagnosticInfo?.Severity != DiagnosticSeverity.Error)
Lowering\SyntheticBoundNodeFactory.cs (1)
376if (useSiteInfo.DiagnosticInfo?.DefaultSeverity == DiagnosticSeverity.Error)
Parser\LanguageParser.cs (1)
14155if (diagnostic.Severity == DiagnosticSeverity.Error)
Symbols\ConstraintsHelper.cs (1)
1301if (info.Severity == DiagnosticSeverity.Error)
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (1)
785if (info.DiagnosticInfo?.Severity != DiagnosticSeverity.Error)
Symbols\Metadata\PE\PETypeParameterSymbol.cs (1)
685if (useSiteInfo.DiagnosticInfo?.Severity == DiagnosticSeverity.Error)
Symbols\ReducedExtensionMethodSymbol.cs (1)
62if (diag.Severity == DiagnosticSeverity.Error)
Symbols\Retargeting\RetargetingSymbolTranslator.cs (1)
814if (useSiteDiagnostic?.Severity == DiagnosticSeverity.Error)
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (3)
250reportedAnError = implementingMemberAndDiagnostics.Diagnostics.Diagnostics.Any(static d => d.Severity == DiagnosticSeverity.Error); 288if (useSiteDiagnostic != null && useSiteDiagnostic.DefaultSeverity == DiagnosticSeverity.Error) 1797if (diagnostic.Severity == DiagnosticSeverity.Error && diagnostic.Code is not ((int)ErrorCode.ERR_ImplicitImplementationOfNonPublicInterfaceMember or (int)ErrorCode.ERR_ImplicitImplementationOfInaccessibleInterfaceMember))
Symbols\Symbol.cs (6)
1052return info.DiagnosticInfo?.Severity == DiagnosticSeverity.Error; 1121if (info.Severity == DiagnosticSeverity.Error && IsHighestPriorityUseSiteErrorCode(info.Code)) 1128if (result == null || result.Severity == DiagnosticSeverity.Warning && info.Severity == DiagnosticSeverity.Error) 1148if (diagnosticInfo?.Severity == DiagnosticSeverity.Error) 1186return info.Severity == DiagnosticSeverity.Error;
Symbols\Tuples\TupleTypeSymbol.cs (1)
499if (useSiteInfo.DiagnosticInfo?.Severity != DiagnosticSeverity.Error)
Symbols\TypeSymbol.cs (1)
2038useSiteDiagnostic.DefaultSeverity == DiagnosticSeverity.Error)
Microsoft.CodeAnalysis.CSharp.CodeStyle (17)
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToBlockScopedNamespaceDiagnosticAnalyzer.cs (1)
53var diagnosticLocation = severity.WithDefaultSeverity(DiagnosticSeverity.Hidden) != ReportDiagnostic.Hidden
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToFileScopedNamespaceDiagnosticAnalyzer.cs (1)
56var diagnosticLocation = option.Notification.Severity.WithDefaultSeverity(DiagnosticSeverity.Hidden) != ReportDiagnostic.Hidden
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertToProgramMainDiagnosticAnalyzer.cs (1)
58root, isHidden: severity.WithDefaultSeverity(DiagnosticSeverity.Hidden) == ReportDiagnostic.Hidden),
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertToTopLevelStatementsDiagnosticAnalyzer.cs (1)
78methodDeclaration, isHidden: option.Notification.Severity.WithDefaultSeverity(DiagnosticSeverity.Hidden) == ReportDiagnostic.Hidden),
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs (1)
51if (switchStatement.GetDiagnostics().Any(diagnostic => diagnostic.Severity == DiagnosticSeverity.Error))
src\Analyzers\CSharp\Analyzers\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementDiagnosticAnalyzer.cs (1)
72if (arrowExpressionClause.GetDiagnostics().Any(static d => d.Severity == DiagnosticSeverity.Error))
src\Analyzers\CSharp\Analyzers\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementDiagnosticAnalyzer.cs (1)
43if (conditionalExpression.GetRequiredParent().GetDiagnostics().Any(static d => d.Severity == DiagnosticSeverity.Error))
src\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementDiagnosticAnalyzer.cs (1)
62if (current.ContainsDiagnostics && current.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
94if (topMostExpression.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
src\Analyzers\CSharp\Analyzers\UseExpressionBody\UseExpressionBodyDiagnosticAnalyzer.cs (2)
100var location = severity.WithDefaultSeverity(DiagnosticSeverity.Hidden) == ReportDiagnostic.Hidden 115var location = severity.WithDefaultSeverity(DiagnosticSeverity.Hidden) == ReportDiagnostic.Hidden
src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaHelpers.cs (1)
103? severity.WithDefaultSeverity(DiagnosticSeverity.Hidden)
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (2)
99if (localDeclaration.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)) 139if (styleOption.Notification.Severity.WithDefaultSeverity(DiagnosticSeverity.Hidden) < ReportDiagnostic.Hidden)
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (1)
51if (expression.GetDiagnostics().Any(diagnostic => diagnostic.Severity == DiagnosticSeverity.Error))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (1)
184if (parentExpression.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (1)
96if (parsed.GetDiagnostics().Any(static d => d.Severity == DiagnosticSeverity.Error))
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Analyzers\CSharp\CodeFixes\MakeAnonymousFunctionStatic\CSharpMakeAnonymousFunctionStaticCodeFixProvider.cs (1)
33context.Diagnostics[0].Severity > DiagnosticSeverity.Hidden ? CodeActionPriority.Default : CodeActionPriority.Low);
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (1)
43var priority = diagnostic.Severity == DiagnosticSeverity.Hidden
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (69)
src\Analyzers\CSharp\Tests\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionTests.cs (1)
894new DiagnosticResult(descriptor).WithSeverity(DiagnosticSeverity.Warning).WithSpan(5, 9, 5, 15).WithSpan(5, 9, 15, 10),
src\Analyzers\CSharp\Tests\ConvertToRecord\ConvertToRecordCodeFixTests.cs (1)
169DiagnosticSeverity.Error,
src\Analyzers\CSharp\Tests\MakeStructMemberReadOnly\MakeStructMemberReadOnlyTests.cs (2)
751VerifyCS.Diagnostic("IDE0251").WithSeverity(DiagnosticSeverity.Info).WithSpan(5, 32, 5, 35).WithOptions(DiagnosticOptions.IgnoreAdditionalLocations), 795VerifyCS.Diagnostic("IDE0251").WithSeverity(DiagnosticSeverity.Info).WithSpan(5, 42, 5, 45).WithOptions(DiagnosticOptions.IgnoreAdditionalLocations),
src\Analyzers\CSharp\Tests\RemoveUnnecessaryParentheses\RemoveUnnecessaryExpressionParenthesesTests.cs (1)
47=> descriptor.ImmutableCustomTags().Contains(WellKnownDiagnosticTags.Unnecessary) && descriptor.DefaultSeverity == DiagnosticSeverity.Hidden;
src\Analyzers\CSharp\Tests\RemoveUnnecessaryParentheses\RemoveUnnecessaryPatternParenthesesTests.cs (1)
40=> descriptor.ImmutableCustomTags().Contains(WellKnownDiagnosticTags.Unnecessary) && descriptor.DefaultSeverity == DiagnosticSeverity.Hidden;
src\Analyzers\CSharp\Tests\RemoveUnusedParametersAndValues\RemoveUnusedValueAssignmentTests.cs (3)
1372VerifyCS.Diagnostic("IDE0059").WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithArguments("y")); 1495VerifyCS.Diagnostic("IDE0059").WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithArguments("y")); 3386VerifyCS.Diagnostic("IDE0059").WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithArguments("x2"));
src\Analyzers\CSharp\Tests\SimplifyInterpolation\SimplifyInterpolationTests.cs (1)
48("IDE0071", DiagnosticSeverity.Info),
src\Analyzers\CSharp\Tests\UseCollectionExpression\UseCollectionExpressionForFluentTests.cs (1)
2076VerifyCS.Diagnostic().WithSpan(8, 51, 8, 57).WithSpan(8, 33, 8, 59).WithSeverity(DiagnosticSeverity.Info),
src\Analyzers\CSharp\Tests\UseImplicitOrExplicitType\UseExplicitTypeTests.cs (4)
2362diagnosticSeverity: DiagnosticSeverity.Hidden); 2382diagnosticSeverity: DiagnosticSeverity.Info); 2402diagnosticSeverity: DiagnosticSeverity.Warning); 2422diagnosticSeverity: DiagnosticSeverity.Error);
src\Analyzers\CSharp\Tests\UseImplicitOrExplicitType\UseImplicitTypeTests.cs (4)
1892diagnosticSeverity: DiagnosticSeverity.Hidden); 1912diagnosticSeverity: DiagnosticSeverity.Info); 1932diagnosticSeverity: DiagnosticSeverity.Warning); 1952diagnosticSeverity: DiagnosticSeverity.Error);
src\Analyzers\CSharp\Tests\UseObjectInitializer\UseObjectInitializerTests.cs (25)
74VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 181VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 246VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 310VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 355VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 402VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3).WithLocation(4).WithLocation(5), 449VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 495VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 544VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 595VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 674VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 676VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(4).WithLocation(5).WithLocation(6).WithLocation(7), 730VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 732VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(4).WithLocation(5).WithLocation(6).WithLocation(7), 787VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3).WithLocation(4).WithLocation(5), 789VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(6).WithLocation(7).WithLocation(8).WithLocation(9).WithLocation(10).WithLocation(11), 834VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3).WithLocation(4).WithLocation(5), 886VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3).WithLocation(4).WithLocation(5), 987VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 1040VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 1152VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 1217VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 1254VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 1346VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3)); 1404VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Warning).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3),
src\Analyzers\CSharp\Tests\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzerTests.cs (1)
661Assert.Equal(DiagnosticSeverity.Warning, diag.Severity);
src\Analyzers\CSharp\Tests\ValidateFormatString\ValidateFormatStringTests.cs (24)
642diagnosticSeverity: DiagnosticSeverity.Info, 677diagnosticSeverity: DiagnosticSeverity.Info, 695diagnosticSeverity: DiagnosticSeverity.Info, 713diagnosticSeverity: DiagnosticSeverity.Info, 732diagnosticSeverity: DiagnosticSeverity.Info, 751diagnosticSeverity: DiagnosticSeverity.Info, 770diagnosticSeverity: DiagnosticSeverity.Info, 790diagnosticSeverity: DiagnosticSeverity.Info, 810diagnosticSeverity: DiagnosticSeverity.Info, 828diagnosticSeverity: DiagnosticSeverity.Info, 846diagnosticSeverity: DiagnosticSeverity.Info, 864diagnosticSeverity: DiagnosticSeverity.Info, 882diagnosticSeverity: DiagnosticSeverity.Info, 901diagnosticSeverity: DiagnosticSeverity.Info, 920diagnosticSeverity: DiagnosticSeverity.Info, 939diagnosticSeverity: DiagnosticSeverity.Info, 966diagnosticSeverity: DiagnosticSeverity.Info, 985diagnosticSeverity: DiagnosticSeverity.Info, 1004diagnosticSeverity: DiagnosticSeverity.Info, 1023diagnosticSeverity: DiagnosticSeverity.Info, 1042diagnosticSeverity: DiagnosticSeverity.Info, 1061diagnosticSeverity: DiagnosticSeverity.Info, 1080diagnosticSeverity: DiagnosticSeverity.Info, 1099diagnosticSeverity: DiagnosticSeverity.Info,
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (134)
CommandLineTests.cs (134)
216var analyzer = new CompilationAnalyzerWithSeverity(DiagnosticSeverity.Warning, configurable: true); 13062var analyzer = new CompilationAnalyzerWithSeverity(DiagnosticSeverity.Warning, configurable: true); 13107analyzer = new CompilationAnalyzerWithSeverity(DiagnosticSeverity.Warning, configurable: false); 13129var analyzer = new CompilationAnalyzerWithSeverity(DiagnosticSeverity.Error, configurable: true); 13147[InlineData(DiagnosticSeverity.Warning, false)] 13148[InlineData(DiagnosticSeverity.Info, true)] 13149[InlineData(DiagnosticSeverity.Info, false)] 13150[InlineData(DiagnosticSeverity.Hidden, false)] 13152public void TestCategoryBasedBulkAnalyzerDiagnosticConfiguration(DiagnosticSeverity defaultSeverity, bool errorlog) 13225if (defaultSeverity == DiagnosticSeverity.Hidden || 13226defaultSeverity == DiagnosticSeverity.Info && !errorlog) 13247[InlineData(DiagnosticSeverity.Warning, false, false)] 13248[InlineData(DiagnosticSeverity.Warning, false, true)] 13249[InlineData(DiagnosticSeverity.Info, true, false)] 13250[InlineData(DiagnosticSeverity.Info, false, false)] 13251[InlineData(DiagnosticSeverity.Info, true, true)] 13252[InlineData(DiagnosticSeverity.Info, false, true)] 13253[InlineData(DiagnosticSeverity.Hidden, false, false)] 13254[InlineData(DiagnosticSeverity.Hidden, false, true)] 13256public void TestBulkAnalyzerDiagnosticConfiguration(DiagnosticSeverity defaultSeverity, bool errorlog, bool customConfigurable) 13317if (defaultSeverity == DiagnosticSeverity.Hidden || 13318defaultSeverity == DiagnosticSeverity.Info && !errorlog) 13337[InlineData(DiagnosticSeverity.Warning, false)] 13338[InlineData(DiagnosticSeverity.Info, true)] 13339[InlineData(DiagnosticSeverity.Info, false)] 13340[InlineData(DiagnosticSeverity.Hidden, false)] 13342public void TestMixedCategoryBasedAndBulkAnalyzerDiagnosticConfiguration(DiagnosticSeverity defaultSeverity, bool errorlog) 13633var analyzer = new NamedTypeAnalyzerWithConfigurableEnabledByDefault(isEnabledByDefault, defaultSeverity: DiagnosticSeverity.Warning, customConfigurable, throwOnAllNamedTypes: false); 13743public void TestAnalyzerFilteringBasedOnSeverity(DiagnosticSeverity defaultSeverity, bool errorlog, bool customConfigurable) 13749var analyzerShouldBeSkipped = (defaultSeverity == DiagnosticSeverity.Hidden || 13750defaultSeverity == DiagnosticSeverity.Info && !errorlog) && !customConfigurable; 13780public void TestWarnAsErrorMinusDoesNotEnableDisabledByDefaultAnalyzers(DiagnosticSeverity defaultSeverity, bool isEnabledByDefault, bool customConfigurable) 13788defaultSeverity is DiagnosticSeverity.Hidden or DiagnosticSeverity.Info) && !customConfigurable; 13802var expectedExitCode = !analyzerShouldBeSkipped && defaultSeverity == DiagnosticSeverity.Error ? 1 : 0; 13806if (analyzerShouldBeSkipped || customConfigurable && defaultSeverity is DiagnosticSeverity.Hidden or DiagnosticSeverity.Info) 13812var prefix = defaultSeverity == DiagnosticSeverity.Warning ? "warning" : "error"; 13820[InlineData(false, false, DiagnosticSeverity.Info, DiagnosticSeverity.Warning, null, DiagnosticSeverity.Error)] 13821[InlineData(true, false, DiagnosticSeverity.Info, DiagnosticSeverity.Warning, null, DiagnosticSeverity.Warning)] 13822[InlineData(false, true, DiagnosticSeverity.Info, DiagnosticSeverity.Warning, null, DiagnosticSeverity.Error)] 13823[InlineData(true, true, DiagnosticSeverity.Info, DiagnosticSeverity.Warning, null, DiagnosticSeverity.Warning)] 13825[InlineData(false, false, DiagnosticSeverity.Info, null, DiagnosticSeverity.Warning, DiagnosticSeverity.Error)] 13826[InlineData(true, false, DiagnosticSeverity.Info, null, DiagnosticSeverity.Warning, DiagnosticSeverity.Warning)] 13827[InlineData(false, true, DiagnosticSeverity.Info, null, DiagnosticSeverity.Warning, DiagnosticSeverity.Error)] 13828[InlineData(true, true, DiagnosticSeverity.Info, null, DiagnosticSeverity.Warning, DiagnosticSeverity.Warning)] 13830[InlineData(false, false, DiagnosticSeverity.Warning, null, null, DiagnosticSeverity.Error)] 13831[InlineData(true, false, DiagnosticSeverity.Warning, null, null, DiagnosticSeverity.Warning)] 13832[InlineData(false, true, DiagnosticSeverity.Warning, null, null, DiagnosticSeverity.Error)] 13833[InlineData(true, true, DiagnosticSeverity.Warning, null, null, DiagnosticSeverity.Warning)] 13835[InlineData(false, false, DiagnosticSeverity.Warning, DiagnosticSeverity.Error, null, DiagnosticSeverity.Error)] 13836[InlineData(true, false, DiagnosticSeverity.Warning, DiagnosticSeverity.Error, null, DiagnosticSeverity.Warning)] 13837[InlineData(false, true, DiagnosticSeverity.Warning, DiagnosticSeverity.Error, null, DiagnosticSeverity.Error)] 13838[InlineData(true, true, DiagnosticSeverity.Warning, DiagnosticSeverity.Error, null, DiagnosticSeverity.Warning)] 13840[InlineData(false, false, DiagnosticSeverity.Info, DiagnosticSeverity.Error, null, DiagnosticSeverity.Error)] 13841[InlineData(true, false, DiagnosticSeverity.Info, DiagnosticSeverity.Error, null, DiagnosticSeverity.Error)] 13842[InlineData(false, true, DiagnosticSeverity.Info, DiagnosticSeverity.Error, null, DiagnosticSeverity.Error)] 13843[InlineData(true, true, DiagnosticSeverity.Info, DiagnosticSeverity.Error, null, DiagnosticSeverity.Error)] 13845[InlineData(false, false, DiagnosticSeverity.Info, null, DiagnosticSeverity.Error, DiagnosticSeverity.Error)] 13846[InlineData(true, false, DiagnosticSeverity.Info, null, DiagnosticSeverity.Error, DiagnosticSeverity.Error)] 13847[InlineData(false, true, DiagnosticSeverity.Info, null, DiagnosticSeverity.Error, DiagnosticSeverity.Error)] 13848[InlineData(true, true, DiagnosticSeverity.Info, null, DiagnosticSeverity.Error, DiagnosticSeverity.Error)] 13849[InlineData(false, false, DiagnosticSeverity.Warning, null, DiagnosticSeverity.Error, DiagnosticSeverity.Error)] 13850[InlineData(true, false, DiagnosticSeverity.Warning, null, DiagnosticSeverity.Error, DiagnosticSeverity.Error)] 13851[InlineData(false, true, DiagnosticSeverity.Warning, null, DiagnosticSeverity.Error, DiagnosticSeverity.Error)] 13852[InlineData(true, true, DiagnosticSeverity.Warning, null, DiagnosticSeverity.Error, DiagnosticSeverity.Error)] 13856DiagnosticSeverity defaultSeverity, 13857DiagnosticSeverity? severityInConfigFile, 13858DiagnosticSeverity? customConfiguredSeverityByAnalyzer, 13859DiagnosticSeverity expectedEffectiveSeverity) 13862var reportedSeverity = customConfiguredSeverityByAnalyzer ?? defaultSeverity; 13899case DiagnosticSeverity.Warning: 13903case DiagnosticSeverity.Error: 14893private static readonly DiagnosticDescriptor _rule = new DiagnosticDescriptor("Id", "Title", "Message", "Category", DiagnosticSeverity.Warning, isEnabledByDefault: true); 15299var analyzer = new CompilationAnalyzerWithSeverity(DiagnosticSeverity.Warning, configurable: true); 15933internal static readonly DiagnosticDescriptor Hidden01 = new DiagnosticDescriptor("Hidden01", "", "Throwing a diagnostic for #region", "", DiagnosticSeverity.Hidden, isEnabledByDefault: true); 15934internal static readonly DiagnosticDescriptor Hidden02 = new DiagnosticDescriptor("Hidden02", "", "Throwing a diagnostic for something else", "", DiagnosticSeverity.Hidden, isEnabledByDefault: true); 15958internal static readonly DiagnosticDescriptor Info01 = new DiagnosticDescriptor("Info01", "", "Throwing a diagnostic for #pragma restore", "", DiagnosticSeverity.Info, isEnabledByDefault: true); 15985internal static readonly DiagnosticDescriptor Warning01 = new DiagnosticDescriptor("Warning01", "", "Throwing a diagnostic for types declared", "", DiagnosticSeverity.Warning, isEnabledByDefault: true); 16008internal static readonly DiagnosticDescriptor Warning02 = new DiagnosticDescriptor("Warning02", "", "Throwing a diagnostic for types declared", "", DiagnosticSeverity.Warning, isEnabledByDefault: true, helpLinkUri: "https://example.org/analyzer"); 16026internal static readonly DiagnosticDescriptor Error01 = new DiagnosticDescriptor("Error01", "", "Throwing a diagnostic for #pragma disable", "", DiagnosticSeverity.Error, isEnabledByDefault: true); 16027internal static readonly DiagnosticDescriptor Error02 = new DiagnosticDescriptor("Error02", "", "Throwing a diagnostic for something else", "", DiagnosticSeverity.Error, isEnabledByDefault: true);
Microsoft.CodeAnalysis.CSharp.EditorFeatures (3)
Interactive\CSharpSendToInteractiveSubmissionProvider.cs (1)
33!tree.GetDiagnostics().Any(diagnostic => diagnostic.Severity == DiagnosticSeverity.Error);
StringCopyPaste\StringCopyPasteHelpers.cs (2)
46if (diagnostic.Severity == DiagnosticSeverity.Error) 70if (diagnostic.Severity == DiagnosticSeverity.Error)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (25)
Diagnostics\DiagnosticAnalyzerDriver\DiagnosticAnalyzerDriverTests.cs (2)
217new DiagnosticDescriptor(ID, title: "Syntax", messageFormat: "Syntax", category: "Test", defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true); 862var descriptor = new DiagnosticDescriptor(id, "Title", messageFormat: analyzerName, "Category", DiagnosticSeverity.Warning, isEnabledByDefault: true);
Diagnostics\MockDiagnosticAnalyzerTests.cs (1)
23private readonly DiagnosticDescriptor _descriptor = new DiagnosticDescriptor(Id, "MockDiagnostic", "MockDiagnostic", "InternalCategory", DiagnosticSeverity.Warning, isEnabledByDefault: true, helpLinkUri: "https://github.com/dotnet/roslyn");
EditorConfigSettings\Updater\SettingsUpdaterTests.cs (2)
133var descriptor = new DiagnosticDescriptor(id: id, title: "", messageFormat: "", category: "Naming", defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: false); 332var descriptor = new DiagnosticDescriptor(id: id, title: "", messageFormat: "", category: "Naming", defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: false);
Formatting\CodeCleanupTests.cs (18)
572[CombinatorialValues(DiagnosticSeverity.Warning, DiagnosticSeverity.Info)] DiagnosticSeverity severity) 594expectedCleanup = severity >= DiagnosticSeverity.Warning; 741[InlineData(DiagnosticSeverity.Warning)] 742[InlineData(DiagnosticSeverity.Error)] 743public async Task RunThirdPartyFixerWithSeverityOfWarningOrHigher(DiagnosticSeverity severity) 749[InlineData(DiagnosticSeverity.Hidden)] 750[InlineData(DiagnosticSeverity.Info)] 751public async Task DoNotRunThirdPartyFixerWithSeverityLessThanWarning(DiagnosticSeverity severity) 768private static Task TestThirdPartyCodeFixerNoChanges<TCodefix, TAnalyzer>(string code, DiagnosticSeverity severity = DiagnosticSeverity.Warning) 775private static Task TestThirdPartyCodeFixerApplied<TCodefix, TAnalyzer>(string code, string expected, DiagnosticSeverity severity = DiagnosticSeverity.Warning) 782private static async Task TestThirdPartyCodeFixer<TCodefix, TAnalyzer>(string code = null, string expected = null, DiagnosticSeverity severity = DiagnosticSeverity.Warning) 860private protected static Task AssertCodeCleanupResult(string expected, string code, bool systemUsingsFirst = true, bool separateUsingGroups = false, Func<string, bool> enabledFixIdsFilter = null, (string, DiagnosticSeverity)[] diagnosticIdsWithSeverity = null) 874private protected static async Task AssertCodeCleanupResult(string expected, string code, CodeStyleOption2<AddImportPlacement> preferredImportPlacement, bool systemUsingsFirst = true, bool separateUsingGroups = false, Func<string, bool> enabledFixIdsFilter = null, (string, DiagnosticSeverity)[] diagnosticIdsWithSeverity = null)
PdbSourceDocument\AbstractPdbSourceDocumentTests.cs (1)
327Assert.Empty(result.Diagnostics.Where(d => d.Severity == DiagnosticSeverity.Error));
Semantics\SpeculationAnalyzerTests.cs (1)
539static bool isProblem(Diagnostic d) => d.Severity >= DiagnosticSeverity.Warning;
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (4)
Emit\NumericIntPtrTests.cs (2)
9017if (expectedDiagnostics.Any(d => ErrorFacts.GetSeverity((ErrorCode)d.Code) == DiagnosticSeverity.Error)) 9062if (expectedDiagnostics.Any(d => ErrorFacts.GetSeverity((ErrorCode)d.Code) == DiagnosticSeverity.Error))
PDB\CSharpPDBTestBase.cs (1)
28compilation.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error).Verify();
PDB\PDBUsingTests.cs (1)
1488compilation.GetDiagnostics().Where(d => d.Severity > DiagnosticSeverity.Info).Verify();
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (132)
Diagnostics\DiagnosticAnalyzerTests.cs (51)
38new DiagnosticDescriptor(id: "CA9999_UseOfVariableThatStartsWithX", title: "CA9999_UseOfVariableThatStartsWithX", messageFormat: "Use of variable whose name starts with 'x': '{0}'", category: "Test", defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true); 234private static readonly DiagnosticDescriptor s_descriptor = new DiagnosticDescriptor("XX0001", "My Syntax/Symbol Diagnostic", "My Syntax/Symbol Diagnostic for '{0}'", "Compiler", DiagnosticSeverity.Warning, isEnabledByDefault: true); 303var noneDiagDescriptor = new DiagnosticDescriptor("XX0001", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Hidden, isEnabledByDefault: true); 304var infoDiagDescriptor = new DiagnosticDescriptor("XX0002", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Info, isEnabledByDefault: true); 305var warningDiagDescriptor = new DiagnosticDescriptor("XX0003", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Warning, isEnabledByDefault: true); 306var errorDiagDescriptor = new DiagnosticDescriptor("XX0004", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Error, isEnabledByDefault: true); 327Assert.True(effectiveDiag.Severity == DiagnosticSeverity.Error); 360case DiagnosticSeverity.Hidden: 364case DiagnosticSeverity.Info: 368case DiagnosticSeverity.Warning: 372case DiagnosticSeverity.Error: 387var noneDiagDescriptor = new DiagnosticDescriptor("XX0001", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Hidden, isEnabledByDefault: true); 388var infoDiagDescriptor = new DiagnosticDescriptor("XX0002", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Info, isEnabledByDefault: true); 389var warningDiagDescriptor = new DiagnosticDescriptor("XX0003", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Warning, isEnabledByDefault: true); 390var errorDiagDescriptor = new DiagnosticDescriptor("XX0004", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Error, isEnabledByDefault: true); 414Assert.Equal(1, effectiveDiags.Count(d => d.Severity == DiagnosticSeverity.Error)); 415Assert.Equal(1, effectiveDiags.Count(d => d.Severity == DiagnosticSeverity.Warning)); 421Assert.Equal(1, effectiveDiags.Count(d => d.Severity == DiagnosticSeverity.Error)); 422Assert.Equal(1, effectiveDiags.Count(d => d.Severity == DiagnosticSeverity.Info)); 428Assert.Equal(1, effectiveDiags.Count(d => d.Severity == DiagnosticSeverity.Error)); 429Assert.Equal(1, effectiveDiags.Count(d => d.Severity == DiagnosticSeverity.Hidden)); 435Assert.Equal(1, effectiveDiags.Count(d => d.Severity == DiagnosticSeverity.Error)); 436Assert.Equal(1, effectiveDiags.Count(d => d.Severity == DiagnosticSeverity.Hidden)); 442var disabledDiagDescriptor = new DiagnosticDescriptor("XX001", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Warning, isEnabledByDefault: false); 443var enabledDiagDescriptor = new DiagnosticDescriptor("XX002", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Warning, isEnabledByDefault: true); 471public static DiagnosticDescriptor desc1 = new DiagnosticDescriptor("XX001", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Warning, isEnabledByDefault: false); 472public static DiagnosticDescriptor desc2 = new DiagnosticDescriptor("XX002", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Warning, isEnabledByDefault: false); 473public static DiagnosticDescriptor desc3 = new DiagnosticDescriptor("XX003", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Warning, isEnabledByDefault: false, customTags: WellKnownDiagnosticTags.NotConfigurable); 487public static DiagnosticDescriptor desc1 = new DiagnosticDescriptor("XX003", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Warning, isEnabledByDefault: false); 488public static DiagnosticDescriptor desc2 = new DiagnosticDescriptor("XX004", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Warning, isEnabledByDefault: true); 502public static DiagnosticDescriptor desc1 = new DiagnosticDescriptor("DummyId", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Warning, isEnabledByDefault: false); 656internal static DiagnosticDescriptor Rule = new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, Category, DiagnosticSeverity.Warning, isEnabledByDefault: true); 829public static DiagnosticDescriptor Descriptor1 = new DiagnosticDescriptor("MethodSymbolDiagnostic", "MethodSymbolDiagnostic", "{0}", "MethodSymbolDiagnostic", DiagnosticSeverity.Warning, isEnabledByDefault: true); 873new DiagnosticDescriptor("ID_1", "DummyTitle", "DummyMessage", "DummyCategory", DiagnosticSeverity.Warning, isEnabledByDefault: true); 876new DiagnosticDescriptor("ID_2", "DummyTitle", "DummyMessage", "DummyCategory", DiagnosticSeverity.Warning, isEnabledByDefault: true); 1276DiagnosticSeverity defaultSeverity, 1294TestEffectiveSeverity(DiagnosticSeverity.Warning, ReportDiagnostic.Warn); 1305TestEffectiveSeverity(DiagnosticSeverity.Warning, expectedEffectiveSeverity: ReportDiagnostic.Warn, specificOptions: specificOptions, generalOption: generalOption); 1314TestEffectiveSeverity(DiagnosticSeverity.Warning, expectedEffectiveSeverity: generalOption, generalOption: generalOption); 1326TestEffectiveSeverity(DiagnosticSeverity.Warning, expectedEffectiveSeverity: specificOption, specificOptions: specificOptions, generalOption: generalOption); 1337TestEffectiveSeverity(DiagnosticSeverity.Warning, expectedEffectiveSeverity: ReportDiagnostic.Suppress, generalOption: generalOption, isEnabledByDefault: enabledByDefault); 1350TestEffectiveSeverity(DiagnosticSeverity.Warning, expectedEffectiveSeverity: specificOption, specificOptions: specificOptions, generalOption: generalOption, isEnabledByDefault: enabledByDefault); 1640DiagnosticSeverity.Warning, 2288DiagnosticSeverity.Warning, 2296DiagnosticSeverity.Warning, 3841internal static DiagnosticDescriptor Rule = new(DiagnosticId, Title, MessageFormat, Category, DiagnosticSeverity.Warning, isEnabledByDefault: true); 4075internal static DiagnosticDescriptor Rule = new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, Category, DiagnosticSeverity.Warning, isEnabledByDefault: true); 4114internal static DiagnosticDescriptor Rule = new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, Category, DiagnosticSeverity.Warning, isEnabledByDefault: true); 4388[InlineData(SeverityFilter.None, DiagnosticSeverity.Hidden)] 4390[InlineData(SeverityFilter.Hidden | SeverityFilter.Info, DiagnosticSeverity.Warning)] 4391internal async Task TestMinimumReportedSeverity(SeverityFilter severityFilter, DiagnosticSeverity expectedMinimumReportedSeverity)
Diagnostics\DiagnosticSuppressorTests.cs (17)
233var analyzer = new CompilationAnalyzerWithSeverity(DiagnosticSeverity.Warning, configurable: true); 256var analyzer = new CompilationAnalyzerWithSeverity(DiagnosticSeverity.Warning, configurable: true); 282var analyzer = new CompilationAnalyzerWithSeverity(DiagnosticSeverity.Warning, configurable: true); 304var analyzer = new CompilationAnalyzerWithSeverity(DiagnosticSeverity.Warning, configurable: true); 327var severities = Enum.GetValues(typeof(DiagnosticSeverity)); 332foreach (DiagnosticSeverity defaultSeverity in severities) 334foreach (DiagnosticSeverity effectiveSeverity in severities) 346if (defaultSeverity == DiagnosticSeverity.Warning && 347effectiveSeverity == DiagnosticSeverity.Error && 369if (defaultSeverity == DiagnosticSeverity.Error || !configurable) 391var analyzer = new CompilationAnalyzerWithSeverity(DiagnosticSeverity.Warning, configurable: true); 433var analyzer = new CompilationAnalyzerWithSeverity(DiagnosticSeverity.Warning, configurable: true); 479var analyzer = new CompilationAnalyzerWithSeverity(DiagnosticSeverity.Warning, configurable: true); 532var analyzer = new CompilationAnalyzerWithSeverity(DiagnosticSeverity.Warning, configurable: true); 585var analyzer = new CompilationAnalyzerWithSeverity(DiagnosticSeverity.Warning, configurable: true); 634var analyzer = new CompilationAnalyzerWithSeverity(DiagnosticSeverity.Warning, configurable: true); 674var analyzer = new CompilationAnalyzerWithSeverity(DiagnosticSeverity.Warning, configurable: true);
Diagnostics\GetDiagnosticsTests.cs (18)
120Assert.Equal(DiagnosticSeverity.Warning, diag.Severity); 123var error = diag.WithSeverity(DiagnosticSeverity.Error); 124Assert.Equal(DiagnosticSeverity.Error, error.Severity); 125Assert.Equal(DiagnosticSeverity.Warning, error.DefaultSeverity); 128var warning = error.WithSeverity(DiagnosticSeverity.Warning); 129Assert.Equal(DiagnosticSeverity.Warning, warning.Severity); 130Assert.Equal(DiagnosticSeverity.Warning, warning.DefaultSeverity); 133var hidden = diag.WithSeverity(DiagnosticSeverity.Hidden); 134Assert.Equal(DiagnosticSeverity.Hidden, hidden.Severity); 135Assert.Equal(DiagnosticSeverity.Warning, hidden.DefaultSeverity); 138var info = diag.WithSeverity(DiagnosticSeverity.Info); 139Assert.Equal(DiagnosticSeverity.Info, info.Severity); 140Assert.Equal(DiagnosticSeverity.Warning, info.DefaultSeverity); 573Assert.Equal(DiagnosticSeverity.Warning, diagnostic.Severity); 621Assert.Equal(DiagnosticSeverity.Warning, diagnostic.Severity); 936defaultSeverity: DiagnosticSeverity.Warning, 944defaultSeverity: DiagnosticSeverity.Warning, 1712public static readonly DiagnosticDescriptor Descriptor = new DiagnosticDescriptor("ID0001", "Title", "Message", "Category", defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true);
FlowAnalysis\FlowDiagnosticTests.cs (19)
158Assert.Equal(0, count[(int)DiagnosticSeverity.Error]); 159Assert.Equal(1, count[(int)DiagnosticSeverity.Warning]); 160Assert.Equal(0, count[(int)DiagnosticSeverity.Info]); 186Assert.Equal(0, count[(int)DiagnosticSeverity.Error]); 187Assert.Equal(2, count[(int)DiagnosticSeverity.Warning]); 188Assert.Equal(0, count[(int)DiagnosticSeverity.Info]); 355Assert.Equal(0, count[(int)DiagnosticSeverity.Error]); 356Assert.Equal(1, count[(int)DiagnosticSeverity.Warning]); 357Assert.Equal(0, count[(int)DiagnosticSeverity.Info]); 391Assert.Equal(0, count[(int)DiagnosticSeverity.Error]); 392Assert.Equal(0, count[(int)DiagnosticSeverity.Info]); 397Assert.Equal(2, count[(int)DiagnosticSeverity.Warning]); 496Assert.NotEmpty(this.FlowDiagnostics(comp).Where(e => e.Severity >= DiagnosticSeverity.Error)); 514Assert.Empty(this.FlowDiagnostics(comp).Where(e => e.Severity >= DiagnosticSeverity.Error)); 535Assert.NotEmpty(this.FlowDiagnostics(comp).Where(e => e.Severity >= DiagnosticSeverity.Error)); 552Assert.Empty(this.FlowDiagnostics(comp).Where(e => e.Severity >= DiagnosticSeverity.Error)); 573Assert.NotEmpty(this.FlowDiagnostics(comp).Where(e => e.Severity >= DiagnosticSeverity.Error)); 591Assert.NotEmpty(this.FlowDiagnostics(comp).Where(e => e.Severity >= DiagnosticSeverity.Error)); 636Assert.NotEmpty(this.FlowDiagnostics(comp).Where(e => e.Severity >= DiagnosticSeverity.Error));
Semantics\OutVarTests.cs (1)
18799new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test");
Semantics\PatternMatchingTests.cs (1)
5650compilation.GetEmitDiagnostics().Where(d => d.Severity != DiagnosticSeverity.Warning).Verify(
Semantics\PrimaryConstructorTests.cs (16)
3747new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 4072new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 4158new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 4307new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 4497new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 4631new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 4811new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 4956new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 5135new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 5248new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 5475new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 5562new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 5675new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 5772new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 5830new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 5923new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test");
Semantics\RecordTests.cs (9)
26232new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 26555new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 26650new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 26815new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 27005new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 27139new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 27319new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 27464new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 27647new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test");
Microsoft.CodeAnalysis.CSharp.Features (22)
CodeRefactorings\SyncNamespace\CSharpChangeNamespaceService.cs (1)
372if (namespaceDecl.Name.GetDiagnostics().Any(diag => diag.DefaultSeverity == DiagnosticSeverity.Error))
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (1)
93!_semanticModel.GetDiagnostics(_source.Span, _cancellationToken).Any(static diagnostic => diagnostic.DefaultSeverity == DiagnosticSeverity.Error))
ConvertToRawString\ConvertInterpolatedStringToRawStringCodeRefactoringProvider.cs (1)
72if (stringExpression.GetDiagnostics().Any(static d => d.Severity == DiagnosticSeverity.Error))
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToBlockScopedNamespaceDiagnosticAnalyzer.cs (1)
53var diagnosticLocation = severity.WithDefaultSeverity(DiagnosticSeverity.Hidden) != ReportDiagnostic.Hidden
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToFileScopedNamespaceDiagnosticAnalyzer.cs (1)
56var diagnosticLocation = option.Notification.Severity.WithDefaultSeverity(DiagnosticSeverity.Hidden) != ReportDiagnostic.Hidden
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertToProgramMainDiagnosticAnalyzer.cs (1)
58root, isHidden: severity.WithDefaultSeverity(DiagnosticSeverity.Hidden) == ReportDiagnostic.Hidden),
src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertToTopLevelStatementsDiagnosticAnalyzer.cs (1)
78methodDeclaration, isHidden: option.Notification.Severity.WithDefaultSeverity(DiagnosticSeverity.Hidden) == ReportDiagnostic.Hidden),
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.cs (1)
51if (switchStatement.GetDiagnostics().Any(diagnostic => diagnostic.Severity == DiagnosticSeverity.Error))
src\Analyzers\CSharp\Analyzers\NewLines\ArrowExpressionClausePlacement\ArrowExpressionClausePlacementDiagnosticAnalyzer.cs (1)
72if (arrowExpressionClause.GetDiagnostics().Any(static d => d.Severity == DiagnosticSeverity.Error))
src\Analyzers\CSharp\Analyzers\NewLines\ConditionalExpressionPlacement\ConditionalExpressionPlacementDiagnosticAnalyzer.cs (1)
43if (conditionalExpression.GetRequiredParent().GetDiagnostics().Any(static d => d.Severity == DiagnosticSeverity.Error))
src\Analyzers\CSharp\Analyzers\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementDiagnosticAnalyzer.cs (1)
62if (current.ContainsDiagnostics && current.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
94if (topMostExpression.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
src\Analyzers\CSharp\Analyzers\UseExpressionBody\UseExpressionBodyDiagnosticAnalyzer.cs (2)
100var location = severity.WithDefaultSeverity(DiagnosticSeverity.Hidden) == ReportDiagnostic.Hidden 115var location = severity.WithDefaultSeverity(DiagnosticSeverity.Hidden) == ReportDiagnostic.Hidden
src\Analyzers\CSharp\Analyzers\UseExpressionBodyForLambda\UseExpressionBodyForLambdaHelpers.cs (1)
103? severity.WithDefaultSeverity(DiagnosticSeverity.Hidden)
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (2)
99if (localDeclaration.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)) 139if (styleOption.Notification.Severity.WithDefaultSeverity(DiagnosticSeverity.Hidden) < ReportDiagnostic.Hidden)
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (1)
51if (expression.GetDiagnostics().Any(diagnostic => diagnostic.Severity == DiagnosticSeverity.Error))
src\Analyzers\CSharp\CodeFixes\MakeAnonymousFunctionStatic\CSharpMakeAnonymousFunctionStaticCodeFixProvider.cs (1)
33context.Diagnostics[0].Severity > DiagnosticSeverity.Hidden ? CodeActionPriority.Default : CodeActionPriority.Low);
src\Analyzers\CSharp\CodeFixes\UseExpressionBody\UseExpressionBodyCodeFixProvider.cs (1)
43var priority = diagnostic.Severity == DiagnosticSeverity.Hidden
StringIndentation\CSharpStringIndentationService.cs (2)
82if (token.ContainsDiagnostics && token.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)) 99var errors = interpolatedString.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error);
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (103)
ConvertToRecord\ConvertToRecordCodeRefactoringTests.cs (1)
4758DiagnosticSeverity.Error,
Diagnostics\Configuration\ConfigureSeverity\AllAnalyzersSeverityConfigurationTests.cs (1)
30defaultSeverity: DiagnosticSeverity.Info,
Diagnostics\Configuration\ConfigureSeverity\CategoryBasedSeverityConfigurationTests.cs (1)
30defaultSeverity: DiagnosticSeverity.Info,
Diagnostics\Configuration\ConfigureSeverity\DotNetDiagnosticSeverityBasedSeverityConfigurationTests.cs (1)
30defaultSeverity: DiagnosticSeverity.Info,
Diagnostics\Suppression\RemoveSuppressionTests.cs (1)
30new DiagnosticDescriptor("InfoDiagnostic", "InfoDiagnostic Title", "InfoDiagnostic", "InfoDiagnostic", DiagnosticSeverity.Info, isEnabledByDefault: true);
Diagnostics\Suppression\RemoveUnnecessaryPragmaSuppressionsTests.cs (4)
57new DiagnosticDescriptor("Analyzer0168", "Variable is declared but never used", "Message", "Category", DiagnosticSeverity.Warning, isEnabledByDefault: true); 59new DiagnosticDescriptor("Analyzer0219", "Variable is assigned but its value is never used", "Message", "Category", DiagnosticSeverity.Warning, isEnabledByDefault: true); 114new DiagnosticDescriptor("CompilationEndId", "Title", "Message", "Category", DiagnosticSeverity.Warning, isEnabledByDefault: true, 1298new(DiagnosticId, "NonLocalDiagnosticTitle", "NonLocalDiagnosticMessage", "NonLocalDiagnosticCategory", DiagnosticSeverity.Warning, isEnabledByDefault: true);
Diagnostics\Suppression\SuppressionTest_FixMultipleTests.cs (2)
39new DiagnosticDescriptor("InfoDiagnostic", "InfoDiagnostic Title", "InfoDiagnostic", "InfoDiagnostic", DiagnosticSeverity.Info, isEnabledByDefault: true); 41new DiagnosticDescriptor("InfoDiagnostic2", "InfoDiagnostic2 Title", "InfoDiagnostic2", "InfoDiagnostic2", DiagnosticSeverity.Info, isEnabledByDefault: true);
Diagnostics\Suppression\SuppressionTests.cs (7)
693new DiagnosticDescriptor("InfoDiagnostic", "InfoDiagnostic Title", "InfoDiagnostic", "InfoDiagnostic", DiagnosticSeverity.Info, isEnabledByDefault: true); 803new DiagnosticDescriptor("ErrorDiagnostic", "ErrorDiagnostic", "ErrorDiagnostic", "ErrorDiagnostic", DiagnosticSeverity.Error, isEnabledByDefault: true); 866new DiagnosticDescriptor("@~DiagnosticWithBadId", "DiagnosticWithBadId", "DiagnosticWithBadId", "DiagnosticWithBadId", DiagnosticSeverity.Info, isEnabledByDefault: true); 916new DiagnosticDescriptor("InfoDiagnostic", "InfoDiagnostic Title", "InfoDiagnostic", "InfoDiagnostic", DiagnosticSeverity.Info, isEnabledByDefault: true); 1057new("InfoDiagnostic", "InfoDiagnostic", "InfoDiagnostic", "InfoDiagnostic", DiagnosticSeverity.Info, isEnabledByDefault: true); 2057new("InfoDiagnostic", "InfoDiagnostic", "InfoDiagnostic", "InfoDiagnostic", DiagnosticSeverity.Info, isEnabledByDefault: true); 2452new("NoLocationDiagnostic", "NoLocationDiagnostic", "NoLocationDiagnostic", "NoLocationDiagnostic", DiagnosticSeverity.Info, isEnabledByDefault: true);
EmbeddedLanguages\ValidateJsonStringTests.cs (9)
46diagnosticSeverity: DiagnosticSeverity.Warning, 64diagnosticSeverity: DiagnosticSeverity.Warning, 82diagnosticSeverity: DiagnosticSeverity.Warning, 109diagnosticSeverity: DiagnosticSeverity.Warning, 136diagnosticSeverity: DiagnosticSeverity.Warning, 207diagnosticSeverity: DiagnosticSeverity.Warning, 234diagnosticSeverity: DiagnosticSeverity.Warning, 309diagnosticSeverity: DiagnosticSeverity.Warning, 340diagnosticSeverity: DiagnosticSeverity.Warning,
EmbeddedLanguages\ValidateRegexStringTests.cs (2)
48diagnosticSeverity: DiagnosticSeverity.Warning, 68diagnosticSeverity: DiagnosticSeverity.Warning,
SimplifyPropertyPattern\SimplifyPropertyPatternTests.cs (1)
720VerifyCS.Diagnostic("IDE0170").WithSpan(8, 20, 8, 29).WithSpan(8, 20, 8, 86).WithSeverity(DiagnosticSeverity.Info),
SimplifyThisOrMe\SimplifyThisOrMeTests.cs (1)
107diagnosticSeverity: DiagnosticSeverity.Warning);
SimplifyTypeNames\SimplifyTypeNamesTests.cs (3)
5374""", IDEDiagnosticIds.PreferBuiltInOrFrameworkTypeDiagnosticId, DiagnosticSeverity.Hidden); 5389""", IDEDiagnosticIds.PreferBuiltInOrFrameworkTypeDiagnosticId, DiagnosticSeverity.Hidden); 7033""", IDEDiagnosticIds.SimplifyMemberAccessDiagnosticId, DiagnosticSeverity.Hidden);
src\Analyzers\CSharp\Tests\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionTests.cs (1)
894new DiagnosticResult(descriptor).WithSeverity(DiagnosticSeverity.Warning).WithSpan(5, 9, 5, 15).WithSpan(5, 9, 15, 10),
src\Analyzers\CSharp\Tests\ConvertToRecord\ConvertToRecordCodeFixTests.cs (1)
169DiagnosticSeverity.Error,
src\Analyzers\CSharp\Tests\MakeStructMemberReadOnly\MakeStructMemberReadOnlyTests.cs (2)
751VerifyCS.Diagnostic("IDE0251").WithSeverity(DiagnosticSeverity.Info).WithSpan(5, 32, 5, 35).WithOptions(DiagnosticOptions.IgnoreAdditionalLocations), 795VerifyCS.Diagnostic("IDE0251").WithSeverity(DiagnosticSeverity.Info).WithSpan(5, 42, 5, 45).WithOptions(DiagnosticOptions.IgnoreAdditionalLocations),
src\Analyzers\CSharp\Tests\RemoveUnnecessaryParentheses\RemoveUnnecessaryExpressionParenthesesTests.cs (1)
47=> descriptor.ImmutableCustomTags().Contains(WellKnownDiagnosticTags.Unnecessary) && descriptor.DefaultSeverity == DiagnosticSeverity.Hidden;
src\Analyzers\CSharp\Tests\RemoveUnnecessaryParentheses\RemoveUnnecessaryPatternParenthesesTests.cs (1)
40=> descriptor.ImmutableCustomTags().Contains(WellKnownDiagnosticTags.Unnecessary) && descriptor.DefaultSeverity == DiagnosticSeverity.Hidden;
src\Analyzers\CSharp\Tests\RemoveUnusedParametersAndValues\RemoveUnusedValueAssignmentTests.cs (3)
1372VerifyCS.Diagnostic("IDE0059").WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithArguments("y")); 1495VerifyCS.Diagnostic("IDE0059").WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithArguments("y")); 3386VerifyCS.Diagnostic("IDE0059").WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithArguments("x2"));
src\Analyzers\CSharp\Tests\SimplifyInterpolation\SimplifyInterpolationTests.cs (1)
48("IDE0071", DiagnosticSeverity.Info),
src\Analyzers\CSharp\Tests\UseCollectionExpression\UseCollectionExpressionForFluentTests.cs (1)
2076VerifyCS.Diagnostic().WithSpan(8, 51, 8, 57).WithSpan(8, 33, 8, 59).WithSeverity(DiagnosticSeverity.Info),
src\Analyzers\CSharp\Tests\UseImplicitOrExplicitType\UseExplicitTypeTests.cs (4)
2362diagnosticSeverity: DiagnosticSeverity.Hidden); 2382diagnosticSeverity: DiagnosticSeverity.Info); 2402diagnosticSeverity: DiagnosticSeverity.Warning); 2422diagnosticSeverity: DiagnosticSeverity.Error);
src\Analyzers\CSharp\Tests\UseImplicitOrExplicitType\UseImplicitTypeTests.cs (4)
1892diagnosticSeverity: DiagnosticSeverity.Hidden); 1912diagnosticSeverity: DiagnosticSeverity.Info); 1932diagnosticSeverity: DiagnosticSeverity.Warning); 1952diagnosticSeverity: DiagnosticSeverity.Error);
src\Analyzers\CSharp\Tests\UseObjectInitializer\UseObjectInitializerTests.cs (25)
74VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 181VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 246VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 310VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 355VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 402VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3).WithLocation(4).WithLocation(5), 449VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 495VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 544VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 595VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 674VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 676VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(4).WithLocation(5).WithLocation(6).WithLocation(7), 730VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 732VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(4).WithLocation(5).WithLocation(6).WithLocation(7), 787VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3).WithLocation(4).WithLocation(5), 789VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(6).WithLocation(7).WithLocation(8).WithLocation(9).WithLocation(10).WithLocation(11), 834VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3).WithLocation(4).WithLocation(5), 886VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3).WithLocation(4).WithLocation(5), 987VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 1040VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 1152VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 1217VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 1254VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3), 1346VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3)); 1404VerifyCS.Diagnostic().WithSeverity(DiagnosticSeverity.Warning).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3),
src\Analyzers\CSharp\Tests\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzerTests.cs (1)
661Assert.Equal(DiagnosticSeverity.Warning, diag.Severity);
src\Analyzers\CSharp\Tests\ValidateFormatString\ValidateFormatStringTests.cs (24)
642diagnosticSeverity: DiagnosticSeverity.Info, 677diagnosticSeverity: DiagnosticSeverity.Info, 695diagnosticSeverity: DiagnosticSeverity.Info, 713diagnosticSeverity: DiagnosticSeverity.Info, 732diagnosticSeverity: DiagnosticSeverity.Info, 751diagnosticSeverity: DiagnosticSeverity.Info, 770diagnosticSeverity: DiagnosticSeverity.Info, 790diagnosticSeverity: DiagnosticSeverity.Info, 810diagnosticSeverity: DiagnosticSeverity.Info, 828diagnosticSeverity: DiagnosticSeverity.Info, 846diagnosticSeverity: DiagnosticSeverity.Info, 864diagnosticSeverity: DiagnosticSeverity.Info, 882diagnosticSeverity: DiagnosticSeverity.Info, 901diagnosticSeverity: DiagnosticSeverity.Info, 920diagnosticSeverity: DiagnosticSeverity.Info, 939diagnosticSeverity: DiagnosticSeverity.Info, 966diagnosticSeverity: DiagnosticSeverity.Info, 985diagnosticSeverity: DiagnosticSeverity.Info, 1004diagnosticSeverity: DiagnosticSeverity.Info, 1023diagnosticSeverity: DiagnosticSeverity.Info, 1042diagnosticSeverity: DiagnosticSeverity.Info, 1061diagnosticSeverity: DiagnosticSeverity.Info, 1080diagnosticSeverity: DiagnosticSeverity.Info, 1099diagnosticSeverity: DiagnosticSeverity.Info,
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (120)
Semantics\ColorColorTests.cs (1)
1771new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test");
Semantics\ImportsTests.cs (1)
147comp.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error).Verify();
Semantics\InteractiveUsingTests.cs (5)
142CreateCompilation(source).GetDiagnostics().Where(d => d.Severity > DiagnosticSeverity.Hidden).Verify(expectedDiagnostics); 161CreateCompilation(source, options: options).GetDiagnostics().Where(d => d.Severity > DiagnosticSeverity.Hidden).Verify(expectedDiagnostics); 179CreateCompilation(source).GetDiagnostics().Where(d => d.Severity > DiagnosticSeverity.Hidden).Verify(expectedDiagnostics); 251CreateCompilation(source).GetDiagnostics().Where(d => d.Severity > DiagnosticSeverity.Hidden).Verify(expectedDiagnostics); 270CreateCompilation(source, options: options).GetDiagnostics().Where(d => d.Severity > DiagnosticSeverity.Hidden).Verify(expectedDiagnostics);
Semantics\InterpolationTests.cs (12)
533Assert.True(SyntaxFactory.ParseSyntaxTree(source + normal).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 534Assert.True(SyntaxFactory.ParseSyntaxTree(source + normal + " ").GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 535Assert.True(SyntaxFactory.ParseSyntaxTree(source + normal + "{").GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 536Assert.True(SyntaxFactory.ParseSyntaxTree(source + normal + "{ ").GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 537Assert.True(SyntaxFactory.ParseSyntaxTree(source + verbat).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 538Assert.True(SyntaxFactory.ParseSyntaxTree(source + verbat + " ").GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 539Assert.True(SyntaxFactory.ParseSyntaxTree(source + verbat + "{").GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 540Assert.True(SyntaxFactory.ParseSyntaxTree(source + verbat + "{ ").GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 558Assert.True(SyntaxFactory.ParseSyntaxTree(source).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 576Assert.True(SyntaxFactory.ParseSyntaxTree(source).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 595Assert.True(SyntaxFactory.ParseSyntaxTree(source).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 1489Assert.True(SyntaxFactory.ParseSyntaxTree(text).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error));
Semantics\MethodBodyModelTests.cs (5)
134Assert.Equal(2, count[(int)DiagnosticSeverity.Error]); 135Assert.Equal(0, count[(int)DiagnosticSeverity.Warning]); 136Assert.Equal(0, count[(int)DiagnosticSeverity.Info]); 618Assert.Equal(0, diags.Count(d => d.Severity == DiagnosticSeverity.Error)); 619Assert.Equal(0, diags.Count(d => d.Severity == DiagnosticSeverity.Warning));
Semantics\NativeIntegerTests.cs (2)
13267if (expectedDiagnostics.Any(d => ErrorFacts.GetSeverity((ErrorCode)d.Code) == DiagnosticSeverity.Error)) 13310if (expectedDiagnostics.Any(d => ErrorFacts.GetSeverity((ErrorCode)d.Code) == DiagnosticSeverity.Error))
Semantics\NullableReferenceTypesTests.cs (22)
125133Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125142Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125151Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125162Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125171Assert.Equal(DiagnosticSeverity.Error, diagnostics.Single().Severity); 125182Assert.Equal(DiagnosticSeverity.Error, diagnostics.Single().Severity); 125192Assert.Equal(DiagnosticSeverity.Error, diagnostics.Single().Severity); 125217Assert.Equal(DiagnosticSeverity.Hidden, diagnostics.Single().Severity); 125228Assert.Equal(DiagnosticSeverity.Hidden, diagnostics.Single().Severity); 125238Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125249Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125468Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125477Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125486Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125497Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125506Assert.Equal(DiagnosticSeverity.Error, diagnostics.Single().Severity); 125517Assert.Equal(DiagnosticSeverity.Error, diagnostics.Single().Severity); 125527Assert.Equal(DiagnosticSeverity.Error, diagnostics.Single().Severity); 125552Assert.Equal(DiagnosticSeverity.Hidden, diagnostics.Single().Severity); 125563Assert.Equal(DiagnosticSeverity.Hidden, diagnostics.Single().Severity); 125573Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125584Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity);
Semantics\OperatorTests.cs (2)
6272CreateCompilation(text).GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error).Verify( 6293CreateCompilation(text).GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error).Verify();
Semantics\OverloadResolutionPerfTests.cs (1)
312var diagnostics = comp.GetDiagnostics().Where(d => d is not { Severity: DiagnosticSeverity.Info, Code: (int)ErrorCode.INF_TooManyBoundLambdas });
Semantics\RawInterpolationTests.cs (8)
559Assert.True(SyntaxFactory.ParseSyntaxTree(source + normal).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 560Assert.True(SyntaxFactory.ParseSyntaxTree(source + normal + " ").GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 561Assert.True(SyntaxFactory.ParseSyntaxTree(source + normal + "{").GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 562Assert.True(SyntaxFactory.ParseSyntaxTree(source + normal + "{ ").GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 580Assert.True(SyntaxFactory.ParseSyntaxTree(source).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 598Assert.True(SyntaxFactory.ParseSyntaxTree(source).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 617Assert.True(SyntaxFactory.ParseSyntaxTree(source).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 1163Assert.True(SyntaxFactory.ParseSyntaxTree(text).GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error));
Semantics\RecordStructTests.cs (8)
5947new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 6176new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 6272new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 6401new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 6498new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 6556new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 6649new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 6810new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test");
Semantics\RefEscapingTests.cs (1)
48Assert.True(comp.GetDiagnostics().All(d => d.Severity != DiagnosticSeverity.Error));
Semantics\TopLevelStatementsTests.cs (13)
6424new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 6523new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 6598new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 6707new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 6788new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 6846new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 6904new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 6972new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 7052new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 7168new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 7262new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 7334new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 7401new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test");
Semantics\UnsafeTests.cs (1)
5190if (expectError != compilationDiagnostics.Any(diag => diag.Severity == DiagnosticSeverity.Error))
Semantics\VarianceTests.cs (2)
114var errors = comp.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error); 227var errors = comp.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error);
SourceGeneration\GeneratorDriverTests.cs (36)
178new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 433DiagnosticDescriptor generatorDiagnostic = new DiagnosticDescriptor("TG001", "Test Diagnostic", description, "Generators", DiagnosticSeverity.Warning, isEnabledByDefault: true, description: description); 662DiagnosticDescriptor generatorDiagnostic1 = new DiagnosticDescriptor("TG001", "Test Diagnostic", description, "Generators", DiagnosticSeverity.Warning, isEnabledByDefault: true, description: description); 663DiagnosticDescriptor generatorDiagnostic2 = new DiagnosticDescriptor("TG002", "Test Diagnostic", description, "Generators", DiagnosticSeverity.Warning, isEnabledByDefault: true, description: description); 664DiagnosticDescriptor generatorDiagnostic3 = new DiagnosticDescriptor("TG003", "Test Diagnostic", description, "Generators", DiagnosticSeverity.Warning, isEnabledByDefault: true, description: description); 709DiagnosticDescriptor generatorDiagnostic1 = new DiagnosticDescriptor("TG001", "Test Diagnostic", description, "Generators", DiagnosticSeverity.Warning, isEnabledByDefault: true, description: description); 710DiagnosticDescriptor generatorDiagnostic2 = new DiagnosticDescriptor("TG002", "Test Diagnostic", description, "Generators", DiagnosticSeverity.Warning, isEnabledByDefault: true, description: description); 711DiagnosticDescriptor generatorDiagnostic3 = new DiagnosticDescriptor("TG003", "Test Diagnostic", description, "Generators", DiagnosticSeverity.Warning, isEnabledByDefault: true, description: description); 1164c.ReportDiagnostic(CSDiagnostic.Create("GEN001", "generators", "message", DiagnosticSeverity.Warning, DiagnosticSeverity.Warning, true, 2)); 1165c.ReportDiagnostic(CSDiagnostic.Create("GEN002", "generators", "message", DiagnosticSeverity.Warning, DiagnosticSeverity.Warning, true, 3)); 1215var gen001 = CSDiagnostic.Create("GEN001", "generators", "message", DiagnosticSeverity.Warning, DiagnosticSeverity.Warning, true, 2); 1286var gen001 = CSDiagnostic.Create("GEN001", "generators", "message", DiagnosticSeverity.Warning, DiagnosticSeverity.Warning, isEnabledByDefault: true, warningLevel: 2); 3622DiagnosticSeverity.Warning, 3623DiagnosticSeverity.Warning, 3655DiagnosticSeverity.Warning, 3656DiagnosticSeverity.Warning, 3686DiagnosticSeverity.Warning, 3687DiagnosticSeverity.Warning, 3716DiagnosticSeverity.Warning, 3717DiagnosticSeverity.Warning, 3748DiagnosticSeverity.Warning, 3749DiagnosticSeverity.Warning, 3780DiagnosticSeverity.Warning, 3781DiagnosticSeverity.Warning, 3811DiagnosticSeverity.Warning, 3812DiagnosticSeverity.Warning, 3840DiagnosticSeverity.Warning, 3841DiagnosticSeverity.Warning, 3872DiagnosticSeverity.Warning, 3873DiagnosticSeverity.Warning, 3902DiagnosticSeverity.Warning, 3903DiagnosticSeverity.Warning,
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (8)
Compilation\SemanticModelAPITests.cs (1)
4366compilation.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error).Verify();
Compilation\UsedAssembliesTests.cs (2)
109if (!after.Any(d => ErrorFacts.GetSeverity((ErrorCode)d.Code) == DiagnosticSeverity.Error)) 282Assert.True(diagnostics.Any(d => d.DefaultSeverity == DiagnosticSeverity.Error));
Symbols\Source\NullablePublicAPITests.cs (4)
1157private static readonly DiagnosticDescriptor s_descriptor1 = new DiagnosticDescriptor(id: "CA9999_NullabilityPrinter", title: "CA9999_NullabilityPrinter", messageFormat: "Nullability of '{0}' is '{1}':'{2}'. Speculative flow state is '{3}'", category: "Test", defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true); 1158private static readonly DiagnosticDescriptor s_descriptor2 = new DiagnosticDescriptor(id: "CA9998_NullabilityPrinter", title: "CA9998_NullabilityPrinter", messageFormat: "Declared nullability of '{0}' is '{1}'", category: "Test", defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true); 1779new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test"); 4835new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test");
Symbols\TypeTests.cs (1)
1198Assert.Equal(0, comp.GetDeclarationDiagnostics().Count(e => e.Severity >= DiagnosticSeverity.Error));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (19)
Diagnostics\DiagnosticTest.cs (7)
73Assert.Equal(DiagnosticSeverity.Error, di1.Severity); 79Assert.Equal(DiagnosticSeverity.Warning, di2.Severity); 126var other = diagnostic.GetInstanceWithSeverity(DiagnosticSeverity.Info); 128Assert.Equal(DiagnosticSeverity.Info, other.Severity); 2782public override DiagnosticSeverity GetSeverity(int code) 2786return DiagnosticSeverity.Warning; 2790return DiagnosticSeverity.Error;
Diagnostics\LocationsTests.cs (6)
505var diagnostic = CodeAnalysis.Diagnostic.Create("CS0000", "", "msg", DiagnosticSeverity.Warning, DiagnosticSeverity.Warning, true, 1, location: location); 523var diagnosticWithoutMapping = CodeAnalysis.Diagnostic.Create("CS0000", "", "msg", DiagnosticSeverity.Warning, DiagnosticSeverity.Warning, true, 1, location: locationWithoutMapping); 526var diagnosticWithMapping = CodeAnalysis.Diagnostic.Create("CS0000", "", "msg", DiagnosticSeverity.Warning, DiagnosticSeverity.Warning, true, 1, location: locationWithMapping);
LexicalAndXml\PreprocessorTests.cs (2)
422Assert.Equal(DiagnosticSeverity.Warning, actual.Severity); 3876Assert.Equal(DiagnosticSeverity.Warning, diagnostic.Severity);
LexicalAndXml\XmlDocCommentTests.cs (1)
3311select new TestError(e.Code, e.Severity == DiagnosticSeverity.Warning)).ToList();
Parsing\SyntaxExtensions.cs (2)
112if (item.Severity == (errorsOnly ? DiagnosticSeverity.Error : DiagnosticSeverity.Warning))
Syntax\LambdaUtilitiesTests.cs (1)
44compilation.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error).Verify();
Microsoft.CodeAnalysis.CSharp.Test.Utilities (4)
CSharpTestBase.cs (3)
1365if (!compileDiagnostics.Any(d => d.DefaultSeverity == DiagnosticSeverity.Error) && 2124var actualDiagnostics = compilation.GetDiagnostics().Where(d => d.Severity != DiagnosticSeverity.Hidden); 2135var actualDiagnostics = compilation.GetDiagnostics().Where(d => d.Severity != DiagnosticSeverity.Hidden);
DiagnosticTestUtilities.cs (1)
121IsWarning = e.Severity == DiagnosticSeverity.Warning,
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (1)
184if (parentExpression.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (1)
96if (parsed.GetDiagnostics().Any(static d => d.Severity == DiagnosticSeverity.Error))
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
CodeGeneration\AddImportsTests.cs (1)
795Assert.Empty(compilerDiagnostics.Where(d => d.Severity == DiagnosticSeverity.Error));
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (3)
Squiggles\TestDiagnosticTagProducer.cs (2)
37severity: DiagnosticSeverity.Error, 38defaultSeverity: DiagnosticSeverity.Error,
Workspaces\NoCompilationDocumentDiagnosticAnalyzer.cs (1)
20"NC0000", "No Compilation Syntax Error", "No Compilation Syntax Error", "Error", DiagnosticSeverity.Error, isEnabledByDefault: true);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (27)
CodeFixes\CodeFixServiceTests.cs (4)
524var descriptor = new DiagnosticDescriptor(diagnosticId, "MockDiagnostic", "MockDiagnostic", category, DiagnosticSeverity.Warning, isEnabledByDefault: true); 605private readonly DiagnosticDescriptor s_descriptor = new(MockFixer.Id, "Title", "Message", "Category", DiagnosticSeverity.Warning, isEnabledByDefault: true); 911private readonly DiagnosticDescriptor _descriptor = new(DiagnosticId, "AdditionalFileAnalyzer", "AdditionalFileAnalyzer", "AdditionalFileAnalyzer", DiagnosticSeverity.Warning, isEnabledByDefault: true); 1171public static readonly DiagnosticDescriptor Descriptor = new("ID0001", "Title", "Message", "Category", DiagnosticSeverity.Warning, isEnabledByDefault: true);
Diagnostics\DiagnosticAnalyzerServiceTests.cs (15)
327using var workspace = CreateWorkspaceWithProjectAndAnalyzer(new NamedTypeAnalyzer(DiagnosticSeverity.Hidden)); 338using var workspace = CreateWorkspaceWithProjectAndAnalyzer(new NamedTypeAnalyzer(DiagnosticSeverity.Hidden)); 349using var workspace = CreateWorkspaceWithProjectAndAnalyzer(new NamedTypeAnalyzer(DiagnosticSeverity.Hidden)); 697var analyzer1 = new NamedTypeAnalyzerWithConfigurableEnabledByDefault(isEnabledByDefault: true, DiagnosticSeverity.Warning, throwOnAllNamedTypes: false); 915internal static readonly DiagnosticDescriptor s_syntaxRule = new DiagnosticDescriptor("syntax", "test", "test", "test", DiagnosticSeverity.Error, isEnabledByDefault: true); 916internal static readonly DiagnosticDescriptor s_semanticRule = new DiagnosticDescriptor("semantic", "test", "test", "test", DiagnosticSeverity.Error, isEnabledByDefault: true); 917internal static readonly DiagnosticDescriptor s_compilationRule = new DiagnosticDescriptor("compilation", "test", "test", "test", DiagnosticSeverity.Error, isEnabledByDefault: true); 931internal static readonly DiagnosticDescriptor s_syntaxRule = new DiagnosticDescriptor("syntax", "test", "test", "test", DiagnosticSeverity.Error, isEnabledByDefault: false); 932internal static readonly DiagnosticDescriptor s_semanticRule = new DiagnosticDescriptor("semantic", "test", "test", "test", DiagnosticSeverity.Error, isEnabledByDefault: false); 933internal static readonly DiagnosticDescriptor s_compilationRule = new DiagnosticDescriptor("compilation", "test", "test", "test", DiagnosticSeverity.Error, isEnabledByDefault: false); 947internal static readonly DiagnosticDescriptor s_syntaxRule = new DiagnosticDescriptor("syntax", "test", "test", "test", DiagnosticSeverity.Error, isEnabledByDefault: true); 1009internal static readonly DiagnosticDescriptor s_syntaxRule = new DiagnosticDescriptor("leak", "test", "test", "test", DiagnosticSeverity.Error, isEnabledByDefault: true); 1025private static readonly DiagnosticDescriptor s_rule = new DiagnosticDescriptor("project", "test", "test", "test", DiagnosticSeverity.Error, isEnabledByDefault: true); 1036public NamedTypeAnalyzer(DiagnosticSeverity defaultSeverity = DiagnosticSeverity.Warning)
Diagnostics\DiagnosticDataTests.cs (8)
118severity: DiagnosticSeverity.Info, 119defaultSeverity: DiagnosticSeverity.Info, 151severity: DiagnosticSeverity.Info, 152defaultSeverity: DiagnosticSeverity.Info, 197severity: DiagnosticSeverity.Info, 198defaultSeverity: DiagnosticSeverity.Info, 245severity: DiagnosticSeverity.Info, 246defaultSeverity: DiagnosticSeverity.Info,
Microsoft.CodeAnalysis.EditorFeatures.Wpf (9)
InlineDiagnostics\InlineDiagnosticsTag.cs (1)
163DiagnosticSeverity.Warning => KnownMonikers.StatusWarning,
InlineDiagnostics\InlineDiagnosticsTaggerProvider.cs (4)
48diagnostic.Severity is DiagnosticSeverity.Warning or DiagnosticSeverity.Error && 81if (diagnostic.Severity == DiagnosticSeverity.Error) 87else if (diagnostic.Severity == DiagnosticSeverity.Warning)
Suggestions\SuggestedActionsSource.cs (4)
260DiagnosticSeverity.Hidden or DiagnosticSeverity.Info or DiagnosticSeverity.Warning => PredefinedSuggestedActionCategoryNames.CodeFix, 261DiagnosticSeverity.Error => PredefinedSuggestedActionCategoryNames.ErrorFix,
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (16)
CodeFixes\CodeFixServiceTests.vb (1)
179DiagnosticSeverity.Warning,
Diagnostics\AdditionalFileDiagnosticsTests.vb (1)
68Public Shared Rule As New DiagnosticDescriptor("OA1001", "Options test", "Serialization support has not been requested", "Test", DiagnosticSeverity.Error, True)
Diagnostics\DiagnosticProviderTests.vb (3)
336Return CreateDiagnostic(id, message, DiagnosticSeverity.Error, docId, projId, mappedLine, originalLine, mappedColumn, originalColumn, mappedFile, originalFile) 341Return CreateDiagnostic(id, message, DiagnosticSeverity.Warning, docId, projId, mappedLine, originalLine, mappedColumn, originalColumn, mappedFile, originalFile) 344Private Shared Function CreateDiagnostic(id As String, message As String, severity As DiagnosticSeverity, docId As DocumentId, projId As ProjectId, mappedLine As Integer, originalLine As Integer, mappedColumn As Integer,
Diagnostics\DiagnosticServiceTests.vb (11)
314Assert.Equal(DiagnosticSeverity.Error, diagnostics(0).Severity) 1248Public Shared Descriptor1 As New DiagnosticDescriptor("MustOverrideMethodDiagnostic", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Warning, isEnabledByDefault:=True) 1367Public Shared Descriptor1 As New DiagnosticDescriptor("FieldDeclarationDiagnostic", "DummyDescription", "{0}", "DummyCategory", DiagnosticSeverity.Warning, isEnabledByDefault:=True) 1447DiagnosticSeverity.Warning, 1476DiagnosticSeverity.Warning, 1521DiagnosticSeverity.Warning, 1762DiagnosticSeverity.Warning, 1875DiagnosticSeverity.Warning, 2122Dim analyzer = New CompilationAnalyzerWithSeverity(DiagnosticSeverity.Hidden, configurable:=False) 2381Public Property Descriptor As New DiagnosticDescriptor("ID0001", "Title", "Message", "Category", DiagnosticSeverity.Warning, isEnabledByDefault:=True) 2496Public Shared s_descriptor As DiagnosticDescriptor = New DiagnosticDescriptor("ID0001", "Title", "Message", "Category", DiagnosticSeverity.Warning, isEnabledByDefault:=True)
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (6)
EvaluationContextBase.cs (6)
60var errors = diagnostics.AsEnumerable().Where(d => d.Severity == DiagnosticSeverity.Error); 131public override DiagnosticSeverity Severity 133get { return DiagnosticSeverity.Error; } 136public override DiagnosticSeverity DefaultSeverity 138get { return DiagnosticSeverity.Error; } 171internal override Diagnostic WithSeverity(DiagnosticSeverity severity)
Microsoft.CodeAnalysis.ExternalAccess.FSharp (4)
Internal\Diagnostics\FSharpDocumentDiagnosticAnalyzer.cs (1)
62dummyDescriptors.Add(new DiagnosticDescriptor(String.Format("FS{0:D4}", i), String.Empty, String.Empty, String.Empty, DiagnosticSeverity.Error, true, null, null));
Internal\Diagnostics\FSharpSimplifyNameDiagnosticAnalyzer.cs (1)
49DiagnosticCategory.Style, DiagnosticSeverity.Hidden, isEnabledByDefault: true, customTags: FSharpDiagnosticCustomTags.Unnecessary);
Internal\Diagnostics\FSharpUnusedDeclarationsAnalyzer.cs (1)
51DiagnosticCategory.Style, DiagnosticSeverity.Hidden, isEnabledByDefault: true, customTags: FSharpDiagnosticCustomTags.Unnecessary);
Internal\Diagnostics\FSharpUnusedOpensDiagnosticAnalyzer.cs (1)
46DiagnosticCategory.Style, DiagnosticSeverity.Hidden, isEnabledByDefault: true, customTags: FSharpDiagnosticCustomTags.Unnecessary);
Microsoft.CodeAnalysis.Features (53)
CodeFixes\DiagnosticExtensions.cs (2)
9public static bool IsMoreSevereThanOrEqualTo(this DiagnosticSeverity left, DiagnosticSeverity right)
CodeFixes\Suppression\SuppressionHelpers.cs (4)
51case DiagnosticSeverity.Hidden: 55case DiagnosticSeverity.Error: 56case DiagnosticSeverity.Warning: 57case DiagnosticSeverity.Info:
Completion\Providers\AbstractInternalsVisibleToCompletionProvider.cs (1)
195if (diagnostic.Severity == DiagnosticSeverity.Error)
ConvertCast\AbstractConvertCastCodeRefactoringProvider.cs (1)
42if (from.GetDiagnostics().Any(d => d.DefaultSeverity == DiagnosticSeverity.Error))
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.cs (1)
81if (ifStatement == null || ifStatement.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
ConvertLinq\ConvertForEachToLinqQuery\AbstractConvertForEachToLinqQueryProvider.cs (1)
94.Any(static diagnostic => diagnostic.DefaultSeverity == DiagnosticSeverity.Error))
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (2)
59if (stringToken.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)) 100if (interpolatedString.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
ConvertToInterpolatedString\ConvertRegularStringToInterpolatedStringRefactoringProvider.cs (1)
49if (literalExpression.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
Diagnostics\Analyzers\UnboundIdentifiersDiagnosticAnalyzerBase.cs (1)
54DiagnosticSeverity.Error,
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
571var syntaxError = syntaxDiagnostics.FirstOrDefault(d => d.Severity == DiagnosticSeverity.Error);
EditAndContinue\EditAndContinueDiagnosticDescriptors.cs (9)
40void add(int index, int id, string resourceName, LocalizableResourceString title, DiagnosticSeverity severity) 57void AddRudeEdit(RudeEditKind kind, string resourceName, DiagnosticSeverity severity = DiagnosticSeverity.Error) 60void AddGeneralDiagnostic(EditAndContinueErrorCode code, string resourceName, DiagnosticSeverity severity = DiagnosticSeverity.Error) 150AddRudeEdit(RudeEditKind.UpdateMightNotHaveAnyEffect, nameof(FeaturesResources.Changing_0_might_not_have_any_effect_until_the_application_is_restarted), DiagnosticSeverity.Warning); 169AddGeneralDiagnostic(EditAndContinueErrorCode.DocumentIsOutOfSyncWithDebuggee, nameof(FeaturesResources.DocumentIsOutOfSyncWithDebuggee), DiagnosticSeverity.Warning); 170AddGeneralDiagnostic(EditAndContinueErrorCode.UnableToReadSourceFileOrPdb, nameof(FeaturesResources.UnableToReadSourceFileOrPdb), DiagnosticSeverity.Warning); 198DiagnosticSeverity.Error,
EditAndContinue\EditSessionTelemetry.cs (1)
127=> LogProjectAnalysisSummary(summary, projectTelemetryId, emitDiagnostics.SelectAsArray(d => d.Severity == DiagnosticSeverity.Error, d => d.Id));
EditAndContinue\RudeEditDiagnostic.cs (3)
50internal static DiagnosticSeverity GetSeverity(this RudeEditKind kind) 54=> kind.GetSeverity() == DiagnosticSeverity.Error; 57=> diagnostic.Descriptor.DefaultSeverity == DiagnosticSeverity.Error;
EditAndContinue\SolutionUpdate.cs (1)
55if (diagnostic.Severity == DiagnosticSeverity.Error)
EditAndContinue\Utilities\Extensions.cs (3)
125DiagnosticSeverity.Error => ManagedHotReloadDiagnosticSeverity.RestartRequired, 126DiagnosticSeverity.Warning => ManagedHotReloadDiagnosticSeverity.Warning, 131: (data.Severity == DiagnosticSeverity.Error)
ExternalAccess\VSTypeScript\Api\VSTypeScriptDiagnosticData.cs (1)
23public DiagnosticSeverity Severity
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (3)
17private DiagnosticSeverity? _minimumReportedSeverity; 62DiagnosticSeverity.Hidden, 167if (_minimumReportedSeverity!.Value == DiagnosticSeverity.Hidden)
src\Analyzers\Core\Analyzers\AbstractCodeQualityDiagnosticAnalyzer.cs (1)
53DiagnosticSeverity.Info,
src\Analyzers\Core\Analyzers\MatchFolderAndNamespace\AbstractMatchFolderAndNamespaceDiagnosticAnalyzer.cs (1)
115?.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)
src\Analyzers\Core\Analyzers\NewLines\ConsecutiveStatementPlacement\AbstractConsecutiveStatementPlacementDiagnosticAnalyzer.cs (1)
52if (node.ContainsDiagnostics && node.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
src\Analyzers\Core\Analyzers\OrderModifiers\AbstractOrderModifiersDiagnosticAnalyzer.cs (1)
75if (notificationOption.Severity.WithDefaultSeverity(DiagnosticSeverity.Hidden) == ReportDiagnostic.Hidden)
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (1)
39defaultSeverity: DiagnosticSeverity.Warning,
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (4)
130if (root.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)) 613DiagnosticSeverity severity, 633DiagnosticSeverity severity) 664DiagnosticSeverity severity)
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
620if (tree.GetDiagnostics(cancellationToken).Any(d => d.Severity == DiagnosticSeverity.Error))
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.cs (1)
81if (syntax.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (1)
124if (context.Operation.Syntax.GetDiagnostics().Any(diagnostic => diagnostic.Severity == DiagnosticSeverity.Error))
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
39DiagnosticSeverity.Info,
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersCodeFixProvider.cs (1)
30var priority = diagnostic.Severity == DiagnosticSeverity.Hidden
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (1)
70var priority = diagnostic.Severity == DiagnosticSeverity.Hidden
Wrapping\AbstractWrapper.cs (1)
66=> declaration.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error && d.Location.SourceSpan.OverlapsWith(headerSpan));
Wrapping\AbstractWrappingCodeRefactoringProvider.cs (1)
51var containsSyntaxError = node.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error);
Microsoft.CodeAnalysis.Features.UnitTests (10)
EditAndContinue\EmitSolutionUpdateResultsTests.cs (6)
83severity: DiagnosticSeverity.Warning, 84defaultSeverity: DiagnosticSeverity.Warning, 99severity: DiagnosticSeverity.Error, 100defaultSeverity: DiagnosticSeverity.Warning, 116severity: DiagnosticSeverity.Error, 117defaultSeverity: DiagnosticSeverity.Error,
FindUsages\DefinitionItemFactoryTests.cs (4)
935Assert.Empty(compilation.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error)); 1340Assert.Empty(compilation.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error)); 1400Assert.Empty(compilation.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error)); 1515Assert.Empty(compilation.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error));
Microsoft.CodeAnalysis.InteractiveHost (2)
Interactive\Core\InteractiveHost.Service.cs (2)
532var writer = (error.Severity == DiagnosticSeverity.Error) ? Console.Error : Console.Out; 667if (diagnostics.Any(static d => d.Severity == DiagnosticSeverity.Error))
Microsoft.CodeAnalysis.LanguageServer.Protocol (31)
Extensions\ProtocolConversions.Diagnostics.cs (7)
170if (diagnosticData.Severity != DiagnosticSeverity.Hidden) 210private static LSP.DiagnosticSeverity ConvertDiagnosticSeverity(DiagnosticSeverity severity, bool supportsVisualStudioExtensions) 215DiagnosticSeverity.Hidden => LSP.DiagnosticSeverity.Hint, 217DiagnosticSeverity.Info => supportsVisualStudioExtensions ? LSP.DiagnosticSeverity.Information : LSP.DiagnosticSeverity.Hint, 218DiagnosticSeverity.Warning => LSP.DiagnosticSeverity.Warning, 219DiagnosticSeverity.Error => LSP.DiagnosticSeverity.Error, 231if (diagnosticData.Severity == DiagnosticSeverity.Hidden)
Features\CodeCleanup\AbstractCodeCleanupService.cs (5)
161var minimumSeverity = isAnyDiagnosticIdExplicitlyEnabled ? DiagnosticSeverity.Hidden : DiagnosticSeverity.Warning; 176Document document, string diagnosticId, DiagnosticSeverity minimumSeverity, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken) 232document, diagnosticId, DiagnosticSeverity.Warning, progressTracker, cancellationToken).ConfigureAwait(false);
Features\CodeFixes\CodeFixService.cs (5)
131var preferredMap = diagnostic.Severity == DiagnosticSeverity.Error 282=> GetDocumentFixAllForIdInSpanAsync(document, range, diagnosticId, DiagnosticSeverity.Hidden, cancellationToken); 285TextDocument document, TextSpan range, string diagnosticId, DiagnosticSeverity minimumSeverity, CancellationToken cancellationToken) 325=> ApplyCodeFixesForSpecificDiagnosticIdAsync(document, diagnosticId, DiagnosticSeverity.Hidden, progressTracker, cancellationToken); 330DiagnosticSeverity severity,
Features\CodeFixes\ICodeFixService.cs (3)
27Task<CodeFixCollection?> GetDocumentFixAllForIdInSpanAsync(TextDocument document, TextSpan textSpan, string diagnosticId, DiagnosticSeverity severity, CancellationToken cancellationToken); 28Task<TDocument> ApplyCodeFixesForSpecificDiagnosticIdAsync<TDocument>(TDocument document, string diagnosticId, DiagnosticSeverity severity, IProgress<CodeAnalysisProgress> progressTracker, CancellationToken cancellationToken) 45=> service.ApplyCodeFixesForSpecificDiagnosticIdAsync(document, diagnosticId, DiagnosticSeverity.Hidden, progressTracker, cancellationToken);
Features\Diagnostics\DocumentAnalysisExecutor_Helpers.cs (3)
68defaultSeverity: DiagnosticSeverity.Warning, 119severity: DiagnosticSeverity.Warning, 120defaultSeverity: DiagnosticSeverity.Warning,
Features\UnifiedSuggestions\UnifiedSuggestedActionsSource.cs (5)
409private static string GetFixCategory(DiagnosticSeverity severity) 413case DiagnosticSeverity.Hidden: 414case DiagnosticSeverity.Info: 415case DiagnosticSeverity.Warning: 417case DiagnosticSeverity.Error:
Handler\Breakpoints\ValidateBreakableRangeHandler.cs (1)
62if (tree.GetDiagnostics(cancellationToken).Any(d => d.Severity == DiagnosticSeverity.Error))
Handler\Diagnostics\DiagnosticSources\TaskListDiagnosticSource.cs (2)
53severity: DiagnosticSeverity.Info, 54defaultSeverity: DiagnosticSeverity.Info,
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (13)
Diagnostics\AbstractPullDiagnosticTestsBase.cs (1)
375"TS01", "TS error", "TS error", "Error", DiagnosticSeverity.Error, isEnabledByDefault: true);
Diagnostics\AdditionalFileDiagnosticsTests.cs (1)
126private readonly DiagnosticDescriptor _descriptor = new(Id, "MockAdditionalDiagnostic", "MockAdditionalDiagnostic", "InternalCategory", DiagnosticSeverity.Warning, isEnabledByDefault: true, helpLinkUri: "https://github.com/dotnet/roslyn");
Diagnostics\BuildOnlyDiagnosticIdsHandlerTests.cs (2)
92private static readonly DiagnosticDescriptor s_descriptor = new(Id, "Title", "Message", "Category", DiagnosticSeverity.Warning, isEnabledByDefault: true, customTags: [WellKnownDiagnosticTags.CompilationEnd]); 104private static readonly DiagnosticDescriptor s_descriptor = new(Id, "Title", "Message", "Category", DiagnosticSeverity.Warning, isEnabledByDefault: true);
Diagnostics\DiagnosticsPullCacheTests.cs (2)
123return Task.FromResult<ImmutableArray<DiagnosticData>>([new DiagnosticData(Id, category: "category", context.Document!.Name, DiagnosticSeverity.Error, DiagnosticSeverity.Error,
Diagnostics\NonLocalDiagnosticTests.cs (2)
78public static readonly DiagnosticDescriptor NonLocalDescriptor = new("NonLocal0001", "Title1", "NonLocal0001", "Category", DiagnosticSeverity.Warning, isEnabledByDefault: true); 79public static readonly DiagnosticDescriptor CompilationEndDescriptor = new("NonLocal0002", "Title2", "NonLocal0002", "Category", DiagnosticSeverity.Warning, isEnabledByDefault: true, customTags: [WellKnownDiagnosticTags.CompilationEnd]);
Diagnostics\PullDiagnosticTests.cs (4)
130private readonly DiagnosticDescriptor _descriptor = new(RuleId, "Title", "Message", "Category", DiagnosticSeverity.Warning, isEnabledByDefault: true); 144private readonly DiagnosticDescriptor _descriptor = new(RuleId, "Title", "Message", "Category", DiagnosticSeverity.Warning, isEnabledByDefault: true); 1283severity: DiagnosticSeverity.Error, 1284defaultSeverity: DiagnosticSeverity.Error,
Diagnostics\WorkspaceProjectDiagnosticsTests.cs (1)
75private readonly DiagnosticDescriptor _descriptor = new(Id, "MockProjectDiagnostic", "MockProjectDiagnostic", "InternalCategory", DiagnosticSeverity.Warning, isEnabledByDefault: true, helpLinkUri: "https://github.com/dotnet/roslyn");
Microsoft.CodeAnalysis.Scripting (5)
Hosting\CommandLine\CommandLineRunner.cs (1)
393Console.SetForegroundColor(diagnostic.Severity == DiagnosticSeverity.Error ? ConsoleColor.Red : ConsoleColor.Yellow);
Script.cs (3)
367return ImmutableArray.CreateRange(GetCompilation().GetDiagnostics(cancellationToken).Where(d => d.Severity == DiagnosticSeverity.Warning)); 371return ImmutableArray.CreateRange(e.Diagnostics.Where(d => d.Severity is DiagnosticSeverity.Error or DiagnosticSeverity.Warning));
ScriptBuilder.cs (1)
109var filtered = diagnostics.AsEnumerable().Where(d => d.Severity == DiagnosticSeverity.Error).AsImmutable();
Microsoft.CodeAnalysis.Scripting.TestUtilities (1)
ScriptingTestHelpers.cs (1)
91e.Diagnostics.Any(d => d.Severity == DiagnosticSeverity.Error && e.Message == d.ToString());
Microsoft.CodeAnalysis.Test.Utilities (182)
Diagnostics\BoxingOperationAnalyzer.cs (1)
29DiagnosticSeverity.Warning,
Diagnostics\CommonDiagnosticAnalyzers.cs (82)
36defaultSeverity: DiagnosticSeverity.Warning, 47defaultSeverity: DiagnosticSeverity.Error, 109var effectiveSeverity1 = warnAsError || Descriptor1.DefaultSeverity == DiagnosticSeverity.Error ? "error" : "warning"; 110var effectiveSeverity2 = warnAsError || Descriptor2.DefaultSeverity == DiagnosticSeverity.Error ? "error" : "warning"; 151""defaultLevel"": """ + (Descriptor1.DefaultSeverity == DiagnosticSeverity.Error ? "error" : "warning") + @""", 165""defaultLevel"": """ + (Descriptor2.DefaultSeverity == DiagnosticSeverity.Error ? "error" : "warning") + @""", 192""level"": """ + (Descriptor1.DefaultSeverity == DiagnosticSeverity.Error ? "error" : "warning") + @""", 216""level"": """ + (Descriptor2.DefaultSeverity == DiagnosticSeverity.Error ? "error" : "warning") + @""", 228""defaultLevel"": """ + (Descriptor1.DefaultSeverity == DiagnosticSeverity.Error ? "error" : "warning") + @""", 242""defaultLevel"": """ + (Descriptor2.DefaultSeverity == DiagnosticSeverity.Error ? "error" : "warning") + @""", 264var effectiveSeverity1 = warnAsError || Descriptor1.DefaultSeverity == DiagnosticSeverity.Error ? "error" : "warning"; 265var effectiveSeverity2 = warnAsError || Descriptor2.DefaultSeverity == DiagnosticSeverity.Error ? "error" : "warning"; 326""level"": """ + (Descriptor1.DefaultSeverity == DiagnosticSeverity.Error ? "error" : "warning") + @""", 358""level"": """ + (Descriptor2.DefaultSeverity == DiagnosticSeverity.Error ? "error" : "warning") + @""", 487""level"": """ + (Descriptor2.DefaultSeverity == DiagnosticSeverity.Error ? "error" : "warning") + @""" 538defaultSeverity: DiagnosticSeverity.Warning, 547defaultSeverity: DiagnosticSeverity.Warning, 587defaultSeverity: DiagnosticSeverity.Warning, 595defaultSeverity: DiagnosticSeverity.Warning, 646defaultSeverity: DiagnosticSeverity.Warning, 672public const DiagnosticSeverity Severity = DiagnosticSeverity.Warning; 711public const DiagnosticSeverity Severity = DiagnosticSeverity.Warning; 740defaultSeverity: DiagnosticSeverity.Warning, 755defaultSeverity: DiagnosticSeverity.Warning, 778public const DiagnosticSeverity Severity = DiagnosticSeverity.Warning; 818defaultSeverity: DiagnosticSeverity.Warning, 849defaultSeverity: DiagnosticSeverity.Warning, 870defaultSeverity: DiagnosticSeverity.Warning, 891defaultSeverity: DiagnosticSeverity.Warning, 927defaultSeverity: DiagnosticSeverity.Warning, 995defaultSeverity: DiagnosticSeverity.Warning, 1034defaultSeverity: DiagnosticSeverity.Warning, 1053DiagnosticSeverity severity, 1096DiagnosticSeverity.Warning, 1126DiagnosticSeverity.Warning, 1195DiagnosticSeverity.Warning, 1237defaultSeverity: DiagnosticSeverity.Warning, 1382defaultSeverity: DiagnosticSeverity.Warning, 1408defaultSeverity: DiagnosticSeverity.Warning, 1458defaultSeverity: DiagnosticSeverity.Warning, 1483DiagnosticSeverity.Warning, 1491DiagnosticSeverity.Error, 1499DiagnosticSeverity.Warning, 1507DiagnosticSeverity.Warning, 1688DiagnosticSeverity.Warning, 1728DiagnosticSeverity.Warning, 1736DiagnosticSeverity.Warning, 1744DiagnosticSeverity.Warning, 1752DiagnosticSeverity.Warning, 1852defaultSeverity: DiagnosticSeverity.Warning, 1892defaultSeverity: DiagnosticSeverity.Warning, 1900defaultSeverity: DiagnosticSeverity.Warning, 1908defaultSeverity: DiagnosticSeverity.Warning, 1916defaultSeverity: DiagnosticSeverity.Warning, 1924defaultSeverity: DiagnosticSeverity.Warning, 1932defaultSeverity: DiagnosticSeverity.Warning, 1940defaultSeverity: DiagnosticSeverity.Warning, 1948defaultSeverity: DiagnosticSeverity.Warning, 1956defaultSeverity: DiagnosticSeverity.Warning, 2374severity: DiagnosticSeverity.Warning, 2375defaultSeverity: DiagnosticSeverity.Warning, 2411defaultSeverity: DiagnosticSeverity.Warning, 2476defaultSeverity: DiagnosticSeverity.Warning, 2494private readonly DiagnosticSeverity _reportedSeverity; 2496public NamedTypeAnalyzerWithConfigurableEnabledByDefault(bool isEnabledByDefault, DiagnosticSeverity defaultSeverity, bool throwOnAllNamedTypes = false) 2501public NamedTypeAnalyzerWithConfigurableEnabledByDefault(bool isEnabledByDefault, DiagnosticSeverity defaultSeverity, bool customConfigurable, bool throwOnAllNamedTypes) 2508DiagnosticSeverity defaultSeverity, 2509DiagnosticSeverity reportedSeverity, 2557defaultSeverity: DiagnosticSeverity.Warning, 2586defaultSeverity: DiagnosticSeverity.Warning, 2632defaultSeverity: DiagnosticSeverity.Warning, 2674defaultSeverity: DiagnosticSeverity.Warning, 2705private static readonly DiagnosticDescriptor s_descriptor = new("ID0001", "Title", "{0}", "Category", DiagnosticSeverity.Warning, isEnabledByDefault: true); 2869defaultSeverity: DiagnosticSeverity.Warning, 2908new DiagnosticDescriptor(DiagnosticId, "test", "test", "test", DiagnosticSeverity.Warning, isEnabledByDefault: true); 2975private static readonly DiagnosticDescriptor s_descriptor = new("ID0001", "Title", "Message", "Category", DiagnosticSeverity.Warning, isEnabledByDefault: true); 3082defaultSeverity: DiagnosticSeverity.Warning, 3231defaultSeverity: DiagnosticSeverity.Warning, 3234public DiagnosticSeverity MinimumReportedSeverity { get; private set; }
Diagnostics\CouldHaveMoreSpecificTypeAnalyzer.cs (2)
25DiagnosticSeverity.Warning, 33DiagnosticSeverity.Warning,
Diagnostics\DescriptorFactory.cs (2)
24/// - <see cref="DiagnosticDescriptor.DefaultSeverity"/> set to <see cref="DiagnosticSeverity.Hidden"/> 34defaultSeverity: DiagnosticSeverity.Hidden, isEnabledByDefault: true,
Diagnostics\DiagnosticDescription.cs (12)
39private readonly DiagnosticSeverity? _defaultSeverityOpt; 40private readonly DiagnosticSeverity? _effectiveSeverityOpt; 81DiagnosticSeverity? defaultSeverityOpt = null, 82DiagnosticSeverity? effectiveSeverityOpt = null, 106DiagnosticSeverity? defaultSeverityOpt = null, 107DiagnosticSeverity? effectiveSeverityOpt = null, 129_defaultSeverityOpt = includeDefaultSeverity ? d.DefaultSeverity : (DiagnosticSeverity?)null; 130_effectiveSeverityOpt = includeEffectiveSeverity ? d.Severity : (DiagnosticSeverity?)null; 210public DiagnosticDescription WithDefaultSeverity(DiagnosticSeverity defaultSeverity) 215public DiagnosticDescription WithEffectiveSeverity(DiagnosticSeverity effectiveSeverity) 244public DiagnosticSeverity? DefaultSeverity => _defaultSeverityOpt; 245public DiagnosticSeverity? EffectiveSeverity => _effectiveSeverityOpt;
Diagnostics\DiagnosticExtensions.cs (7)
246expected.DefaultSeverity.Value == DiagnosticSeverity.Warning; 248expected.EffectiveSeverity.Value == DiagnosticSeverity.Warning || 249expected.EffectiveSeverity.Value == DiagnosticSeverity.Error; 258var newEffectiveSeverity = expected.EffectiveSeverity.Value == DiagnosticSeverity.Error ? 259DiagnosticSeverity.Warning : 260DiagnosticSeverity.Error;
Diagnostics\EmptyArrayAnalyzer.cs (1)
34DiagnosticSeverity.Warning,
Diagnostics\FieldCouldBeReadOnlyAnalyzer.cs (1)
25DiagnosticSeverity.Warning,
Diagnostics\LocalCouldBeConstAnalyzer.cs (1)
25DiagnosticSeverity.Warning,
Diagnostics\OperationTestAnalyzer.cs (68)
27DiagnosticSeverity.Warning, 35DiagnosticSeverity.Warning, 43DiagnosticSeverity.Warning, 89DiagnosticSeverity.Warning, 130DiagnosticSeverity.Warning, 303DiagnosticSeverity.Warning, 311DiagnosticSeverity.Warning, 319DiagnosticSeverity.Warning, 499DiagnosticSeverity.Warning, 507DiagnosticSeverity.Warning, 515DiagnosticSeverity.Warning, 523DiagnosticSeverity.Warning, 616DiagnosticSeverity.Warning, 653DiagnosticSeverity.Warning, 693DiagnosticSeverity.Warning, 701DiagnosticSeverity.Warning, 739DiagnosticSeverity.Warning, 780DiagnosticSeverity.Warning, 820DiagnosticSeverity.Warning, 828DiagnosticSeverity.Warning, 877DiagnosticSeverity.Warning, 885DiagnosticSeverity.Warning, 935DiagnosticSeverity.Warning, 943DiagnosticSeverity.Warning, 969DiagnosticSeverity.Warning, 977DiagnosticSeverity.Warning, 985DiagnosticSeverity.Warning, 993DiagnosticSeverity.Warning, 1001DiagnosticSeverity.Warning, 1009DiagnosticSeverity.Warning, 1017DiagnosticSeverity.Warning, 1082DiagnosticSeverity.Warning, 1090DiagnosticSeverity.Warning, 1171DiagnosticSeverity.Warning, 1213DiagnosticSeverity.Warning, 1242DiagnosticSeverity.Warning, 1250DiagnosticSeverity.Warning, 1283DiagnosticSeverity.Warning, 1291DiagnosticSeverity.Warning, 1300DiagnosticSeverity.Warning, 1352DiagnosticSeverity.Warning, 1361DiagnosticSeverity.Warning, 1431DiagnosticSeverity.Warning, 1439DiagnosticSeverity.Warning, 1481DiagnosticSeverity.Warning, 1489DiagnosticSeverity.Warning, 1497DiagnosticSeverity.Warning, 1505DiagnosticSeverity.Warning, 1558DiagnosticSeverity.Warning, 1589DiagnosticSeverity.Warning, 1597DiagnosticSeverity.Warning, 1671DiagnosticSeverity.Warning, 1681DiagnosticSeverity.Warning, 1757DiagnosticSeverity.Warning, 1765DiagnosticSeverity.Warning, 1773DiagnosticSeverity.Warning, 1824DiagnosticSeverity.Warning, 1832DiagnosticSeverity.Warning, 1881DiagnosticSeverity.Warning, 1913DiagnosticSeverity.Warning, 1952DiagnosticSeverity.Warning, 1960DiagnosticSeverity.Warning, 1994DiagnosticSeverity.Warning, 2002DiagnosticSeverity.Warning, 2038DiagnosticSeverity.Warning, 2068DiagnosticSeverity.Warning, 2096DiagnosticSeverity.Warning, 2128DiagnosticSeverity.Warning,
Diagnostics\SuppressMessageAttributeTests.DiagnosticAnalyzers.cs (1)
319DiagnosticSeverity.Warning,
Diagnostics\TestDiagnosticAnalyzer.cs (1)
25new DiagnosticDescriptor("CA7777", "CA7777_AnalyzerTestDiagnostic", "I'm here for test purposes", "Test", DiagnosticSeverity.Warning, isEnabledByDefault: true);
Mocks\TestMessageProvider.cs (2)
31public override string GetMessagePrefix(string id, DiagnosticSeverity severity, bool isWarningAsError, CultureInfo culture) 303public override DiagnosticSeverity GetSeverity(int code)
SourceGeneration\TestGenerators.cs (1)
54new DiagnosticDescriptor(nameof(DiagnosticProducingGenerator), "Diagnostic Title", "Diagnostic Format", "Test", DiagnosticSeverity.Error, isEnabledByDefault: true);
Microsoft.CodeAnalysis.UnitTests (24)
Diagnostics\AnalysisContextInfoTests.cs (1)
104DiagnosticSeverity.Warning,
Diagnostics\DiagnosticCreationTests.cs (4)
17var defaultSeverity = DiagnosticSeverity.Info; 18var effectiveSeverity = DiagnosticSeverity.Error;
Diagnostics\DiagnosticLocalizationTests.cs (4)
49DiagnosticSeverity.Warning, 67DiagnosticSeverity.Warning, 343DiagnosticSeverity.Warning, 360DiagnosticSeverity.Warning,
Diagnostics\SarifErrorLoggerTests.cs (15)
38var descriptor = new DiagnosticDescriptor("TST", "_TST_", "", "", DiagnosticSeverity.Error, false); 55new DiagnosticDescriptor("TST001-001", "_TST001-001_", "", "", DiagnosticSeverity.Warning, true), 56new DiagnosticDescriptor("TST001", "_TST001_", "", "", DiagnosticSeverity.Warning, true), 57new DiagnosticDescriptor("TST001", "_TST001-002_", "", "", DiagnosticSeverity.Warning, true), 58new DiagnosticDescriptor("TST001", "_TST001-003_", "", "", DiagnosticSeverity.Warning, true), 61new DiagnosticDescriptor("TST002", "", "", "", DiagnosticSeverity.Warning, true), 62new DiagnosticDescriptor("TST002", "", "", "", DiagnosticSeverity.Warning, true), 65new DiagnosticDescriptor("TST002", "", "messageFormat", "", DiagnosticSeverity.Warning, true), 68new DiagnosticDescriptor("TST002", "title_001", "", "", DiagnosticSeverity.Warning, true), 69new DiagnosticDescriptor("TST002", "", "", "category_002", DiagnosticSeverity.Warning, true), 70new DiagnosticDescriptor("TST002", "", "", "", DiagnosticSeverity.Error /*003*/, true), 71new DiagnosticDescriptor("TST002", "", "", "", DiagnosticSeverity.Warning, isEnabledByDefault: false /*004*/), 72new DiagnosticDescriptor("TST002", "", "", "", DiagnosticSeverity.Warning, true, "description_005"), 119DiagnosticSeverity.Warning, 120DiagnosticSeverity.Warning,
Microsoft.CodeAnalysis.VisualBasic (36)
Binding\Binder_Expressions.vb (3)
1110If diag.Severity = DiagnosticSeverity.Error Then 3108If di.Severity = DiagnosticSeverity.Error Then 4940If diag.Severity = DiagnosticSeverity.Error Then
Binding\Binder_Invocation.vb (1)
1942If diagnostic.Severity <> DiagnosticSeverity.Error Then
Binding\Binder_Lookup.vb (1)
265Debug.Assert(diagInfo.Severity = DiagnosticSeverity.Error)
Binding\Binder_Symbols.vb (2)
958reportedAnError = (lookupResult.Diagnostic.Severity = DiagnosticSeverity.Error) 1049reportedAnError = (lookupResult.Diagnostic.Severity = DiagnosticSeverity.Error)
Binding\Binder_Utils.vb (1)
122If diag.Severity = DiagnosticSeverity.Error Then
Binding\BindingDiagnosticBag.vb (1)
77Debug.Assert(diagnosticInfo.Severity = DiagnosticSeverity.Error)
CommandLine\VisualBasicCommandLineParser.vb (1)
2242(VisualBasic.MessageProvider.Instance.GetSeverity(number) = DiagnosticSeverity.Warning) AndAlso
Compilation\VisualBasicDiagnosticFilter.vb (5)
125Friend Shared Function GetDiagnosticReport(severity As DiagnosticSeverity, 183Not (specifiedWarnAsErrorMinus AndAlso severity = DiagnosticSeverity.Warning AndAlso reportFromSyntaxTreeOptions = ReportDiagnostic.Error) Then 217(severity = DiagnosticSeverity.Warning OrElse severity = DiagnosticSeverity.Info) Then 223If (generalDiagnosticOption = ReportDiagnostic.Error) AndAlso (severity = DiagnosticSeverity.Warning) Then
Declarations\DeclarationTreeBuilder.vb (1)
852If Not modifier.GetDiagnostics().Any(Function(d) d.Severity = DiagnosticSeverity.Error) Then
Errors\DiagnosticBagExtensions.vb (1)
96Debug.Assert(info.Severity = DiagnosticSeverity.Error)
Errors\MessageProvider.vb (7)
50Public Overrides Function GetSeverity(code As Integer) As DiagnosticSeverity 57Return DiagnosticSeverity.Warning 59Return DiagnosticSeverity.Info 61Return DiagnosticSeverity.Hidden 63Return DiagnosticSeverity.Error 111Public Overrides Function GetMessagePrefix(id As String, severity As DiagnosticSeverity, isWarningAsError As Boolean, culture As CultureInfo) As String 113If(severity = DiagnosticSeverity.Error OrElse isWarningAsError, "error", "warning"), id)
Errors\VBDiagnostic.vb (1)
33Friend Overrides Function WithSeverity(severity As DiagnosticSeverity) As Diagnostic
GlobalImport.vb (1)
80Dim firstError = errors.AsEnumerable().FirstOrDefault(Function(diag) diag.Severity = DiagnosticSeverity.Error)
OptionsValidator.vb (1)
55If Not errors.Any(Function(diag) diag.Severity = DiagnosticSeverity.Error) Then
Symbols\ConstraintsHelper.vb (1)
747Debug.Assert(info.Severity = DiagnosticSeverity.Error)
Symbols\EventSymbol.vb (1)
232Debug.Assert(errorInfo.Severity = DiagnosticSeverity.Error)
Symbols\ExtendedErrorTypeSymbol.vb (2)
50Debug.Assert(errorInfo Is Nothing OrElse errorInfo.Severity = DiagnosticSeverity.Error) 78Debug.Assert(errorInfo Is Nothing OrElse errorInfo.Severity = DiagnosticSeverity.Error)
Symbols\FieldSymbol.vb (1)
307Debug.Assert(errorInfo.Severity = DiagnosticSeverity.Error)
Symbols\InstanceTypeSymbol.vb (1)
173Debug.Assert(errorInfo.Severity = DiagnosticSeverity.Error)
Symbols\MethodSymbol.vb (1)
720Debug.Assert(errorInfo Is Nothing OrElse errorInfo.Severity = DiagnosticSeverity.Error)
Symbols\PropertySymbol.vb (1)
458Debug.Assert(errorInfo Is Nothing OrElse errorInfo.Severity = DiagnosticSeverity.Error)
Symbols\Source\SynthesizedMyGroupCollectionPropertyAccessorSymbol.vb (1)
87If diag.Severity = DiagnosticSeverity.Error Then
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.UnitTests (25)
src\Analyzers\VisualBasic\Tests\RemoveUnnecessaryParentheses\RemoveUnnecessaryParenthesesTests.vb (1)
34Return descriptor.ImmutableCustomTags().Contains(WellKnownDiagnosticTags.Unnecessary) And descriptor.DefaultSeverity = DiagnosticSeverity.Hidden
src\Analyzers\VisualBasic\Tests\RemoveUnusedMembers\RemoveUnusedMembersTests.vb (1)
1624DiagnosticSeverity.Hidden,
src\Analyzers\VisualBasic\Tests\SimplifyInterpolation\SimplifyInterpolationTests.vb (1)
35("IDE0071", DiagnosticSeverity.Info)
src\Analyzers\VisualBasic\Tests\UseObjectInitializer\UseObjectInitializerTests.vb (17)
45VerifyVB.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2)) 76VerifyVB.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2)) 109VerifyVB.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2)) 142VerifyVB.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2)) 181VerifyVB.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3)) 216VerifyVB.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2)) 252VerifyVB.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2)) 290VerifyVB.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2)) 347VerifyVB.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2)) 395VerifyVB.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3)) 399VerifyVB.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(4).WithLocation(5).WithLocation(6).WithLocation(7)) 434VerifyVB.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3)) 486VerifyVB.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3)) 541VerifyVB.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2).WithLocation(3)) 580VerifyVB.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2)) 688VerifyVB.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2)) 745VerifyVB.Diagnostic().WithSeverity(DiagnosticSeverity.Info).WithLocation(0).WithLocation(1).WithLocation(2))
src\Analyzers\VisualBasic\Tests\ValidateFormatString\ValidateFormatStringTests.vb (5)
83diagnosticSeverity:=DiagnosticSeverity.Info, 97diagnosticSeverity:=DiagnosticSeverity.Info, 113diagnosticSeverity:=DiagnosticSeverity.Info, 137diagnosticSeverity:=DiagnosticSeverity.Info, 322diagnosticSeverity:=DiagnosticSeverity.Info,
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (109)
CommandLineTests.vb (109)
9896Dim analyzer = New CompilationAnalyzerWithSeverity(DiagnosticSeverity.Warning, configurable:=True) 9940analyzer = New CompilationAnalyzerWithSeverity(DiagnosticSeverity.Warning, configurable:=False) 9962Dim analyzer = New CompilationAnalyzerWithSeverity(DiagnosticSeverity.Error, configurable:=True) 10168Public Sub TestAnalyzerFilteringBasedOnSeverity(defaultSeverity As DiagnosticSeverity, errorlog As Boolean, customConfigurable As Boolean) 10173Dim analyzerShouldBeSkipped = (defaultSeverity = DiagnosticSeverity.Hidden OrElse 10174defaultSeverity = DiagnosticSeverity.Info AndAlso Not errorlog) AndAlso Not customConfigurable 10204Public Sub TestWarnAsErrorMinusDoesNotEnableDisabledByDefaultAnalyzers(defaultSeverity As DiagnosticSeverity, isEnabledByDefault As Boolean, customConfigurable As Boolean) 10211defaultSeverity = DiagnosticSeverity.Hidden OrElse 10212defaultSeverity = DiagnosticSeverity.Info) AndAlso 10229Dim expectedExitCode = If(Not analyzerShouldBeSkipped AndAlso defaultSeverity = DiagnosticSeverity.[Error], 1, 0) 10234(customConfigurable AndAlso (defaultSeverity = DiagnosticSeverity.Hidden OrElse defaultSeverity = DiagnosticSeverity.Info)) Then 10237Dim prefix = If(defaultSeverity = DiagnosticSeverity.Warning, "warning", "error") 10244<InlineData(False, False, DiagnosticSeverity.Info, DiagnosticSeverity.Warning, Nothing, DiagnosticSeverity.Error)> 10245<InlineData(True, False, DiagnosticSeverity.Info, DiagnosticSeverity.Warning, Nothing, DiagnosticSeverity.Warning)> 10246<InlineData(False, True, DiagnosticSeverity.Info, DiagnosticSeverity.Warning, Nothing, DiagnosticSeverity.Error)> 10247<InlineData(True, True, DiagnosticSeverity.Info, DiagnosticSeverity.Warning, Nothing, DiagnosticSeverity.Warning)> 10248<InlineData(False, False, DiagnosticSeverity.Info, Nothing, DiagnosticSeverity.Warning, DiagnosticSeverity.Error)> 10249<InlineData(True, False, DiagnosticSeverity.Info, Nothing, DiagnosticSeverity.Warning, DiagnosticSeverity.Warning)> 10250<InlineData(False, True, DiagnosticSeverity.Info, Nothing, DiagnosticSeverity.Warning, DiagnosticSeverity.Error)> 10251<InlineData(True, True, DiagnosticSeverity.Info, Nothing, DiagnosticSeverity.Warning, DiagnosticSeverity.Warning)> 10252<InlineData(False, False, DiagnosticSeverity.Warning, Nothing, Nothing, DiagnosticSeverity.Error)> 10253<InlineData(True, False, DiagnosticSeverity.Warning, Nothing, Nothing, DiagnosticSeverity.Warning)> 10254<InlineData(False, True, DiagnosticSeverity.Warning, Nothing, Nothing, DiagnosticSeverity.Error)> 10255<InlineData(True, True, DiagnosticSeverity.Warning, Nothing, Nothing, DiagnosticSeverity.Warning)> 10256<InlineData(False, False, DiagnosticSeverity.Warning, DiagnosticSeverity.Error, Nothing, DiagnosticSeverity.Error)> 10257<InlineData(True, False, DiagnosticSeverity.Warning, DiagnosticSeverity.Error, Nothing, DiagnosticSeverity.Warning)> 10258<InlineData(False, True, DiagnosticSeverity.Warning, DiagnosticSeverity.Error, Nothing, DiagnosticSeverity.Error)> 10259<InlineData(True, True, DiagnosticSeverity.Warning, DiagnosticSeverity.Error, Nothing, DiagnosticSeverity.Warning)> 10260<InlineData(False, False, DiagnosticSeverity.Info, DiagnosticSeverity.Error, Nothing, DiagnosticSeverity.Error)> 10261<InlineData(True, False, DiagnosticSeverity.Info, DiagnosticSeverity.Error, Nothing, DiagnosticSeverity.Error)> 10262<InlineData(False, True, DiagnosticSeverity.Info, DiagnosticSeverity.Error, Nothing, DiagnosticSeverity.Error)> 10263<InlineData(True, True, DiagnosticSeverity.Info, DiagnosticSeverity.Error, Nothing, DiagnosticSeverity.Error)> 10264<InlineData(False, False, DiagnosticSeverity.Info, Nothing, DiagnosticSeverity.Error, DiagnosticSeverity.Error)> 10265<InlineData(True, False, DiagnosticSeverity.Info, Nothing, DiagnosticSeverity.Error, DiagnosticSeverity.Error)> 10266<InlineData(False, True, DiagnosticSeverity.Info, Nothing, DiagnosticSeverity.Error, DiagnosticSeverity.Error)> 10267<InlineData(True, True, DiagnosticSeverity.Info, Nothing, DiagnosticSeverity.Error, DiagnosticSeverity.Error)> 10268<InlineData(False, False, DiagnosticSeverity.Warning, Nothing, DiagnosticSeverity.Error, DiagnosticSeverity.Error)> 10269<InlineData(True, False, DiagnosticSeverity.Warning, Nothing, DiagnosticSeverity.Error, DiagnosticSeverity.Error)> 10270<InlineData(False, True, DiagnosticSeverity.Warning, Nothing, DiagnosticSeverity.Error, DiagnosticSeverity.Error)> 10271<InlineData(True, True, DiagnosticSeverity.Warning, Nothing, DiagnosticSeverity.Error, DiagnosticSeverity.Error)> 10274defaultSeverity As DiagnosticSeverity, 10275severityInConfigFile As DiagnosticSeverity?, 10276customConfiguredSeverityByAnalyzer As DiagnosticSeverity?, 10277expectedEffectiveSeverity As DiagnosticSeverity) 10312Case DiagnosticSeverity.Warning 10314Case DiagnosticSeverity.[Error] 10481Dim analyzer = New CompilationAnalyzerWithSeverity(DiagnosticSeverity.Warning, configurable:=True) 10975Friend Shared ReadOnly Hidden01 As DiagnosticDescriptor = New DiagnosticDescriptor("Hidden01", "", "Throwing a diagnostic for #ExternalSource", "", DiagnosticSeverity.Hidden, isEnabledByDefault:=True) 10999Friend Shared ReadOnly Info01 As DiagnosticDescriptor = New DiagnosticDescriptor("Info01", "", "Throwing a diagnostic for #Enable", "", DiagnosticSeverity.Info, isEnabledByDefault:=True) 11000Friend Shared ReadOnly Info02 As DiagnosticDescriptor = New DiagnosticDescriptor("Info02", "", "Throwing a diagnostic for something else", "", DiagnosticSeverity.Info, isEnabledByDefault:=True) 11024Friend Shared ReadOnly Warning01 As DiagnosticDescriptor = New DiagnosticDescriptor("Warning01", "", "Throwing a diagnostic for types declared", "", DiagnosticSeverity.Warning, isEnabledByDefault:=True) 11025Friend Shared ReadOnly Warning02 As DiagnosticDescriptor = New DiagnosticDescriptor("Warning02", "", "Throwing a diagnostic for something else", "", DiagnosticSeverity.Warning, isEnabledByDefault:=True) 11026Friend Shared ReadOnly Warning03 As DiagnosticDescriptor = New DiagnosticDescriptor("Warning03", "", "Throwing a diagnostic for types declared", "", DiagnosticSeverity.Warning, isEnabledByDefault:=True) 11050Friend Shared ReadOnly Warning04 As DiagnosticDescriptor = New DiagnosticDescriptor("Warning04", "", "Throwing a diagnostic for types declared", "", DiagnosticSeverity.Warning, isEnabledByDefault:=True, helpLinkUri:="https://example.org/analyzer") 11074Friend Shared ReadOnly Error01 As DiagnosticDescriptor = New DiagnosticDescriptor("Error01", "", "Throwing a diagnostic for #Disable", "", DiagnosticSeverity.Error, isEnabledByDefault:=True) 11097Friend Shared ReadOnly Rule As DiagnosticDescriptor = New DiagnosticDescriptor("AdditionalFileDiagnostic", "", "Additional File Diagnostic: {0}", "", DiagnosticSeverity.Warning, isEnabledByDefault:=True)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (4)
BreakingChanges.vb (3)
89Assert.Equal(DiagnosticSeverity.Warning, errs(0).Severity) 211Assert.Equal(DiagnosticSeverity.Warning, errs(0).Severity) 306Assert.Equal(DiagnosticSeverity.Warning, errs(0).Severity)
CodeGen\WinRTCollectionTests.vb (1)
6338verifier.Diagnostics.AsEnumerable().Where(Function(d) d.Severity > DiagnosticSeverity.Info).Verify()
Microsoft.CodeAnalysis.VisualBasic.ExpressionCompiler (1)
CompilationContext.vb (1)
248If local.GetUseSiteInfo().DiagnosticInfo?.Severity = DiagnosticSeverity.Error Then
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (16)
Diagnostics\Configuration\ConfigureSeverity\DotNetDiagnosticSeverityBasedSeverityConfigurationTests.vb (1)
24defaultSeverity:=DiagnosticSeverity.Info,
Diagnostics\Suppression\SuppressionTests.vb (6)
697Private ReadOnly _descriptor As New DiagnosticDescriptor("InfoDiagnostic", "InfoDiagnostic", "InfoDiagnostic", "InfoDiagnostic", DiagnosticSeverity.Info, isEnabledByDefault:=True) 772Private ReadOnly _descriptor As New DiagnosticDescriptor("#$DiagnosticWithBadId", "DiagnosticWithBadId", "DiagnosticWithBadId", "DiagnosticWithBadId", DiagnosticSeverity.Info, isEnabledByDefault:=True) 816Private ReadOnly _descriptor As New DiagnosticDescriptor("REm", "REm Title", "REm", "REm", DiagnosticSeverity.Warning, isEnabledByDefault:=True) 882Private ReadOnly _descriptor As New DiagnosticDescriptor("ErrorDiagnostic", "ErrorDiagnostic", "ErrorDiagnostic", "ErrorDiagnostic", DiagnosticSeverity.[Error], isEnabledByDefault:=True) 1002Private ReadOnly _descriptor As New DiagnosticDescriptor("InfoDiagnostic", "InfoDiagnostic", "InfoDiagnostic", "InfoDiagnostic", DiagnosticSeverity.Info, isEnabledByDefault:=True) 1718Private ReadOnly _descriptor As New DiagnosticDescriptor("InfoDiagnostic", "InfoDiagnostic", "InfoDiagnostic", "InfoDiagnostic", DiagnosticSeverity.Info, isEnabledByDefault:=True)
EmbeddedLanguages\ValidateJsonStringTests.vb (6)
41diagnosticSeverity:=DiagnosticSeverity.Warning, 56diagnosticSeverity:=DiagnosticSeverity.Warning, 78diagnosticSeverity:=DiagnosticSeverity.Warning, 100diagnosticSeverity:=DiagnosticSeverity.Warning, 156diagnosticSeverity:=DiagnosticSeverity.Warning, 177diagnosticSeverity:=DiagnosticSeverity.Warning,
EmbeddedLanguages\ValidateRegexStringTests.vb (2)
37diagnosticSeverity:=DiagnosticSeverity.Warning, 53diagnosticSeverity:=DiagnosticSeverity.Warning,
SimplifyThisOrMe\SimplifyThisOrMeTests.vb (1)
66diagnosticSeverity:=DiagnosticSeverity.Error)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (86)
Diagnostics\DiagnosticAnalyzerTests.vb (41)
27Private Shared ReadOnly s_CA9999_UseOfVariableThatStartsWithX As DiagnosticDescriptor = New DiagnosticDescriptor(id:="CA9999_UseOfVariableThatStartsWithX", title:="CA9999_UseOfVariableThatStartsWithX", messageFormat:="Use of variable whose name starts with 'x': '{0}'", category:="Test", defaultSeverity:=DiagnosticSeverity.Warning, isEnabledByDefault:=True) 49Dim noneDiagDescriptor = New DiagnosticDescriptor("XX0001", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Hidden, isEnabledByDefault:=True) 50Dim infoDiagDescriptor = New DiagnosticDescriptor("XX0002", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Info, isEnabledByDefault:=True) 51Dim warningDiagDescriptor = New DiagnosticDescriptor("XX0003", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Warning, isEnabledByDefault:=True) 52Dim errorDiagDescriptor = New DiagnosticDescriptor("XX0004", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Error, isEnabledByDefault:=True) 72Assert.True(effectiveDiag.Severity = DiagnosticSeverity.Error) 104Case DiagnosticSeverity.Hidden 107Case DiagnosticSeverity.Info 111Case DiagnosticSeverity.Warning 115Case DiagnosticSeverity.Error 130Dim noneDiagDescriptor = New DiagnosticDescriptor("XX0001", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Hidden, isEnabledByDefault:=True) 131Dim infoDiagDescriptor = New DiagnosticDescriptor("XX0002", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Info, isEnabledByDefault:=True) 132Dim warningDiagDescriptor = New DiagnosticDescriptor("XX0003", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Warning, isEnabledByDefault:=True) 133Dim errorDiagDescriptor = New DiagnosticDescriptor("XX0004", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.[Error], isEnabledByDefault:=True) 157Assert.Equal(1, effectiveDiags.Count(Function(d) d.Severity = DiagnosticSeverity.Error)) 158Assert.Equal(1, effectiveDiags.Count(Function(d) d.Severity = DiagnosticSeverity.Warning)) 164Assert.Equal(1, effectiveDiags.Count(Function(d) d.Severity = DiagnosticSeverity.Error)) 165Assert.Equal(1, effectiveDiags.Count(Function(d) d.Severity = DiagnosticSeverity.Info)) 171Assert.Equal(1, effectiveDiags.Count(Function(d) d.Severity = DiagnosticSeverity.Error)) 172Assert.Equal(1, effectiveDiags.Count(Function(d) d.Severity = DiagnosticSeverity.Hidden)) 178Assert.Equal(1, effectiveDiags.Count(Function(d) d.Severity = DiagnosticSeverity.Error)) 179Assert.Equal(1, effectiveDiags.Count(Function(d) d.Severity = DiagnosticSeverity.Hidden)) 185Dim disabledDiagDescriptor = New DiagnosticDescriptor("XX001", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Warning, isEnabledByDefault:=False) 186Dim enabledDiagDescriptor = New DiagnosticDescriptor("XX002", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Warning, isEnabledByDefault:=True) 215Public Shared desc1 As New DiagnosticDescriptor("XX001", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Warning, isEnabledByDefault:=False) 216Public Shared desc2 As New DiagnosticDescriptor("XX002", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Warning, isEnabledByDefault:=False) 231Public Shared desc1 As New DiagnosticDescriptor("XX003", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Warning, isEnabledByDefault:=False) 232Public Shared desc2 As New DiagnosticDescriptor("XX004", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Warning, isEnabledByDefault:=True) 265Public Shared desc1 As New DiagnosticDescriptor("XX001", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Warning, isEnabledByDefault:=True) 303Public Shared desc1 As New DiagnosticDescriptor("XX001", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Warning, isEnabledByDefault:=True) 348Public Shared desc1 As New DiagnosticDescriptor("XX001", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Warning, isEnabledByDefault:=True) 497Public Shared desc1 As New DiagnosticDescriptor("FieldSymbolDiagnostic", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Warning, isEnabledByDefault:=True) 562Public Shared desc1 As New DiagnosticDescriptor("FieldDeclarationDiagnostic", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Warning, isEnabledByDefault:=True) 752Private Shared Sub TestEffectiveSeverity(defaultSeverity As DiagnosticSeverity, expectedEffectiveSeverity As ReportDiagnostic, Optional specificOptions As Dictionary(Of String, ReportDiagnostic) = Nothing, Optional generalOption As ReportDiagnostic = ReportDiagnostic.Default, Optional isEnabledByDefault As Boolean = True) 766TestEffectiveSeverity(DiagnosticSeverity.Warning, ReportDiagnostic.Warn) 776TestEffectiveSeverity(DiagnosticSeverity.Warning, expectedEffectiveSeverity:=ReportDiagnostic.Warn, specificOptions:=specificOptions, generalOption:=generalOption) 784TestEffectiveSeverity(DiagnosticSeverity.Warning, expectedEffectiveSeverity:=generalOption, generalOption:=generalOption) 795TestEffectiveSeverity(DiagnosticSeverity.Warning, expectedEffectiveSeverity:=specificOption, specificOptions:=specificOptions, generalOption:=generalOption) 805TestEffectiveSeverity(DiagnosticSeverity.Warning, expectedEffectiveSeverity:=ReportDiagnostic.Suppress, generalOption:=generalOption, isEnabledByDefault:=enabledByDefault) 817TestEffectiveSeverity(DiagnosticSeverity.Warning, expectedEffectiveSeverity:=specificOption, specificOptions:=specificOptions, generalOption:=generalOption, isEnabledByDefault:=enabledByDefault) 950Public Shared ReadOnly ExpressionDescriptor As New DiagnosticDescriptor("Expression", "Expression", "Expression found.", "Testing", DiagnosticSeverity.Warning, isEnabledByDefault:=True)
Diagnostics\GetDiagnosticsTests.vb (16)
104Assert.Equal(DiagnosticSeverity.Warning, diag.Severity) 107Dim [error] = diag.WithSeverity(DiagnosticSeverity.Error) 108Assert.Equal(DiagnosticSeverity.Error, [error].Severity) 109Assert.Equal(DiagnosticSeverity.Warning, [error].DefaultSeverity) 112Dim warning = [error].WithSeverity(DiagnosticSeverity.Warning) 113Assert.Equal(DiagnosticSeverity.Warning, warning.Severity) 114Assert.Equal(DiagnosticSeverity.Warning, warning.DefaultSeverity) 117Dim hidden = warning.WithSeverity(DiagnosticSeverity.Hidden) 118Assert.Equal(DiagnosticSeverity.Hidden, hidden.Severity) 119Assert.Equal(DiagnosticSeverity.Warning, hidden.DefaultSeverity) 122Dim info = warning.WithSeverity(DiagnosticSeverity.Info) 123Assert.Equal(DiagnosticSeverity.Info, info.Severity) 124Assert.Equal(DiagnosticSeverity.Warning, info.DefaultSeverity) 587Public Shared ReadOnly Descriptor As DiagnosticDescriptor = New DiagnosticDescriptor("ID0001", "Title", "{0}", "Category", defaultSeverity:=DiagnosticSeverity.Warning, isEnabledByDefault:=True) 588Public Shared ReadOnly DescriptorForBlockEnd As DiagnosticDescriptor = New DiagnosticDescriptor("ID0002", "Title", "Message", "Category", defaultSeverity:=DiagnosticSeverity.Warning, isEnabledByDefault:=True) 711Public Shared ReadOnly Descriptor As New DiagnosticDescriptor("ID0001", "Title", "Message", "Category", defaultSeverity:=DiagnosticSeverity.Warning, isEnabledByDefault:=True)
FlowAnalysis\FlowDiagnosticTests.vb (1)
915Assert.NotEmpty(Me.FlowDiagnostics(comp).AsEnumerable().Where(Function(e) e.Severity = DiagnosticSeverity.[Warning]))
SourceGeneration\GeneratorDriverTests.vb (28)
187c.ReportDiagnostic(VBDiagnostic.Create("GEN001", "generators", "message", DiagnosticSeverity.Warning, DiagnosticSeverity.Warning, True, 2)) 188c.ReportDiagnostic(VBDiagnostic.Create("GEN002", "generators", "message", DiagnosticSeverity.Warning, DiagnosticSeverity.Warning, True, 3)) 221Dim gen001 = VBDiagnostic.Create("GEN001", "generators", "message", DiagnosticSeverity.Warning, DiagnosticSeverity.Warning, True, 2) 253Dim gen001 = VBDiagnostic.Create("GEN001", "generators", "message", DiagnosticSeverity.Warning, DiagnosticSeverity.Warning, True, 2) 308DiagnosticSeverity.Warning, 309DiagnosticSeverity.Warning, 339DiagnosticSeverity.Warning, 340DiagnosticSeverity.Warning, 370DiagnosticSeverity.Warning, 371DiagnosticSeverity.Warning, 400DiagnosticSeverity.Warning, 401DiagnosticSeverity.Warning, 430DiagnosticSeverity.Warning, 431DiagnosticSeverity.Warning, 460DiagnosticSeverity.Warning, 461DiagnosticSeverity.Warning, 491DiagnosticSeverity.Warning, 492DiagnosticSeverity.Warning, 520DiagnosticSeverity.Warning, 521DiagnosticSeverity.Warning, 550DiagnosticSeverity.Warning, 551DiagnosticSeverity.Warning, 580DiagnosticSeverity.Warning, 581DiagnosticSeverity.Warning,
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (2)
SymbolsTests\SymbolErrorTests.vb (1)
7910Assert.Equal(DiagnosticSeverity.Error, DirectCast(test.ReturnType, ErrorTypeSymbol).ErrorInfo.Severity)
UsedAssembliesTests.vb (1)
133Assert.True(diagnostics.Any(Function(d) d.DefaultSeverity = DiagnosticSeverity.Error))
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (8)
Parser\ParseDirectives.vb (4)
3183New DiagnosticDescriptor("sOMEID", "something1", "something2", "something3", DiagnosticSeverity.Warning, isEnabledByDefault:=True), 3290"something1", "something2", "something3", DiagnosticSeverity.Warning, isEnabledByDefault:=True), 3621New DiagnosticDescriptor("TestId", "something1", "something2", "something3", DiagnosticSeverity.Warning, isEnabledByDefault:=True), 3648New DiagnosticDescriptor("TestId", "something1", "something2", "something3", DiagnosticSeverity.Warning, isEnabledByDefault:=True),
Syntax\GeneratedTests.vb (1)
54Public Overrides Function GetSeverity(code As Integer) As DiagnosticSeverity
TestSyntaxNodes.vb (3)
1067Public Overrides Function GetSeverity(code As Integer) As DiagnosticSeverity 1068Return DiagnosticSeverity.Error 1767Assert.Equal(DiagnosticSeverity.Error, tree.GetDiagnostics(node)(0).Severity)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (4)
CompilationTestUtils.vb (4)
96If Not compileDiagnostics.Any(Function(d) d.DefaultSeverity = DiagnosticSeverity.Error) Then 742diags = diags.WhereAsArray(Function(d) d.Severity > DiagnosticSeverity.Info) 763Dim diags As ImmutableArray(Of Diagnostic) = errors.WhereAsArray(Function(e) e.Severity = DiagnosticSeverity.Error) 994If Not suppressInfos OrElse e.Diagnostic.Severity > DiagnosticSeverity.Info Then
Microsoft.CodeAnalysis.Workspaces (64)
CodeStyle\NotificationOption.cs (2)
38public DiagnosticSeverity Value 40get => Severity.ToDiagnosticSeverity() ?? DiagnosticSeverity.Hidden;
Diagnostics\DiagnosticData.cs (11)
24DiagnosticSeverity severity, 25DiagnosticSeverity defaultSeverity, 49public readonly DiagnosticSeverity Severity = severity; 52public readonly DiagnosticSeverity DefaultSeverity = defaultSeverity; 286DiagnosticSeverity effectiveSeverity; 310private static DiagnosticSeverity GetEffectiveSeverity(ReportDiagnostic effectiveReportDiagnostic, DiagnosticSeverity defaultSeverity) 318return DiagnosticSeverity.Error; 321return DiagnosticSeverity.Hidden; 324return DiagnosticSeverity.Info; 327return DiagnosticSeverity.Warning;
src\Compilers\Core\Portable\Diagnostic\DiagnosticArrayExtensions.cs (1)
15if (diagnostic.Severity == DiagnosticSeverity.Error)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOption2`1.cs (8)
120new XAttribute(XmlAttribute_DiagnosticSeverity, Notification.Severity.ToDiagnosticSeverity() ?? DiagnosticSeverity.Hidden)); 188var severity = (DiagnosticSeverity)Enum.Parse(typeof(DiagnosticSeverity), severityAttribute.Value); 192DiagnosticSeverity.Hidden => NotificationOption2.Silent, 193DiagnosticSeverity.Info => NotificationOption2.Suggestion, 194DiagnosticSeverity.Warning => NotificationOption2.Warning, 195DiagnosticSeverity.Error => NotificationOption2.Error,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\NotificationOption2.cs (6)
12/// a code style. Under the hood, it simply maps to <see cref="DiagnosticSeverity"/> 58public static NotificationOption2 ForSeverity(DiagnosticSeverity severity) 61DiagnosticSeverity.Error => Error, 62DiagnosticSeverity.Warning => Warning, 63DiagnosticSeverity.Info => Suggestion, 64DiagnosticSeverity.Hidden => Silent,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticSeverityExtensions.cs (5)
12public static NotificationOption2 ToNotificationOption(this DiagnosticSeverity severity, bool isOverridenSeverity) 16DiagnosticSeverity.Error => NotificationOption2.Error, 17DiagnosticSeverity.Warning => NotificationOption2.Warning, 18DiagnosticSeverity.Info => NotificationOption2.Suggestion, 19DiagnosticSeverity.Hidden => NotificationOption2.Silent,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticSeverityExtensions_Shared.cs (13)
13/// Returns the equivalent <see cref="ReportDiagnostic"/> for a <see cref="DiagnosticSeverity"/> value. 15/// <param name="diagnosticSeverity">The <see cref="DiagnosticSeverity"/> value.</param> 17/// The equivalent <see cref="ReportDiagnostic"/> for the <see cref="DiagnosticSeverity"/> value. 22public static ReportDiagnostic ToReportDiagnostic(this DiagnosticSeverity diagnosticSeverity) 25DiagnosticSeverity.Hidden => ReportDiagnostic.Hidden, 26DiagnosticSeverity.Info => ReportDiagnostic.Info, 27DiagnosticSeverity.Warning => ReportDiagnostic.Warn, 28DiagnosticSeverity.Error => ReportDiagnostic.Error, 32public static string ToEditorConfigString(this DiagnosticSeverity diagnosticSeverity) 36DiagnosticSeverity.Hidden => EditorConfigSeverityStrings.Silent, 37DiagnosticSeverity.Info => EditorConfigSeverityStrings.Suggestion, 38DiagnosticSeverity.Warning => EditorConfigSeverityStrings.Warning, 39DiagnosticSeverity.Error => EditorConfigSeverityStrings.Error,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ReportDiagnosticExtensions.cs (10)
14/// Returns the equivalent <see cref="DiagnosticSeverity"/> for a <see cref="ReportDiagnostic"/> value. 18/// The equivalent <see cref="DiagnosticSeverity"/> for a <see cref="ReportDiagnostic"/> value; otherwise, 19/// <see langword="null"/> if <see cref="DiagnosticSeverity"/> does not contain a direct equivalent for 25public static DiagnosticSeverity? ToDiagnosticSeverity(this ReportDiagnostic reportDiagnostic) 30return DiagnosticSeverity.Error; 33return DiagnosticSeverity.Warning; 36return DiagnosticSeverity.Info; 39return DiagnosticSeverity.Hidden; 61public static ReportDiagnostic WithDefaultSeverity(this ReportDiagnostic reportDiagnostic, DiagnosticSeverity defaultSeverity) 84public static NotificationOption2 ToNotificationOption(this ReportDiagnostic reportDiagnostic, DiagnosticSeverity defaultSeverity)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferencesEditorConfigSerializer.cs (1)
78entryWriter($"dotnet_naming_rule.{ruleName}.severity", namingRule.EnforcementLevel.ToNotificationOption(defaultSeverity: DiagnosticSeverity.Hidden).ToEditorConfigString());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SerializableNamingRule.cs (5)
37new XAttribute(nameof(EnforcementLevel), EnforcementLevel.ToDiagnosticSeverity() ?? DiagnosticSeverity.Hidden)); 46EnforcementLevel = ((DiagnosticSeverity)Enum.Parse(typeof(DiagnosticSeverity), namingRuleElement.Attribute(nameof(EnforcementLevel))!.Value)).ToReportDiagnostic(), 56writer.WriteInt32((int)(EnforcementLevel.ToDiagnosticSeverity() ?? DiagnosticSeverity.Hidden)); 65EnforcementLevel = ((DiagnosticSeverity)reader.ReadInt32()).ToReportDiagnostic(),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
185diag => diag.Severity == DiagnosticSeverity.Error && !ignoreErrorCode.Contains(diag.Id));
Workspace\WorkspaceDiagnosticDescriptors.cs (1)
22defaultSeverity: DiagnosticSeverity.Error,
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (7)
NetCoreTests.cs (1)
509Assert.Empty(diagnostics.Where(d => d.Severity >= DiagnosticSeverity.Warning));
NewlyCreatedProjectsFromDotNetNew.cs (1)
230.Where(diagnostic => diagnostic.Severity > DiagnosticSeverity.Hidden)
VisualStudioMSBuildWorkspaceTests.cs (5)
375.Where(d => d.Severity is DiagnosticSeverity.Error or DiagnosticSeverity.Warning) 2308var errs = comp.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error); 2413comp.GetDiagnostics().Where(d => d.Severity > DiagnosticSeverity.Info).Verify(); 2430comp.GetDiagnostics().Where(d => d.Severity > DiagnosticSeverity.Info).Verify();
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
BatchFixAllProviderTests.cs (1)
57new DiagnosticDescriptor("LiteralZero", "title", "message", "category", DiagnosticSeverity.Warning, isEnabledByDefault: true);
Microsoft.DotNet.CodeAnalysis (6)
Analyzers\AppContextDefaultsAnalyzer.cs (3)
27new DiagnosticDescriptor(DiagnosticIds.BCL0010.ToString(), s_title, CreateDiagnosticMessage(s_defaultValueNotInitializedToTrue, DiagnosticIds.BCL0010.ToString()), s_analyzerName, DiagnosticSeverity.Error, isEnabledByDefault: true, description: s_description); 30new DiagnosticDescriptor(DiagnosticIds.BCL0011.ToString(), s_title, CreateDiagnosticMessage(s_defaultValueInsideUnexpectedIfCondition, DiagnosticIds.BCL0011.ToString()), s_analyzerName, DiagnosticSeverity.Error, isEnabledByDefault: true, description: s_description); 33new DiagnosticDescriptor(DiagnosticIds.BCL0012.ToString(), s_title, CreateDiagnosticMessage(s_defaultValueDefinedOutsideIfCondition, DiagnosticIds.BCL0012.ToString()), s_analyzerName, DiagnosticSeverity.Error, isEnabledByDefault: true, description: s_description);
Analyzers\MembersMustExistAnalyzer.cs (1)
26new DiagnosticDescriptor(DiagnosticIds.BCL0001.ToString(), s_title, s_messageFormat, s_analyzerName, DiagnosticSeverity.Error, isEnabledByDefault: true, description: s_description, customTags: WellKnownDiagnosticTags.CompilationEnd);
Analyzers\PinvokeAnalyzer.cs (1)
24private static DiagnosticDescriptor InvalidPinvokeCall = new DiagnosticDescriptor(DiagnosticIds.BCL0015.ToString(), Title, MessageFormat, AnalyzerName, DiagnosticSeverity.Error, isEnabledByDefault: true, description: Description);
Analyzers\ResourceUsageAnalyzer.cs (1)
19private static DiagnosticDescriptor InvalidSRFormatCall = new DiagnosticDescriptor(DiagnosticIds.BCL0020.ToString(), Title, "", AnalyzerName, DiagnosticSeverity.Error, isEnabledByDefault: true, description: Description);
Microsoft.Extensions.Logging.Generators (27)
DiagnosticDescriptors.cs (26)
17DiagnosticSeverity.Error, 25DiagnosticSeverity.Warning, 33DiagnosticSeverity.Error, 41DiagnosticSeverity.Error, 49DiagnosticSeverity.Info, 57DiagnosticSeverity.Error, 65DiagnosticSeverity.Error, 73DiagnosticSeverity.Warning, 81DiagnosticSeverity.Error, 89DiagnosticSeverity.Error, 97DiagnosticSeverity.Warning, 105DiagnosticSeverity.Warning, 113DiagnosticSeverity.Error, 121DiagnosticSeverity.Warning, 129DiagnosticSeverity.Error, 137DiagnosticSeverity.Error, 145DiagnosticSeverity.Warning, 153DiagnosticSeverity.Error, 161DiagnosticSeverity.Error, 169DiagnosticSeverity.Error, 177DiagnosticSeverity.Error, 185DiagnosticSeverity.Error, 193DiagnosticSeverity.Error, 201DiagnosticSeverity.Warning, 209defaultSeverity: DiagnosticSeverity.Error, 217DiagnosticSeverity.Info,
src\libraries\Common\src\Roslyn\DiagnosticDescriptorHelper.cs (1)
15DiagnosticSeverity defaultSeverity,
Microsoft.Extensions.Options.SourceGeneration (10)
DiagDescriptors.cs (8)
24defaultSeverity: DiagnosticSeverity.Warning); 31defaultSeverity: DiagnosticSeverity.Warning); 86defaultSeverity: DiagnosticSeverity.Warning); 93defaultSeverity: DiagnosticSeverity.Warning); 100defaultSeverity: DiagnosticSeverity.Warning); 107defaultSeverity: DiagnosticSeverity.Info); 114defaultSeverity: DiagnosticSeverity.Error); 121defaultSeverity: DiagnosticSeverity.Warning);
DiagDescriptorsBase.cs (2)
18DiagnosticSeverity defaultSeverity = DiagnosticSeverity.Error,
Microsoft.Gen.ComplianceReports (1)
ComplianceReportsGenerator.cs (1)
97DiagnosticSeverity.Info,
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
GeneratorTests.cs (1)
134Assert.Equal(DiagnosticSeverity.Info, diag.Severity);
Microsoft.Gen.ContextualOptions (4)
DiagDescriptors.cs (1)
31defaultSeverity: DiagnosticSeverity.Warning);
Model\OptionsContextType.cs (1)
21public bool ShouldEmit => Diagnostics.TrueForAll(diag => diag.Severity != DiagnosticSeverity.Error);
src\Generators\Shared\DiagDescriptorsBase.cs (2)
22DiagnosticSeverity defaultSeverity = DiagnosticSeverity.Error,
Microsoft.Gen.Logging (17)
Parsing\DiagDescriptors.cs (14)
19DiagnosticSeverity.Warning); 32DiagnosticSeverity.Warning); 51DiagnosticSeverity.Warning); 70DiagnosticSeverity.Warning); 77DiagnosticSeverity.Warning); 90DiagnosticSeverity.Info); 109DiagnosticSeverity.Warning); 134DiagnosticSeverity.Warning); 147DiagnosticSeverity.Warning); 184DiagnosticSeverity.Warning); 191DiagnosticSeverity.Warning); 240DiagnosticSeverity.Warning); 247DiagnosticSeverity.Warning); 260DiagnosticSeverity.Info);
Parsing\Parser.cs (1)
749if (d.Severity == DiagnosticSeverity.Error)
src\Generators\Shared\DiagDescriptorsBase.cs (2)
22DiagnosticSeverity defaultSeverity = DiagnosticSeverity.Error,
Microsoft.Gen.Metrics (2)
src\Generators\Shared\DiagDescriptorsBase.cs (2)
22DiagnosticSeverity defaultSeverity = DiagnosticSeverity.Error,
Microsoft.Gen.MetricsReports (3)
MetricsReportsGenerator.cs (1)
76DiagnosticSeverity.Info,
src\Generators\Shared\DiagDescriptorsBase.cs (2)
22DiagnosticSeverity defaultSeverity = DiagnosticSeverity.Error,
Microsoft.Gen.MetricsReports.Unit.Tests (1)
GeneratorTests.cs (1)
115Assert.Equal(DiagnosticSeverity.Info, diag.Severity);
Microsoft.Interop.ComInterfaceGenerator (51)
Analyzers\AnalyzerDiagnostics.cs (5)
40DiagnosticSeverity.Info, 50DiagnosticSeverity.Info, 60DiagnosticSeverity.Warning, 70DiagnosticSeverity.Warning, 80DiagnosticSeverity.Warning,
ComInterfaceGenerator.cs (2)
511.Where(context => context.Diagnostics.All(diag => diag.Descriptor.DefaultSeverity != DiagnosticSeverity.Error)) 613.Where(context => context.UnmanagedToManagedStub.Diagnostics.All(diag => diag.Descriptor.DefaultSeverity != DiagnosticSeverity.Error))
GeneratorDiagnostics.cs (43)
42DiagnosticSeverity.Error, 53DiagnosticSeverity.Error, 64DiagnosticSeverity.Error, 75DiagnosticSeverity.Error, 86DiagnosticSeverity.Error, 97DiagnosticSeverity.Error, 108DiagnosticSeverity.Error, 119DiagnosticSeverity.Error, 130DiagnosticSeverity.Error, 141DiagnosticSeverity.Error, 151DiagnosticSeverity.Error, 162DiagnosticSeverity.Error, 173DiagnosticSeverity.Error, 184DiagnosticSeverity.Error, 195DiagnosticSeverity.Error, 206DiagnosticSeverity.Error, 217DiagnosticSeverity.Error, 228DiagnosticSeverity.Error, 239DiagnosticSeverity.Error, 250DiagnosticSeverity.Error, 261DiagnosticSeverity.Error, 272DiagnosticSeverity.Error, 283DiagnosticSeverity.Error, 294DiagnosticSeverity.Error, 305DiagnosticSeverity.Error, 316DiagnosticSeverity.Error, 327DiagnosticSeverity.Error, 338DiagnosticSeverity.Error, 349DiagnosticSeverity.Error, 360DiagnosticSeverity.Error, 371DiagnosticSeverity.Error, 382DiagnosticSeverity.Error, 393DiagnosticSeverity.Error, 404DiagnosticSeverity.Error, 415DiagnosticSeverity.Warning, 426DiagnosticSeverity.Info, 441DiagnosticSeverity.Info, 456DiagnosticSeverity.Warning, 466DiagnosticSeverity.Warning, 476DiagnosticSeverity.Info, 486DiagnosticSeverity.Info, 496DiagnosticSeverity.Info, 507DiagnosticSeverity.Warning,
src\libraries\Common\src\Roslyn\DiagnosticDescriptorHelper.cs (1)
15DiagnosticSeverity defaultSeverity,
Microsoft.Interop.JavaScript.JSImportGenerator (16)
GeneratorDiagnostics.cs (15)
39DiagnosticSeverity.Error, 49DiagnosticSeverity.Error, 59DiagnosticSeverity.Error, 69DiagnosticSeverity.Error, 79DiagnosticSeverity.Error, 89DiagnosticSeverity.Error, 99DiagnosticSeverity.Error, 109DiagnosticSeverity.Error, 119DiagnosticSeverity.Error, 129DiagnosticSeverity.Error, 139DiagnosticSeverity.Error, 149DiagnosticSeverity.Error, 159DiagnosticSeverity.Error, 169DiagnosticSeverity.Error, 179DiagnosticSeverity.Error,
src\libraries\Common\src\Roslyn\DiagnosticDescriptorHelper.cs (1)
15DiagnosticSeverity defaultSeverity,
Microsoft.Interop.LibraryImportGenerator (69)
Analyzers\ConvertToLibraryImportAnalyzer.cs (1)
29DiagnosticSeverity.Info,
Analyzers\CustomMarshallerAttributeAnalyzer.cs (43)
49DiagnosticSeverity.Error, 60DiagnosticSeverity.Error, 71DiagnosticSeverity.Error, 82DiagnosticSeverity.Error, 93DiagnosticSeverity.Error, 104DiagnosticSeverity.Error, 115DiagnosticSeverity.Error, 126DiagnosticSeverity.Error, 137DiagnosticSeverity.Error, 148DiagnosticSeverity.Error, 159DiagnosticSeverity.Error, 170DiagnosticSeverity.Error, 181DiagnosticSeverity.Error, 192DiagnosticSeverity.Error, 203DiagnosticSeverity.Error, 214DiagnosticSeverity.Error, 225DiagnosticSeverity.Error, 236DiagnosticSeverity.Error, 247DiagnosticSeverity.Error, 258DiagnosticSeverity.Error, 269DiagnosticSeverity.Error, 280DiagnosticSeverity.Error, 291DiagnosticSeverity.Error, 302DiagnosticSeverity.Error, 313DiagnosticSeverity.Error, 324DiagnosticSeverity.Warning, 335DiagnosticSeverity.Warning, 346DiagnosticSeverity.Warning, 357DiagnosticSeverity.Warning, 368DiagnosticSeverity.Warning, 379DiagnosticSeverity.Error, 390DiagnosticSeverity.Error, 401DiagnosticSeverity.Error, 419DiagnosticSeverity.Info, 430DiagnosticSeverity.Info, 441DiagnosticSeverity.Info, 452DiagnosticSeverity.Info, 463DiagnosticSeverity.Info, 474DiagnosticSeverity.Info, 485DiagnosticSeverity.Info, 496DiagnosticSeverity.Info, 507DiagnosticSeverity.Info, 518DiagnosticSeverity.Info,
Analyzers\NativeMarshallingAttributeAnalyzer.cs (3)
30DiagnosticSeverity.Error, 40DiagnosticSeverity.Error, 50DiagnosticSeverity.Error,
GeneratorDiagnostics.cs (21)
38DiagnosticSeverity.Error, 49DiagnosticSeverity.Error, 60DiagnosticSeverity.Error, 71DiagnosticSeverity.Error, 82DiagnosticSeverity.Error, 93DiagnosticSeverity.Error, 104DiagnosticSeverity.Error, 115DiagnosticSeverity.Error, 126DiagnosticSeverity.Error, 137DiagnosticSeverity.Error, 148DiagnosticSeverity.Error, 159DiagnosticSeverity.Error, 170DiagnosticSeverity.Error, 181DiagnosticSeverity.Error, 192DiagnosticSeverity.Error, 203DiagnosticSeverity.Error, 214DiagnosticSeverity.Info, 229DiagnosticSeverity.Info, 244DiagnosticSeverity.Warning, 254DiagnosticSeverity.Warning, 264DiagnosticSeverity.Info,
src\libraries\Common\src\Roslyn\DiagnosticDescriptorHelper.cs (1)
15DiagnosticSeverity defaultSeverity,
Microsoft.Interop.LibraryImportGenerator.Downlevel (22)
GeneratorDiagnostics.cs (21)
38DiagnosticSeverity.Error, 49DiagnosticSeverity.Error, 60DiagnosticSeverity.Error, 71DiagnosticSeverity.Error, 82DiagnosticSeverity.Error, 93DiagnosticSeverity.Error, 104DiagnosticSeverity.Error, 115DiagnosticSeverity.Error, 126DiagnosticSeverity.Error, 137DiagnosticSeverity.Error, 148DiagnosticSeverity.Error, 159DiagnosticSeverity.Error, 170DiagnosticSeverity.Error, 181DiagnosticSeverity.Error, 192DiagnosticSeverity.Error, 203DiagnosticSeverity.Error, 214DiagnosticSeverity.Info, 229DiagnosticSeverity.Info, 244DiagnosticSeverity.Warning, 254DiagnosticSeverity.Warning, 264DiagnosticSeverity.Info,
src\libraries\Common\src\Roslyn\DiagnosticDescriptorHelper.cs (1)
15DiagnosticSeverity defaultSeverity,
Microsoft.Maui.Controls.BindingSourceGen (10)
DiagnosticsFactory.cs (10)
26 defaultSeverity: DiagnosticSeverity.Error, 37 defaultSeverity: DiagnosticSeverity.Error, 48 defaultSeverity: DiagnosticSeverity.Error, 59 defaultSeverity: DiagnosticSeverity.Hidden, 70 defaultSeverity: DiagnosticSeverity.Error, 81 defaultSeverity: DiagnosticSeverity.Error, 92 defaultSeverity: DiagnosticSeverity.Error, 103 defaultSeverity: DiagnosticSeverity.Error, 114 defaultSeverity: DiagnosticSeverity.Error, 125 defaultSeverity: DiagnosticSeverity.Error,
Microsoft.Maui.Controls.SourceGen (1)
Descriptors.cs (1)
13 defaultSeverity: DiagnosticSeverity.Error,
Microsoft.ML.CodeAnalyzer.Tests (11)
Code\BestFriendTest.cs (1)
47new DiagnosticResult("CS0122", DiagnosticSeverity.Error).WithLocation(23, 21).WithMessage("'D.D(float)' is inaccessible due to its protection level"),
Code\ContractsCheckTest.cs (9)
29new DiagnosticResult("CS0051", DiagnosticSeverity.Error).WithLocation(15, 16).WithMessage("Inconsistent accessibility: parameter type 'IHostEnvironment' is less accessible than method 'TypeName.TypeName(IHostEnvironment, float, int)'"), 42new DiagnosticResult("CS0122", DiagnosticSeverity.Error).WithSpan("/0/Test1.cs", 752, 24, 752, 35).WithMessage("'ICancelable' is inaccessible due to its protection level"), 43new DiagnosticResult("CS0122", DiagnosticSeverity.Error).WithSpan("/0/Test1.cs", 752, 67, 752, 77).WithMessage("'ICancelable.IsCanceled' is inaccessible due to its protection level"), 129new DiagnosticResult("CS0122", DiagnosticSeverity.Error).WithSpan("/0/Test1.cs", 752, 24, 752, 35).WithMessage("'ICancelable' is inaccessible due to its protection level"), 130new DiagnosticResult("CS0122", DiagnosticSeverity.Error).WithSpan("/0/Test1.cs", 752, 67, 752, 77).WithMessage("'ICancelable.IsCanceled' is inaccessible due to its protection level"), 131new DiagnosticResult("CS1503", DiagnosticSeverity.Error).WithSpan("/0/Test1.cs", 753, 90, 753, 93).WithMessage("Argument 2: cannot convert from 'Microsoft.ML.Runtime.IHostEnvironment' to 'Microsoft.ML.Runtime.IExceptionContext'"), 149new DiagnosticResult("CS0122", DiagnosticSeverity.Error).WithSpan("/0/Test1.cs", 752, 24, 752, 35).WithMessage("'ICancelable' is inaccessible due to its protection level"), 150new DiagnosticResult("CS0122", DiagnosticSeverity.Error).WithSpan("/0/Test1.cs", 752, 67, 752, 77).WithMessage("'ICancelable.IsCanceled' is inaccessible due to its protection level"), 151new DiagnosticResult("CS1503", DiagnosticSeverity.Error).WithSpan("/0/Test1.cs", 753, 90, 753, 93).WithMessage("Argument 2: cannot convert from 'Microsoft.ML.Runtime.IHostEnvironment' to 'Microsoft.ML.Runtime.IExceptionContext'"),
Code\RelaxTestNamingTest.cs (1)
107public static readonly DiagnosticDescriptor Rule = new DiagnosticDescriptor(RelaxTestNamingSuppressor.Rule.SuppressedDiagnosticId, "Title", "Message", "Category", DiagnosticSeverity.Warning, isEnabledByDefault: true);
Microsoft.ML.InternalCodeAnalyzer (13)
BaseTestClassAnalyzer.cs (1)
26DiagnosticSeverity.Warning, isEnabledByDefault: true, description: Description);
BestFriendAnalyzer.cs (1)
31DiagnosticSeverity.Warning, isEnabledByDefault: true, description: Description);
BestFriendOnPublicDeclarationsAnalyzer.cs (1)
27DiagnosticSeverity.Warning, isEnabledByDefault: true, description: Description);
ContractsCheckAnalyzer.cs (4)
34DiagnosticSeverity.Warning, isEnabledByDefault: true, description: Description); 48DiagnosticSeverity.Warning, isEnabledByDefault: true, description: Description); 59DiagnosticSeverity.Warning, isEnabledByDefault: true, 71DiagnosticSeverity.Warning, isEnabledByDefault: true,
InstanceInitializerAnalyzer.cs (1)
25DiagnosticSeverity.Warning, isEnabledByDefault: true,
NameAnalyzer.cs (2)
55DiagnosticSeverity.Warning, isEnabledByDefault: true, description: Description); 68DiagnosticSeverity.Warning, isEnabledByDefault: true, description: Description);
ParameterVariableNameAnalyzer.cs (1)
27DiagnosticSeverity.Warning, isEnabledByDefault: true, description: Description);
SingleVariableDeclarationAnalyzer.cs (1)
27DiagnosticSeverity.Warning, isEnabledByDefault: true, description: Description);
TypeParamNameAnalyzer.cs (1)
26DiagnosticSeverity.Warning, isEnabledByDefault: true, description: Description);
Microsoft.VisualStudio.LanguageServices (22)
LanguageService\AbstractLanguageService`2.VsLanguageDebugInfo.cs (1)
301if (tree.GetDiagnostics(cancellationToken).Any(d => d.Severity == DiagnosticSeverity.Error))
PreviewPane\PreviewPaneService.cs (4)
46case DiagnosticSeverity.Error: 49case DiagnosticSeverity.Warning: 52case DiagnosticSeverity.Info: 55case DiagnosticSeverity.Hidden:
TableDataSource\Suppression\VisualStudioDiagnosticListSuppressionStateService.cs (2)
278severity: DiagnosticSeverity.Warning, 279defaultSeverity: DiagnosticSeverity.Warning,
TaskList\ExternalErrorDiagnosticUpdateSource.cs (5)
236private static RpcContracts.DiagnosticManagement.DiagnosticSeverity GetSeverity(CodeAnalysis.DiagnosticSeverity severity) 240CodeAnalysis.DiagnosticSeverity.Hidden => RpcContracts.DiagnosticManagement.DiagnosticSeverity.Hint, 241CodeAnalysis.DiagnosticSeverity.Info => RpcContracts.DiagnosticManagement.DiagnosticSeverity.Information, 242CodeAnalysis.DiagnosticSeverity.Warning => RpcContracts.DiagnosticManagement.DiagnosticSeverity.Warning, 243CodeAnalysis.DiagnosticSeverity.Error => RpcContracts.DiagnosticManagement.DiagnosticSeverity.Error,
TaskList\ProjectExternalErrorReporter.cs (10)
215var severity = nPriority switch 217VSTASKPRIORITY.TP_HIGH => DiagnosticSeverity.Error, 218VSTASKPRIORITY.TP_NORMAL => DiagnosticSeverity.Warning, 219VSTASKPRIORITY.TP_LOW => DiagnosticSeverity.Info, 268DiagnosticSeverity severity, 274DiagnosticSeverity defaultSeverity; 308warningLevel: (severity == DiagnosticSeverity.Error) ? 0 : 1, 349private static DiagnosticSeverity GetDiagnosticSeverity(ExternalError error) 350=> error.fError != 0 ? DiagnosticSeverity.Error : DiagnosticSeverity.Warning;
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
EditorConfigSettings\DataProvider\DataProviderTests.MockAnalyzerReference.cs (1)
96var descriptor = new DiagnosticDescriptor(diagnosticId, "MockDiagnostic", "MockDiagnostic", category, DiagnosticSeverity.Warning, isEnabledByDefault: true);
Microsoft.VisualStudio.LanguageServices.UnitTests (8)
SolutionExplorer\AnalyzerCommandHandlerTests.vb (1)
21defaultSeverity:=DiagnosticSeverity.Error,
SolutionExplorer\DiagnosticDescriptorComparerTests.vb (6)
23DiagnosticSeverity.Warning, 31DiagnosticSeverity.Warning, 52DiagnosticSeverity.Warning, 60DiagnosticSeverity.Warning, 81DiagnosticSeverity.Warning, 89DiagnosticSeverity.Warning,
SolutionExplorer\DiagnosticItemTests.vb (1)
46defaultSeverity:=DiagnosticSeverity.Error,
Microsoft.VisualStudio.LanguageServices.VisualBasic (1)
ProjectSystemShim\TempPECompiler.TempPEProject.vb (1)
52Return emitResult.Diagnostics.Where(Function(d) d.Severity = DiagnosticSeverity.Error).Count()
Mvc.Analyzers.Test (2)
TagHelpersInCodeBlocksAnalyzerTest.cs (2)
17private static readonly DiagnosticResult CS4033Result = new("CS4033", DiagnosticSeverity.Error); 18private static readonly DiagnosticResult CS4034Result = new("CS4034", DiagnosticSeverity.Error);
Roslyn.Test.PdbUtilities (2)
EditAndContinue\EditAndContinueTest.cs (1)
102diff.EmitResult.Diagnostics.Where(d => d.Severity == DiagnosticSeverity.Error).Verify(expectedErrors);
Reader\PdbValidation.cs (1)
536result.Diagnostics.Where(d => d.Severity == DiagnosticSeverity.Error).Verify();
Roslyn.VisualStudio.Next.UnitTests (8)
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (8)
54Assert.Equal(DiagnosticSeverity.Hidden, diagnostics[0].Severity); 62Assert.Equal(isHostAnalyzer ? DiagnosticSeverity.Info : DiagnosticSeverity.Hidden, diagnostics[0].Severity); 92Assert.Equal(DiagnosticSeverity.Info, diagnostics[0].Severity); 101Assert.Equal(isHostAnalyzer ? DiagnosticSeverity.Error : DiagnosticSeverity.Info, diagnostics[0].Severity); 266ImmutableArray.Create(new DiagnosticDescriptor("test", "test", "test", "test", DiagnosticSeverity.Error, isEnabledByDefault: true)); 286ImmutableArray.Create(new DiagnosticDescriptor("test", "test", "test", "test", DiagnosticSeverity.Error, isEnabledByDefault: true));
SemanticSearch.BuildTask.UnitTests (3)
GenerateFilteredReferenceAssembliesTaskTests.cs (3)
130c.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error).Verify( 178c.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error).Verify( 227c.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error).Verify(
System.Private.CoreLib.Generators (4)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (4)
34private static readonly DiagnosticDescriptor Rule = new DiagnosticDescriptor(DiagnosticId, Title, MessageFormat, Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: Description); 38private static readonly DiagnosticDescriptor RuleHelper = new DiagnosticDescriptor(DiagnosticIdHelper, Title, MessageHelperFormat, Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: Description); 42private static readonly DiagnosticDescriptor RuleCantParse = new DiagnosticDescriptor(DiagnosticIdConditionParsing, Title, MessageNonParseableConditionFormat, Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: Description); 46private static readonly DiagnosticDescriptor RuleAttributeNotSpecificEnough = new DiagnosticDescriptor(DiagnosticIdAttributeNotSpecificEnough, Title, MessageAttributeNotSpecificEnoughFormat, Category, DiagnosticSeverity.Error, isEnabledByDefault: true, description: Description);
System.Text.Json.SourceGeneration (16)
JsonSourceGenerator.DiagnosticDescriptors.cs (15)
20defaultSeverity: DiagnosticSeverity.Warning, 28defaultSeverity: DiagnosticSeverity.Warning, 36defaultSeverity: DiagnosticSeverity.Warning, 44defaultSeverity: DiagnosticSeverity.Error, 52defaultSeverity: DiagnosticSeverity.Warning, 60defaultSeverity: DiagnosticSeverity.Error, 68defaultSeverity: DiagnosticSeverity.Error, 76defaultSeverity: DiagnosticSeverity.Warning, 84defaultSeverity: DiagnosticSeverity.Warning, 92defaultSeverity: DiagnosticSeverity.Warning, 100defaultSeverity: DiagnosticSeverity.Error, 108defaultSeverity: DiagnosticSeverity.Warning, 116defaultSeverity: DiagnosticSeverity.Warning, 124defaultSeverity: DiagnosticSeverity.Warning, 132defaultSeverity: DiagnosticSeverity.Warning,
src\libraries\Common\src\Roslyn\DiagnosticDescriptorHelper.cs (1)
15DiagnosticSeverity defaultSeverity,
System.Text.RegularExpressions.Generator (7)
DiagnosticDescriptors.cs (6)
18DiagnosticSeverity.Error, 27DiagnosticSeverity.Error, 36DiagnosticSeverity.Error, 45DiagnosticSeverity.Error, 54DiagnosticSeverity.Info, 62DiagnosticSeverity.Info,
src\libraries\Common\src\Roslyn\DiagnosticDescriptorHelper.cs (1)
15DiagnosticSeverity defaultSeverity,
System.Windows.Forms.Analyzers (2)
System\Windows\Forms\Analyzers\Diagnostics\SharedDiagnosticDescriptors.cs (2)
16defaultSeverity: DiagnosticSeverity.Warning, 24defaultSeverity: DiagnosticSeverity.Warning,
System.Windows.Forms.Analyzers.CSharp (5)
System\Windows\Forms\CSharp\Analyzers\Diagnostics\CSharpDiagnosticDescriptors.cs (5)
17defaultSeverity: DiagnosticSeverity.Error, 25defaultSeverity: DiagnosticSeverity.Error, 33defaultSeverity: DiagnosticSeverity.Error, 41defaultSeverity: DiagnosticSeverity.Error, 50DiagnosticSeverity.Warning,
System.Windows.Forms.Analyzers.CSharp.Tests (2)
Analyzers\Verifiers\CSharpVerifierHelper.cs (2)
14/// <see cref="DiagnosticSeverity.Warning"/>, and the analyzer test framework defaults to only validating 15/// diagnostics at <see cref="DiagnosticSeverity.Error"/>. This map contains all compiler diagnostic IDs
System.Windows.Forms.Analyzers.VisualBasic (2)
Diagnostic\VisualBasicDiagnosticDescriptors.vb (2)
15defaultSeverity:=DiagnosticSeverity.Error, 24defaultSeverity:=DiagnosticSeverity.Warning,
System.Windows.Forms.PrivateSourceGenerators (2)
System\Windows\Forms\SourceGenerators\EnumValidationGenerator.cs (2)
191context.ReportDiagnostic(Diagnostic.Create("EV1", nameof(EnumValidationGenerator), $"Can't validate an enum that has no elements", DiagnosticSeverity.Error, DiagnosticSeverity.Error, true, 4));
System.Windows.Forms.PrivateSourceGenerators.Tests (1)
EnumValidationTests.cs (1)
309Assert.False(diagnostics.Any(d => d.Severity == DiagnosticSeverity.Error), $"Failed: {diagnostics.FirstOrDefault()?.GetMessage()}");
VBCSCompiler.UnitTests (1)
AnalyzerConsistencyCheckerTests.cs (1)
73Assert.Empty(emitResult.Diagnostics.Where(x => x.Severity == DiagnosticSeverity.Error));