Closed Klaster1 closed 7 years ago
The problem appears to be that editors, sanely, count positions in characters, but Tern, at the moment, counts in UTF16 units, so astral plane characters will count as two, and throw off all positions after them.
This is a bug in Tern, and it should be adjusted to treat positions received from and sent to the outside world as character offsets.
Attached patch seems to solve the issue in Sublime Text. (Emacs is still broken because Emacs' JSON library seems to not be aware that astral plane characters exist.)
(It does work in Emacs version 25, which fixes the JSON encoder.)
What happens: Weird completion results when document has emoji (commented or not).![actual](http://i.imgur.com/ELtheNF.png)
Expected behavior: Same completion as on this image:![expected](http://i.imgur.com/CoE80Zg.png)