sourcegraph / go-langserver

Go language server to add Go support to editors and other tools that use the Language Server Protocol (LSP)
https://sourcegraph.com
MIT License
1.17k stars 89 forks source link

What unit does go-langserver use in lsp ranges? #362

Closed Avi-D-coder closed 5 years ago

Avi-D-coder commented 5 years ago

Does this project use UTF-8, UTF-16, codepoint, or grapheme cluster indexes for lsp ranges?

I am conducting a survey to inform the debate over what unit ranges should use in the Language Server Protocol. The debate is occuring in issue #376.

slimsag commented 5 years ago

We currently use unicode codepoints. Given the spec said that Position is character-based (it is a bit ambiguous what a character is) the thinking was that it was safe to assume it was a unicode codepoint. I can see why grapheme cluster indexes would also make sense.

We also currently do not support any document encoding except UTF-8, I believe(?), so we are probably limited to UTF-8 codepoints.

Avi-D-coder commented 5 years ago

@slimsag thanks