11 instantiations of CompilationWithAnalyzers
Microsoft.CodeAnalysis (4)
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (1)
69
/// <inheritdoc cref="
CompilationWithAnalyzers
(Compilation, ImmutableArray{DiagnosticAnalyzer}, AnalyzerOptions?)"/>
DiagnosticAnalyzer\DiagnosticAnalyzerExtensions.cs (3)
19
return new
CompilationWithAnalyzers
(compilation, analyzers, options, cancellationToken);
32
return new
CompilationWithAnalyzers
(compilation, analyzers, options);
43
return new
CompilationWithAnalyzers
(compilation, analyzers, analysisOptions);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (5)
Diagnostics\DiagnosticAnalyzerTests.cs (4)
3605
var compWithAnalyzers = new
CompilationWithAnalyzers
(
4438
var compWithAnalyzers = new
CompilationWithAnalyzers
(
4601
var compWithAnalyzers = new
CompilationWithAnalyzers
(
4626
var compWithAnalyzers = new
CompilationWithAnalyzers
(
Diagnostics\DiagnosticSuppressorTests.cs (1)
715
var compilationWithAnalyzers = new
CompilationWithAnalyzers
(compilation, analyzersAndSuppressors.ToImmutableArray(), options);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Preview\PreviewWorkspaceTests.cs (1)
169
var compilationWithAnalyzers = new
CompilationWithAnalyzers
(compilation, analyzers, compilationWithAnalyzersOptions);
Microsoft.CodeAnalysis.UnitTests (1)
Diagnostics\CompilationWithAnalyzersTests.cs (1)
62
var compWithAnalyzers = new
CompilationWithAnalyzers
(compilation, analyzers, analyzerOptions);
109 references to CompilationWithAnalyzers
AnalyzerRunner (2)
DiagnosticAnalyzerRunner.cs (2)
190
CompilationWithAnalyzers
compilationWithAnalyzers = compilation.WithAnalyzers(languageAnalyzers, new CompilationWithAnalyzersOptions(project.AnalyzerOptions, null, analyzerOptionsInternal.RunConcurrent, logAnalyzerExecutionTime: true, reportSuppressedDiagnostics: analyzerOptionsInternal.ReportSuppressedDiagnostics));
396
var
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)
25
CompilationWithAnalyzers
hostCompilationWithAnalyzers,
Metrics (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
25
CompilationWithAnalyzers
hostCompilationWithAnalyzers,
Metrics.Legacy (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
25
CompilationWithAnalyzers
hostCompilationWithAnalyzers,
Microsoft.AspNetCore.Analyzer.Testing (2)
DiagnosticAnalyzerRunner.cs (1)
73
var
compilationWithAnalyzers = compilation
DiagnosticVerifier.cs (1)
93
var
compilationWithAnalyzers = compilation
Microsoft.AspNetCore.Components.Analyzers.Tests (1)
Helpers\DiagnosticVerifier.Helper.cs (1)
62
var
compilationWithAnalyzers = project.GetCompilationAsync().Result.WithAnalyzers(ImmutableArray.Create(analyzer));
Microsoft.AspNetCore.Components.SdkAnalyzers.Tests (1)
Helpers\DiagnosticVerifier.Helper.cs (1)
62
var
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"/>.
96
public static AnalysisScope Create(Compilation compilation, ImmutableArray<DiagnosticAnalyzer> analyzers,
CompilationWithAnalyzers
compilationWithAnalyzers)
117
public static AnalysisScope Create(ImmutableArray<DiagnosticAnalyzer> analyzers, SourceOrAdditionalFile filterFile, TextSpan? filterSpan, bool isSyntacticSingleFileAnalysis,
CompilationWithAnalyzers
compilationWithAnalyzers)
120
public static AnalysisScope Create(ImmutableArray<DiagnosticAnalyzer> analyzers, SourceOrAdditionalFile filterFile, TextSpan? filterSpan, SourceOrAdditionalFile originalFilterFile, TextSpan? originalFilterSpan, bool isSyntacticSingleFileAnalysis,
CompilationWithAnalyzers
compilationWithAnalyzers)
191
public AnalysisScope WithAnalyzers(ImmutableArray<DiagnosticAnalyzer> analyzers,
CompilationWithAnalyzers
compilationWithAnalyzers)
197
private 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)
17
public static
CompilationWithAnalyzers
WithAnalyzers(this Compilation compilation, ImmutableArray<DiagnosticAnalyzer> analyzers, AnalyzerOptions? options, CancellationToken cancellationToken)
29
public 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>
41
public static
CompilationWithAnalyzers
WithAnalyzers(this Compilation compilation, ImmutableArray<DiagnosticAnalyzer> analyzers, CompilationWithAnalyzersOptions analysisOptions)
Microsoft.CodeAnalysis.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
25
CompilationWithAnalyzers
hostCompilationWithAnalyzers,
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
25
CompilationWithAnalyzers
hostCompilationWithAnalyzers,
Microsoft.CodeAnalysis.BannedApiAnalyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
25
CompilationWithAnalyzers
hostCompilationWithAnalyzers,
Microsoft.CodeAnalysis.CodeStyle (5)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (4)
87
CompilationWithAnalyzers
compilationWithAnalyzers,
393
CompilationWithAnalyzers
compilationWithAnalyzers,
509
CompilationWithAnalyzers
compilationWithAnalyzers,
621
var effectiveDiagnostics =
CompilationWithAnalyzers
.GetEffectiveDiagnostics(diagnosticsBuilder, compilation);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
25
CompilationWithAnalyzers
hostCompilationWithAnalyzers,
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (26)
Diagnostics\DiagnosticAnalyzerTests.cs (12)
3267
var
compilationWithAnalyzers = compilation.WithAnalyzers(analyzers);
3313
var
compilationWithAnalyzers = compilation.WithAnalyzers(analyzers);
3350
var
compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer1, analyzer2));
3605
var
compWithAnalyzers = new CompilationWithAnalyzers(
3688
var
compilationWithAnalyzers = compilation.WithAnalyzers(allAnalyzers);
3755
var
compilationWithAnalyzers = compilation.WithAnalyzers(allAnalyzers);
3815
var
compilationWithAnalyzers = compilation.WithAnalyzers(analyzers);
4230
var
compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer));
4319
var
compilationWithAnalyzers = compilation.WithAnalyzers(analyzers, options);
4438
var
compWithAnalyzers = new CompilationWithAnalyzers(
4601
var
compWithAnalyzers = new CompilationWithAnalyzers(
4626
var
compWithAnalyzers = new CompilationWithAnalyzers(
Diagnostics\DiagnosticSuppressorTests.cs (1)
715
var
compilationWithAnalyzers = new CompilationWithAnalyzers(compilation, analyzersAndSuppressors.ToImmutableArray(), options);
Diagnostics\GetDiagnosticsTests.cs (13)
645
var effectiveDiagnostics =
CompilationWithAnalyzers
.GetEffectiveDiagnostics(diagnostics, compilation);
678
var
compilationWithAnalyzers = compilation.WithAnalyzers(analyzers, new AnalyzerOptions(ImmutableArray<AdditionalText>.Empty));
740
var
compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create(analyzer), analyzerOptions);
788
var
compilationWithAnalyzers = compilation.WithAnalyzers(analyzers,
841
var
compilationWithAnalyzers = compilation.WithAnalyzers(analyzers,
870
var
compilationWithAnalyzers = compilation.WithAnalyzers(analyzers,
910
var
compilationWithAnalyzers = compilation.WithAnalyzers(analyzers, AnalyzerOptions.Empty);
963
var
compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer), AnalyzerOptions.Empty);
1189
var
compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(compilerAnalyzer), AnalyzerOptions.Empty);
1249
var
compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer), AnalyzerOptions.Empty);
1564
var
compilationWithAnalyzers = compilation.WithAnalyzers(analyzers);
1644
var
compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer), AnalyzerOptions.Empty);
1823
var
compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer), AnalyzerOptions.Empty);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Preview\PreviewWorkspaceTests.cs (1)
169
var
compilationWithAnalyzers = new CompilationWithAnalyzers(compilation, analyzers, compilationWithAnalyzersOptions);
Microsoft.CodeAnalysis.Features (22)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Pragma.cs (1)
213
var effectiveDiagnostic =
CompilationWithAnalyzers
.GetEffectiveDiagnostics([dummyDiagnosticWithLocationToCheck], model.Compilation).FirstOrDefault();
Diagnostics\Service\DiagnosticAnalyzerService.cs (1)
128
Project 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
35
AsyncLazy<
CompilationWithAnalyzers
?>>> s_projectToCompilationWithAnalyzers = new();
42
private static async Task<
CompilationWithAnalyzers
?> GetOrCreateCompilationWithAnalyzers_OnlyCallInProcessAsync(
59
AsyncLazy<
CompilationWithAnalyzers
?>? lazy;
77
static async Task<
CompilationWithAnalyzers
?> CreateCompilationWithAnalyzersAsync(
Diagnostics\Service\DiagnosticAnalyzerService_ComputeDiagnosticAnalysisResults.cs (1)
26
CompilationWithAnalyzers
? compilationWithAnalyzers,
Diagnostics\Service\DiagnosticAnalyzerService_CoreAnalyze.cs (2)
30
CompilationWithAnalyzers
compilationWithAnalyzers,
190
CompilationWithAnalyzers
hostCompilationWithAnalyzers,
Diagnostics\Service\DiagnosticAnalyzerService_DeprioritizationCandidates.cs (1)
47
CompilationWithAnalyzers
? compilationWithAnalyzers = null;
Diagnostics\Service\DiagnosticAnalyzerService_GetDiagnosticsForSpan.cs (1)
292
var
compilationWithAnalyzers = await GetOrCreateCompilationWithAnalyzers_OnlyCallInProcessAsync(
Diagnostics\Service\DiagnosticAnalyzerService_ProduceProjectDiagnostics.cs (1)
170
var
compilation = await GetOrCreateCompilationWithAnalyzers_OnlyCallInProcessAsync(
Diagnostics\Service\DocumentAnalysisExecutor.cs (3)
31
private readonly
CompilationWithAnalyzers
? _compilationWithAnalyzers;
43
CompilationWithAnalyzers
? compilationWithAnalyzers,
142
Debug.Assert(diags.Length ==
CompilationWithAnalyzers
.GetEffectiveDiagnostics(diags, compilation).Count());
Diagnostics\Service\DocumentAnalysisExecutor_Helpers.cs (1)
114
diagnostics =
CompilationWithAnalyzers
.GetEffectiveDiagnostics(diagnostics, compilation).ToImmutableArrayOrEmpty();
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (4)
87
CompilationWithAnalyzers
compilationWithAnalyzers,
393
CompilationWithAnalyzers
compilationWithAnalyzers,
509
CompilationWithAnalyzers
compilationWithAnalyzers,
621
var effectiveDiagnostics =
CompilationWithAnalyzers
.GetEffectiveDiagnostics(diagnosticsBuilder, compilation);
SyncNamespaces\AbstractSyncNamespacesService.cs (1)
90
var
analyzerCompilation = compilation.WithAnalyzers(diagnosticAnalyzers, analyzerOptions);
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
25
CompilationWithAnalyzers
hostCompilationWithAnalyzers,
Microsoft.CodeAnalysis.PublicApiAnalyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
25
CompilationWithAnalyzers
hostCompilationWithAnalyzers,
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
25
CompilationWithAnalyzers
hostCompilationWithAnalyzers,
Microsoft.CodeAnalysis.Test.Utilities (2)
Diagnostics\DiagnosticExtensions.cs (2)
341
return
CompilationWithAnalyzers
.GetEffectiveDiagnostics(diagnostics, compilation);
350
return
CompilationWithAnalyzers
.IsDiagnosticAnalyzerSuppressed(analyzer, options);
Microsoft.CodeAnalysis.UnitTests (7)
AnalyzerAssemblyLoaderTests.cs (1)
1188
var
compilationWithAnalyzers = compilation.WithAnalyzers(analyzers);
Diagnostics\CompilationWithAnalyzersTests.cs (6)
31
Assert.Throws<ArgumentNullException>(() =>
CompilationWithAnalyzers
.GetEffectiveDiagnostics(default(ImmutableArray<Diagnostic>), c));
32
Assert.Throws<ArgumentNullException>(() =>
CompilationWithAnalyzers
.GetEffectiveDiagnostics(null, c));
33
Assert.Throws<ArgumentNullException>(() =>
CompilationWithAnalyzers
.GetEffectiveDiagnostics(ds, null));
47
var filtered =
CompilationWithAnalyzers
.GetEffectiveDiagnostics(ds, c);
62
var
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)
25
CompilationWithAnalyzers
hostCompilationWithAnalyzers,
Roslyn.Diagnostics.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
25
CompilationWithAnalyzers
hostCompilationWithAnalyzers,
Roslyn.VisualStudio.Next.UnitTests (3)
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (3)
160
var
compilationWithAnalyzers =
200
var
compilationWithAnalyzers =
230
var
compilationWithAnalyzers = (await project.GetCompilationAsync()).WithAnalyzers(
Test.Utilities (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
25
CompilationWithAnalyzers
hostCompilationWithAnalyzers,
Text.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
25
CompilationWithAnalyzers
hostCompilationWithAnalyzers,