Docsv3.31.0
Back to API Reference
Class

MutableRangeSource

sealed
Inherits:RangeSource

Runtime-owned range source for search results, diagnostics, annotations and other externally produced ranges. Changes become visible through atomic transactions.

public string Identity{ get }

Stable configuration identity used by tooling. Runtime entity identity still uses this source instance's RangeSource.RuntimeId.

public int Count{ get }

Number of committed logical range entities.

public RangeEntity[] CaptureEntities()

Copies the currently committed entity snapshot for inspection or event correlation.

public bool TryGetEntity(RangeId id, out RangeEntity entity)

Gets one committed entity by its source-local identity.

public void SetIdentity(string value)

Sets the tooling identity without changing existing entity identifiers.

public MutableRangeUpdate BeginUpdate(TextRevision revision)

Begins an isolated update against revision. Commit fails if text or this source changed after the transaction began.

public MutableRangeUpdate BeginUpdate(in TextSnapshot textSnapshot)

Begins an update against an immutable snapshot captured from the owner.

public void SetRanges(TextRevision revision, IEnumerable<TextRange> ranges)

Replaces all entities with single-segment ranges in one notification.

protected override void CollectRanges(in TextSnapshot currentSnapshot, RangeMatchWriter writer)
protected override void OnSnapshotChanged(in TextSnapshot previous, in TextSnapshot current)