Formats only the top-level statements that the byte range from to to touches, and returns
the whole text with everything outside them untouched. The range snaps outward to whole
statements (and to the lines they share with their neighbours); an empty range selects the
statement it sits in, and a range that touches none, or sits after a // jaifmt: off, changes
nothing.
Signature
format_range :: (
text: string,
from: s64,
to: s64,
config: Format_Config = .{}
) -> (result: string, ok: bool, error: string)
text := "a::1;\nb :: 2;\nc :: 3;\n";
formatted, ok, error := format_range(text, 8, 8);
assert(ok && formatted == "a::1;\nb :: 2;\nc :: 3;\n");