7 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 (2)
Diagnostics\DiagnosticAnalyzerTests.cs (1)
3604var compWithAnalyzers = new CompilationWithAnalyzers(
Diagnostics\DiagnosticSuppressorTests.cs (1)
715var compilationWithAnalyzers = new CompilationWithAnalyzers(compilation, analyzersAndSuppressors.ToImmutableArray(), options);
Microsoft.CodeAnalysis.UnitTests (1)
Diagnostics\CompilationWithAnalyzersTests.cs (1)
62var compWithAnalyzers = new CompilationWithAnalyzers(compilation, analyzers, analyzerOptions);
91 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));
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) 118public static AnalysisScope Create(ImmutableArray<DiagnosticAnalyzer> analyzers, SourceOrAdditionalFile filterFile, TextSpan? filterSpan, bool isSyntacticSingleFileAnalysis, CompilationWithAnalyzers compilationWithAnalyzers) 121public static AnalysisScope Create(ImmutableArray<DiagnosticAnalyzer> analyzers, SourceOrAdditionalFile filterFile, TextSpan? filterSpan, SourceOrAdditionalFile originalFilterFile, TextSpan? originalFilterSpan, bool isSyntacticSingleFileAnalysis, CompilationWithAnalyzers compilationWithAnalyzers) 192public AnalysisScope WithAnalyzers(ImmutableArray<DiagnosticAnalyzer> analyzers, CompilationWithAnalyzers compilationWithAnalyzers) 198private 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.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 (24)
Diagnostics\DiagnosticAnalyzerTests.cs (10)
3266var compilationWithAnalyzers = compilation.WithAnalyzers(analyzers); 3312var compilationWithAnalyzers = compilation.WithAnalyzers(analyzers); 3349var compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer1, analyzer2)); 3604var compWithAnalyzers = new CompilationWithAnalyzers( 3687var compilationWithAnalyzers = compilation.WithAnalyzers(allAnalyzers); 3754var compilationWithAnalyzers = compilation.WithAnalyzers(allAnalyzers); 3814var compilationWithAnalyzers = compilation.WithAnalyzers(analyzers); 4229var compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer)); 4318var compilationWithAnalyzers = compilation.WithAnalyzers(analyzers, options); 4437var compWithAnalyzers = new CompilationWithAnalyzers(
Diagnostics\DiagnosticSuppressorTests.cs (1)
715var compilationWithAnalyzers = new CompilationWithAnalyzers(compilation, analyzersAndSuppressors.ToImmutableArray(), options);
Diagnostics\GetDiagnosticsTests.cs (13)
520var effectiveDiagnostics = CompilationWithAnalyzers.GetEffectiveDiagnostics(diagnostics, compilation); 553var compilationWithAnalyzers = compilation.WithAnalyzers(analyzers, new AnalyzerOptions(ImmutableArray<AdditionalText>.Empty)); 615var compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create(analyzer), analyzerOptions); 663var compilationWithAnalyzers = compilation.WithAnalyzers(analyzers, 716var compilationWithAnalyzers = compilation.WithAnalyzers(analyzers, 745var compilationWithAnalyzers = compilation.WithAnalyzers(analyzers, 785var compilationWithAnalyzers = compilation.WithAnalyzers(analyzers, AnalyzerOptions.Empty); 838var compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer), AnalyzerOptions.Empty); 1064var compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(compilerAnalyzer), AnalyzerOptions.Empty); 1124var compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer), AnalyzerOptions.Empty); 1439var compilationWithAnalyzers = compilation.WithAnalyzers(analyzers); 1519var compilationWithAnalyzers = compilation.WithAnalyzers(ImmutableArray.Create<DiagnosticAnalyzer>(analyzer), AnalyzerOptions.Empty); 1698var 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 (6)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction_Pragma.cs (1)
213var effectiveDiagnostic = CompilationWithAnalyzers.GetEffectiveDiagnostics([dummyDiagnosticWithLocationToCheck], model.Compilation).FirstOrDefault();
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.LanguageServer.Protocol (5)
Features\Diagnostics\DocumentAnalysisExecutor.cs (3)
175Debug.Assert(diags.Length == CompilationWithAnalyzers.GetEffectiveDiagnostics(diags, compilation).Count()); 256var analysisScope = AnalysisScope.WithAnalyzers(_compilationBasedProjectAnalyzersInAnalysisScope, _compilationBasedHostAnalyzersInAnalysisScope); 292var analysisScope = AnalysisScope.WithAnalyzers(_compilationBasedProjectAnalyzersInAnalysisScope, _compilationBasedHostAnalyzersInAnalysisScope);
Features\Diagnostics\DocumentAnalysisExecutor_Helpers.cs (2)
276diagnostics = CompilationWithAnalyzers.GetEffectiveDiagnostics(diagnostics, compilation).ToImmutableArrayOrEmpty(); 309diagnostics = CompilationWithAnalyzers.GetEffectiveDiagnostics(diagnostics, compilation).ToImmutableArrayOrEmpty();
Microsoft.CodeAnalysis.Remote.ServiceHub (2)
Services\DiagnosticAnalyzer\DiagnosticComputer.cs (2)
29/// Cache of <see cref="CompilationWithAnalyzers"/> and a map from analyzer IDs to <see cref="DiagnosticAnalyzer"/>s 31/// The <see cref="CompilationWithAnalyzers"/> instance is shared between all the following document analyses modes for the project:
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)
1221var 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 (8)
Diagnostics\CompilationWithAnalyzersPair.cs (6)
20private readonly CompilationWithAnalyzers? _projectCompilationWithAnalyzers; 21private readonly CompilationWithAnalyzers? _hostCompilationWithAnalyzers; 23public CompilationWithAnalyzersPair(CompilationWithAnalyzers? projectCompilationWithAnalyzers, CompilationWithAnalyzers? hostCompilationWithAnalyzers) 43public CompilationWithAnalyzers? ProjectCompilationWithAnalyzers => _projectCompilationWithAnalyzers; 45public CompilationWithAnalyzers? HostCompilationWithAnalyzers => _hostCompilationWithAnalyzers;
Diagnostics\Extensions.cs (1)
426CompilationWithAnalyzers hostCompilationWithAnalyzers,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Diagnostics\IPragmaSuppressionsAnalyzer.cs (1)
25CompilationWithAnalyzers hostCompilationWithAnalyzers,
Roslyn.VisualStudio.Next.UnitTests (1)
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (1)
235var compilationWithAnalyzers = (await project.GetCompilationAsync()).WithAnalyzers(