starkware-libs / cairo

Cairo is the first Turing-complete language for creating provable programs for general computation.
Apache License 2.0
1.52k stars 469 forks source link

Properly support position encodings #5778

Open mkaput opened 2 months ago

mkaput commented 2 months ago

LS is not aware of and thus is not performing position encoding kind negotiation, which means the language client will assume UTF-16. Actually, LS is using UTF-8 because that's the native encoding of Rust strings. This means bad things can happen if files contain non-ASCII characters, especially ones like Emoji, which span multiple Unicode codepoints.

Things to implement:

mkaput commented 2 months ago

Using https://docs.rs/line-index/latest/line_index/ for line counting instead of custom code may enable this.