@Override
  public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
    if (!(file instanceof PyFile) || file instanceof PyDocstringFile) return false;

    final PyFunction function = findSuitableFunction(editor, file);
    if (function == null) return false;

    if (function.getTypeComment() != null) {
      return false;
    }

    final PyAnnotation annotation = function.getAnnotation();
    if (annotation != null) {
      boolean allParametersAnnotated = ContainerUtil.and(function.getParameterList().getParameters(),
                                                         it -> it instanceof PyNamedParameter &&
                                                               ((PyNamedParameter)it).getAnnotation() != null);
      if (allParametersAnnotated) {
        return false;
      }
    }

    setText(PyPsiBundle.message("INTN.add.type.hints.for.function", function.getName()));
    return true;
  }
@Override
  public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file)