private static @Nullable SmartPsiFileRange merge(
    @Nullable SmartPsiFileRange sr1,
    @Nullable SmartPsiFileRange sr2
  ) {
    if (sr1 == null) return sr2;
    if (sr2 == null) return sr1;
    var r1 = sr1.getRange();
    var r2 = sr2.getRange();
    if (r1 == null) return sr2;
    if (r2 == null) return sr1;
    var r1start = r1.getStartOffset();
    var r2start = r2.getStartOffset();
    if (r1start != r2start) {
      return r1start <= r2start ? sr1 : sr2;
    }
    else {
      var r1end = r1.getEndOffset();
      var r2end = r2.getEndOffset();
      return r1end <= r2end ? sr1 : sr2;
    }
  }
private static @Nullable SmartPsiFileRange merge(
    @Nullable SmartPsiFileRange sr1,
    @Nullable SmartPsiFileRange sr2
  )