Skip to content

Diagnotics are reported using UTF8-positions regardless of the agreement #2138

Description

@panglesd

During the initial capability exchange phase, the server picks a position encoding from the list offered by the client. To ensure communication is possible, both clients and server are expected to speak the "utf16 position encoding".

ocaml-lsp prefers UTF8 when available, but when it is not (which seems to be the case from VSCode), it should properly support utf16 positions. However, Merlin's utf8 positions are not migrated.

As a consequence, the error in

let x = {|a𐐀b|} ^ 3333333

is reported in the wrong place (and semantic highlighting is wrong):

Image

With something after to see the full wrong range:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions