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