String (@Nullable PsiMethod method, @Nullable List<ParameterInfoImpl> infos) { if (method == null) { return null; } StringBuilder builder = new StringBuilder(); PsiCodeBlock body = method.getBody(); PsiParameterList list = method.getParameterList(); for (PsiElement child : method.getChildren()) { if (child == body) { break; } if (child == list && infos != null) { StringJoiner joiner = new StringJoiner(", ", "(", ")"); for (ParameterInfoImpl info : infos) { joiner.add(info.getTypeText() + " " + info.getName()); } builder.append(joiner); continue; } builder.append(child.getText()); } return builder.toString(); }