Delen via


CodeBlockAnalysisContext Struct

Definition

Context for a code block action or code block end action. A code block action or code block end action can use a CodeBlockAnalysisContext to report Diagnostics about a code block.

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

Constructors

CodeBlockAnalysisContext(SyntaxNode, ISymbol, SemanticModel, AnalyzerOptions, Action<Diagnostic>, Func<Diagnostic,Boolean>, CancellationToken)

Properties

CancellationToken

Token to check for requested cancellation of the analysis.

CodeBlock

Code block that is the subject of the 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 for 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

ReportDiagnostic(Diagnostic)

Report a Diagnostic about a code block.

Applies to