If the range field is null, then it means that the text should overwrite the whole document:
{"text":"replace all"}
If the range start and end is the same value, then it means to insert the text at that point:
{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":0}},"rangeLength":3,"text":"insert at 0,0"}
In the current version, range is not a pointer, so the rangestart and end fields gets default Go zero values of {"line":0,"character":0}. Setting omitempty on the range field doesn't make any difference, unless the range field becomes a pointer.
So, this change converts range to be a pointer, to be able to express the idea that a range can be omitted from the message.
If the
range
field is null, then it means that the text should overwrite the whole document:If the range start and end is the same value, then it means to insert the text at that point:
In the current version,
range
is not a pointer, so therange
start
andend
fields gets default Go zero values of{"line":0,"character":0}
. Settingomitempty
on therange
field doesn't make any difference, unless therange
field becomes a pointer.So, this change converts
range
to be a pointer, to be able to express the idea that arange
can be omitted from the message.