1 instantiation of AnalysisResult
Microsoft.CodeAnalysis (1)
DiagnosticAnalyzer\AnalysisResultBuilder.cs (1)
520return new AnalysisResult(analyzers, localSyntaxDiagnostics, localSemanticDiagnostics, localAdditionalFileDiagnostics, nonLocalDiagnostics, analyzerTelemetryInfo);
96 references to AnalysisResult
AnalyzerRunner (10)
DiagnosticAnalyzerRunner.cs (10)
314private static async Task<ImmutableDictionary<ProjectId, AnalysisResult>> GetAnalysisResultAsync( 320var projectDiagnosticBuilder = ImmutableDictionary.CreateBuilder<ProjectId, AnalysisResult>(); 324var projectDiagnosticTasks = new List<KeyValuePair<ProjectId, Task<AnalysisResult>>>(); 345projectDiagnosticTasks.Add(new KeyValuePair<ProjectId, Task<AnalysisResult>>(project.Id, resultTask)); 350var result = await task.Value.ConfigureAwait(false); 356if (projectDiagnosticBuilder.TryGetValue(task.Key, out var previousResult)) 379private static async Task<AnalysisResult> GetProjectAnalysisResultAsync( 397var analystResult = await compilationWithAnalyzers.GetAnalysisResultAsync(cancellationToken).ConfigureAwait(false); 407internal static void WriteTelemetry(ImmutableDictionary<ProjectId, AnalysisResult> dictionary) 415foreach (var analysisResult in dictionary.Values)
Microsoft.Analyzers.Local.Tests (1)
Resources\RoslynTestUtils.cs (1)
260var result = await comp!.WithAnalyzers(analyzers, options)
Microsoft.CodeAnalysis (38)
DiagnosticAnalyzer\AnalysisResultBuilder.cs (1)
499internal AnalysisResult ToAnalysisResult(ImmutableArray<DiagnosticAnalyzer> analyzers, AnalysisScope analysisScope, CancellationToken cancellationToken)
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (37)
261/// Executes all <see cref="Analyzers"/> and returns the corresponding <see cref="AnalysisResult"/> with all diagnostics and telemetry info. 263public async Task<AnalysisResult> GetAnalysisResultAsync(CancellationToken cancellationToken) 269/// Executes the given <paramref name="analyzers"/> and returns the corresponding <see cref="AnalysisResult"/> with all diagnostics and telemetry info. 273public async Task<AnalysisResult> GetAnalysisResultAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 349private async Task<AnalysisResult> GetAnalysisResultCoreAsync(ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 454/// Returns an <see cref="AnalysisResult"/> populated with <see cref="AnalysisResult.SyntaxDiagnostics"/> produced by all <see cref="Analyzers"/> from analyzing the given <paramref name="tree"/>. 459public Task<AnalysisResult> GetAnalysisResultAsync(SyntaxTree tree, CancellationToken cancellationToken) 467/// Returns an <see cref="AnalysisResult"/> populated with <see cref="AnalysisResult.SyntaxDiagnostics"/> produced by all <see cref="Analyzers"/> 474public Task<AnalysisResult> GetAnalysisResultAsync(SyntaxTree tree, TextSpan? filterSpan, CancellationToken cancellationToken) 482/// Returns an <see cref="AnalysisResult"/> populated with <see cref="AnalysisResult.SyntaxDiagnostics"/> produced by given <paramref name="analyzers"/> from analyzing the given <paramref name="tree"/>. 488public Task<AnalysisResult> GetAnalysisResultAsync(SyntaxTree tree, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 497/// Returns an <see cref="AnalysisResult"/> populated with <see cref="AnalysisResult.SyntaxDiagnostics"/> produced by given <paramref name="analyzers"/> 505public Task<AnalysisResult> GetAnalysisResultAsync(SyntaxTree tree, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 514/// Returns an <see cref="AnalysisResult"/> populated with <see cref="AnalysisResult.AdditionalFileDiagnostics"/> produced by all <see cref="Analyzers"/> from analyzing the given additional <paramref name="file"/>. 520public async Task<AnalysisResult> GetAnalysisResultAsync(AdditionalText file, CancellationToken cancellationToken) 528/// Returns an <see cref="AnalysisResult"/> populated with <see cref="AnalysisResult.AdditionalFileDiagnostics"/> produced by given <paramref name="analyzers"/> from analyzing the given additional <paramref name="file"/>. 535public async Task<AnalysisResult> GetAnalysisResultAsync(AdditionalText file, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 544/// Returns an <see cref="AnalysisResult"/> populated with <see cref="AnalysisResult.AdditionalFileDiagnostics"/> produced by all <see cref="Analyzers"/> from analyzing the given additional <paramref name="file"/>, 552public async Task<AnalysisResult> GetAnalysisResultAsync(AdditionalText file, TextSpan? filterSpan, CancellationToken cancellationToken) 560/// Returns an <see cref="AnalysisResult"/> populated with <see cref="AnalysisResult.AdditionalFileDiagnostics"/> produced by given <paramref name="analyzers"/> from analyzing the given additional <paramref name="file"/>, 569public async Task<AnalysisResult> GetAnalysisResultAsync(AdditionalText file, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 577private async Task<AnalysisResult> GetAnalysisResultCoreAsync(SourceOrAdditionalFile file, ImmutableArray<DiagnosticAnalyzer> analyzers, TextSpan? filterSpan, CancellationToken cancellationToken) 622/// Returns an <see cref="AnalysisResult"/> populated with <see cref="AnalysisResult.SemanticDiagnostics"/> produced by all <see cref="Analyzers"/> from analyzing the given <paramref name="model"/>, optionally scoped to a <paramref name="filterSpan"/>. 628public Task<AnalysisResult> GetAnalysisResultAsync(SemanticModel model, TextSpan? filterSpan, CancellationToken cancellationToken) 636/// Returns an <see cref="AnalysisResult"/> populated with <see cref="AnalysisResult.SemanticDiagnostics"/> produced by the given <paramref name="analyzers"/> from analyzing the given <paramref name="model"/>, optionally scoped to a <paramref name="filterSpan"/>. 643public Task<AnalysisResult> GetAnalysisResultAsync(SemanticModel model, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken) 651private async Task<AnalysisResult> GetAnalysisResultCoreAsync(SemanticModel model, TextSpan? filterSpan, ImmutableArray<DiagnosticAnalyzer> analyzers, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.CodeStyle (7)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
464var analysisResult = await compilationWithAnalyzers.GetAnalysisResultAsync(semanticModel.SyntaxTree, analyzers, cancellationToken).ConfigureAwait(false); 491static void AddAllCompilationDiagnosticsForTree(AnalysisResult analysisResult, SyntaxTree tree, ArrayBuilder<Diagnostic> reportedDiagnostics)
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (5)
48private static readonly ObjectPool<ConcurrentStack<AnalysisResult>> s_analysisResultPool = new(() => new()); 333ConcurrentStack<AnalysisResult> analysisResults) 534ConcurrentStack<AnalysisResult> analysisResults, 543foreach (var result in analysisResults) 636void ReportDiagnostics(AnalysisResult result)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderCodeFixProvider.cs (3)
96static AnalysisResult TrackAnalysisResult(SyntaxNode root, AnalysisResult analysisResult) 107AnalysisResult analysisResult,
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (13)
Diagnostics\DiagnosticAnalyzerTests.cs (7)
3696AnalysisResult analysisResult; 3759var analysisResult = await compilationWithAnalyzers.GetAnalysisResultAsync( 3815var analysisResult = await compilationWithAnalyzers.GetAnalysisResultAsync( 3892var analysisResult = await compilation.WithAnalyzers(analyzers, options).GetAnalysisResultAsync(additionalFile, CancellationToken.None); 3934var analysisResult = await compilation.WithAnalyzers(analyzers, options).GetAnalysisResultAsync(additionalFile1, CancellationToken.None); 3997AnalysisResult analysisResult, 4021static ImmutableArray<Diagnostic> getReportedDiagnostics(AnalysisResult analysisResult, DiagnosticAnalyzer analyzer, AdditionalText additionalFile)
Diagnostics\GetDiagnosticsTests.cs (6)
839var result = await compilationWithAnalyzers.GetAnalysisResultAsync(CancellationToken.None); 1065var result = await compilationWithAnalyzers.GetAnalysisResultAsync(semanticModel, span, CancellationToken.None); 1126var result = await compilationWithAnalyzers.GetAnalysisResultAsync(CancellationToken.None); 1524var syntaxResult = await compilationWithAnalyzers.GetAnalysisResultAsync(tree1, CancellationToken.None); 1553var result = await compilationWithAnalyzers.GetAnalysisResultAsync(model1, filterSpan: localDecl.Span, CancellationToken.None); 1699var result = await compilationWithAnalyzers.GetAnalysisResultAsync(CancellationToken.None);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Preview\PreviewWorkspaceTests.cs (1)
170var result = compilationWithAnalyzers.GetAnalysisResultAsync(CancellationToken.None).Result;
Microsoft.CodeAnalysis.Features (6)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
491static void AddAllCompilationDiagnosticsForTree(AnalysisResult analysisResult, SyntaxTree tree, ArrayBuilder<Diagnostic> reportedDiagnostics)
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (5)
48private static readonly ObjectPool<ConcurrentStack<AnalysisResult>> s_analysisResultPool = new(() => new()); 333ConcurrentStack<AnalysisResult> analysisResults) 534ConcurrentStack<AnalysisResult> analysisResults, 543foreach (var result in analysisResults) 636void ReportDiagnostics(AnalysisResult result)
Microsoft.CodeAnalysis.UnitTests (1)
Diagnostics\CompilationWithAnalyzersTests.cs (1)
64var analysisResult = compWithAnalyzers.GetAnalysisResultAsync(CancellationToken.None).Result;
Microsoft.CodeAnalysis.Workspaces (16)
Diagnostics\AnalysisResultPair.cs (8)
13private readonly AnalysisResult? _projectAnalysisResult; 14private readonly AnalysisResult? _hostAnalysisResult; 22public AnalysisResultPair(AnalysisResult? projectAnalysisResult, AnalysisResult? hostAnalysisResult) 36public AnalysisResult? ProjectAnalysisResult => _projectAnalysisResult; 38public AnalysisResult? HostAnalysisResult => _hostAnalysisResult; 165public static AnalysisResultPair? FromResult(AnalysisResult? projectAnalysisResult, AnalysisResult? hostAnalysisResult)
Diagnostics\CompilationWithAnalyzersPair.cs (8)
72var projectAnalysisResult = ProjectCompilationWithAnalyzers is not null 75var hostAnalysisResult = HostCompilationWithAnalyzers is not null 84var projectAnalysisResult = projectAnalyzers.Any() 87var hostAnalysisResult = hostAnalyzers.Any() 96var projectAnalysisResult = projectAnalyzers.Any() 99var hostAnalysisResult = hostAnalyzers.Any() 108var projectAnalysisResult = projectAnalyzers.Any() 111var hostAnalysisResult = hostAnalyzers.Any()