Table of Contents

Class CodeDocumentSnapshot

Namespace
CodeEdit.Maui
Assembly
CodeEdit.Maui.dll

An immutable plain-source snapshot.

public sealed class CodeDocumentSnapshot
Inheritance
CodeDocumentSnapshot
Inherited Members

Properties

Length

Gets the UTF-16 source length.

public int Length { get; }

Property Value

int

LineCount

Gets the number of logical source lines, including an empty trailing line.

public int LineCount { get; }

Property Value

int

Revision

Gets the captured document identity and version.

public DocumentRevision Revision { get; }

Property Value

DocumentRevision

Text

Gets the UTF-16 source text.

public string Text { get; }

Property Value

string

TextBuffer

Gets the persistent text storage represented by this snapshot.

public TextSnapshot TextBuffer { get; }

Property Value

TextSnapshot

Version

Gets the source revision.

public long Version { get; }

Property Value

long

Methods

GetLine(int)

Gets a zero-based source line with its exact terminator length.

public TextLine GetLine(int line)

Parameters

line int

Returns

TextLine

GetLineRange(int)

Gets a zero-based source line, excluding its terminator.

public TextSpan GetLineRange(int line)

Parameters

line int

The zero-based logical line.

Returns

TextSpan

The line's source range.

GetOffset(TextPosition)

Converts a zero-based line and UTF-16 column to an exact source offset.

public int GetOffset(TextPosition position)

Parameters

position TextPosition

The source position.

Returns

int

The source offset.

GetPosition(int)

Converts a UTF-16 source offset to a zero-based line and column.

public TextPosition GetPosition(int offset)

Parameters

offset int

The source offset.

Returns

TextPosition

The source position.

GetText(TextSpan)

Reads a bounded UTF-16 range without materializing the complete source.

public string GetText(TextSpan range)

Parameters

range TextSpan

Returns

string