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.
Stable configuration identity used by tooling. Runtime entity identity still uses this source instance's RangeSource.RuntimeId.
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 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)