Class BlockBoundaryTriviaNode
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
IdentitySyntaxNodeIdA unique identifier for this specific syntax node, keyed by the block's module (BlockUri(Uri, string)).
SourceLocationSourceLocationThe document location (
Uri+Range) of the line, in the file, before its comment.KindFileBlockKindThe kind of the block:
ClassorModule.IsEndboolWhether the line is the block's end; its header otherwise.
SourcestringThe 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
Kind
The kind of the block: Class or Module.
public FileBlockKind Kind { get; init; }
Property Value
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; }