Description
Your environment
Which OS do you use: MacOS
Which LSP client (editor/plugin) do you use: Sublime Code
Steps to reproduce
aaa :: Word
aaa = 10
πππ :: Word
πππ = 10
Expected behaviour
Both aaa
and πππ
should be underlined as unused bindings.
Actual behaviour
aaa
is underlined correctly, but only the first character of πππ
is underlined.
That's because HLS does not distinguish positions returned from GHC (which are in code points = characters) from positions mandated by LSP (which are UTF-16 code units). Basically, GHC says us that 3 first code points in line 5 are an unused binding. Each π
is a single character, but 2 UTF-16 code units, so HLS should ask LSP to underline first 6 code units. Instead of this HLS asks LSP to underline only 3, and since the 3rd one is in the middle of the 2nd character, only the 1st character gets underlined.
CC @michaelpj @alanz, this is related to haskell/lsp#392 (comment).