8 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 (3)
Diagnostics\DiagnosticAnalyzerTests.cs (2)
3604
var compWithAnalyzers = new
CompilationWithAnalyzers
(
4437
var compWithAnalyzers = new
CompilationWithAnalyzers
(
Diagnostics\DiagnosticSuppressorTests.cs (1)
715
var compilationWithAnalyzers = new
CompilationWithAnalyzers
(compilation, analyzersAndSuppressors.ToImmutableArray(), options);
Microsoft.CodeAnalysis.UnitTests (1)
Diagnostics\CompilationWithAnalyzersTests.cs (1)
62
var compWithAnalyzers = new
CompilationWithAnalyzers
(compilation, analyzers, analyzerOptions);
104 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)
118
public static AnalysisScope Create(ImmutableArray<DiagnosticAnalyzer> analyzers, SourceOrAdditionalFile filterFile, TextSpan? filterSpan, bool isSyntacticSingleFileAnalysis,
CompilationWithAnalyzers
compilationWithAnalyzers)
121
public static AnalysisScope Create(ImmutableArray<DiagnosticAnalyzer> analyzers, SourceOrAdditionalFile filterFile, TextSpan? filterSpan, SourceOrAdditionalFile originalFilterFile, TextSpan? originalFilterSpan, bool isSyntacticSingleFileAnalysis,
CompilationWithAnalyzers
compilationWithAnalyzers)
192
public AnalysisScope WithAnalyzers(ImmutableArray<DiagnosticAnalyzer> analyzers,
CompilationWithAnalyzers
compilationWithAnalyzers)
198
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 (24)
Diagnostics\DiagnosticAnalyzerTests.cs (10)
3266
var
compilationWithAnalyzers = compilation.WithAnalyzers(analyzers);
3312
var
compilationWithAnalyzers = compilation.WithAnalyzers(analyzers);
3349
var
compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer1, analyzer2));
3604
var
compWithAnalyzers = new CompilationWithAnalyzers(
3687
var
compilationWithAnalyzers = compilation.WithAnalyzers(allAnalyzers);
3754
var
compilationWithAnalyzers = compilation.WithAnalyzers(allAnalyzers);
3814
var
compilationWithAnalyzers = compilation.WithAnalyzers(analyzers);
4229
var
compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer));
4318
var
compilationWithAnalyzers = compilation.WithAnalyzers(analyzers, options);
4437
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 (12)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Pragma.cs (1)
213
var effectiveDiagnostic =
CompilationWithAnalyzers
.GetEffectiveDiagnostics([dummyDiagnosticWithLocationToCheck], model.Compilation).FirstOrDefault();
Diagnostics\Service\DocumentAnalysisExecutor.cs (3)
145
Debug.Assert(diags.Length ==
CompilationWithAnalyzers
.GetEffectiveDiagnostics(diags, compilation).Count());
213
var
analysisScope = AnalysisScope.WithAnalyzers(_compilationBasedProjectAnalyzersInAnalysisScope, _compilationBasedHostAnalyzersInAnalysisScope);
249
var
analysisScope = AnalysisScope.WithAnalyzers(_compilationBasedProjectAnalyzersInAnalysisScope, _compilationBasedHostAnalyzersInAnalysisScope);
Diagnostics\Service\DocumentAnalysisExecutor_Helpers.cs (1)
115
diagnostics =
CompilationWithAnalyzers
.GetEffectiveDiagnostics(diagnostics, compilation).ToImmutableArrayOrEmpty();
Diagnostics\Service\EngineV2\DiagnosticIncrementalAnalyzer.CompilationManager.cs (2)
105
var
projectCompilation = !filteredProjectAnalyzers.Any()
115
var
hostCompilation = !filteredHostAnalyzers.Any()
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.Remote.ServiceHub (2)
Services\DiagnosticAnalyzer\DiagnosticComputer.cs (2)
27
/// Cache of <see cref="
CompilationWithAnalyzers
"/> and a map from analyzer IDs to <see cref="DiagnosticAnalyzer"/>s
28
/// for all analyzers for the last project to be analyzed. The <see cref="
CompilationWithAnalyzers
"/> instance is
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)
1190
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 (8)
Diagnostics\CompilationWithAnalyzersPair.cs (6)
18
private readonly
CompilationWithAnalyzers
? _projectCompilationWithAnalyzers;
19
private readonly
CompilationWithAnalyzers
? _hostCompilationWithAnalyzers;
21
public CompilationWithAnalyzersPair(
CompilationWithAnalyzers
? projectCompilationWithAnalyzers,
CompilationWithAnalyzers
? hostCompilationWithAnalyzers)
41
public
CompilationWithAnalyzers
? ProjectCompilationWithAnalyzers => _projectCompilationWithAnalyzers;
43
public
CompilationWithAnalyzers
? HostCompilationWithAnalyzers => _hostCompilationWithAnalyzers;
Diagnostics\Extensions.cs (1)
424
CompilationWithAnalyzers
hostCompilationWithAnalyzers,
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 (1)
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (1)
243
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,