The company I work for has a very special javadoc comment style. So, I was trying to write a plugin to generate the shell of these comments. Basically, I find the PSIElement that I want to put the comment on, and then call element.addBefore(element.getFirstChild(), newComment) (if no comment previously existed). But I keep getting IllegalArgumentExceptions from addBefore(). I was putting the comment here because if I manually add the comment, and use PSIViewer to look at the structure, the comment is the first child of the method. Any thoughts?