synchronized @NotNull LogicalPosition offsetToLogicalPosition(int offset) {
    if (myUpdateInProgress) throw new IllegalStateException();
    int textLength = myDocument.getTextLength();
    if (offset <= 0 || textLength == 0) {
      return new LogicalPosition(0, 0);
    }
    offset = Math.min(offset, textLength);
    int line = myDocument.getLineNumber(offset);
    LineData lineData = getLineInfo(line);
    return new LogicalPosition(line, lineData.offsetToLogicalColumn(myDocument, line, myTabSize, offset));
  }
synchronized @NotNull LogicalPosition offsetToLogicalPosition(int offset)