CompilationAnalysisContext Struct

Definition

Context for a compilation action or compilation end action. A compilation action or compilation end action can use a CompilationAnalysisContext to report Diagnostics about a Compilation.

C#
public struct CompilationAnalysisContext
C#
public readonly struct CompilationAnalysisContext
Inheritance
CompilationAnalysisContext

Constructors

Properties

CancellationToken

Token to check for requested cancellation of the analysis.

Compilation

Compilation that is the subject of the analysis.

Options

Options specified for the analysis.

Methods

ReportDiagnostic(Diagnostic)

Report a Diagnostic about a Compilation.

TryGetValue<TValue>(AdditionalText, AdditionalTextValueProvider<TValue>, TValue)

Attempts to compute or get the cached value provided by the given valueProvider for the given text. Note that the pair {valueProvider, text} acts as the key. Reusing the same valueProvider instance across analyzer actions and/or analyzer instances can improve the overall analyzer performance by avoiding recomputation of the values.

TryGetValue<TValue>(SourceText, SourceTextValueProvider<TValue>, TValue)

Attempts to compute or get the cached value provided by the given valueProvider for the given text. Note that the pair {valueProvider, text} acts as the key. Reusing the same valueProvider instance across analyzer actions and/or analyzer instances can improve the overall analyzer performance by avoiding recomputation of the values.

TryGetValue<TValue>(SyntaxTree, SyntaxTreeValueProvider<TValue>, TValue)

Attempts to compute or get the cached value provided by the given valueProvider for the given tree. Note that the pair {valueProvider, tree} acts as the key. Reusing the same valueProvider instance across analyzer actions and/or analyzer instances can improve the overall analyzer performance by avoiding recomputation of the values.

Applies to

Tuote Versiot
Roslyn 4.2.0, 4.3.0, 4.4.0, 4.5.0, 4.6.0, 4.7.0, 4.8.0, 4.9.2, 3.0.0, 3.1.0, 3.2.0, 3.2.1, 3.3.1, 3.4.0, 3.5.0, 3.6.0, 3.7.0, 3.8.0, 3.9.0, 3.10.0, 3.11.0, 4.0.1, 4.1.0, 4.12.2, 4.13.0