Skip to content

UTF-8 support #1224

Open
Open

Description

For about half a year now, UTF-8 character positioning support has been supported by the LSP protocol since 3.17.0 and multiple servers, such as clangd and rust-analyzer, have supported it either since then or before then (in fact, clangd "invented" this capability with an LSP extension).

This feature would be highly useful in this client library. For my server (and probably many others), UTF-8 is much simpler to handle, already supported by the LSP interface library (lsp-types in my case), and of course supported by many IDEs. Only the glue code client shim doesn't cooperate yet.

Reopens #748 in a new issue, since the author of that issue and the maintainers of this repo have not done so.

Activity

  1. added
    help wanted
    on Apr 6, 2023
  2. dbaeumer commented on Apr 6, 2023

    @dbaeumer
    Member

    The biggest concern I have with this is that it forces the client to open and read every file that is part of a response to do the conversion. Servers usually already processed the content and can IMO do the conversion more efficiently.

    But if someone finds a good implementation I am happy to have a look.

  3. tooltitude-support commented on Apr 11, 2023

    @tooltitude-support

    The biggest concern I have with this is that it forces the client to open and read every file that is part of a response to do the conversion. Servers usually already processed the content and can IMO do the conversion more efficiently.

    Does it mean that you are using utf16 internall in vscode. Am I right?

  4. dbaeumer commented on Apr 12, 2023

    @dbaeumer
    Member

    Yes, VS Code is written in JavaScript which is utf16 based

  5. kleinesfilmroellchen commented on Apr 16, 2023

    @kleinesfilmroellchen
    Author

    The biggest concern I have with this is that it forces the client to open and read every file that is part of a response to do the conversion.

    Doing the conversion is necessary in general, isn't it? Most files are UTF-8, node converts that and other encodings to UTF-16. I don't see the point.

    Servers usually already processed the content and can IMO do the conversion more efficiently.

    It still complicates simple servers written in UTF-8-based languages, such as Python, or Rust. Even the JVM handles UTF-8 more transparently than JavaScript even though it interally uses UTF-16.

  6. added
    feature-request
    on Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requesthelp wanted

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions