private static @Nullable String getItemText(@NotNull PsiFile file, Object o) {
    if (o instanceof PsiMethod method) {
      final PsiType type = method.getReturnType();
      if (PsiTypes.voidType().equals(type) || PsiTypes.nullType().equals(type)) return null;
      if (!method.getParameterList().isEmpty()) return null;
      return method.getName() + "(" +
             getSpace(CodeStyle.getLanguageSettings(file).SPACE_WITHIN_EMPTY_METHOD_CALL_PARENTHESES) + ")";
    }
    else if (o instanceof PsiVariable variable) {
      return variable.getName();
    }
    return null;
  }
private static @Nullable String getItemText(@NotNull PsiFile file, Object o)