String (@NotNull PsiMethod method) { StringBuilder builder = new StringBuilder(); PsiCodeBlock body = method.getBody(); for (PsiElement child : method.getChildren()) { if (child == body) { break; } builder.append(child.getText()); } return builder.toString(); }