6 overrides of Severity
Microsoft.CodeAnalysis (5)
CommandLine\CommonCompiler.SuppressionDiagnostic.cs (1)
63public override DiagnosticSeverity Severity => DiagnosticSeverity.Info;
Diagnostic\Diagnostic.DiagnosticWithProgrammaticSuppression.cs (1)
51public override DiagnosticSeverity Severity
Diagnostic\Diagnostic_SimpleDiagnostic.cs (1)
115public override DiagnosticSeverity Severity
Diagnostic\DiagnosticWithInfo.cs (1)
74public sealed override DiagnosticSeverity Severity
DiagnosticAnalyzer\CompilerDiagnosticAnalyzer.CompilationAnalyzer.cs (1)
95public override DiagnosticSeverity Severity => _original.Severity;
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
EvaluationContextBase.cs (1)
131public override DiagnosticSeverity Severity
239 references to Severity
ConfigurationSchemaGenerator.Tests (1)
GeneratorTests.cs (1)
1564Assert.Empty(compilation.GetDiagnostics().Where(diagnostic => diagnostic.Severity > DiagnosticSeverity.Hidden));
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.App.Analyzers (1)
Infrastructure\VirtualChars\CSharpVirtualCharService.cs (1)
193if (parentExpression.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
Microsoft.AspNetCore.Components.Analyzers.Tests (2)
Verifiers\DiagnosticVerifier.cs (2)
163if (actual.Severity != expected.Severity) 169expected.Severity, actual.Severity, FormatDiagnostics(analyzer, actual)));
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (2)
Verifiers\DiagnosticVerifier.cs (2)
163if (actual.Severity != expected.Severity) 169expected.Severity, actual.Severity, FormatDiagnostics(analyzer, actual)));
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.Mvc.Razor.RuntimeCompilation (1)
CompilationFailedExceptionFactory.cs (1)
54.Where(diagnostic => diagnostic.IsWarningAsError || diagnostic.Severity == DiagnosticSeverity.Error)
Microsoft.CodeAnalysis (27)
Binding\BindingDiagnosticBag.cs (1)
361if ((diagnostic as DiagnosticWithInfo)?.HasLazyInfo != true && diagnostic.Severity == DiagnosticSeverity.Error)
CommandLine\CommonCompiler.cs (2)
551else if (diag.Severity == DiagnosticSeverity.Hidden) 585if (diag.Severity == DiagnosticSeverity.Error)
CommandLine\SarifV1ErrorLogger.cs (1)
70_writer.Write("level", GetLevel(diagnostic.Severity));
CommandLine\SarifV2ErrorLogger.cs (1)
63_writer.Write("level", GetLevel(diagnostic.Severity));
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\Diagnostic.cs (5)
319/// To get the effective severity of the diagnostic, use <see cref="Severity"/>. 378/// and <see cref="Severity"/> = <see cref="DiagnosticSeverity.Error"/>. 385this.Severity == DiagnosticSeverity.Error; 432switch (this.Severity) 596=> Severity == DiagnosticSeverity.Error && !IsSuppressed;
Diagnostic\Diagnostic.DiagnosticWithProgrammaticSuppression.cs (1)
53get { return _originalUnsuppressedDiagnostic.Severity; }
Diagnostic\DiagnosticArrayExtensions.cs (1)
15if (diagnostic.Severity == DiagnosticSeverity.Error)
Diagnostic\DiagnosticBag.cs (5)
207if (diagnostic.Severity != InternalDiagnosticSeverity.Void) 209Debug.Assert(diagnostic.Severity != InternalDiagnosticSeverity.Unknown); //Info access should have forced resolution. 234if (diagnostic.Severity == InternalDiagnosticSeverity.Void) 254if (diagnostic.Severity != InternalDiagnosticSeverity.Void) 256Debug.Assert(diagnostic.Severity != InternalDiagnosticSeverity.Unknown); //Info access should have forced resolution.
Diagnostic\DiagnosticDescriptor.cs (1)
245return effectiveDiagnostic != null ? MapSeverityToReport(effectiveDiagnostic.Severity) : ReportDiagnostic.Suppress;
Diagnostic\DiagnosticFormatter.cs (2)
85switch (diagnostic.Severity) 100throw ExceptionUtilities.UnexpectedValue(diagnostic.Severity);
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
2014severityFilter.Contains(DiagnosticDescriptor.MapSeverityToReport(diagnostic.Severity)))
DiagnosticAnalyzer\AnalyzerExecutor.cs (2)
1354exceptionDiagnostic.Severity == other.Severity &&
DiagnosticAnalyzer\CompilerDiagnosticAnalyzer.CompilationAnalyzer.cs (2)
68diagnostic.Severity != DiagnosticSeverity.Hidden) 95public override DiagnosticSeverity Severity => _original.Severity;
Microsoft.CodeAnalysis.CodeStyle (7)
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\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
130if (root.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
578if (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)
118if (context.Operation.Syntax.GetDiagnostics().Any(diagnostic => diagnostic.Severity == DiagnosticSeverity.Error))
src\Compilers\Core\Portable\Diagnostic\DiagnosticArrayExtensions.cs (1)
15if (diagnostic.Severity == DiagnosticSeverity.Error)
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AbstractAddAccessibilityModifiersCodeFixProvider.cs (1)
30var priority = diagnostic.Severity == DiagnosticSeverity.Hidden
Microsoft.CodeAnalysis.CSharp (6)
Binder\Binder_Crefs.cs (1)
1015if (diag.Severity == DiagnosticSeverity.Error)
Compilation\CSharpDiagnosticFilter.cs (2)
61else if (d.Severity == InternalDiagnosticSeverity.Void) 96reportAction = GetDiagnosticReport(d.Severity,
Compilation\SyntaxAndDeclarationManager.cs (1)
211Debug.Assert(!directive.IsActive || tree.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error));
FlowAnalysis\FlowAnalysisPass.cs (1)
90IEnumerable<Diagnostic> getErrorsOnly(IEnumerable<Diagnostic> diags) => diags.Where(d => d.Severity == DiagnosticSeverity.Error);
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (1)
1797if (diagnostic.Severity == DiagnosticSeverity.Error && diagnostic.Code is not ((int)ErrorCode.ERR_ImplicitImplementationOfNonPublicInterfaceMember or (int)ErrorCode.ERR_ImplicitImplementationOfInaccessibleInterfaceMember))
Microsoft.CodeAnalysis.CSharp.CodeStyle (7)
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\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
79if (topMostExpression.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
99if (localDeclaration.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (1)
56if (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 (1)
src\Analyzers\CSharp\Tests\SimplifyInterpolation\SimplifyInterpolationTests.cs (1)
50diagnostics.Select(d => (d.Descriptor.Id, d.Severity)));
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 (2)
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 (2)
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 (29)
Diagnostics\DiagnosticAnalyzerTests.cs (10)
327Assert.True(effectiveDiag.Severity == DiagnosticSeverity.Error); 358switch (effectiveDiag.Severity) 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));
Diagnostics\GetDiagnosticsTests.cs (7)
120Assert.Equal(DiagnosticSeverity.Warning, diag.Severity); 124Assert.Equal(DiagnosticSeverity.Error, error.Severity); 129Assert.Equal(DiagnosticSeverity.Warning, warning.Severity); 134Assert.Equal(DiagnosticSeverity.Hidden, hidden.Severity); 139Assert.Equal(DiagnosticSeverity.Info, info.Severity); 573Assert.Equal(DiagnosticSeverity.Warning, diagnostic.Severity); 621Assert.Equal(DiagnosticSeverity.Warning, diagnostic.Severity);
FlowAnalysis\FlowDiagnosticTests.cs (11)
156count[(int)e.Severity]++; 184count[(int)e.Severity]++; 353count[(int)e.Severity]++; 386count[(int)e.Severity]++; 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\PatternMatchingTests.cs (1)
5650compilation.GetEmitDiagnostics().Where(d => d.Severity != DiagnosticSeverity.Warning).Verify(
Microsoft.CodeAnalysis.CSharp.Features (9)
ConvertToRawString\ConvertInterpolatedStringToRawStringCodeRefactoringProvider.cs (1)
72if (stringExpression.GetDiagnostics().Any(static d => d.Severity == DiagnosticSeverity.Error))
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\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (1)
99if (localDeclaration.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (1)
56if (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 (1)
src\Analyzers\CSharp\Tests\SimplifyInterpolation\SimplifyInterpolationTests.cs (1)
50diagnostics.Select(d => (d.Descriptor.Id, d.Severity)));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (58)
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 (3)
129count[(int)e.Severity]++; 618Assert.Equal(0, diags.Count(d => d.Severity == DiagnosticSeverity.Error)); 619Assert.Equal(0, diags.Count(d => d.Severity == DiagnosticSeverity.Warning));
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\RefEscapingTests.cs (1)
48Assert.True(comp.GetDiagnostics().All(d => d.Severity != DiagnosticSeverity.Error));
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);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
Compilation\SemanticModelAPITests.cs (1)
4366compilation.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error).Verify();
Symbols\TypeTests.cs (1)
1198Assert.Equal(0, comp.GetDeclarationDiagnostics().Count(e => e.Severity >= DiagnosticSeverity.Error));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (2)
LexicalAndXml\PreprocessorTests.cs (1)
3876Assert.Equal(DiagnosticSeverity.Warning, diagnostic.Severity);
Syntax\LambdaUtilitiesTests.cs (1)
44compilation.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error).Verify();
Microsoft.CodeAnalysis.CSharp.Test.Utilities (3)
CSharpTestBase.cs (2)
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.Features (15)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaBatchFixHelpers.cs (1)
75severity: diagnostic.Severity,
CodeFixes\Suppression\SuppressionHelpers.cs (2)
49switch (diagnostic.Severity) 63throw ExceptionUtilities.UnexpectedValue(diagnostic.Severity);
Completion\Providers\AbstractInternalsVisibleToCompletionProvider.cs (1)
195if (diagnostic.Severity == DiagnosticSeverity.Error)
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.cs (1)
81if (ifStatement == null || ifStatement.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (1)
100if (interpolatedString.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
571var syntaxError = syntaxDiagnostics.FirstOrDefault(d => d.Severity == DiagnosticSeverity.Error);
SemanticSearch\AbstractSemanticSearchService.cs (1)
109if (diagnostic.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\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
130if (root.GetDiagnostics().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)
118if (context.Operation.Syntax.GetDiagnostics().Any(diagnostic => diagnostic.Severity == DiagnosticSeverity.Error))
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));
Microsoft.CodeAnalysis.Features.UnitTests (4)
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 (1)
Handler\Breakpoints\ValidateBreakableRangeHandler.cs (1)
66if (tree.GetDiagnostics(cancellationToken).Any(d => d.Severity == DiagnosticSeverity.Error))
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.Scripting.TestUtilities (1)
ScriptingTestHelpers.cs (1)
91e.Diagnostics.Any(d => d.Severity == DiagnosticSeverity.Error && e.Message == d.ToString());
Microsoft.CodeAnalysis.Test.Utilities (2)
Diagnostics\DiagnosticDescription.cs (1)
130_effectiveSeverityOpt = includeEffectiveSeverity ? d.Severity : (DiagnosticSeverity?)null;
Diagnostics\DiagnosticExtensions.cs (1)
446=> e.Location.IsInSource ? $"{e.Severity} {e.Id}: {e.GetMessage(CultureInfo.CurrentCulture)}" :
Microsoft.CodeAnalysis.UnitTests (1)
Diagnostics\DiagnosticCreationTests.cs (1)
21Assert.Equal(effectiveSeverity, diagnostic.Severity);
Microsoft.CodeAnalysis.VisualBasic (5)
Binding\Binder_Expressions.vb (1)
1110If diag.Severity = DiagnosticSeverity.Error Then
Compilation\VisualBasicDiagnosticFilter.vb (2)
42If diagnostic.Severity = InternalDiagnosticSeverity.Void Then 83diagnostic.Severity,
OptionsValidator.vb (1)
55If Not errors.Any(Function(diag) diag.Severity = DiagnosticSeverity.Error) Then
Symbols\Source\SynthesizedMyGroupCollectionPropertyAccessorSymbol.vb (1)
87If diag.Severity = DiagnosticSeverity.Error Then
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (1)
FlowAnalysis\FlowDiagnosticTests.vb (1)
915Assert.NotEmpty(Me.FlowDiagnostics(comp).AsEnumerable().Where(Function(e) e.Severity = DiagnosticSeverity.[Warning]))
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (1)
CompilationTestUtils.vb (1)
994If Not suppressInfos OrElse e.Diagnostic.Severity > DiagnosticSeverity.Info Then
Microsoft.CodeAnalysis.Workspaces (3)
Diagnostics\DiagnosticData.cs (1)
232diagnostic.Severity,
src\Compilers\Core\Portable\Diagnostic\DiagnosticArrayExtensions.cs (1)
15if (diagnostic.Severity == DiagnosticSeverity.Error)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
185diag => diag.Severity == DiagnosticSeverity.Error && !ignoreErrorCode.Contains(diag.Id));
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (5)
NetCoreTests.cs (1)
509Assert.Empty(diagnostics.Where(d => d.Severity >= DiagnosticSeverity.Warning));
VisualStudioMSBuildWorkspaceTests.cs (4)
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.Gen.ComplianceReports.Unit.Tests (1)
GeneratorTests.cs (1)
134Assert.Equal(DiagnosticSeverity.Info, diag.Severity);
Microsoft.Gen.ContextualOptions (1)
Model\OptionsContextType.cs (1)
21public bool ShouldEmit => Diagnostics.TrueForAll(diag => diag.Severity != DiagnosticSeverity.Error);
Microsoft.Gen.Logging (1)
Parsing\Parser.cs (1)
749if (d.Severity == 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();
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.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));