4 ms·
Yes the language server protocol is particularly insane because they use UTF-16 word positions (sort of, it's JavaScript so it's not anything standard really),
by IshKebab 7y ago
Yes the language server protocol is particularly insane because they use UTF-16 word positions (sort of, it's JavaScript so it's not anything standard really), but the actual text data is sent as UTF-8! So for my sane UTF-8 speaking language server the text gets converted from UTF-8 to UTF-16 when loaded from disk, then converted back for transmission via the LSP, then converted back to UTF-16 by my language server so I can handle the positions, and then it does everything in reverse again on the way back!
Absolute madness. I think they will fix it eventually though. The madness is too great to ignore.