6 overrides of GetDiagnostics
Microsoft.CodeAnalysis.CSharp (3)
Compilation\MemberSemanticModel.cs (1)
586public sealed override ImmutableArray<Diagnostic> GetDiagnostics(TextSpan? span = null, CancellationToken cancellationToken = default(CancellationToken))
Compilation\SpeculativeSemanticModelWithMemberModel.cs (1)
250public override ImmutableArray<Diagnostic> GetDiagnostics(TextSpan? span = null, CancellationToken cancellationToken = default(CancellationToken))
Compilation\SyntaxTreeSemanticModel.cs (1)
135public override ImmutableArray<Diagnostic> GetDiagnostics(TextSpan? span = null, CancellationToken cancellationToken = default(CancellationToken))
Microsoft.CodeAnalysis.VisualBasic (3)
Binding\MemberSemanticModel.vb (1)
460Public NotOverridable Overrides Function GetDiagnostics(Optional span As TextSpan? = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of Diagnostic)
Compilation\SpeculativeSemanticModelWithMemberModel.vb (1)
149Public Overrides Function GetDiagnostics(Optional span As TextSpan? = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of Diagnostic)
Compilation\SyntaxTreeSemanticModel.vb (1)
93Public Overrides Function GetDiagnostics(Optional span As TextSpan? = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ImmutableArray(Of Diagnostic)
111 references to GetDiagnostics
Microsoft.AspNetCore.Components.Analyzers.Tests (1)
Helpers\CodeFixVerifier.Helper.cs (1)
70return document.GetSemanticModelAsync().Result.GetDiagnostics();
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (1)
Helpers\CodeFixVerifier.Helper.cs (1)
70return document.GetSemanticModelAsync().Result.GetDiagnostics();
Microsoft.CodeAnalysis (2)
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (1)
1035_ = mappedModel.GetDiagnostics(analysisScope.FilterSpanOpt, cancellationToken);
Operations\OperationExtensions.cs (1)
63return model.GetDiagnostics(operation.Syntax.Span, cancellationToken).Any(static d => d.DefaultSeverity == DiagnosticSeverity.Error);
Microsoft.CodeAnalysis.CodeStyle (1)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
456reportedDiagnostics.AddRange(semanticModel.GetDiagnostics(cancellationToken: cancellationToken));
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
184return semanticModel!.GetDiagnostics(cancellationToken: cancellationToken).WhereAsArray(
Microsoft.CodeAnalysis.CSharp (1)
Errors\ErrorFacts.cs (1)
580/// <see cref="SemanticModel.GetDiagnostics(Text.TextSpan?, System.Threading.CancellationToken)"/> API.
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Analyzers\CSharp\Analyzers\RemoveUnreachableCode\CSharpRemoveUnreachableCodeDiagnosticAnalyzer.cs (1)
60var diagnostics = semanticModel.GetDiagnostics(context.FilterSpan, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Helpers\RemoveUnnecessaryImports\CSharpUnnecessaryImportsProvider.cs (1)
30var diagnostics = model.GetDiagnostics(cancellationToken: cancellationToken);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
CodeGeneration\SyntaxGeneratorTests.cs (2)
49var diagnostics = semanticModel.GetDiagnostics(); 79var diagnostics = semanticModel.GetDiagnostics();
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
Emit\EntryPointTests.cs (1)
1598Assert.Empty(model.GetDiagnostics());
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (8)
Diagnostics\GetDiagnosticsTests.cs (4)
173model.GetDiagnostics(tree1.GetRoot().FullSpan); 222model.GetDiagnostics(tree1.GetRoot().FullSpan); 274model.GetDiagnostics(tree1.GetRoot().FullSpan); 324model.GetDiagnostics(tree.GetRoot().FullSpan);
Semantics\PrimaryConstructorTests.cs (4)
19787model.GetDiagnostics().Verify(); 21642model.GetDiagnostics().Verify( 22206comp.GetSemanticModel(comp.SyntaxTrees[0]).GetDiagnostics().Verify( 22212comp.GetSemanticModel(comp.SyntaxTrees[1]).GetDiagnostics().Verify();
Microsoft.CodeAnalysis.CSharp.Features (3)
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (1)
93!_semanticModel.GetDiagnostics(_source.Span, _cancellationToken).Any(static diagnostic => diagnostic.DefaultSeverity == DiagnosticSeverity.Error))
src\Analyzers\CSharp\Analyzers\RemoveUnreachableCode\CSharpRemoveUnreachableCodeDiagnosticAnalyzer.cs (1)
60var diagnostics = semanticModel.GetDiagnostics(context.FilterSpan, cancellationToken);
UsePatternMatching\CSharpIsAndCastCheckWithoutNameDiagnosticAnalyzer.cs (1)
205var diagnostics = updatedSemanticModel.GetDiagnostics(currentNode.Span, cancellationToken);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (49)
Semantics\GlobalUsingDirectiveTests.cs (39)
2906comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected2); 2907comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDiagnostics().Verify(expected3); 2910comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDiagnostics().Verify(expected3); 2911comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected2); 2914comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected3); 2915comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDiagnostics().Verify(expected2); 2918comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected1); 2992comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected2); 2993comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDiagnostics().Verify(expected3); 2996comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDiagnostics().Verify(expected3); 2997comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected2); 3000comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected3); 3001comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDiagnostics().Verify(expected2); 3004comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected1); 3078comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected2); 3079comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDiagnostics().Verify(expected3); 3082comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDiagnostics().Verify(expected3); 3083comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected2); 3086comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected3); 3087comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDiagnostics().Verify(expected2); 3090comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected1); 3245comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDiagnostics().Verify(expected1); 3248comp2.GetSemanticModel(comp2.SyntaxTrees[2]).GetDiagnostics().Verify(expected2); 3251comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected0); 3256comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics(TextSpan.FromBounds(20, comp2.SyntaxTrees[0].Length - 1)).Verify( 3264comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDiagnostics(TextSpan.FromBounds(20, comp2.SyntaxTrees[1].Length - 1)).Verify( 3272comp2.GetSemanticModel(comp2.SyntaxTrees[2]).GetDiagnostics(TextSpan.FromBounds(20, comp2.SyntaxTrees[2].Length - 1)).Verify( 3285comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDiagnostics().Verify(expected1); 3287comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDiagnostics().Verify(expected1); 3290comp2.GetSemanticModel(comp2.SyntaxTrees[2]).GetDiagnostics().Verify(expected2); 3292comp2.GetSemanticModel(comp2.SyntaxTrees[2]).GetDiagnostics().Verify(expected2); 3295comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected0); 3297comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected0); 3302comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDiagnostics().Verify(expected1); 3305comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected0); 3308comp2.GetSemanticModel(comp2.SyntaxTrees[2]).GetDiagnostics().Verify(expected2); 3313comp2.GetSemanticModel(comp2.SyntaxTrees[0]).GetDiagnostics().Verify(expected0); 3316comp2.GetSemanticModel(comp2.SyntaxTrees[1]).GetDiagnostics().Verify(expected1); 3319comp2.GetSemanticModel(comp2.SyntaxTrees[2]).GetDiagnostics().Verify(expected2);
Semantics\LambdaTests.cs (1)
8094model.GetDiagnostics().Verify();
Semantics\QueryTests.cs (3)
2522semanticModel.GetDiagnostics().Verify( 2663var diags = semanticModel.GetDiagnostics(); 2690var diags = semanticModel.GetDiagnostics();
Semantics\TopLevelStatementsTests.cs (4)
2925model1.GetDiagnostics(nameRef.Ancestors().OfType<StatementSyntax>().First().Span).Verify( 2930model1.GetDiagnostics().Verify( 2947model2.GetDiagnostics(nameRef.Ancestors().OfType<StatementSyntax>().First().Span).Verify( 2952model2.GetDiagnostics().Verify(
Semantics\UnsafeTests.cs (2)
11806model.GetDiagnostics().Verify(); 11903model.GetDiagnostics().Verify();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (16)
Compilation\CompilationAPITests.cs (2)
1942model2.GetDiagnostics().Verify(); // None, since the file is empty. 1960model2.GetDiagnostics().Verify(); // None, since the file is empty.
Compilation\GetSemanticInfoBrokenCodeTests.cs (1)
178var diagnostics = model.GetDiagnostics().ToArray();
Compilation\GetSemanticInfoTests.cs (4)
416var errs = model.GetDiagnostics(); 443var errs = model.GetDiagnostics(); 492var errs = model.GetDiagnostics(); 5783var errs = model.GetDiagnostics();
Compilation\GetUnusedImportDirectivesTests.cs (3)
102model.GetDiagnostics().Verify(Diagnostic(ErrorCode.HDN_UnusedUsingDirective, "using ClassLibrary2;")); 428model.GetDiagnostics().Verify( 456model.GetDiagnostics().Verify(
Compilation\SemanticModelAPITests.cs (1)
518var errs = comp.GetSemanticModel(partial1Tree).GetDiagnostics();
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (3)
3789var diagnostics = model.GetDiagnostics(); 3807var diagnostics = model.GetDiagnostics(); 3826var diagnostics = model.GetDiagnostics();
DocumentationComments\DocumentationCommentCompilerTests.cs (2)
3166comp.GetSemanticModel(tree1).GetDiagnostics().Verify( 3170comp.GetSemanticModel(tree2).GetDiagnostics().Verify(
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
Simplification\CSharpSimplificationService.cs (1)
189var diagnostics = model.GetDiagnostics(cancellationToken: cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Helpers\RemoveUnnecessaryImports\CSharpUnnecessaryImportsProvider.cs (1)
30var diagnostics = model.GetDiagnostics(cancellationToken: cancellationToken);
Microsoft.CodeAnalysis.Features (1)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
456reportedDiagnostics.AddRange(semanticModel.GetDiagnostics(cancellationToken: cancellationToken));
Microsoft.CodeAnalysis.Test.Utilities (2)
Compilation\ControlFlowGraphVerifier.cs (1)
350if (model.GetDiagnostics(graph.OriginalOperation.Syntax.Span).
Diagnostics\DiagnosticsHelper.cs (1)
35VerifyDiagnostics(model.GetDiagnostics(FindSpan(source, pattern)), expectedDiagnosticIds);
Microsoft.CodeAnalysis.VisualBasic (1)
Errors\ErrorFacts.vb (1)
9''' <see cref="SemanticModel.GetDiagnostics(Text.TextSpan?, System.Threading.CancellationToken)"/> API.
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Helpers\RemoveUnnecessaryImports\VisualBasicUnnecessaryImportsProvider.vb (2)
32Dim diagnostics = model.GetDiagnostics(cancellationToken:=cancellationToken) 80Dim diagnostics = updatedModel.GetDiagnostics(cancellationToken:=cancellationToken)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (2)
Compilation\CompilationAPITests.vb (1)
1461Dim diagnostics2 = semanticModel2.GetDiagnostics()
Compilation\GetSemanticInfoBrokenCodeTests.vb (1)
424Dim diagnostics = model.GetDiagnostics().ToArray()
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (2)
DocumentationComments\DocCommentTests.vb (2)
678CompilationUtils.AssertTheseDiagnostics(model.GetDiagnostics(), <error></error>) 681CompilationUtils.AssertTheseDiagnostics(model.GetDiagnostics(), <error></error>)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (3)
Simplification\VisualBasicSimplificationService.vb (1)
166Dim diagnostics = model.GetDiagnostics(cancellationToken:=cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Helpers\RemoveUnnecessaryImports\VisualBasicUnnecessaryImportsProvider.vb (2)
32Dim diagnostics = model.GetDiagnostics(cancellationToken:=cancellationToken) 80Dim diagnostics = updatedModel.GetDiagnostics(cancellationToken:=cancellationToken)
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
184return semanticModel!.GetDiagnostics(cancellationToken: cancellationToken).WhereAsArray(
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (6)
NetCoreTests.cs (6)
92var diagnostics = semanticModel.GetDiagnostics(); 117var diagnostics = semanticModel.GetDiagnostics(); 157var diagnostics = semanticModel.GetDiagnostics(); 217var diagnostics = semanticModel.GetDiagnostics(); 341var diagnostics = semanticModel.GetDiagnostics(); 508var diagnostics = semanticModel.GetDiagnostics();
Microsoft.VisualStudio.LanguageServices.UnitTests (1)
Venus\DocumentService_IntegrationTests.vb (1)
230Assert.True(model.GetDiagnostics().Any())