Table of Contents

Class BlockBoundaryTriviaNode

Namespace
RDCore.SDK.Model.AST.Abstract
Assembly
RDCore.SDK.dll

Preserves the header or the end line of a block of a source file (FileBlocks): Class Name or Module Name, and End Class or End Module, before the line's comment.

public sealed record BlockBoundaryTriviaNode : SyntaxNode, IEquatable<SyntaxNode>, IEquatable<BlockBoundaryTriviaNode>
Inheritance
BlockBoundaryTriviaNode
Implements
Inherited Members
Extension Methods

Remarks

The lines between a block's header and its end are the block's module (BlockModules), and no module's tree holds the header or the end. They are still source, kept as the file's trivia, so that a formatter or an exporter can write the file back out as it was read. A comment on either line is a CommentTriviaNode of its own, read as any comment is.

Constructors

BlockBoundaryTriviaNode(SyntaxNodeId, SourceLocation, FileBlockKind, bool, string)

Preserves the header or the end line of a block of a source file (FileBlocks): Class Name or Module Name, and End Class or End Module, before the line's comment.

public BlockBoundaryTriviaNode(SyntaxNodeId Identity, SourceLocation SourceLocation, FileBlockKind Kind, bool IsEnd, string Source)

Parameters

Identity SyntaxNodeId

A unique identifier for this specific syntax node, keyed by the block's module (BlockUri(Uri, string)).

SourceLocation SourceLocation

The document location (Uri+Range) of the line, in the file, before its comment.

Kind FileBlockKind

The kind of the block: Class or Module.

IsEnd bool

Whether the line is the block's end; its header otherwise.

Source string

The exact original text of the line before its comment, its leading blanks and a header's modifiers (Public, Private, Partial, Creatable) included.

Remarks

The lines between a block's header and its end are the block's module (BlockModules), and no module's tree holds the header or the end. They are still source, kept as the file's trivia, so that a formatter or an exporter can write the file back out as it was read. A comment on either line is a CommentTriviaNode of its own, read as any comment is.

Properties

IsEnd

Whether the line is the block's end; its header otherwise.

public bool IsEnd { get; init; }

Property Value

bool

Kind

The kind of the block: Class or Module.

public FileBlockKind Kind { get; init; }

Property Value

FileBlockKind

Source

The exact original text of the line before its comment, its leading blanks and a header's modifiers (Public, Private, Partial, Creatable) included.

public string Source { get; init; }

Property Value

string