We should be able to avoid exposing the zipper in Text_document.Expert by adding the following functions to the non-expert API:
val offset : t -> Position.t -> int
val offsets : t -> Range.t -> int * int
val position : t -> offset:int -> Position.t
val range : t -> start_offset_inclusive:int -> end_offset_exclusive:int -> Range.t
The positions should be interpreted with the text document's encoding.
We should be able to avoid exposing the zipper in
Text_document.Expert
by adding the following functions to the non-expert API:The positions should be interpreted with the text document's encoding.