@Override
  public Object getCurrentEditorElement() {
    if (myEditor == null) return null;

    PsiFile file = getPsiFile();
    if (file == null || !file.isValid()) return null;

    int offset = myEditor.getCaretModel().getOffset();
    Object o1 = findAcceptableElement(file.getViewProvider().findElementAt(offset, file.getLanguage()));
    Object o2 = offset == 0 ? o1 : findAcceptableElement(file.getViewProvider().findElementAt(offset - 1, file.getLanguage()));
    if (o1 != o2 && o1 instanceof PsiElement e1 && o2 instanceof PsiElement e2 && PsiTreeUtil.isAncestor(e1, e2, false)) return o2;
    return o1;
  }
@Override
  public Object getCurrentEditorElement()