@Override
  public void invoke(final @NotNull Project project, final @NotNull Editor editor, final @NotNull PsiFile file) {
    PsiElement element = file.findElementAt(editor.getCaretModel().getOffset());
    PyClass pyClass = PsiTreeUtil.getParentOfType(element, PyClass.class);
    if (pyClass != null) {
      PyFunction function = PsiTreeUtil.getParentOfType(element, PyFunction.class, false, PyClass.class);
      if (function != null) {
        gotoSuperFunctions(editor, function, pyClass);
      }
      else {
        final PyAssignmentStatement assignment = PsiTreeUtil.getParentOfType(element, PyAssignmentStatement.class, false, PyClass.class);
        if (assignment != null && assignment.getTargets()[0] instanceof PyTargetExpression) {
          gotoSuperClassAttributes(editor, (PyTargetExpression)assignment.getTargets()[0], pyClass);
        }
        else {
          final TypeEvalContext context = TypeEvalContext.codeAnalysis(project, file);
          navigateOrChoose(editor, pyClass.getAncestorClasses(context), PyBundle.message("goto.superclass.choose"));
        }
      }
    }
  }
@Override
  public void invoke(final @NotNull Project project, final @NotNull Editor editor, final @NotNull PsiFile file)