Skip to content

textDocument/didChange interpretation #112

Closed
@alanz

Description

@alanz

At the moment we accumulate changes and send them once a timer triggers.

Each emacs onChange event is wrt to the document at the point when the change is made.

This means the order of application is important, and needs to be preserved.

However

According to microsoft/language-server-protocol#279, the changes in a single textDocument/didChange message should all be wrt the same document, and hence they need to be applied in reverse order.

So, to fix this we can either

  • Send one textDocument/didChange per emacs change, as it is reported; or
  • Adjust the edit locations so that they all refer to the original document, so they can be applied according to the specification.

The first option is simpler, and seems to be what happens in vscode. But, it means we potentially run diagnostics generation more frequently than required.

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