Skip to content
This repository was archived by the owner on Dec 15, 2021. It is now read-only.
This repository was archived by the owner on Dec 15, 2021. It is now read-only.

Fix placeholder lines returned from LocalServer #312

Open
@oferb

Description

@oferb

Local server marks lines as changed not by them actual number, but by number after adding placeholders (blue numbers on the pic).
image
Line 27 isn't highlighted, because placeholder 31 is highlighted instead.
Temporary front-end method, which fixes the issue:

tempFixChangesLineNumber(textChanges: TextChange[]): void {
  let delimiter: number = 0;
  textChanges.forEach(textChange => {
    switch (textChange.getType()) {
      case ChangeType.DELETE:
      case ChangeType.ADD:
        textChange.setLineNumber(textChange.getLineNumber() - delimiter);
        break;
      case ChangeType.LINE_PLACEHOLDER:
        delimiter++;
    }
  });
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions