820 references to Warning
CodeStyleConfigFileGenerator (4)
Program.cs (2)
164return (isEnabledByDefault: false, DiagnosticSeverity.Warning); 191effectiveSeverity: isEnabledInNonDefaultMode ? DiagnosticSeverity.Warning : rule.DefaultSeverity);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticSeverityExtensions_Shared.cs (2)
27DiagnosticSeverity.Warning => ReportDiagnostic.Warn, 38DiagnosticSeverity.Warning => EditorConfigSeverityStrings.Warning,
ConfigurationSchemaGenerator (4)
DiagnosticDescriptors.cs (4)
33defaultSeverity: DiagnosticSeverity.Warning, 49defaultSeverity: DiagnosticSeverity.Warning, 57defaultSeverity: DiagnosticSeverity.Warning, 66defaultSeverity: DiagnosticSeverity.Warning,
CSharpSyntaxGenerator (1)
SourceGenerator.cs (1)
31defaultSeverity: DiagnosticSeverity.Warning,
ILLink.RoslynAnalyzer (3)
DiagnosticDescriptors.cs (3)
18 DiagnosticSeverity.Warning, 28 DiagnosticSeverity.Warning, 36 DiagnosticSeverity diagnosticSeverity = DiagnosticSeverity.Warning,
Microsoft.Analyzers.Extra (14)
DiagDescriptors.cs (14)
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);
Microsoft.Analyzers.Local (9)
DiagDescriptors.cs (9)
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);
Microsoft.AspNetCore.Analyzers (3)
StartupAnalyzer.Diagnostics.cs (3)
20DiagnosticSeverity.Warning, 29DiagnosticSeverity.Warning, 38DiagnosticSeverity.Warning,
Microsoft.AspNetCore.App.Analyzers (15)
DiagnosticDescriptors.cs (15)
16DiagnosticSeverity.Warning, 25DiagnosticSeverity.Warning, 34DiagnosticSeverity.Warning, 43DiagnosticSeverity.Warning, 52DiagnosticSeverity.Warning, 88DiagnosticSeverity.Warning, 97DiagnosticSeverity.Warning, 106DiagnosticSeverity.Warning, 115DiagnosticSeverity.Warning, 133DiagnosticSeverity.Warning, 142DiagnosticSeverity.Warning, 160DiagnosticSeverity.Warning, 187DiagnosticSeverity.Warning, 196DiagnosticSeverity.Warning, 223DiagnosticSeverity.Warning,
Microsoft.AspNetCore.Components.Analyzers (5)
DiagnosticDescriptors.cs (5)
25DiagnosticSeverity.Warning, 34DiagnosticSeverity.Warning, 52DiagnosticSeverity.Warning, 61DiagnosticSeverity.Warning, 70DiagnosticSeverity.Warning,
Microsoft.AspNetCore.Components.Analyzers.Tests (9)
ComponentParameterCaptureUnmatchedValuesHasWrongTypeTest.cs (1)
66Severity = DiagnosticSeverity.Warning,
ComponentParameterCaptureUnmatchedValuesMustBeUniqueTest.cs (1)
54Severity = DiagnosticSeverity.Warning,
ComponentParameterShouldBeAutoPropertiesTest.cs (2)
108Severity = CodeAnalysis.DiagnosticSeverity.Warning, 147Severity = CodeAnalysis.DiagnosticSeverity.Warning,
ComponentParameterUsageAnalyzerTest.cs (5)
52Severity = DiagnosticSeverity.Warning, 83Severity = DiagnosticSeverity.Warning, 114Severity = DiagnosticSeverity.Warning, 145Severity = DiagnosticSeverity.Warning, 176Severity = DiagnosticSeverity.Warning,
Microsoft.AspNetCore.Components.SdkAnalyzers (4)
DiagnosticDescriptors.cs (4)
29DiagnosticSeverity.Warning, 38DiagnosticSeverity.Warning, 56DiagnosticSeverity.Warning, 65DiagnosticSeverity.Warning,
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (7)
ComponentParameterCaptureUnmatchedValuesHasWrongTypeTest.cs (1)
66Severity = DiagnosticSeverity.Warning,
ComponentParameterCaptureUnmatchedValuesMustBeUniqueTest.cs (1)
54Severity = DiagnosticSeverity.Warning,
ComponentParameterUsageAnalyzerTest.cs (5)
52Severity = DiagnosticSeverity.Warning, 83Severity = DiagnosticSeverity.Warning, 114Severity = DiagnosticSeverity.Warning, 145Severity = DiagnosticSeverity.Warning, 176Severity = DiagnosticSeverity.Warning,
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 (5)
DiagnosticDescriptors.cs (5)
17DiagnosticSeverity.Warning, 26DiagnosticSeverity.Warning, 35DiagnosticSeverity.Warning, 44DiagnosticSeverity.Warning, 54DiagnosticSeverity.Warning,
Microsoft.AspNetCore.Mvc.Api.Analyzers (2)
ApiDiagnosticDescriptors.cs (2)
17DiagnosticSeverity.Warning, 26DiagnosticSeverity.Warning,
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (2)
DiagnosticDescriptors.cs (2)
27defaultSeverity: DiagnosticSeverity.Warning, 101defaultSeverity: DiagnosticSeverity.Warning,
Microsoft.CodeAnalysis (22)
CommandLine\AnalyzerConfigSet.cs (3)
100DiagnosticSeverity.Warning, 109DiagnosticSeverity.Warning, 118DiagnosticSeverity.Warning,
CommandLine\SarifErrorLogger.cs (2)
67case DiagnosticSeverity.Warning: 79goto case DiagnosticSeverity.Warning;
Diagnostic\CommonMessageProvider.cs (1)
141return diagnosticInfo.GetInstanceWithSeverity(DiagnosticSeverity.Warning);
Diagnostic\Diagnostic.cs (6)
174/// <param name="warningLevel">The warning level, greater than 0 if severity is <see cref="DiagnosticSeverity.Warning"/>; otherwise 0.</param> 223/// <param name="warningLevel">The warning level, greater than 0 if severity is <see cref="DiagnosticSeverity.Warning"/>; otherwise 0.</param> 377/// True implies <see cref="DefaultSeverity"/> = <see cref="DiagnosticSeverity.Warning"/> 384return this.DefaultSeverity == DiagnosticSeverity.Warning && 539return this.WithSeverity(DiagnosticSeverity.Warning); 569case DiagnosticSeverity.Warning:
Diagnostic\DiagnosticDescriptor.cs (2)
257case DiagnosticSeverity.Warning: 273return DiagnosticSeverity.Warning;
Diagnostic\DiagnosticFormatter.cs (1)
93case DiagnosticSeverity.Warning:
Diagnostic\DiagnosticInfo.cs (4)
154Debug.Assert(!isWarningAsError || _defaultSeverity == DiagnosticSeverity.Warning); 197/// If IsWarningsAsError is true, then this returns <see cref="DiagnosticSeverity.Error"/>, while <see cref="DefaultSeverity"/> returns <see cref="DiagnosticSeverity.Warning"/>. 241/// <see cref="DefaultSeverity"/> = <see cref="DiagnosticSeverity.Warning"/>. 247return this.DefaultSeverity == DiagnosticSeverity.Warning &&
Diagnostic\SeverityFilter.cs (1)
44return DiagnosticSeverity.Warning;
DiagnosticAnalyzer\AnalyzerExecutor.cs (1)
1317defaultSeverity: DiagnosticSeverity.Warning,
SourceGeneration\GeneratorDriver.cs (1)
412defaultSeverity: DiagnosticSeverity.Warning,
Microsoft.CodeAnalysis.CodeStyle (7)
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (1)
39defaultSeverity: DiagnosticSeverity.Warning,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOption2`1.cs (1)
194DiagnosticSeverity.Warning => NotificationOption2.Warning,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\NotificationOption2.cs (1)
62DiagnosticSeverity.Warning => Warning,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticSeverityExtensions.cs (1)
17DiagnosticSeverity.Warning => NotificationOption2.Warning,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticSeverityExtensions_Shared.cs (2)
27DiagnosticSeverity.Warning => ReportDiagnostic.Warn, 38DiagnosticSeverity.Warning => EditorConfigSeverityStrings.Warning,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ReportDiagnosticExtensions.cs (1)
33return DiagnosticSeverity.Warning;
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (1)
src\Features\DiagnosticsTestUtilities\CodeActions\CSharpVerifierHelper.cs (1)
17/// <see cref="DiagnosticSeverity.Warning"/>, and the analyzer test framework defaults to only validating
Microsoft.CodeAnalysis.CSharp (5)
Compilation\CSharpDiagnosticFilter.cs (3)
233!(specifiedWarnAsErrorMinus && severity == DiagnosticSeverity.Warning && reportFromSyntaxTreeOptions == ReportDiagnostic.Error)) 313if (severity == DiagnosticSeverity.Warning || severity == DiagnosticSeverity.Info) 338return severity == DiagnosticSeverity.Warning &&
Errors\ErrorFacts.cs (1)
118return DiagnosticSeverity.Warning;
Symbols\Symbol.cs (1)
1128if (result == null || result.Severity == DiagnosticSeverity.Warning && info.Severity == DiagnosticSeverity.Error)
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (5)
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\UseImplicitOrExplicitType\UseExplicitTypeTests.cs (1)
2402diagnosticSeverity: DiagnosticSeverity.Warning);
src\Analyzers\CSharp\Tests\UseImplicitOrExplicitType\UseImplicitTypeTests.cs (1)
1932diagnosticSeverity: DiagnosticSeverity.Warning);
src\Analyzers\CSharp\Tests\UseObjectInitializer\UseObjectInitializerTests.cs (1)
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);
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (42)
CommandLineTests.cs (42)
216var analyzer = new CompilationAnalyzerWithSeverity(DiagnosticSeverity.Warning, configurable: true); 13062var analyzer = new CompilationAnalyzerWithSeverity(DiagnosticSeverity.Warning, configurable: true); 13107analyzer = new CompilationAnalyzerWithSeverity(DiagnosticSeverity.Warning, configurable: false); 13147[InlineData(DiagnosticSeverity.Warning, false)] 13247[InlineData(DiagnosticSeverity.Warning, false, false)] 13248[InlineData(DiagnosticSeverity.Warning, false, true)] 13337[InlineData(DiagnosticSeverity.Warning, false)] 13633var analyzer = new NamedTypeAnalyzerWithConfigurableEnabledByDefault(isEnabledByDefault, defaultSeverity: DiagnosticSeverity.Warning, customConfigurable, throwOnAllNamedTypes: false); 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)] 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)] 13899case DiagnosticSeverity.Warning: 14893private static readonly DiagnosticDescriptor _rule = new DiagnosticDescriptor("Id", "Title", "Message", "Category", DiagnosticSeverity.Warning, isEnabledByDefault: true); 15299var analyzer = new CompilationAnalyzerWithSeverity(DiagnosticSeverity.Warning, configurable: 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");
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (12)
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 (6)
572[CombinatorialValues(DiagnosticSeverity.Warning, DiagnosticSeverity.Info)] DiagnosticSeverity severity) 594expectedCleanup = severity >= DiagnosticSeverity.Warning; 741[InlineData(DiagnosticSeverity.Warning)] 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)
Semantics\SpeculationAnalyzerTests.cs (1)
539static bool isProblem(Diagnostic d) => d.Severity >= DiagnosticSeverity.Warning;
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (86)
Diagnostics\DiagnosticAnalyzerTests.cs (31)
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); 305var warningDiagDescriptor = new DiagnosticDescriptor("XX0003", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Warning, isEnabledByDefault: true); 368case DiagnosticSeverity.Warning: 389var warningDiagDescriptor = new DiagnosticDescriptor("XX0003", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Warning, isEnabledByDefault: true); 415Assert.Equal(1, effectiveDiags.Count(d => d.Severity == DiagnosticSeverity.Warning)); 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); 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); 4390[InlineData(SeverityFilter.Hidden | SeverityFilter.Info, DiagnosticSeverity.Warning)]
Diagnostics\DiagnosticSuppressorTests.cs (12)
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); 346if (defaultSeverity == DiagnosticSeverity.Warning && 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 (12)
120Assert.Equal(DiagnosticSeverity.Warning, diag.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); 135Assert.Equal(DiagnosticSeverity.Warning, hidden.DefaultSeverity); 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 (4)
159Assert.Equal(1, count[(int)DiagnosticSeverity.Warning]); 187Assert.Equal(2, count[(int)DiagnosticSeverity.Warning]); 356Assert.Equal(1, count[(int)DiagnosticSeverity.Warning]); 397Assert.Equal(2, count[(int)DiagnosticSeverity.Warning]);
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.UnitTests (21)
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);
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,
SimplifyThisOrMe\SimplifyThisOrMeTests.cs (1)
107diagnosticSeverity: DiagnosticSeverity.Warning);
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\UseImplicitOrExplicitType\UseExplicitTypeTests.cs (1)
2402diagnosticSeverity: DiagnosticSeverity.Warning);
src\Analyzers\CSharp\Tests\UseImplicitOrExplicitType\UseImplicitTypeTests.cs (1)
1932diagnosticSeverity: DiagnosticSeverity.Warning);
src\Analyzers\CSharp\Tests\UseObjectInitializer\UseObjectInitializerTests.cs (1)
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);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (72)
Semantics\ColorColorTests.cs (1)
1771new DiagnosticDescriptor("XY0000", "Test", "Test", "Test", DiagnosticSeverity.Warning, true, "Test", "Test");
Semantics\MethodBodyModelTests.cs (2)
135Assert.Equal(0, count[(int)DiagnosticSeverity.Warning]); 619Assert.Equal(0, diags.Count(d => d.Severity == DiagnosticSeverity.Warning));
Semantics\NullableReferenceTypesTests.cs (12)
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); 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); 125573Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity); 125584Assert.Equal(DiagnosticSeverity.Warning, diagnostics.Single().Severity);
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\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");
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 (4)
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");
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (12)
Diagnostics\DiagnosticTest.cs (2)
79Assert.Equal(DiagnosticSeverity.Warning, di2.Severity); 2786return DiagnosticSeverity.Warning;
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 (1)
112if (item.Severity == (errorsOnly ? DiagnosticSeverity.Error : DiagnosticSeverity.Warning))
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
DiagnosticTestUtilities.cs (1)
121IsWarning = e.Severity == DiagnosticSeverity.Warning,
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (6)
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 (2)
697var analyzer1 = new NamedTypeAnalyzerWithConfigurableEnabledByDefault(isEnabledByDefault: true, DiagnosticSeverity.Warning, throwOnAllNamedTypes: false); 1036public NamedTypeAnalyzer(DiagnosticSeverity defaultSeverity = DiagnosticSeverity.Warning)
Microsoft.CodeAnalysis.EditorFeatures.Wpf (4)
InlineDiagnostics\InlineDiagnosticsTag.cs (1)
163DiagnosticSeverity.Warning => KnownMonikers.StatusWarning,
InlineDiagnostics\InlineDiagnosticsTaggerProvider.cs (2)
48diagnostic.Severity is DiagnosticSeverity.Warning or DiagnosticSeverity.Error && 87else if (diagnostic.Severity == DiagnosticSeverity.Warning)
Suggestions\SuggestedActionsSource.cs (1)
260DiagnosticSeverity.Hidden or DiagnosticSeverity.Info or DiagnosticSeverity.Warning => PredefinedSuggestedActionCategoryNames.CodeFix,
Microsoft.CodeAnalysis.EditorFeatures2.UnitTests (11)
CodeFixes\CodeFixServiceTests.vb (1)
179DiagnosticSeverity.Warning,
Diagnostics\DiagnosticProviderTests.vb (1)
341Return CreateDiagnostic(id, message, DiagnosticSeverity.Warning, docId, projId, mappedLine, originalLine, mappedColumn, originalColumn, mappedFile, originalFile)
Diagnostics\DiagnosticServiceTests.vb (9)
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, 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.Features (6)
CodeFixes\Suppression\SuppressionHelpers.cs (1)
56case DiagnosticSeverity.Warning:
EditAndContinue\EditAndContinueDiagnosticDescriptors.cs (3)
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);
EditAndContinue\Utilities\Extensions.cs (1)
126DiagnosticSeverity.Warning => ManagedHotReloadDiagnosticSeverity.Warning,
src\Analyzers\Core\Analyzers\RemoveUnnecessaryImports\AbstractRemoveUnnecessaryImportsDiagnosticAnalyzer.cs (1)
39defaultSeverity: DiagnosticSeverity.Warning,
Microsoft.CodeAnalysis.Features.UnitTests (3)
EditAndContinue\EmitSolutionUpdateResultsTests.cs (3)
83severity: DiagnosticSeverity.Warning, 84defaultSeverity: DiagnosticSeverity.Warning, 100defaultSeverity: DiagnosticSeverity.Warning,
Microsoft.CodeAnalysis.LanguageServer.Protocol (7)
Extensions\ProtocolConversions.Diagnostics.cs (1)
218DiagnosticSeverity.Warning => LSP.DiagnosticSeverity.Warning,
Features\CodeCleanup\AbstractCodeCleanupService.cs (2)
161var minimumSeverity = isAnyDiagnosticIdExplicitlyEnabled ? DiagnosticSeverity.Hidden : DiagnosticSeverity.Warning; 232document, diagnosticId, DiagnosticSeverity.Warning, progressTracker, cancellationToken).ConfigureAwait(false);
Features\Diagnostics\DocumentAnalysisExecutor_Helpers.cs (3)
68defaultSeverity: DiagnosticSeverity.Warning, 119severity: DiagnosticSeverity.Warning, 120defaultSeverity: DiagnosticSeverity.Warning,
Features\UnifiedSuggestions\UnifiedSuggestedActionsSource.cs (1)
415case DiagnosticSeverity.Warning:
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (8)
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\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 (2)
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);
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 (2)
Script.cs (2)
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));
Microsoft.CodeAnalysis.Test.Utilities (136)
Diagnostics\BoxingOperationAnalyzer.cs (1)
29DiagnosticSeverity.Warning,
Diagnostics\CommonDiagnosticAnalyzers.cs (57)
36defaultSeverity: DiagnosticSeverity.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, 1096DiagnosticSeverity.Warning, 1126DiagnosticSeverity.Warning, 1195DiagnosticSeverity.Warning, 1237defaultSeverity: DiagnosticSeverity.Warning, 1382defaultSeverity: DiagnosticSeverity.Warning, 1408defaultSeverity: DiagnosticSeverity.Warning, 1458defaultSeverity: DiagnosticSeverity.Warning, 1483DiagnosticSeverity.Warning, 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, 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,
Diagnostics\CouldHaveMoreSpecificTypeAnalyzer.cs (2)
25DiagnosticSeverity.Warning, 33DiagnosticSeverity.Warning,
Diagnostics\DiagnosticExtensions.cs (3)
246expected.DefaultSeverity.Value == DiagnosticSeverity.Warning; 248expected.EffectiveSeverity.Value == DiagnosticSeverity.Warning || 259DiagnosticSeverity.Warning :
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);
Microsoft.CodeAnalysis.UnitTests (18)
Diagnostics\AnalysisContextInfoTests.cs (1)
104DiagnosticSeverity.Warning,
Diagnostics\DiagnosticLocalizationTests.cs (4)
49DiagnosticSeverity.Warning, 67DiagnosticSeverity.Warning, 343DiagnosticSeverity.Warning, 360DiagnosticSeverity.Warning,
Diagnostics\SarifErrorLoggerTests.cs (13)
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), 71new DiagnosticDescriptor("TST002", "", "", "", DiagnosticSeverity.Warning, isEnabledByDefault: false /*004*/), 72new DiagnosticDescriptor("TST002", "", "", "", DiagnosticSeverity.Warning, true, "description_005"), 119DiagnosticSeverity.Warning, 120DiagnosticSeverity.Warning,
Microsoft.CodeAnalysis.VisualBasic (5)
CommandLine\VisualBasicCommandLineParser.vb (1)
2242(VisualBasic.MessageProvider.Instance.GetSeverity(number) = DiagnosticSeverity.Warning) AndAlso
Compilation\VisualBasicDiagnosticFilter.vb (3)
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
Errors\MessageProvider.vb (1)
57Return DiagnosticSeverity.Warning
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (38)
CommandLineTests.vb (38)
9896Dim analyzer = New CompilationAnalyzerWithSeverity(DiagnosticSeverity.Warning, configurable:=True) 9940analyzer = New CompilationAnalyzerWithSeverity(DiagnosticSeverity.Warning, configurable:=False) 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)> 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)> 10312Case DiagnosticSeverity.Warning 10481Dim analyzer = New CompilationAnalyzerWithSeverity(DiagnosticSeverity.Warning, configurable:=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") 11097Friend Shared ReadOnly Rule As DiagnosticDescriptor = New DiagnosticDescriptor("AdditionalFileDiagnostic", "", "Additional File Diagnostic: {0}", "", DiagnosticSeverity.Warning, isEnabledByDefault:=True)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (3)
BreakingChanges.vb (3)
89Assert.Equal(DiagnosticSeverity.Warning, errs(0).Severity) 211Assert.Equal(DiagnosticSeverity.Warning, errs(0).Severity) 306Assert.Equal(DiagnosticSeverity.Warning, errs(0).Severity)
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (9)
Diagnostics\Suppression\SuppressionTests.vb (1)
816Private ReadOnly _descriptor As New DiagnosticDescriptor("REm", "REm Title", "REm", "REm", DiagnosticSeverity.Warning, 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,
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (62)
Diagnostics\DiagnosticAnalyzerTests.vb (23)
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) 51Dim warningDiagDescriptor = New DiagnosticDescriptor("XX0003", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Warning, isEnabledByDefault:=True) 111Case DiagnosticSeverity.Warning 132Dim warningDiagDescriptor = New DiagnosticDescriptor("XX0003", "DummyDescription", "DummyMessage", "DummyCategory", DiagnosticSeverity.Warning, isEnabledByDefault:=True) 158Assert.Equal(1, effectiveDiags.Count(Function(d) d.Severity = DiagnosticSeverity.Warning)) 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) 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 (10)
104Assert.Equal(DiagnosticSeverity.Warning, diag.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) 119Assert.Equal(DiagnosticSeverity.Warning, hidden.DefaultSeverity) 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.Syntax.UnitTests (4)
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),
Microsoft.CodeAnalysis.Workspaces (7)
Diagnostics\DiagnosticData.cs (1)
327return DiagnosticSeverity.Warning;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOption2`1.cs (1)
194DiagnosticSeverity.Warning => NotificationOption2.Warning,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\NotificationOption2.cs (1)
62DiagnosticSeverity.Warning => Warning,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticSeverityExtensions.cs (1)
17DiagnosticSeverity.Warning => NotificationOption2.Warning,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticSeverityExtensions_Shared.cs (2)
27DiagnosticSeverity.Warning => ReportDiagnostic.Warn, 38DiagnosticSeverity.Warning => EditorConfigSeverityStrings.Warning,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ReportDiagnosticExtensions.cs (1)
33return DiagnosticSeverity.Warning;
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (2)
NetCoreTests.cs (1)
509Assert.Empty(diagnostics.Where(d => d.Severity >= DiagnosticSeverity.Warning));
VisualStudioMSBuildWorkspaceTests.cs (1)
375.Where(d => d.Severity is DiagnosticSeverity.Error or DiagnosticSeverity.Warning)
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
BatchFixAllProviderTests.cs (1)
57new DiagnosticDescriptor("LiteralZero", "title", "message", "category", DiagnosticSeverity.Warning, isEnabledByDefault: true);
Microsoft.Extensions.Logging.Generators (7)
DiagnosticDescriptors.cs (7)
25DiagnosticSeverity.Warning, 73DiagnosticSeverity.Warning, 97DiagnosticSeverity.Warning, 105DiagnosticSeverity.Warning, 121DiagnosticSeverity.Warning, 145DiagnosticSeverity.Warning, 201DiagnosticSeverity.Warning,
Microsoft.Extensions.Options.SourceGeneration (6)
DiagDescriptors.cs (6)
24defaultSeverity: DiagnosticSeverity.Warning); 31defaultSeverity: DiagnosticSeverity.Warning); 86defaultSeverity: DiagnosticSeverity.Warning); 93defaultSeverity: DiagnosticSeverity.Warning); 100defaultSeverity: DiagnosticSeverity.Warning); 121defaultSeverity: DiagnosticSeverity.Warning);
Microsoft.Gen.ContextualOptions (1)
DiagDescriptors.cs (1)
31defaultSeverity: DiagnosticSeverity.Warning);
Microsoft.Gen.Logging (12)
Parsing\DiagDescriptors.cs (12)
19DiagnosticSeverity.Warning); 32DiagnosticSeverity.Warning); 51DiagnosticSeverity.Warning); 70DiagnosticSeverity.Warning); 77DiagnosticSeverity.Warning); 109DiagnosticSeverity.Warning); 134DiagnosticSeverity.Warning); 147DiagnosticSeverity.Warning); 184DiagnosticSeverity.Warning); 191DiagnosticSeverity.Warning); 240DiagnosticSeverity.Warning); 247DiagnosticSeverity.Warning);
Microsoft.Interop.ComInterfaceGenerator (7)
Analyzers\AnalyzerDiagnostics.cs (3)
60DiagnosticSeverity.Warning, 70DiagnosticSeverity.Warning, 80DiagnosticSeverity.Warning,
GeneratorDiagnostics.cs (4)
415DiagnosticSeverity.Warning, 456DiagnosticSeverity.Warning, 466DiagnosticSeverity.Warning, 507DiagnosticSeverity.Warning,
Microsoft.Interop.LibraryImportGenerator (7)
Analyzers\CustomMarshallerAttributeAnalyzer.cs (5)
324DiagnosticSeverity.Warning, 335DiagnosticSeverity.Warning, 346DiagnosticSeverity.Warning, 357DiagnosticSeverity.Warning, 368DiagnosticSeverity.Warning,
GeneratorDiagnostics.cs (2)
244DiagnosticSeverity.Warning, 254DiagnosticSeverity.Warning,
Microsoft.Interop.LibraryImportGenerator.Downlevel (2)
GeneratorDiagnostics.cs (2)
244DiagnosticSeverity.Warning, 254DiagnosticSeverity.Warning,
Microsoft.ML.CodeAnalyzer.Tests (1)
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 (6)
PreviewPane\PreviewPaneService.cs (1)
49case DiagnosticSeverity.Warning:
TableDataSource\Suppression\VisualStudioDiagnosticListSuppressionStateService.cs (2)
278severity: DiagnosticSeverity.Warning, 279defaultSeverity: DiagnosticSeverity.Warning,
TaskList\ExternalErrorDiagnosticUpdateSource.cs (1)
242CodeAnalysis.DiagnosticSeverity.Warning => RpcContracts.DiagnosticManagement.DiagnosticSeverity.Warning,
TaskList\ProjectExternalErrorReporter.cs (2)
218VSTASKPRIORITY.TP_NORMAL => DiagnosticSeverity.Warning, 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 (6)
SolutionExplorer\DiagnosticDescriptorComparerTests.vb (6)
23DiagnosticSeverity.Warning, 31DiagnosticSeverity.Warning, 52DiagnosticSeverity.Warning, 60DiagnosticSeverity.Warning, 81DiagnosticSeverity.Warning, 89DiagnosticSeverity.Warning,
System.Text.Json.SourceGeneration (11)
JsonSourceGenerator.DiagnosticDescriptors.cs (11)
20defaultSeverity: DiagnosticSeverity.Warning, 28defaultSeverity: DiagnosticSeverity.Warning, 36defaultSeverity: DiagnosticSeverity.Warning, 52defaultSeverity: DiagnosticSeverity.Warning, 76defaultSeverity: DiagnosticSeverity.Warning, 84defaultSeverity: DiagnosticSeverity.Warning, 92defaultSeverity: DiagnosticSeverity.Warning, 108defaultSeverity: DiagnosticSeverity.Warning, 116defaultSeverity: DiagnosticSeverity.Warning, 124defaultSeverity: DiagnosticSeverity.Warning, 132defaultSeverity: DiagnosticSeverity.Warning,
System.Windows.Forms.Analyzers (2)
System\Windows\Forms\Analyzers\Diagnostics\SharedDiagnosticDescriptors.cs (2)
16defaultSeverity: DiagnosticSeverity.Warning, 24defaultSeverity: DiagnosticSeverity.Warning,
System.Windows.Forms.Analyzers.CSharp (1)
System\Windows\Forms\CSharp\Analyzers\Diagnostics\CSharpDiagnosticDescriptors.cs (1)
50DiagnosticSeverity.Warning,
System.Windows.Forms.Analyzers.CSharp.Tests (1)
Analyzers\Verifiers\CSharpVerifierHelper.cs (1)
14/// <see cref="DiagnosticSeverity.Warning"/>, and the analyzer test framework defaults to only validating
System.Windows.Forms.Analyzers.VisualBasic (1)
Diagnostic\VisualBasicDiagnosticDescriptors.vb (1)
24defaultSeverity:=DiagnosticSeverity.Warning,