Udostępnij za pośrednictwem


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.

public value class CompilationAnalysisContext
public struct CompilationAnalysisContext
public readonly struct CompilationAnalysisContext
type CompilationAnalysisContext = struct
Public Structure CompilationAnalysisContext
Inheritance
CompilationAnalysisContext

Constructors

CompilationAnalysisContext(Compilation, AnalyzerOptions, Action<Diagnostic>, Func<Diagnostic,Boolean>, CancellationToken)

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