@Override
      protected int calcOffset() {
        return ReadAction.compute(() -> {
          PsiElement elem = pointer.getElement();
          return elem != null ? elem.getTextOffset() : -1;
        });
      }
@Override
      protected int calcOffset()