void (PsiElement first, PsiElement last, List<PsiComment> comments) { if (first == last && first instanceof PsiComment) { comments.add((PsiComment)first); return; } PsiElement elem = first; while (elem != last && elem != null) { if (elem instanceof PsiComment) { comments.add((PsiComment)elem); LOG.debug("found comment"); } elem = getNextSibling(elem); } }