92 references to GetDiagnostics
Microsoft.AspNetCore.App.Analyzers (1)
Infrastructure\VirtualChars\CSharpVirtualCharService.cs (1)
193if (parentExpression.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
Microsoft.CodeAnalysis.CSharp.CodeStyle (6)
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)
94if (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)
51if (expression.GetDiagnostics().Any(diagnostic => diagnostic.Severity == DiagnosticSeverity.Error))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (1)
184if (parentExpression.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\BlockSyntaxExtensions.cs (1)
96if (parsed.GetDiagnostics().Any(static d => d.Severity == DiagnosticSeverity.Error))
Microsoft.CodeAnalysis.CSharp.EditorFeatures (2)
StringCopyPaste\StringCopyPasteHelpers.cs (2)
44foreach (var diagnostic in interpolatedString.GetDiagnostics()) 55foreach (var diagnostic in text.GetDiagnostics())
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (4)
Semantics\PatternMatchingTests.cs (4)
4173SyntaxFactory.ParseExpression("A is B < C, D > E").GetDiagnostics().Verify(); 4174SyntaxFactory.ParseExpression("A as B < C, D > E").GetDiagnostics().Verify( 4180SyntaxFactory.ParseExpression("A as B < C, D > ?? string.Empty").GetDiagnostics().Verify(); 4181SyntaxFactory.ParseExpression("A is B < C, D > ?? string.Empty").GetDiagnostics().Verify(
Microsoft.CodeAnalysis.CSharp.Features (7)
CodeRefactorings\SyncNamespace\CSharpChangeNamespaceService.cs (1)
372if (namespaceDecl.Name.GetDiagnostics().Any(diag => diag.DefaultSeverity == DiagnosticSeverity.Error))
ConvertToRawString\ConvertInterpolatedStringToRawStringCodeRefactoringProvider.cs (1)
72if (stringExpression.GetDiagnostics().Any(static d => d.Severity == DiagnosticSeverity.Error))
Copilot\CSharpCopilotCodeFixProvider.cs (1)
109if (memberDeclaration is null || memberDeclaration is not BaseMethodDeclarationSyntax baseMethodDeclaration || baseMethodDeclaration.GetDiagnostics().Count() > 3)
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)
51if (expression.GetDiagnostics().Any(diagnostic => diagnostic.Severity == DiagnosticSeverity.Error))
StringIndentation\CSharpStringIndentationService.cs (1)
99var errors = interpolatedString.GetDiagnostics().Where(d => d.Severity == DiagnosticSeverity.Error);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (70)
LexicalAndXml\PreprocessorTests.cs (5)
112Assert.Empty(node.GetDiagnostics()); 116Assert.NotEmpty(node.GetDiagnostics()); 3241node.GetDiagnostics().Verify( 3264node.GetDiagnostics().Verify( 3287node.GetDiagnostics().Verify(
LexicalAndXml\XmlDocCommentTests.cs (5)
1807firstComment.GetDiagnostics().Verify( 2447doc.GetDiagnostics().Verify( 2473doc.GetDiagnostics().Verify( 2547doc.GetDiagnostics().Verify( 2573doc.GetDiagnostics().Verify(
Parsing\CrefParsingTests.cs (1)
818UsingNode("operator }}}(A{A{T}})").GetDiagnostics().Verify();
Parsing\LambdaParameterParsingTests.cs (1)
647tree.GetDiagnostics().Verify(
Parsing\MemberDeclarationParsingTests.cs (4)
78if (d.GetDiagnostics().Any()) // some platforms have extra deep stacks and can parse this 80d.GetDiagnostics().Verify( 104if (cu.GetDiagnostics().Any()) // some platforms have extra deep stacks and can parse this 106cu.GetDiagnostics().Verify(
Parsing\ParserErrorMessageTests.cs (27)
5440tree.GetCompilationUnitRoot().GetDiagnostics().Verify(); 5443tree.GetCompilationUnitRoot().GetDiagnostics().Verify(); 5462tree.GetCompilationUnitRoot().GetDiagnostics().Verify(); 5465tree.GetCompilationUnitRoot().GetDiagnostics().Verify(); 5527tree.GetCompilationUnitRoot().GetDiagnostics().Verify(); 5530tree.GetCompilationUnitRoot().GetDiagnostics().Verify(); 5546tree.GetCompilationUnitRoot().GetDiagnostics().Verify(); 5549tree.GetCompilationUnitRoot().GetDiagnostics().Verify(); 5589tree.GetCompilationUnitRoot().GetDiagnostics().Verify(); 5592tree.GetCompilationUnitRoot().GetDiagnostics().Verify(); 5624tree.GetCompilationUnitRoot().GetDiagnostics().Verify(); 5627tree.GetCompilationUnitRoot().GetDiagnostics().Verify(); 5658tree.GetCompilationUnitRoot().GetDiagnostics().Verify(); 5661tree.GetCompilationUnitRoot().GetDiagnostics().Verify(); 5947tree.GetCompilationUnitRoot().GetDiagnostics().Verify(); 5965tree.GetCompilationUnitRoot().GetDiagnostics().Verify(); 5978tree.GetCompilationUnitRoot().GetDiagnostics().Verify(); 5986tree.GetCompilationUnitRoot().GetDiagnostics().Verify(); 6007tree.GetCompilationUnitRoot().GetDiagnostics().Verify(); 6014tree.GetCompilationUnitRoot().GetDiagnostics().Verify(); 6037tree.GetCompilationUnitRoot().GetDiagnostics().Verify(); 6050tree.GetCompilationUnitRoot().GetDiagnostics().Verify(); 6079tree.GetCompilationUnitRoot().GetDiagnostics().Verify(); 6092tree.GetCompilationUnitRoot().GetDiagnostics().Verify(); 6366tree.GetCompilationUnitRoot().GetDiagnostics().Verify( 6580var actualErrors = expr.GetDiagnostics().ToArray(); 6607var actualErrors = stmt.GetDiagnostics().ToArray();
Parsing\ParsingErrorRecoveryTests.cs (4)
5833file.GetDiagnostics().Verify( 5990file.GetDiagnostics().Verify( 6159file.GetDiagnostics().Verify( 7123file.GetDiagnostics().Verify(
Parsing\ParsingTests.cs (3)
116var actualErrors = node.GetDiagnostics(); 136var actualErrors = node.GetDiagnostics(); 159var actualErrors = _node.GetDiagnostics();
Parsing\PatternParsingTests.cs (14)
302SyntaxFactory.ParseExpression("e is A<B> && e").GetDiagnostics().Verify(); 303SyntaxFactory.ParseExpression("e is A<B> || e").GetDiagnostics().Verify(); 304SyntaxFactory.ParseExpression("e is A<B> ^ e").GetDiagnostics().Verify(); 305SyntaxFactory.ParseExpression("e is A<B> | e").GetDiagnostics().Verify(); 306SyntaxFactory.ParseExpression("e is A<B> & e").GetDiagnostics().Verify(); 307SyntaxFactory.ParseExpression("e is A<B>[]").GetDiagnostics().Verify(); 308SyntaxFactory.ParseExpression("new { X = e is A<B> }").GetDiagnostics().Verify(); 309SyntaxFactory.ParseExpression("e is A<B>").GetDiagnostics().Verify(); 311SyntaxFactory.ParseExpression("(item is Dictionary<string, object>[])").GetDiagnostics().Verify(); 312SyntaxFactory.ParseExpression("A is B < C, D > [ ]").GetDiagnostics().Verify(); 313SyntaxFactory.ParseExpression("A is B < C, D > [ ] E").GetDiagnostics().Verify(); 314SyntaxFactory.ParseExpression("A < B > C").GetDiagnostics().Verify(); 320SyntaxFactory.ParseExpression("from s in a where s is string where s.Length > 1 select s").GetDiagnostics().Verify(); 321SyntaxFactory.ParseExpression("M(out int? x)").GetDiagnostics().Verify();
Parsing\RoundTrippingTests.cs (2)
1594Assert.NotEmpty(typeOfExpression.GetDiagnostics()); 1598Assert.NotEmpty(typeOfExpression.GetDiagnostics());
Syntax\SyntaxFactoryTests.cs (2)
627parsedWith8.GetDiagnostics().Verify(); 630parsedWithPreview.GetDiagnostics().Verify();
Syntax\SyntaxNodeTests.cs (2)
361compilationUnit.GetDiagnostics().Verify( 489compilationUnit.GetDiagnostics().Verify(
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))