ReflectiveSignature (@Nullable PsiMethod method) { if (method != null) { final List<String> types = new ArrayList<>(); final PsiType returnType = method.getReturnType(); types.add(getTypeText(returnType != null ? returnType : PsiTypes.voidType())); // null return type means it's a constructor for (PsiParameter parameter : method.getParameterList().getParameters()) { types.add(getTypeText(parameter.getType())); } final Icon icon = method.getIcon(Iconable.ICON_FLAG_VISIBILITY); return ReflectiveSignature.create(icon, types); } return null; }