11 instantiations of CompilationWithAnalyzers
Microsoft.CodeAnalysis (4)
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (1)
69/// <inheritdoc cref="CompilationWithAnalyzers(Compilation, ImmutableArray{DiagnosticAnalyzer}, AnalyzerOptions?)"/>
DiagnosticAnalyzer\DiagnosticAnalyzerExtensions.cs (3)
19return new CompilationWithAnalyzers(compilation, analyzers, options, cancellationToken); 32return new CompilationWithAnalyzers(compilation, analyzers, options); 43return new CompilationWithAnalyzers(compilation, analyzers, analysisOptions);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (5)
Diagnostics\DiagnosticAnalyzerTests.cs (4)
3605var compWithAnalyzers = new CompilationWithAnalyzers( 4438var compWithAnalyzers = new CompilationWithAnalyzers( 4601var compWithAnalyzers = new CompilationWithAnalyzers( 4626var compWithAnalyzers = new CompilationWithAnalyzers(
Diagnostics\DiagnosticSuppressorTests.cs (1)
715var compilationWithAnalyzers = new CompilationWithAnalyzers(compilation, analyzersAndSuppressors.ToImmutableArray(), options);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Preview\PreviewWorkspaceTests.cs (1)
169var compilationWithAnalyzers = new CompilationWithAnalyzers(compilation, analyzers, compilationWithAnalyzersOptions);
Microsoft.CodeAnalysis.UnitTests (1)
Diagnostics\CompilationWithAnalyzersTests.cs (1)
62var compWithAnalyzers = new CompilationWithAnalyzers(compilation, analyzers, analyzerOptions);
109 references to CompilationWithAnalyzers
AnalyzerRunner (2)
DiagnosticAnalyzerRunner.cs (2)
190CompilationWithAnalyzers compilationWithAnalyzers = compilation.WithAnalyzers(languageAnalyzers, new CompilationWithAnalyzersOptions(project.AnalyzerOptions, null, analyzerOptionsInternal.RunConcurrent, logAnalyzerExecutionTime: true, reportSuppressedDiagnostics: analyzerOptionsInternal.ReportSuppressedDiagnostics)); 396var compilationWithAnalyzers = newCompilation.WithAnalyzers(analyzers, new CompilationWithAnalyzersOptions(project.AnalyzerOptions, null, analyzerOptionsInternal.RunConcurrent, logAnalyzerExecutionTime: true, reportSuppressedDiagnostics: analyzerOptionsInternal.ReportSuppressedDiagnostics));
GenerateDocumentationAndConfigFiles (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
25CompilationWithAnalyzers hostCompilationWithAnalyzers,
Metrics (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
25CompilationWithAnalyzers hostCompilationWithAnalyzers,
Metrics.Legacy (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
25CompilationWithAnalyzers hostCompilationWithAnalyzers,
Microsoft.AspNetCore.Analyzer.Testing (2)
DiagnosticAnalyzerRunner.cs (1)
73var compilationWithAnalyzers = compilation
DiagnosticVerifier.cs (1)
93var compilationWithAnalyzers = compilation
Microsoft.AspNetCore.Components.Analyzers.Tests (1)
Helpers\DiagnosticVerifier.Helper.cs (1)
62var compilationWithAnalyzers = project.GetCompilationAsync().Result.WithAnalyzers(ImmutableArray.Create(analyzer));
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (1)
Helpers\DiagnosticVerifier.Helper.cs (1)
62var compilationWithAnalyzers = project.GetCompilationAsync().Result.WithAnalyzers(ImmutableArray.Create(analyzer));
Microsoft.CodeAnalysis (24)
DiagnosticAnalyzer\AnalysisScope.cs (7)
75/// Flag indicating if this analysis scope contains all analyzers from the corresponding <see cref="CompilationWithAnalyzers"/>, 76/// i.e. <see cref="Analyzers"/> is the same set as <see cref="CompilationWithAnalyzers.Analyzers"/>. 96public static AnalysisScope Create(Compilation compilation, ImmutableArray<DiagnosticAnalyzer> analyzers, CompilationWithAnalyzers compilationWithAnalyzers) 117public static AnalysisScope Create(ImmutableArray<DiagnosticAnalyzer> analyzers, SourceOrAdditionalFile filterFile, TextSpan? filterSpan, bool isSyntacticSingleFileAnalysis, CompilationWithAnalyzers compilationWithAnalyzers) 120public static AnalysisScope Create(ImmutableArray<DiagnosticAnalyzer> analyzers, SourceOrAdditionalFile filterFile, TextSpan? filterSpan, SourceOrAdditionalFile originalFilterFile, TextSpan? originalFilterSpan, bool isSyntacticSingleFileAnalysis, CompilationWithAnalyzers compilationWithAnalyzers) 191public AnalysisScope WithAnalyzers(ImmutableArray<DiagnosticAnalyzer> analyzers, CompilationWithAnalyzers compilationWithAnalyzers) 197private static bool ComputeHasAllAnalyzers(ImmutableArray<DiagnosticAnalyzer> analyzers, CompilationWithAnalyzers compilationWithAnalyzers)
DiagnosticAnalyzer\CachingSemanticModelProvider.cs (1)
17/// For example, <see cref="CompilationWithAnalyzers"/> uses this provider to ensure that semantic model instances
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (11)
251/// <param name="analyzers">Analyzers whose diagnostics are required. All the given analyzers must be from the analyzers passed into the constructor of <see cref="CompilationWithAnalyzers"/>.</param> 271/// <param name="analyzers">Analyzers whose analysis results are required. All the given analyzers must be from the analyzers passed into the constructor of <see cref="CompilationWithAnalyzers"/>.</param> 332/// <param name="analyzers">Analyzers whose diagnostics are required. All the given analyzers must be from the analyzers passed into the constructor of <see cref="CompilationWithAnalyzers"/>.</param> 425/// <param name="analyzers">Analyzers whose diagnostics are required. All the given analyzers must be from the analyzers passed into the constructor of <see cref="CompilationWithAnalyzers"/>.</param> 442/// <param name="analyzers">Analyzers whose diagnostics are required. All the given analyzers must be from the analyzers passed into the constructor of <see cref="CompilationWithAnalyzers"/>.</param> 486/// <param name="analyzers">Analyzers whose diagnostics are required. All the given analyzers must be from the analyzers passed into the constructor of <see cref="CompilationWithAnalyzers"/>.</param> 502/// <param name="analyzers">Analyzers whose diagnostics are required. All the given analyzers must be from the analyzers passed into the constructor of <see cref="CompilationWithAnalyzers"/>.</param> 533/// <param name="analyzers">Analyzers whose diagnostics are required. All the given analyzers must be from the analyzers passed into the constructor of <see cref="CompilationWithAnalyzers"/>.</param> 567/// <param name="analyzers">Analyzers whose diagnostics are required. All the given analyzers must be from the analyzers passed into the constructor of <see cref="CompilationWithAnalyzers"/>.</param> 611/// <param name="analyzers">Analyzers whose diagnostics are required. All the given analyzers must be from the analyzers passed into the constructor of <see cref="CompilationWithAnalyzers"/>.</param> 641/// <param name="analyzers">Analyzers whose diagnostics are required. All the given analyzers must be from the analyzers passed into the constructor of <see cref="CompilationWithAnalyzers"/>.</param>
DiagnosticAnalyzer\CompilationWithAnalyzersOptions.cs (1)
10/// Options to configure analyzer execution within <see cref="CompilationWithAnalyzers"/>.
DiagnosticAnalyzer\DiagnosticAnalyzerExtensions.cs (4)
17public static CompilationWithAnalyzers WithAnalyzers(this Compilation compilation, ImmutableArray<DiagnosticAnalyzer> analyzers, AnalyzerOptions? options, CancellationToken cancellationToken) 29public static CompilationWithAnalyzers WithAnalyzers(this Compilation compilation, ImmutableArray<DiagnosticAnalyzer> analyzers, AnalyzerOptions? options = null) 40/// <param name="analysisOptions">Options to configure analyzer execution within <see cref="CompilationWithAnalyzers"/>.</param> 41public static CompilationWithAnalyzers WithAnalyzers(this Compilation compilation, ImmutableArray<DiagnosticAnalyzer> analyzers, CompilationWithAnalyzersOptions analysisOptions)
Microsoft.CodeAnalysis.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
25CompilationWithAnalyzers hostCompilationWithAnalyzers,
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
25CompilationWithAnalyzers hostCompilationWithAnalyzers,
Microsoft.CodeAnalysis.BannedApiAnalyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
25CompilationWithAnalyzers hostCompilationWithAnalyzers,
Microsoft.CodeAnalysis.CodeStyle (5)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (4)
87CompilationWithAnalyzers compilationWithAnalyzers, 393CompilationWithAnalyzers compilationWithAnalyzers, 509CompilationWithAnalyzers compilationWithAnalyzers, 621var effectiveDiagnostics = CompilationWithAnalyzers.GetEffectiveDiagnostics(diagnosticsBuilder, compilation);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
25CompilationWithAnalyzers hostCompilationWithAnalyzers,
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (26)
Diagnostics\DiagnosticAnalyzerTests.cs (12)
3267var compilationWithAnalyzers = compilation.WithAnalyzers(analyzers); 3313var compilationWithAnalyzers = compilation.WithAnalyzers(analyzers); 3350var compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer1, analyzer2)); 3605var compWithAnalyzers = new CompilationWithAnalyzers( 3688var compilationWithAnalyzers = compilation.WithAnalyzers(allAnalyzers); 3755var compilationWithAnalyzers = compilation.WithAnalyzers(allAnalyzers); 3815var compilationWithAnalyzers = compilation.WithAnalyzers(analyzers); 4230var compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer)); 4319var compilationWithAnalyzers = compilation.WithAnalyzers(analyzers, options); 4438var compWithAnalyzers = new CompilationWithAnalyzers( 4601var compWithAnalyzers = new CompilationWithAnalyzers( 4626var compWithAnalyzers = new CompilationWithAnalyzers(
Diagnostics\DiagnosticSuppressorTests.cs (1)
715var compilationWithAnalyzers = new CompilationWithAnalyzers(compilation, analyzersAndSuppressors.ToImmutableArray(), options);
Diagnostics\GetDiagnosticsTests.cs (13)
645var effectiveDiagnostics = CompilationWithAnalyzers.GetEffectiveDiagnostics(diagnostics, compilation); 678var compilationWithAnalyzers = compilation.WithAnalyzers(analyzers, new AnalyzerOptions(ImmutableArray<AdditionalText>.Empty)); 740var compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create(analyzer), analyzerOptions); 788var compilationWithAnalyzers = compilation.WithAnalyzers(analyzers, 841var compilationWithAnalyzers = compilation.WithAnalyzers(analyzers, 870var compilationWithAnalyzers = compilation.WithAnalyzers(analyzers, 910var compilationWithAnalyzers = compilation.WithAnalyzers(analyzers, AnalyzerOptions.Empty); 963var compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer), AnalyzerOptions.Empty); 1189var compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(compilerAnalyzer), AnalyzerOptions.Empty); 1249var compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer), AnalyzerOptions.Empty); 1564var compilationWithAnalyzers = compilation.WithAnalyzers(analyzers); 1644var compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer), AnalyzerOptions.Empty); 1823var compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer), AnalyzerOptions.Empty);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Preview\PreviewWorkspaceTests.cs (1)
169var compilationWithAnalyzers = new CompilationWithAnalyzers(compilation, analyzers, compilationWithAnalyzersOptions);
Microsoft.CodeAnalysis.Features (22)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Pragma.cs (1)
213var effectiveDiagnostic = CompilationWithAnalyzers.GetEffectiveDiagnostics([dummyDiagnosticWithLocationToCheck], model.Compilation).FirstOrDefault();
Diagnostics\Service\DiagnosticAnalyzerService.cs (1)
128Project project, CompilationWithAnalyzers compilationWithAnalyzers, bool logPerformanceInfo, bool getTelemetryInfo, CancellationToken cancellationToken)
Diagnostics\Service\DiagnosticAnalyzerService_CompilationWithAnalyzersPair.cs (5)
20/// Cached data from a <see cref="ProjectState"/> to the <see cref="CompilationWithAnalyzers"/>s 35AsyncLazy<CompilationWithAnalyzers?>>> s_projectToCompilationWithAnalyzers = new(); 42private static async Task<CompilationWithAnalyzers?> GetOrCreateCompilationWithAnalyzers_OnlyCallInProcessAsync( 59AsyncLazy<CompilationWithAnalyzers?>? lazy; 77static async Task<CompilationWithAnalyzers?> CreateCompilationWithAnalyzersAsync(
Diagnostics\Service\DiagnosticAnalyzerService_ComputeDiagnosticAnalysisResults.cs (1)
26CompilationWithAnalyzers? compilationWithAnalyzers,
Diagnostics\Service\DiagnosticAnalyzerService_CoreAnalyze.cs (2)
30CompilationWithAnalyzers compilationWithAnalyzers, 190CompilationWithAnalyzers hostCompilationWithAnalyzers,
Diagnostics\Service\DiagnosticAnalyzerService_DeprioritizationCandidates.cs (1)
47CompilationWithAnalyzers? compilationWithAnalyzers = null;
Diagnostics\Service\DiagnosticAnalyzerService_GetDiagnosticsForSpan.cs (1)
292var compilationWithAnalyzers = await GetOrCreateCompilationWithAnalyzers_OnlyCallInProcessAsync(
Diagnostics\Service\DiagnosticAnalyzerService_ProduceProjectDiagnostics.cs (1)
170var compilation = await GetOrCreateCompilationWithAnalyzers_OnlyCallInProcessAsync(
Diagnostics\Service\DocumentAnalysisExecutor.cs (3)
31private readonly CompilationWithAnalyzers? _compilationWithAnalyzers; 43CompilationWithAnalyzers? compilationWithAnalyzers, 142Debug.Assert(diags.Length == CompilationWithAnalyzers.GetEffectiveDiagnostics(diags, compilation).Count());
Diagnostics\Service\DocumentAnalysisExecutor_Helpers.cs (1)
114diagnostics = CompilationWithAnalyzers.GetEffectiveDiagnostics(diagnostics, compilation).ToImmutableArrayOrEmpty();
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (4)
87CompilationWithAnalyzers compilationWithAnalyzers, 393CompilationWithAnalyzers compilationWithAnalyzers, 509CompilationWithAnalyzers compilationWithAnalyzers, 621var effectiveDiagnostics = CompilationWithAnalyzers.GetEffectiveDiagnostics(diagnosticsBuilder, compilation);
SyncNamespaces\AbstractSyncNamespacesService.cs (1)
90var analyzerCompilation = compilation.WithAnalyzers(diagnosticAnalyzers, analyzerOptions);
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
25CompilationWithAnalyzers hostCompilationWithAnalyzers,
Microsoft.CodeAnalysis.PublicApiAnalyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
25CompilationWithAnalyzers hostCompilationWithAnalyzers,
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
25CompilationWithAnalyzers hostCompilationWithAnalyzers,
Microsoft.CodeAnalysis.Test.Utilities (2)
Diagnostics\DiagnosticExtensions.cs (2)
341return CompilationWithAnalyzers.GetEffectiveDiagnostics(diagnostics, compilation); 350return CompilationWithAnalyzers.IsDiagnosticAnalyzerSuppressed(analyzer, options);
Microsoft.CodeAnalysis.UnitTests (7)
AnalyzerAssemblyLoaderTests.cs (1)
1188var compilationWithAnalyzers = compilation.WithAnalyzers(analyzers);
Diagnostics\CompilationWithAnalyzersTests.cs (6)
31Assert.Throws<ArgumentNullException>(() => CompilationWithAnalyzers.GetEffectiveDiagnostics(default(ImmutableArray<Diagnostic>), c)); 32Assert.Throws<ArgumentNullException>(() => CompilationWithAnalyzers.GetEffectiveDiagnostics(null, c)); 33Assert.Throws<ArgumentNullException>(() => CompilationWithAnalyzers.GetEffectiveDiagnostics(ds, null)); 47var filtered = CompilationWithAnalyzers.GetEffectiveDiagnostics(ds, c); 62var compWithAnalyzers = new CompilationWithAnalyzers(compilation, analyzers, analyzerOptions); 77_ = CompilationWithAnalyzers.IsDiagnosticAnalyzerSuppressed(analyzer, s_dllWithMaxWarningLevel, onAnalyzerException: null);
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
25CompilationWithAnalyzers hostCompilationWithAnalyzers,
Roslyn.Diagnostics.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
25CompilationWithAnalyzers hostCompilationWithAnalyzers,
Roslyn.VisualStudio.Next.UnitTests (3)
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (3)
160var compilationWithAnalyzers = 200var compilationWithAnalyzers = 230var compilationWithAnalyzers = (await project.GetCompilationAsync()).WithAnalyzers(
Test.Utilities (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
25CompilationWithAnalyzers hostCompilationWithAnalyzers,
Text.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
25CompilationWithAnalyzers hostCompilationWithAnalyzers,