CompilationStartAnalysisContext Class

Definition

Context for a compilation start action. A compilation start action can use a CompilationStartAnalysisContext to register actions to be executed at any of:

  • compilation end,
  • completion of parsing a code document,
  • completion of semantic analysis of a code document,
  • completion of semantic analysis of a symbol,
  • start of semantic analysis of a method body or an expression appearing outside a method body,
  • completion of semantic analysis of a method body or an expression appearing outside a method body, or
  • completion of semantic analysis of a syntax node.
public ref class CompilationStartAnalysisContext abstract
public abstract class CompilationStartAnalysisContext
type CompilationStartAnalysisContext = class
Public MustInherit Class CompilationStartAnalysisContext
Inheritance
CompilationStartAnalysisContext

Constructors

CompilationStartAnalysisContext(Compilation, AnalyzerOptions, 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

RegisterAdditionalFileAction(Action<AdditionalFileAnalysisContext>)

Register an action to be executed for each non-code document. An additional file action reports Diagnostics about the AdditionalText of a document.

RegisterCodeBlockAction(Action<CodeBlockAnalysisContext>)

Register an action to be executed at the end of semantic analysis of a method body or an expression appearing outside a method body. A code block action reports Diagnostics about code blocks.

RegisterCodeBlockStartAction<TLanguageKindEnum>(Action<CodeBlockStartAnalysisContext<TLanguageKindEnum>>)

Register an action to be executed at the start of semantic analysis of a method body or an expression appearing outside a method body. A code block start action can register other actions and/or collect state information to be used in diagnostic analysis, but cannot itself report any Diagnostics.

RegisterCompilationEndAction(Action<CompilationAnalysisContext>)

Register an action to be executed at compilation end. A compilation end action reports Diagnostics about the Compilation.

RegisterOperationAction(Action<OperationAnalysisContext>, ImmutableArray<OperationKind>)

Register an action to be executed at completion of semantic analysis of an IOperation with an appropriate Kind. An operation action can report Diagnostics about IOperations, and can also collect state information to be used by other operation actions or code block end actions.

RegisterOperationAction(Action<OperationAnalysisContext>, OperationKind[])

Register an action to be executed at completion of semantic analysis of an IOperation with an appropriate Kind. An operation action can report Diagnostics about IOperations, and can also collect state information to be used by other operation actions or code block end actions.

RegisterOperationBlockAction(Action<OperationBlockAnalysisContext>)

Register an action to be executed after semantic analysis of a method body or an expression appearing outside a method body. An operation block action reports Diagnostics about operation blocks.

RegisterOperationBlockStartAction(Action<OperationBlockStartAnalysisContext>)

Register an action to be executed at the start of semantic analysis of a method body or an expression appearing outside a method body. An operation block start action can register other actions and/or collect state information to be used in diagnostic analysis, but cannot itself report any Diagnostics.

RegisterSemanticModelAction(Action<SemanticModelAnalysisContext>)

Register an action to be executed at completion of semantic analysis of a document, which will operate on the SemanticModel of the document. A semantic model action reports Diagnostics about the model.

RegisterSymbolAction(Action<SymbolAnalysisContext>, ImmutableArray<SymbolKind>)

Register an action to be executed at completion of semantic analysis of an ISymbol with an appropriate Kind. A symbol action reports Diagnostics about ISymbols.

RegisterSymbolAction(Action<SymbolAnalysisContext>, SymbolKind[])

Register an action to be executed at completion of semantic analysis of an ISymbol with an appropriate Kind. A symbol action reports Diagnostics about ISymbols.

RegisterSymbolStartAction(Action<SymbolStartAnalysisContext>, SymbolKind)

Register an action to be executed at start of semantic analysis of an ISymbol and its members with an appropriate Kind.

RegisterSyntaxNodeAction<TLanguageKindEnum>(Action<SyntaxNodeAnalysisContext>, ImmutableArray<TLanguageKindEnum>)

Register an action to be executed at completion of semantic analysis of a SyntaxNode with an appropriate Kind. A syntax node action can report Diagnostics about SyntaxNodes, and can also collect state information to be used by other syntax node actions or code block end actions.

RegisterSyntaxNodeAction<TLanguageKindEnum>(Action<SyntaxNodeAnalysisContext>, TLanguageKindEnum[])

Register an action to be executed at completion of semantic analysis of a SyntaxNode with an appropriate Kind. A syntax node action can report Diagnostics about SyntaxNodes, and can also collect state information to be used by other syntax node actions or code block end actions.

RegisterSyntaxTreeAction(Action<SyntaxTreeAnalysisContext>)

Register an action to be executed at completion of parsing of a code document. A syntax tree action reports Diagnostics about the SyntaxTree of a document.

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