In my previous PR (#56) I assumed utf-8 to be a safe default in case we fail to obtain the preferred offset encoding from the client. However, I missed the part of the spec that defines utf-16 as the only mandatory encoding for Text Documents:
To stay backwards compatible the only mandatory encoding is UTF-16 represented via the string utf-16. [...] If the string value utf-16 is missing from the client’s capability general.positionEncodings servers can safely assume that the client supports UTF-16. If the server omits the position encoding in its initialize result the encoding defaults to the string value utf-16.
In my previous PR (#56) I assumed
utf-8
to be a safe default in case we fail to obtain the preferred offset encoding from the client. However, I missed the part of the spec that definesutf-16
as the only mandatory encoding for Text Documents:This PR sets
utf-16
as the fallback offset encoding instead ofutf-8
to be better aligned with the LSP spec.