Giter Site home page Giter Site logo

Comments (4)

kLabz avatar kLabz commented on September 25, 2024

vshaxe/haxe-language-server#76 could maybe be applied there

from vshaxe.

RblSb avatar RblSb commented on September 25, 2024

Seems like problem with most actions is:
token.getPos() returns offsets in utf8 (1 byte for abc chars, 2 bytes for абв chars)
and then document.rangeAt(pos.min, pos.max) iterates with charAt like arg offsets are single-byte
So there should be some way to convert utf8 byte offsets to characters first, before making range from it.

But Haxe4DisplayOffsetConverter only offsets surrogates currently

from vshaxe.

kLabz avatar kLabz commented on September 25, 2024

Linked PR deals exactly with this on various commands (but not all that need it, apparently)

from vshaxe.

RblSb avatar RblSb commented on September 25, 2024

Lets rename byteOffsetToCharacterOffset to utf16OffsetToCharacterOffset and make separate utf8OffsetToCharacterOffset?
It would be better to make int offsets as encoding-based abstracts, but this change can be too big.

from vshaxe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.