Adding PsiComment at new String
I want to add comments before and after PsiStatement (psiElement in listed code)
So, to convert code:
to such code:
i write:
But executing previous code, i take such changes:
What i do wrong? Thank you in advance!
请先登录再写评论。
Just an idea. Adding a newline char in the after text?
PsiComment psiCommentAfter = psiElementFactory.createCommentFromText("/n//After Comments", psiElement.getParent());
it don't work
IncorrectOperationExcepion: Incorrect comment
Ups the newline char should be \n