Closed alicelogos closed 1 year ago
Thanks and sorry for the late response!
I'm open to adding some methods on Rope
and RopeSlice
that allow converting byte offsets to and from UTF-16 code unit offsets. UTF-32 is rarely used and not mandatory according to the LSP spec so I don't think I'll add that.
I've started working on this in https://github.com/noib3/crop/pull/8, I'll ping you when it'll be ready to be merged.
main
, adding support for converting between UTF-16 and byte offsets by enabling the utf16-metric
feature flag.I consider this completed but feel free to re-open if you think there's something missing.
Thanks for your work!
I like crop's API and consider using crop in a LSP server, however in LSP offsets can be UTF-8, UTF-16 or UTF-32, and LSP servers must support UTF-16 offsets.
According to crop's README:
So I open this issue. Hoping you could add UTF-16 and UTF-32 offsets support.