Delen via


CodeBlockStartAnalysisContext<TLanguageKindEnum> Class

Definition

Context for a code block start action. A code block start action can use a CodeBlockStartAnalysisContext<TLanguageKindEnum> to register actions to be executed at any of:

  • 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.
generic <typename TLanguageKindEnum>
 where TLanguageKindEnum : value classpublic ref class CodeBlockStartAnalysisContext abstract
public abstract class CodeBlockStartAnalysisContext<TLanguageKindEnum> where TLanguageKindEnum : struct
type CodeBlockStartAnalysisContext<'LanguageKindEnum (requires 'LanguageKindEnum : struct)> = class
Public MustInherit Class CodeBlockStartAnalysisContext(Of TLanguageKindEnum)

Type Parameters

TLanguageKindEnum
Inheritance
CodeBlockStartAnalysisContext<TLanguageKindEnum>

Constructors

CodeBlockStartAnalysisContext<TLanguageKindEnum>(SyntaxNode, ISymbol, SemanticModel, AnalyzerOptions, CancellationToken)

Properties

CancellationToken

Token to check for requested cancellation of the analysis.

CodeBlock

Method body or expression subject to analysis.

FilterSpan

Optional filter span within the FilterTree for which to compute diagnostics. null if we are analyzing the entire FilterTree or the entire compilation.

FilterTree

Syntax tree corresponding to the code block being analyzed.

IsGeneratedCode

Indicates if the CodeBlock is generated code.

Options

Options specified for the analysis.

OwningSymbol

ISymbol for which the code block provides a definition or value.

SemanticModel

SemanticModel that can provide semantic information about the SyntaxNodes in the code block.

Methods

RegisterCodeBlockEndAction(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 end action reports Diagnostics about code blocks.

RegisterSyntaxNodeAction(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(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.

Applies to