static int getLineStartOffsetByTotalOffset(Document document, int offset) {
    int line = document.getLineNumber(offset);
    return document.getLineStartOffset(line);
  }
static int getLineStartOffsetByTotalOffset(Document document, int offset)