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

Fix placeholder lines returned from LocalServer #312

Open
oferb opened this issue Sep 14, 2018 · 0 comments
Open

Fix placeholder lines returned from LocalServer #312

oferb opened this issue Sep 14, 2018 · 0 comments

Comments

@oferb
Copy link
Contributor

oferb commented Sep 14, 2018

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++;
    }
  });
}
@oferb oferb added the P2 label Sep 14, 2018
@oferb oferb added this to To do in startup-os via automation Sep 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
startup-os
  
To do
Development

No branches or pull requests

1 participant