From #1637 (comment):
The cursor-translation functionality still needs to be unified with the range-formatting functionality (currently, either one or the other can be used). I think it might be easiest to do this by keeping track of the range start/end positions in the same way as the cursor position, then having an API that returns all 3 positions (if provided), and only formats the text necessary to satisfy the range.
From #1637 (comment):